// JavaScript Document
//This Function is to Book mark the page.
function chkbrowser(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } 
   else if (navigator.appName == "Netscape") {
	  
	   var str=navigator.userAgent;
	   
	var pos=str.indexOf("Safari");

	 if (pos>=0)
{
	alert("Press CTRL-D  to bookmark");
}
else {
	
	 window.sidebar.addPanel(title,url,"");

} 
   
  }
  else {
    alert("Press CTRL-D  to bookmark");
  }
}
//This function will send link of the page to friend 
function mailpage()
{
  mail_str = "mailto:?subject= SaudiAirlines: " + document.title;
  mail_str += "&body= Dear Friend I recommend this page (www.saudiairlines.com) " + document.title;
  mail_str += ". You should check this out at, " + location.href; 
  location.href = mail_str;
}
function setSearch(){

 var test=document.getElementById('searchtxt');
 if(test.value=="")
{

 document.getElementById('searchtxt').value="Search";
 }
}

/*Font increase and decrease*/
var min=9;
var max=18;
function increaseFontSize() {//1
var p = document.getElementsByTagName('p');
for(i=0;i<p.length;i++) {//2
if(p[i].style.fontSize) {//3
 var s = parseInt(p[i].style.fontSize.replace("px",""));
 }//3
 else {//4
 var s = 12;
 }//4
 if(s<=max) {//5
	  s += 1;

  }//5
  if(s<=max)
  {//6
 p[i].style.fontSize = s+"px";
  }//6
 
 }//2

}//1




function decreaseFontSize() {//1
var p = document.getElementsByTagName('p');
  for(i=0;i<p.length;i++) {//2
 if(p[i].style.fontSize) {//3
 var s = parseInt(p[i].style.fontSize.replace("px",""));
 
 } //3 
 else {//4
 var s = 12;
 }//4
 if(s!=min) {//5
 s -= 1;
 }//5
 p[i].style.fontSize = s+"px"
 }//2
}//1

function wwo_displayDetails(){//world wide office
	if(document.getElementById('wwo_city').value!=''){
		document.getElementById('wwo_dtl_wrap').style.display='block';
		if (document.getElementById('intl_officetype').checked){//displays the table#dom_tbl_details when Internatinal option is checked
			document.getElementById('intl_tbl_details').style.display='block';
			document.getElementById('dom_tbl_details').style.display='none';
		}else{
			document.getElementById('dom_tbl_details').style.display='block';
			document.getElementById('intl_tbl_details').style.display='none';
		}
	}else{
		alert('Please select the City');
	}
}
function localtour_displayDetails(){//localtour
	if(document.getElementById('localtour_city').value!='' && document.getElementById('localtour_country').value!=''){
		document.getElementById('localtour_dtl_wrap').style.display='block';
	}else{
		if(document.getElementById('localtour_city').value=='' && document.getElementById('localtour_country').value==''){
			alert('Please select the Country.\nPlease select the City.');
			document.getElementById('localtour_country').focus();
		}
		else if(document.getElementById('localtour_city').value==''){
			alert('Please select the City.');
			document.getElementById('localtour_city').focus();
		}
		else{
			alert('Please select the Country.');
			document.getElementById('localtour_country').focus();
		}
	}
}
