window.defaultStatus="GlobalAircraft.org"; function submit() { var iAm = null; if ( document.Searcher ) {iAm = document.Searcher;}
else if ( document.getElementById && document.getElementById('Searcher') ) {iAm = document.getElementById('Searcher');}
if ( iAm ) { iAm.SBox.value=iAm.SBox.value.toLowerCase(); iAm.submit();}
}
function checkChange(goHere) { var iAm = null; if ( document.Searcher ) {iAm = document.Searcher;}
else if ( document.getElementById && document.getElementById('Searcher') ) {iAm = document.getElementById('Searcher');}
if ( iAm ) { if (goHere == "theWeb") {goHere = "/index.pl";iAm.domain.value="outside";}
else {iAm.domain.value="gac";}
iAm.action="http://search.globalaircraft.org"+goHere;}
}
function Start(page) { var OpenWin; if (screen.width > 700 && screen.height > 500) {OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=700,height=500");}
else {OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=600,height=440");}
}
function preparePRINT(URL) { var config = "toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=720,height=500"; var output = window.open ("http://www.globalaircraft.org/print_this.pl?Page2Print="+URL+"","Print_Window",config);}
function LaLaLand(page) { var OpenWin; if (screen.width >= 700 || screen.height >= 500) {OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=700,height=500");}
else {OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=600,height=440");}
}
function mailme(bottom,top) {document.location="mailto:"+top+"@"+bottom+"";}
function loadXMLDoc(url, frame, method, postContents, callback, JSON) { if ( !JSON && (!document.getElementById || !document.getElementById(frame)) ) { alert("loadXMLDoc:: Invalid frame target! (" + frame+ ")"); return;}
if (url === "" || typeof url == 'undefined') { alert("loadXMLDoc:: Invalid URL supplied!"); return;}
if ( !window.XMLHttpRequest && !window.ActiveXObject ) { alert("loadXMLDoc:: No AJAX functionality found!"); return;}
if (!method) {method = "GET";}
if (!postContents) { if (window.XMLHttpRequest) {postContents = null;}
else if (window.ActiveXObject) {postContents = '';}
}
if (window.XMLHttpRequest) { var xmlhttp=new window.XMLHttpRequest();}
else if (window.ActiveXObject) { xmlhttp=new window.ActiveXObject("Microsoft.XMLHTTP");}
if (xmlhttp) { xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { if (xmlhttp.status==200){ if (xmlhttp.responseText == "SCRIPT::safeReload") {window.location.reload();}
else if (xmlhttp.responseText.match(/^SCRIPT::redirect=/)) { window.location = xmlhttp.responseText.replace(/^SCRIPT::redirect=/, "");}
else if (JSON && callback !== "" && typeof callback != 'undefined') { var escapedText = xmlhttp.responseText.replace(/\'/g, "\\'"); escapedText = escapedText.replace(/^while\(1\)\;/, ""); if (callback.indexOf(')') == -1) {callback += "('" + escapedText + "')";}
else {callback = callback.replace(')', ", '" + escapedText + "')");}
}
else {document.getElementById(frame).innerHTML=xmlhttp.responseText;}
if (callback !== "" && typeof callback != 'undefined') {setTimeout(callback, 100);}
}
else {alert("Problem retrieving data: " + xmlhttp.statusText);}
}
}; xmlhttp.open(method,url,true); xmlhttp.send(postContents);}
}
function buildList() { var form = document.getElementById('VOTE'); var URL = "/cgi-bin/vote.pl"; var contents = "votechoice=" + (form.votechoice[0].checked?form.votechoice[0].value:'')+(form.votechoice[1].checked?form.votechoice[1].value:'')+(form.votechoice[2].checked?form.votechoice[2].value:''); loadXMLDoc(URL,'voteframe','POST',contents);}
function ouvreFerme(title){ if (document.getElementById && document.getElementById(""+title+"Open")) { if (document.getElementById(""+title+"Open").style.display != "none") { document.getElementById(""+title+"Open").innerHTML = ""; document.getElementById(""+title+"Open").style.display = "none";} else { loadXMLDoc('/newLeftBarBackend.pl?CAT='+ title, title+"Open"); document.getElementById(""+title+"Open").style.display = "block";}
}
else if (document.all && document.all(""+title+"Open")) { if (document.all(""+title+"Open").style.display != "none") { document.all(""+title+"Open").innerHTML = ""; document.all(""+title+"Open").style.display = "none";} else { loadXMLDoc('/newLeftBarBackend.pl?CAT='+ title, title+"Open"); document.all(""+title+"Open").style.display = "block";}
}
}
function hpBodySwapper( target, url, frame ) { document.getElementById(frame).innerHTML="<i>working ... </i>"; loadXMLDoc(url, frame); var updateList = ["hpBodySwapaircraft", "hpBodySwapinside", "hpBodySwapforum", "hpBodySwapdirectory"]; for (var i = 0; i < updateList.length; ++i) { document.getElementById(updateList[i]).setAttribute("class", "FullRowFloaterTabBlurred"); document.getElementById(updateList[i]).setAttribute("className", "FullRowFloaterTabBlurred");}
if (document.getElementById && document.getElementById(target)) { document.getElementById(target).setAttribute("class", "FullRowFloaterTabFocused"); document.getElementById(target).setAttribute("className", "FullRowFloaterTabFocused");}
}
function writeOnDay() { loadXMLDoc('/tmiah/', '', 'POST', 'mo=' + new Date().getMonth(), 'tmiahDisplay', 1);}
function tmiahDisplay( evtArray ) { var evts = eval( evtArray ); var randNum = new Date().getDate() % (evts.length - 1); if (document.getElementById('tmiah') !== null) { document.getElementById('tmiah').innerHTML = "<span class='reg1'>"+evts[ randNum ]+"</span>";}
}
function gactimes(a) { loadXMLDoc('/gactimes.pl?type=json', '', 'GET', '', 'gactimesDisplay', 1);}
function gactimesDisplay( evtArray ) { var msgs = eval( evtArray ); var allEvts = ""; for (var i = 0; i < msgs.length; ++i) { switch (i) { case 0: allEvts += msgs[i]+"<br /><br />"; break; case msgs.length-1: allEvts += "<i>"+msgs[i]+"</i>"; break; default: allEvts += "<i>"+msgs[i]+"</i><br /><br />";}
}
if (document.getElementById('gactimes') !== null) { document.getElementById('gactimes').innerHTML = "<table width='275' border='0' class='reg1'><tr><td align='right'>"+allEvts+"</td></tr></table>";}
}
