function lo() {
		 
        var oWait = null, oBody = null, elemWait, elemBody;		 
        if (document.getElementById) { // IE 5+/NS6
	              elemWait = document.getElementById('loading');				  
				 //
              if (elemWait != null) {
                        oWait = elemWait.style;						 
                }
                elemBody = document.getElementById('logo');
                if (elemBody != null) {
                        oBody = elemBody.style;
                }
        } else if (document.layers) {
                oWait = document.layers['loading'];
                oBody = document.layers['logo'];
        } else if (document.all) {
                elemWait = document.all['loading'];
                if (elemWait != null) {
                oWait = elemWait.style;
                }
                elemBody = document.all['logo'];
                if (elemBody != null) {
                oBody = elemBody.style;
                }
        }
        if ((oWait != null) && (oBody != null)) {
                if (oWait && oBody) {
                        oWait.visibility = 'hidden';
                        oBody.visibility = 'visible';
						logo.style.top=0;
                }
        }	
	
	//document.loading.visibility = 'hidden';
			
}  

function show1(url,x,y) 
	{ window.open(url,"", 'toolbar=no, location=no, resizable=no, status=no, scrollbars=yes, menubar=no, width='+x+', height='+y);}
function show(url,x,y) 
	{ window.open(url,"", 'toolbar=no, location=no, resizable=no, status=no, scrollbars=no, menubar=no, width='+x+', height='+y);}
