  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

function error(elem, text) {
	alert(text);
	elem.focus();
}
function fieldNull(id){
document.getElementById(id).value='';
}
function validateForm()
{
with (document.form1){

	if (aname.value=="" || aname.value=="Type Your Name"){
	error(aname, "Please Enter your name");
	return false;
	}
	if (office.value=="aaa"){
	error(office, "Please select our Branch Office");
	return false;
	}
	if(phone.value=="" || phone.value=="Type Your Phone No." ){
			error(phone, "Please enter your Mobile / Phone No.");
	return false;
	}
	else{
	var x=phone.value;
	var filter = /^[0-9]+$/;
	if(!filter.test(x)){ error(phone, "Please enter Numbers only.");
	return false
	}
	else{
	if(x.length<8 || x.length==9 || x.length>10){error(phone, "Please enter Valid Mobile / Phone No.");
	return false;
	}
	}
	}
	
	if (email.value=="" || email.value=="Type your Email"){
	error(email, "Please Enter your Email Id");
	return false;
	}
	
	if (email.value!="Type your Email"){
	var y = email.value;
	if(y.length>0){
	var filter  = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
   	if (!filter.test(y)){ error(email, "Please enter Valid Email"); return false; } 
	} 
	}
	if (enquiry.value==""){
	error(enquiry, "Please type your enquiry");
	return false;
	}
	
	return true;
}
}

var posx;var posy;
function capmouse(e){
// captures the mouse position
posx = 0; posy = 0;
if (!e){var e = window.event;}
if (e.pageX || e.pageY){
posx = e.pageX;
posy = e.pageY;
}
else if (e.clientX || e.clientY){
/*posx = e.clientX;
posy = e.clientY;*/
      posx = e.clientX + 
        (document.documentElement.scrollLeft || 
         document.body.scrollLeft) - 
         document.documentElement.clientLeft;
      posy = e.clientY + 
        (document.documentElement.scrollTop ||
         document.body.scrollTop) - 
         document.documentElement.clientTop;
}
}
function showDiv(id){
	var left;
	document.getElementById('blanket').style.visibility = 'visible';
	var top = posy - 290;
	document.getElementById(id).style.top=top+'px';
	if((posx+370)>=myWidth){
		left=posx-370;
	}
	else{left=posx;}
	document.getElementById(id).style.left=left+'px';
	document.getElementById(id).style.visibility = 'visible';
}
function showDiv2(id){
	var left;
	document.getElementById('blanket').style.visibility = 'visible';
	var top = 100;
	document.getElementById(id).style.top=top+'px';
	left= 40;
	document.getElementById(id).style.left=left+'px';
	document.getElementById(id).style.visibility = 'visible';
}
function hidn(id){
document.getElementById(id).style.visibility = 'hidden';
document.getElementById('blanket').style.visibility = 'hidden';
}
function showThanks(id) {
  	document.getElementById(id).style.top=(myWidth/2+30)+'px';
	document.getElementById(id).style.left=(myHeight/2-20)+'px';
	document.getElementById('blanket').style.height = myHeight + 'px';
	document.getElementById('blanket').style.visibility = 'visible';
	document.getElementById(id).style.visibility = 'visible';
}

function loadXMLDoc(url,id)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById(id).value=xmlhttp.responseText;
}

function changeScrollAmt(amt){
var marquee = document.getElementById('myMarquee');
marquee.scrollAmount=amt;
}
function mm(){
	document.write("caontactlakme@gmail.com");
	}
	
function centerPopup(){
//request data for centering
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupHeight = $("#Layer1").height();
var popupWidth = $("#blanket").width();
//centering
$("#Layer1").css({
"position": "absolute",
"top": windowHeight/2-popupHeight/2,
"left": windowWidth/2-popupWidth/2
});
//only need force for IE6

$("#blanket").css({
"height": windowHeight
});

}
