// JavaScript Document

function popupmenu(str)

{

	if(str=='services')

	 {   document.getElementById('shomenu').style.display='block';

	     document.getElementById('shomenu').style.visibility='visible';

	     document.getElementById('shomenu').style.position='absolute';

		 document.getElementById('shomenu').style.zIndex='100';

		 document.getElementById('shomenu').style.height='196px';

		 document.getElementById('shomenu').style.width='170px';

		 document.getElementById('shomenu').style.backgroundColor='#440B0B';

		 document.getElementById('shomenu').style.color='white';

		 document.getElementById('shomenu').style.marginLeft='130px' 

	 }	

}

function mouseout()

	{

		 document.getElementById('shomenu').style.visibility='hidden';

	

	}



function do_reset()

{

		document.getElementById('name').value="";

		document.getElementById('email').value="";

		document.getElementById('phone').value="";

		document.getElementById('messeage').value="";



  return false;	

}



function do_submit()

{

	   var Name=document.getElementById('name').value;

	   

		var Email=document.getElementById('email').value;

		

		var Phone=document.getElementById('phone').value;

		

		var Messeage=document.getElementById('messeage').value;

		

        if(Name=="" || Name=='Name')

		 {

			 alert('Please Enter the name');

			 document.getElementById('name').value="";

			 document.getElementById('name').focus();

			 return false;

		 }

		if(!isNaN(Name))

		  {

			   alert('Please Enter the name');

			   return false;

		  }

		  

			  // Email validation portion.

	

				if(Email=="")

				 {

						 alert("please fill the mail-Id.");

						 document.getElementById('email').value="";

						 document.getElementById('email').focus();

						 return false;			

				

				  }

			   var  ch=validemail(Email);

			   if(ch==false)

			    {

			      alert('your Email id is not  valided');

			       document.getElementById('email').value="";

				   document.getElementById('email').focus();

			     return false;					  

		        }

				

	    //Phone

		

		  if(Phone=="" || Phone=='Phone')

		 {

			 alert('Please fill the  Phone Number');

			 document.getElementById('phone').value="";

			 document.getElementById('phone').focus();

			 return false;

		 }

		if(isNaN(Phone))

		  {

			   alert('Please fill the phone number');

			    document.getElementById('phone').value="";

			    document.getElementById('phone').focus();

			   return false;

		  }

		  

		      //Message 

		

		  if(Messeage=="" || Messeage=='Message')

		   {

			 alert('Please fill the  message');

			 document.getElementById('messeage').value="";

			 document.getElementById('messeage').focus();

			 return false;

		 }

		 

	 document.enquiry.submit();

}



 //validate email function.

function validemail(mail)    

	 { 

	   var ve= /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;

       return ve.test(mail); 

	 }

	 

var win=null;

function NewWindow(mypage,myname,w,h,scroll,pos)

{				

			if(pos=="random")

			{

			LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;

			

			TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;

			}

			if(pos=="center")

			{

			LeftPosition=(screen.width)?(screen.width-w)/2:100;

			

			TopPosition=(screen.height)?(screen.height-h)/2:100;

			

			}

			else if((pos!="center" && pos!="random") || pos==null)

			{

				LeftPosition=0;

				TopPosition=20

			}

settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';

			

			win=window.open(mypage,myname,settings);





//Put this link 

//<a href="hello.html" onclick="NewWindow(this.href,'mywin','400','500','no','center');return false" onfocus="this.blur()">link</a>



}