function ImgShw(ID, width, height, alt)
{
	var scroll = "no";
	var top=0, left=0;
	if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
	if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
	if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
	width = Math.min(width, screen.width-10);
	height = Math.min(height, screen.height-28);
	var wnd = window.open("","","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
	wnd.document.write(
		"<html><head>"+
		"<"+"script type=\"text/javascript\">"+
		"function KeyPress()"+
		"{"+
		"	 "+
		"		window.close();"+
		"}"+
		"</"+"script>"+
		"<title>"+(alt == ""? "Картинка":alt)+"</title></head>"+
		"<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onClick=\"KeyPress()\">"+
		"<img src=\""+ID+"\" border=\"0\" alt=\""+alt+"\" />"+
		"</body></html>"
	);
	wnd.document.close();
}

function check_required(obj)
	{  			
		if(obj)
		{
			//alert('form');
			var t = 0;
			for(i=0;i<obj.elements.length;i++)
			{
				if(obj.elements[i].id=='required')
				{
					switch(obj.elements[i].type)
					{
						default: if(!obj.elements[i].value) t++; break;
					}
				}
			}
			if(t) alert('Fill in all of the required fields, please');
			else obj.submit();
		}
	
	} 
function check_reqdate(obj)
	{  			
		if(obj)
			{
			var monArr= { "":"00","Jan":"01","Feb":"02","Mar":"03","Apr":"04","May":"05","Jun":"06","Jul":"07","Aug":"08","Sep":"09","Oct":"10","Nov":"11","Dec":"12" };
			var inDate=obj.checkinyear.value + monArr[obj.checkinmon.value];
			if(obj.checkinday.value<10)
				inDate+="0" + obj.checkinday.value;
			else
				inDate+= obj.checkinday.value;	
			var outDate=obj.checkoutyear.value + monArr[obj.checkoutmon.value];
			if(obj.checkoutday.value<10)
				outDate+="0" + obj.checkoutday.value;
			else
				outDate+= obj.checkoutday.value;	
			if(  outDate<10000000 || inDate<10000000 || inDate*1>=outDate*1 ) { alert('Please check dates'); return false; }
			else { return true;}
			
			}
	
	} 
	
function check_reqvisa(obj,f,n)
	{
		if(obj.form)
		{
			var t = 0;
			for(i=0;i<obj.elements.length;i++)
			{
				if(obj.elements[i].id=='required')
				{
					switch(obj.elements[i].type)
					{
						default: if(!obj.elements[i].value) t++; break;
					}
				}
			}
			if(t) alert('Fill in all of the required fields, please');
			
			var em = 0;	 			
			
			if((!t)&&(!em)&&(f==1)&&(n==1)) obj.submit();			
		}
	}	
			
function showObject(obj) { obj.style.visibility="visible"; 
						Sl=document.body.clientWidth;
						St=document.body.clientHeight; 
	if((Sl-(event.clientX + document.body.scrollLeft))<=320)
		{obj.style.left = event.clientX + document.body.scrollLeft-300}
	else {obj.style.left = event.clientX + document.body.scrollLeft}
						obj.style.top = event.clientY + document.body.scrollTop+20;}


function hideObject(obj) { obj.style.visibility="hidden"; }			

function test(obj)
	{  		
		//alert('test');
		alert(obj.elements.length);
	
	}  	

function check_required_sub(obj)
	{  		
		if(obj)
		{
			var t = 0;
			for(i=0;i<obj.elements.length;i++)
			{
				if(obj.elements[i].id=='required')
				{
					switch(obj.elements[i].type)
					{
						default: if(!obj.elements[i].value) t++; break;
					}
				}
			}
			if(t) alert('Fill in all of the required fields, please');
			else obj.submit();
		}
	
	}  
function analiz(a,b)
	{
		a=a.replace(/ /g, '');
		b=b.replace(/ /g, '');  
					
		a=a.toLowerCase();		
		b=b.toLowerCase();
		
		if(a==b) return 1; else alert('CREDIT CARD HOLDER NAME AND NAME OF LEAD PASSENGER DO NOT MATCH, TO PROCESS ORDER THEY MUST BE THE SAME');		
	}	

function analiz_nation(a)
	{
		a=a.replace(/ /g, '');						
		a=a.toLowerCase();	
		suba=a.slice(0,3);
		switch(suba)
		{		
		case 'afg':
		case 'alg':
		case 'ban':
		case 'bos':
		//case 'cha':
		case 'egy':
		case 'eth':
		case 'ind':
		case 'ira':
		case 'jor':
		case 'leb':
		case 'nig':
		case 'pak':
		case 'pal':
		case 'rwa':
		case 'sau':
		case 'som':
		case 'sri':
		case 'sud':
		case 'syr':
		case 'tur':
		case 'vie':
		case 'chi':
		case 'peo':
		case 'gha':
		case 'sie':
		case 'ang':
		case 'prc':
		case 'mal':
		case 'phi':
		case 'mor':
		case 'tha':
		case 'gam':
		case 'ken':
		case 'con':
		case 'gua':
			alert('Unfortunately, we are currently in the process of renewing our license and can no longer issue visas. \nSorry for this inconvenience please try another agency');
			nation=0;
			//for(i=0;i<obj.form.elements.length;i++)
			//{obj.form.elements[i].value='';}
		break;
		
		default: nation=1; break;
		}	
		return 	nation;
	}	
function checkOut(name) {
		if(name=='check-in' || name=='check-out') {
			inDate=document.getElementById('check-in');
			outDate=document.getElementById('check-out'); }
		else if(name=='checkin' || name=='checkout') {
			inDate=document.getElementById('checkin');
			outDate=document.getElementById('checkout'); }
		else if(name=='check-in2' || name=='check-out2') {
			inDate=document.getElementById('check-in2');
			outDate=document.getElementById('check-out2'); }	
		
		if(inDate.value || outDate.value){
			var inArr=inDate.value.split('.');
			var outArr=outDate.value.split('.');
			if(inArr[2]+ inArr[1]+ inArr[0] >= outArr[2]+ outArr[1]+ outArr[0] || inArr.length!=3 || outArr.length!=3) {
				if(name=='check-in' || name=='checkin' || name=='check-in2') {
					var newdate = new Date(inArr[2], inArr[1]-1, inArr[0]*1+2);
					dateforinp=addZero(newdate.getDate())+ "." + addZero(newdate.getMonth()*1+1) + "." + newdate.getFullYear();
					outDate.value=dateforinp;
					 }
				else  {
					var newdate = new Date(outArr[2], outArr[1]-1, outArr[0]-2);
					dateforinp=addZero(newdate.getDate())+ "." + addZero(newdate.getMonth()*1+1) + "." + newdate.getFullYear();
					inDate.value=dateforinp; 
					}
			}
		}
	}
function addZero(str) {
	if (str<10)
		str="0"+str; 
	return (str);
	}	