function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function cngbg(obj1,nc1){
	var objv1=document.getElementById(obj1);	
	if(objv1){
		objv1.nc1=objv1.className;
		objv1.className=nc1;		
	}

}

function cngbg0(obj1,nc1){
	var objv1=document.getElementById(obj1);	
	if(objv1){
		objv1.nc1=objv1.className;
		objv1.className=nc1;		
	}
	objv1.onmouseout=function(){ this.className=this.nc1; }
}

function checkform(objform){
	with(objform){
		if(objform.txtfirstname.value==""){
			alert("Please Fill the field first name");
			return;
		}
		
		if(objform.txtlastname.value==""){
			alert("Please Fill the field last name");	
			return;
		}
		if(objform.txtemail.value==""){
			alert("Please Fill the field email");
			return;
		}
		if(objform.txtmobile.value==""){
			alert("Please Fill the field mobile");	
			return;
		}
		objform.submit();
		return;
		
			
		}	
	
	}
	
	function hideme(divname){
		
	var obj=document.getElementById(divname);
		if(obj){
				obj.style.display='none';
			}
	}
	function showme(divname){
		
	var obj=document.getElementById(divname);
		if(obj){
				obj.style.display='inline';
			}
	}	
	
	function menu_positioning(posname,layername,minustop,minusleft){
		
		var mainobj=document.getElementById(posname);		
		var obj=document.getElementById(layername);
		var y = getAbsY(document.getElementById(posname));
		var x = getAbsX(document.getElementById(posname));
		if(obj && mainobj){
			var pos=y-minustop;
			var posx=x-minusleft;
			obj.style.top=pos+"px";
			obj.style.left=posx+"px";
			obj.style.display="block";
		}		
	}
	function menu_hide(layername){
		var obj=document.getElementById(layername);
		if(obj){
			obj.style.display="none";
		}
		
	}
	function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); }
	function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); }
	
	function getAbsPos(elt,which) {
	iPos = 0;
	while (elt != null) {
	iPos += elt["offset" + which];
	elt = elt.offsetParent;
	}
	return iPos;
	}
	
	function moo(mywidth) { 
	var obj2=getAbsY(document.getElementById('markpos'));
	//alert(obj2);
	var newheight=obj2+100;
	//alert(newheight);
	window.resizeTo(800,newheight);
	window.resizeable="no";
}
	
function poptastic2(hisname,patho,mytitle,mydescr)
		{
		newwindow=window.open("blank.html",hisname,'height=900,width=800,scrollbars=no,toolbar=0,menubar=0,status=no,directories=no,resizable=0');
		if (window.focus) {newwindow.focus()}
			newwindow.document.style
			var str='<html xmlns="http://www.w3.org/1999/xhtml">'+
				'<head>'+
				'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'+
				'<title>LE BRISTOL</title>'+
				'<script language="javascript" type="text/javascript" src="js/bristol.js"></script>'+
				'<link rel="stylesheet" type="text/css" href="css/bristol.css" /><script>'+moo.toString()+'</script>'+
				'</head>'+
				'<body style="background-image:url(\'images/lowerpage/bck.jpg\');background-position:top;margin-left:0px;margin-top:0px;" onload="moo();">'+
				'<table width="800"  border="0" cellspacing="0" cellpadding="0" >'+
				  '<tr><td height="115"><img src="images/lebristol.jpg" height="115"/></td></tr>'+
				  '<tr><td height="420" align="center" valign="middle" style="background-image:url(\'images/loader.gif\');background-position:center;background-repeat:no-repeat;"><br/><br/><img src="'+patho+'"/></td></tr>'+
				  '<tr><td height="20" align="center" valign="middle">&nbsp;</td></tr>'+
				  '<tr><td align="center" valign="middle" class="textverdana_11_bold">'+mytitle+'</td></tr>'+
				  '<tr><td align="center" valign="middle" class="textverdana11_2"><div style="padding-left:100px;padding-right:100px;">'+mydescr+'</div></td></tr>'+				  
				 
				'</table><div id="markpos">&nbsp;</div>'+
				'</body></html>';		
			newwindow.document.write(str);
			newwindow.document.close();
		}
		
         function check_email(email_txt){
                emailRegExp = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.([a-z]){2,4})$/;              
                if(emailRegExp.test(email_txt)){
                    //alert('true');
                    return true;
               }else{

                 //alert('false');
                  return false;
             }
         }

