// JavaScript Document


function validate()
{
      if (document.getElementById("q").value=="")
      {
                 alert("Entre uma palavra para a busca.");
                 document.getElementById("q").focus();
                 return false;
      }
      if (document.getElementById("q").value=="Busca")
      {
                 alert("Entre uma palavra para a busca.");
                 document.getElementById("q").focus();
                 return false;
      }
}

function preloadImages() {
 if(navigator.appName == "Microsoft Internet Explorer")
{
var v=document.getElementsByTagName("noscript"); 
	for(i=0;i<v.length;i++){
	    if(v[i].className=="ACSel"){
			var el=v[i];
			var nel=document.createElement("span");//create new span element to hold content
			nel.innerHTML=el.innerHTML;// fill the newly inserted span with the active content
			el.parentNode.replaceChild(nel,el); // and replace the <noscript> element with the <span> element
	      }
	}
	}
}

// Show/Hide div Info Script
// Used mainly on the Contact Page to display Phones and Emails
function showInfo(objectID1, objectID2){
	document.getElementById(objectID1).style.display="block";
	document.getElementById(objectID2).style.display="none";
}
function hideInfo(objectID1, objectID2){
	document.getElementById(objectID1).style.display="none";
	document.getElementById(objectID2).style.display="block";
}

var left = 0;
var top = 0;
function OpenWinAviso(flight)
	{
	popupWin = window.open('http://www.aircanada.com.br/info' + flight + '.aspx','infoflights','width=560,height=400,scrollbars=no,resizable=no,menubar=no,toolbar=no,location=no,status=no,directories=no,copyhistory=no,left=' + left + ',top=' + top);
	popupWin.focus();
	}

function Contacts(url) {
 	popupWin = window.open(url,'new_page','width=392,height=490,scrollbars=yes,resizable=no,menubar=no,toolbar=no,location=no,status=no,directories=no,copyhistory=no,left=0,top=0')
    popupWin.focus();
}

function popupInfo( url, title ) {
  window.open( url, title, 'width=392,height=490,menubar=no,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=yes,top=0,left=0' );
}

function PopWindow( url, title ) {
  window.open( url, title, 'width=650,height=550,menubar=no,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=yes,top=0,left=0' );
}

function PopExternal( url, title ) {
  window.open( url, title, 'width=450,height=550,menubar=no,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=yes,top=0,left=0' );
}

var message="Right Button is Disable!";

function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("return false")


function showAjaxWaitMessage() {

    waitElement.style.visibility = 'visible';
	MoveWaitElement();

}

function hideAjaxWaitMessage() {

    waitElement.style.visibility = 'hidden';
    
}


