// JavaScript Document
function getQueryVariable(variable)
{
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++)
	{
			var pair = vars[i].split("=");
			if (pair[0] == variable)
			{
				return pair[1];
			}
	}
}
function fnGoTo(page)
{
	document.location.href = page;
}
function PRwin(win)
{
	window.open(win, '', 'toolbar=0, scrollbars=no, status=0, location=0, resizable=0, menubar=0, width=300, height=0, left =350, top =450');
}
function fnloadDt()
{	
	var data = getQueryVariable("data");
	document.getElementById(data).style.display = "inline"
}
function fnloadPt()
{
	var PT = getQueryVariable("type")
	document.getElementById("Product").selectedIndex = PT;
}
function isEmailAddress(WsCheck)
{
	var i, c;
	var at = dot = 0;
	var str = WsCheck;
	var sl  = str.length;
	var dx_at = dx_dot = -1;

	for (i = 0; i < sl; i++)
	{
		c = str.charAt(i);
		if (c == "@") {++at;  dx_at=i; }
		else if (c == ".") {++dot; dx_dot=i;}
		else if (c == " ")
		return false;
	}
	if ((sl < 8) || (dx_dot < 1) || (at != 1)
	|| (dx_at < 1) || (dx_dot-1 <= dx_at)
	|| (sl-3 < dx_dot))
	return false;
	else
	return true;
}
function Trim(TrimString)
	{	var tempObj;
		if(TrimString && TrimString.value){ tempObj = TrimString;TrimString = tempObj.value;}
		if(TrimString == "undefined" || TrimString == null) return null;
		if(TrimString.length == 0 || TrimString.value == "" || TrimString == "")TrimString="";
		else
		{	var Lcont=0,TempStrArray=TrimString.split(" "),Rcont=TempStrArray.length-1;
			while(TempStrArray[Lcont] == "")Lcont++;while(TempStrArray[Rcont] == "")Rcont--;
			if(Rcont<Lcont)TrimString="";else
			for(TrimString = TempStrArray[Lcont], Lcont++ ; Lcont <= Rcont ; Lcont++) TrimString += " " + TempStrArray[Lcont];
			var re = /\'|/g;
			TrimString = TrimString.replace(re,"");
		}
		if(tempObj && TrimString != "undefined" && TrimString != null) 
		{	tempObj.value = TrimString;	return tempObj	  }
		else return TrimString;
	}
function fnPlayFLV(Video, PUpW, PUpH)
{
	window.open('http://www.hmeproviders.com/tempsites/FLVVideos/'+Video,'Video', 'toolbar=0, scrollbars=no, status=0, location=0, resizable=0, menubar=0, width='+PUpW+', height='+PUpH+', left =50, top =50')
}