

function dialog(url,name,feature,isModal, winWidth, winHeight)
{
var isModal = true;
 if(url==null){return false;}
 url = url
 if(name==null){name=""}
 if(feature==null){feature=""};
 if(window.showModelessDialog)
 {
	var leftPos = (screen.width - 600)/2;
	var topPos =  (screen.height - 500)/2;
  	var WindowFeature = new Object();
  if(window.ModelessDialog == null){window.ModelessDialog = new Object() ; };
  if(name!="")
  {
   if(window.ModelessDialog[name]!=null && !window.ModelessDialog[name].closed )
   {
     window.ModelessDialog[name].focus();
	 return window.ModelessDialog[name];
   }
  }
	var F = 'dialogHeight:'+winHeight+'px; dialogWidth:'+winWidth+'px; resizable:yes;';
	if(isModal)
	{
		window.showModalDialog(url,self,F);
		return false;
	}
	else
	{
		window.ModelessDialog[name] = window.showModelessDialog(url,self,F);
		return window.ModelessDialog[name];
	}	
 }
 else
 {
   if(document.getBoxObjectFor)
   {
	

	 if(isModal)
	 {		 
		 var Modal = window.open(url,name,"modal=1," + feature);
		 var ModalFocus = function()
		 {
			if(!Modal.closed){Modal.focus();}
			else{Modal = null; window.removeEventListener(ModalFocus,"focus"); ModalFocus = null; };					
		 }
		 window.addEventListener( "focus",ModalFocus, false ); 
		 return false;
	 }
	 else
	 {
		return window.open(url,name,"modal=1," + feature);
	 }	 
   }
   else
   { 
     return window.open(url,name,feature);
   }
   //
 }
 return null;
}

  
function GlobeSearchOpen()
{
	if (screen) {
		leftPos = (screen.width - 800)/2;
 		topPos =  (screen.height - 600)/2;
	}
	var feature = 'width=800,height=500,toolbars=0,resizable=0,scrollbars=0,status=1,left='+leftPos+',top='+topPos;
	var url = "show_earth_map.php";	
	var browserName=navigator.appName; 
	var newwindow;
	if(browserName == "Microsoft Internet Explorer"){
		newwindow=window.open(url,'GlobeSearch',feature);
		if (window.focus) {newwindow.focus()}
	}
	else
		dialog(url,"GlobeSearchWindow",feature,true, 550, 400);
	return false;
}
  
function Show_Promo_Ad(ID, width, height)
{
	width = (width == 0)? 550 : width;
	height = (width == 0)? 400 : height;
	if (screen) {
		leftPos = (screen.width - 600)/2;
 		topPos =  (screen.height - 500)/2;
	}
	var feature = 'width='+width+',height='+height+',toolbars=0,resizable=0,scrollbars=0,status=0,left='+leftPos+',top='+topPos;
	var url = "show_promo_ad.php?ID="+ID;	
	height +=30;
		dialog(url,"Promo_Avertisement",feature,true, width, height);
}
function popwin(url)
{
	if (screen) {
		leftPos = (screen.width - 800)/2;
 		topPos =  (screen.height - 700)/2;
	}
	url = 'tpl/'+url;
	var feature = 'height=650,width=800,resizable=yes,scrollbars=yes,status=yes,left='+leftPos+',top='+topPos;
	var height = 470+30;
	dialog(url,"MoreInformation",feature,true, 550, height);
}

function popUpMail(lang) {
	url = "mail/contact_us"+lang+".php";
	if (screen) {
		leftPos = (screen.width - 700)/2;
		topPos =  (screen.height - 600)/2;
	}
	var feature = 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=no,width=620px,height=520px,left='+leftPos+',top='+topPos;
	var height = 510+30;
	dialog(url,"SendMail",feature,true, 620, height);
}
function popUpMailContact(lang){
	url = "../mail/contact_us"+lang+".php";
	if (screen) {
		leftPos = (screen.width - 700)/2;
		topPos =  (screen.height - 600)/2;
	}
	var feature = 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=no,width=620px,height=520px,left='+leftPos+',top='+topPos;
	var height = 510+30;
	dialog(url,"SendMail",feature,true, 620, height);
	return false;
}
function openAirlineTopics(BookMark){
	url = "docs/airline_topics.htm#"+BookMark;
	if (screen) {
		leftPos = (screen.width - 700)/2;
		topPos =  (screen.height - 600)/2;
	}
	var feature = 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=no,width=800px,height=570px,left='+leftPos+',top='+topPos;
	var height = 570+30;
	dialog(url,"AirlineTopics",feature,true, 620, height);
	return false;
}
