function newwin(win)
	{
		window.open(win, '', 'toolbar=0, scrollbars=yes, status=0, location=0, resizable=1, menubar=0, width=500, height=244, left =50, top =50');
	}
function newwin1(win)
	{
		window.open(win, '', 'toolbar=0, scrollbars=yes, status=0, location=0, resizable=1, menubar=0, width=700, height=544, left =50, top =50');
	}
function PRwin(win)
	{
		window.open(win, '', 'toolbar=0, scrollbars=no, status=0, location=0, resizable=1, menubar=0, width=640, height=405, left =50, top =50');
	}
function openWin(url, w, h) 
	{ 
		var winprop = "width=" + w + ",height=" + h; 
		openwin = window.open(url,'',winprop); 
	}

function fnpop(win)
	{
		newwin = window.open(win, 'window1', 'toolbar=0, scrollbars=no, status=0, location=0, resizable=0, menubar=0, width=320, height=240, left =50, top =50')
	}
function fnopen()
    {
        window.open('HMEProvidersServices.html', 'window', 'toolbar=0, scrollbars=no, status=0, location=0, resizable=0, menubar=0, width=290, height=340, left =50, top =50')
    }
function fnopen4()
    {
        window.open('HMEProvidersTV.html', 'window', 'toolbar=0, scrollbars=no, status=0, location=0, resizable=0, menubar=0, width=400, height=245')
    }
function fnopenimg()
    {
        window.open('images/meetthestaff.jpg', 'window', 'toolbar=0, scrollbars=no, status=0, location=0, resizable=1, menubar=0, width=600, height=400, left =50, top =50')
    }
function fnshow()
	{
		document.getElementById("comingsoon").style.display = "inline"
	}
function fnopenDT()
    {
        window.open('dealerstraining.html', 'window', 'toolbar=0, scrollbars=no, status=0, location=0, resizable=0, menubar=0, width=810, height=395, left =50, top =50')
    }
	
function fnopen1()
    {
        window.open('../HMEProvidersServices.html', 'window', 'toolbar=0, scrollbars=no, status=0, location=0, resizable=0, menubar=0, width=290, height=340, left =50, top =50')
    }
function fnopenimg1()
    {
        window.open('../images/meetthestaff.jpg', 'window', 'toolbar=0, scrollbars=no, status=0, location=0, resizable=1, menubar=0, width=600, height=400, left =50, top =50')
    }
function fnopenDT1()
    {
        window.open('../dealerstraining.html', 'window', 'toolbar=0, scrollbars=no, status=0, location=0, resizable=0, menubar=0, width=810, height=395, left =50, top =50')
    }
	
function FormTrim(oForm)
{	for (i=0; i<=oForm.length-1; i++)
	{	if (oForm[i].type == "text" || oForm[i].type == "textarea" || oForm[i].type == "password" )		
			Trim(oForm[i])
	}
} 

function Trim(TrimString)
{	var tempObj;
	if(TrimString){tempObj = TrimString;TrimString = tempObj.value;}
	if(TrimString == "undefined" || TrimString == null) return null;
	if(TrimString.length == 0)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 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 js_fnTrim(strText)
    {
	    //parameter description
	    //strText -> text which needs to be trim the spaces
    	
	    var js_intIndex,js_strLen;
	    js_intIndex=0
	    strText += "";
	    if(strText== "undefined" || strText == null)
		    return null;
	    else if(strText.length == 0)
		    strText = "";
	    else
	    {
		    js_strLen= strText.length;
		    //this loop will trim the left side spaces
		    while ((js_intIndex <= js_strLen) && (strText.charAt(js_intIndex) == " "))
			    js_intIndex++;
		    strText = strText.substring(js_intIndex, js_strLen);
		    if(strText.length>0)
		    {
			    //this loop will trim the right side spaces
			    js_intIndex= strText.length +- 1;
			    while ((js_intIndex >= 0) && (strText.charAt(js_intIndex) == " "))
				    js_intIndex--;
			    strText = strText.substring(0, js_intIndex + 1);
		    }
	    }
	    return strText
    }