function checkall(objform){
	with(objform){
		if(stremail.value==""){
			alert("please enter your email");	
			return;
		}
		if(check_email(stremail.value)==false){
			alert("please enter a valid  email");	
			return;			
			
		}
		if(strresume.value==""){
		
			alert("please attach your cv");	
			return;				
		}
		if(strcity.value==""){
			alert("please enter your city");	
			return;
		}
		if(strno.value==""){
			alert("please enter your mobile");	
			return;
		}
		if(strpobox.value==""){
			alert("please enter your po.box");	
			return;
		}
		if(strname.value==""){
			alert("please enter your Name");	
			return;
		}	
		if(txtjob.value==""){
			alert("please choose a job");	
			return;
		}
		if(txtcountry.value==""){
			alert("please choose a country");	
			return;
		}			
		objform.submit();
		
	
		
	}
}

function checkall2(objform){
	with(objform){
		if(txtemail.value==""){
			alert("please enter your email");	
			return;
		}
		if(check_email(txtemail.value)==false){
			alert("please enter a valid  email");	
			return;				
		}
		if(txtfname.value==""){		
			alert("please attach your cv");	
			return;				
		}
		if(txtmname.value==""){
			alert("please enter your city");	
			return;
		}
		if(txtlname.value==""){
			alert("please enter your mobile");	
			return;
		}
		objform.submit();
		
	}
	
	}
	
	
//***********************************************************************************************/

function poptastic3(hisname,patho,mytitle,mydescr)
		{
		newwindow=window.open("blank.html",hisname,'height=900,width=800,scrollbars=no,toolbar=0,menubar=0,status=no,directories=no,resizable=0');
		if (window.focus) {newwindow.focus()}
			newwindow.document.style
			var str='<html xmlns="http://www.w3.org/1999/xhtml">'+
				'<head>'+
				'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'+
				'<title>LE BRISTOL</title>'+
				'<script language="javascript" type="text/javascript" src="js/bristol.js"></script>'+
				'<link rel="stylesheet" type="text/css" href="css/bristol.css" /><script>'+moo.toString()+'</script>'+
				'</head>'+
				'<body style="background-image:url(\'images/lowerpage/bck.jpg\');background-position:top;margin-left:0px;margin-top:0px;" onload="moo();">'+
				'<table width="800"  border="0" cellspacing="0" cellpadding="0" >'+
				  '<tr><td height="115"><img src="images/lebristol.jpg" height="115"/></td></tr>'+
				  '<tr><td height="49">&nbsp;</td></tr>'+
				  '<tr><td   height="362" align="center" valign="middle" style="background-image:url(\'images/loader.gif\');background-position:center;background-repeat:no-repeat;"><table width="540"  border="0" cellspacing="0" cellpadding="0" ><tr><td align="center" valign="middle" bgcolor="#ffffff" height="362"><img src="'+patho+'"/></td></tr></table></td></tr>'+
				  '<tr><td height="20" align="center" valign="middle">&nbsp;</td></tr>'+
				  '<tr><td  align="center" valign="middle" class="textverdana_11_bold">'+mytitle+'</td></tr>'+
				  '<tr><td align="center" valign="middle" class="textverdana11_2"><div style="padding-left:100px;padding-right:100px;">'+mydescr+'</div></td></tr>'+				  
				 
				'</table><div id="markpos">&nbsp;</div>'+
				'</body></html>';		
			newwindow.document.write(str);
			newwindow.document.close();
		}