﻿var thispath="../";
function setthispath(Mthispath)
	{
		thispath=Mthispath;
	}
function showdiv(obj)
	{
		
		
	}
	function rs_Email(emailStr)
	{ 
		var re=/^[\w-]+(\.*[\w-]+)*@([0-9a-z]+(([0-9a-z]*)|([0-9a-z-]*[0-9a-z]))+\.)+[a-z]{2,3}$/i;
		if(re.test(emailStr))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	function Tcheck()
	{
		if(document.getElementById("OrderIDT").value.search(/[^0-9]/)!=-1)
		{
			alert('Please enter your valid Order ID');
			return false;
		}
		else if(!rs_Email(document.getElementById("EmailT").value))
		{
			alert('Please enter your valid email address!');
			return false;
		}
		else
		{
			return true;
		}
			
	}
	function Pcheck()
	{
		if(document.getElementById("OrderIDP").value.search(/[^0-9]/)!=-1)
		{
			alert('Please enter your valid Order ID');
			return false;
		}
		else if(!rs_Email(document.getElementById("EmailP").value))
		{
			alert('Please enter your valid email address!');
			return false;
		}
		else
		{
			return true;
		}
	}
	function Mcheck()
	{
		if (!rs_Email(document.getElementById("LetterEmail").value))
		{
			alert('Please enter your valid Email address');
			return false;
		}
		else
		{
			return true;
		}
	}
	function Scheck()
	{
		if (document.getElementById("txtkeyword").value=="keyword"||document.getElementById("txtkeyword").value=="")
		{
			alert("Please enter a search query");
			return false;		
		}
		else
		{
			return true;
		}
	}


function Check()
{
	if(document.theform.GameNameListID.options[document.theform.GameNameListID.selectedIndex].value==0)
	{
		alert("Please select the game!");
		return false;
	}
	else if(document.theform.ServerNameListID.options[document.theform.ServerNameListID.selectedIndex].value==0)
	{
		alert("Please select the server!");
		return false;
	}
	else if(document.theform.ProductNameListID.options[document.theform.ProductNameListID.selectedIndex].value==0)
	{
		alert("Please select the product");
		return false;
	}
	/*else if((document.theform.Email.value.Trim()!="")&&CheckString(document.theform.Email.value.Trim(),"Email Information")==false)
	{
		return false;
	}
	else if((document.theform.Username.value.Trim()!="")&&CheckString(document.theform.Username.value.Trim(),"The First UserName")==false)
	{
		return false;
	}
	else if((document.theform.LUsername.value.Trim()!="")&&CheckString(document.theform.LUsername.value.Trim(),"The Last UserName")==false)
	{
		return false;
	}
	else if((document.theform.Telephone.value.Trim()!=null)&&CheckString(document.theform.Telephone.value.Trim(),"Your Telephone")==false)
	{
		return false;
	}*/
	else
	{
		return true;
	}
}

function send_request(url,obj) 
{
	http_request = false;
	
	if(window.XMLHttpRequest) 
	{ 
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) 
		{
			http_request.overrideMimeType("text/xml");
		}
	}
	else if (window.ActiveXObject) 
	{ 
		try 
		{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try 
			{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) 
			{}
		}
	}
	if (!http_request) 
	{ 
		return false;
	}
		http_request.onreadystatechange = obj;
		
		
		http_request.open("GET", url, true);
		http_request.send(null);
}







function cleartext(obj,mmark)
{
	if(obj.value==mmark)
	{
		obj.value='';
	}
}