function getCommonAjax(fileName, divName)
{
	try
	{
		var str;
		var xmlHttp = null 	
		if (typeof window.ActiveXObject != 'undefined') 
			{ 
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
			} 
		else 
			{ 
				xmlHttp = new XMLHttpRequest(); 
			}
		var url = fileName + "?sid="+Math.random();
		
		xmlHttp.open("GET", url, false); 
		xmlHttp.send(null);
		
		if (xmlHttp.readyState == 4 || xmlHttp.readyState=="complete") 
			 {
			     document.getElementById(divName).innerHTML=xmlHttp.responseText;
			    }
			    
			     /*else
			     {
			     document.getElementById(divName).innerHTML = "<img src='images/eventsTitle.gif'>"
			     
			 }*/
	}
	
	catch(e)
	{
		//do nothing
	}
}


function validatecontactus()
{
				if (document.myform.txtname.value == "")
				{
					alert("Please enter Name");
					document.getElementById("txtname").focus();
					return false;
				}	
					if (document.myform.txtemail.value == "")
				{
					alert("Please enter Email");
					document.getElementById("txtemail").focus();
					return false;
				}	
				
				if(!ValidateEmail(document.myform.txtemail.value)== true)
				{
					alert("Please enter valid Email");
					document.getElementById("txtemail").focus();
					return false;
				}

					if (document.myform.selcountry.value == "0" || document.myform.selcountry.value == "Select" )
				{
					alert("Please Select Country");
					document.getElementById("selcountry").focus();
					return false;
				}	

				if (document.myform.txtinquiry.value == "")
				{
					alert("Please enter Inquiry");
					document.getElementById("txtinquiry").focus();
					return false;
				}
				return true;
}

function ValidateEmail(emailstr)
{
	if (emailstr == "" )
	{
		return false;
	}
	if(emailstr.replace(/ /g,"") == "")
	{
		return false;
	}
	else if(emailstr.indexOf("@") < 1 )
	{
		return false;
	}	
	else if( emailstr.indexOf('@',0)==0 || emailstr.indexOf('.',0)<1)
	{
		return false;
	}
	else if( emailstr.search(/[^A-Za-z0-9@._-]/) >= 0 )
	{
		return false;
	}
	else if((emailstr.indexOf("@.",0)) > 1)
	{
		return false;
	}
	else if( emailstr.indexOf("/") > 1 || emailstr.indexOf(",") > 1 )
	{
		return false;
	}
	
	cnt = 0;
	instr = emailstr.toString()
	
	for(var i=0;i<emailstr.length;i++)
	{
		var char1=emailstr.charAt(i)
		if ( char1 == "@" )
		{
			cnt=cnt+1;
		}
	}					
	if( cnt > 1 )
	{
		return false;
	}
	return true;
}
