//Contact form validation routine
function echeck(str) {
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   alert("Please enter your correct email");
		   return false;
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please enter your correct email");
		   return false;
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please enter your correct email");
		    return false;
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please enter your correct email");
		    return false;
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please enter your correct email");
		    return false;
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please enter your correct email");
		    return false;
		 }
		 if (str.indexOf(" ")!=-1){
		    alert("Please enter your correct email");
		    return false;
		 }
 		 return true;
	}
function SubscribeForm()
{
	var email=document.subscribefrm.from;
	if ((email.value==null)||(email.value=="")){
		alert("Please enter your email");
		email.focus();
		return false;
	}
	else if (echeck(email.value)==false){
		email.value="";
		email.focus();
		return false;
	}
	return true;
}
function ValidateForm(){
	var name=document.inquiryfrm.name;
	var email=document.inquiryfrm.from;
	var subject=document.inquiryfrm.subject;
	var inquiry=document.inquiryfrm.inquiry;
	if((name.value==null)||(name.value == ""))
	{
		alert("Please enter your name");
		name.focus();
		return false;
	}
	else if ((email.value==null)||(email.value=="")){
		alert("Please enter your email");
		email.focus();
		return false;
	}
	else if (echeck(email.value)==false){
		email.value="";
		email.focus();
		return false;
	}
	else if((subject.value==null)||(subject.value == ""))
	{
		alert("Please enter subject of your inquiry");
		subject.focus();
		return false;
	}
	else if((inquiry.value==null)||(inquiry.value == ""))
	{
		alert("Please enter your inquiry");
		inquiry.focus();
		return false;
	}
	return true
 }
//Disable right click script on images
var clickmessage="Right click disabled on images!"

function disableclick(e) 
{
	if (document.all) 
	{
		if (event.button==2||event.button==3) 
		{
			if (event.srcElement.tagName=="IMG")
			{
				alert(clickmessage);
				return false;
			}
		}
	}
	else if (document.layers) 
	{
		if (e.which == 3) 
		{
			alert(clickmessage);
			return false;
		}
	}
	else if (document.getElementById)
	{
		if (e.which==3&&e.target.tagName=="IMG")
		{
			alert(clickmessage)
			return false
		}
	}
}

function associateimages()
{
	for(i=0;i<document.images.length;i++)
	document.images[i].onmousedown=disableclick;
}

if (document.all)
	document.onmousedown=disableclick
else if (document.getElementById)
	document.onmouseup=disableclick
else if (document.layers)
	associateimages()