// JavaScript Document
function mousehover(id)
{
var x=document.getElementById(id);
//x.style.className="menu_hover"; 
x.style.backgroundImage="url(images/menu_bg_r.jpg)"; 
}
function mouseout(id)
{
var x=document.getElementById(id);
x.style.backgroundImage="url(images/menu_bg.jpg)"; 
}
function google_search()
{
x=document.Gsearch.gsearch.value;
if(x=="")
alert("Text Is Required");
else
window.open("http://www.google.com.eg/search?hl=ar&q="+x+"&meta=");
}
function MyImages(imagepath)
{
window.open("images/Egyptian_marble/"+imagepath+"","","scrollbars=no,menubar=no,height=370,width=415,resizable=yes,toolbar=no,location=no,left=200,top=30,status=no");	
	}
function MyImages2(imagepath)
{
window.open("images/Imported_marble/"+imagepath+"","","scrollbars=no,menubar=no,height=370,width=415,resizable=yes,toolbar=no,location=no,left=200,top=30,status=no");	
	}
function MyImagesg(imagepath)
{
window.open("images/Egyptian_Granite/"+imagepath+"","","scrollbars=no,menubar=no,height=370,width=415,resizable=yes,toolbar=no,location=no,left=200,top=30,status=no");	
	}
function MyImagesig(imagepath)
{
window.open("images/Imported_Granite/"+imagepath+"","","scrollbars=no,menubar=no,height=370,width=415,resizable=yes,toolbar=no,location=no,left=200,top=30,status=no");	
	}
function under_construction()
{
alert("Unfortunately this function is not yet activated"); 
 }
 

///////////////////////////////isempty function/////////////////////
var whitespace="\t\n\r";

function isEmpty(s)
{
  var i;

     if((s==null) || (s.length==0))
     	return true;

        for(i=0;i<s.length;i++)
          {
            var c=s.charAt(i);

            if(whitespace.indexOf(c)==-1)
            return false;
          }
     return true;
}
////////////////////////////////End/////////////////////////////////////

////////////////////////////////// Job validation //////////////////	
function validate_human_r()

{
//alert('koko');
	if (isEmpty(document.hum_res_form.fname.value))
         {
           alert("Frist Name Required !! ");
           document.hum_res_form.fname.focus();
		   return false;
		  }
if (isEmpty(document.hum_res_form.lname.value))
   {
     alert("Last Name Required !! ");
     document.hum_res_form.lname.focus();
     return false;
	}

if (isEmpty(document.hum_res_form.address.value))
   {
	 alert("Address Required !! ");
	 document.hum_res_form.address.focus();
	 return false;
    }

if (isEmpty(document.hum_res_form.city.value))
   {
     alert("City Required !! ");
	 document.hum_res_form.city.focus();
	 return false;
   }
   
   if (isEmpty(document.hum_res_form.tel.value))
   {
     alert("Telephone Required !! ");
     document.hum_res_form.tel.focus();
	 return false;
   }
	////////////////////////mail/////////////////////////////////
var pos;
var pos2;
var s=document.hum_res_form.mail.value;
 if(s == "")
 {
	alert("Please Enter a valid e-mail address");
	document.hum_res_form.mail.focus();
	return false;
 }
 pos = s.indexOf('@',1);
 if((pos == -1) || (pos == (s.length-1)))
 {
	alert("Please Enter a valid e-mail address");
	document.hum_res_form.mail.focus();
	return false;
 }
 pos2 = s.indexOf('.',1);
 if((pos2 == -1) || (pos2 == (s.length-1)))
 {
	alert("Please Enter a valid e-mail address");
	document.hum_res_form.mail.focus();
	return false;
 }
////////////////////////////////////////////////////
	if (document.hum_res_form.jop.options.value=="none")
	{
     alert("Please Select a jop !! ");
	 document.hum_res_form.jop.options.focus();
	 return false;
   }
	return true;
}