/**/
function registration(accountApply)
{
	if(accountApply == 1) {
		window.open('<%=getSecureURLPrefix()%>secure/esp_registration.asp?accountApply=1','ExternalSpawn','top=10,left=10,width=1000,height=600,scrollbars=yes,toolbar=no,menubar=no,status=no');
	} else {
		window.open('<%=getSecureURLPrefix()%>secure/esp_registration.asp','ExternalSpawn','top=10,left=10,width=1000,height=550,scrollbars=yes,toolbar=no,menubar=no,status=no');
	}
}

function launchWindow(url)
{
	window.open(url,'lw','height=480 width=640');
}

var loggin = false;
	
	function isNotEmptyLogin(sInput)
	{
		var sTrim;
		sTrim = sInput.replace(/\s*([^\n])\s*/,"$1");
		if (sTrim == '' || sTrim==' ')
		{
			return false;
		}
		else
		{
			return true;
		}
		
	}

	function quickLogin(value)
	{
		if ((value == 13) && (!loggin))
		{
			validateFormLogin();
		}
	}
	
	function searchEnter(value)
	{
		if ((value == 13))
		{
			validateSearch2();
		}
	}


	
	function validateSearch2()
	{
		var frm;
		
		frm = document.frmNavSearch;
		if (!isNotEmpty(frm.searchkeyword.value) || frm.searchkeyword.value == 'enter keywords')
		{
			alert("You must enter a keyword to search on!");
			//return false;
		}
		else
		{
			frm.keyword.value = frm.searchkeyword.value;
			frm.submit();
		}
	}
	
	function forgottenPassword()
	{
		if (!isNotEmpty(document.frmLogin.username.value))
		{
			alert("You must enter a username before proceeding");
			document.frmLogin.username.focus();
			return;
		}
		document.frmLogin.action = '/pinQuestion.asp';
		document.frmLogin.submit();
	}
	
	function CreateBookmarkLink() {

		title = "esp2office";

		url = "http://www.esp2office.biz/";

		if (window.sidebar) {

		    // Mozilla Firefox Bookmark

		    window.sidebar.addPanel(title, url,"");

		}

		else if( window.external ) {

		    // IE Favorite

		    window.external.AddFavorite( url, title);

		}

		else if(window.opera && window.print) {

		    // Opera Hotlist

		    return true; }
   }
   
   	function expand(elementid)
	{
		var element = document.getElementById(elementid);
		if(element.className == 'expand') {
			element.className = '';
		} else {
			element.className = 'expand';
		}

		var leftNav = document.getElementById('leftNav');
			
		for(var i=0;i<leftNav.childNodes.length;i++)
		{
			//alert(leftNav.childNodes[i].id);
			if(leftNav.childNodes[i].className == 'expand' && leftNav.childNodes[i].id != elementid)
			{
				leftNav.childNodes[i].className = '';
			}
		}
			

			
	}
	
	function openHelpWindow(forceHelpId)
	{
		
		var url;
		var fullPath = new String();
		
		var iPos1=0;
		var iPos2=0;
		var iPos3=0;
		
		var pageName;
		
		fullPath = window.location.href;
		
		var serverName = new String();
		
		serverName = window.location.host;
		serverName = 'http://' + serverName;

		iPos1 = fullPath.indexOf('/',0);
		iPos2 = iPos1;
		
			while(iPos1 > 0)
			{
				iPos1 = fullPath.indexOf('/',iPos1+1);
				if(iPos1 > 0)
				{
					iPos2 = iPos1;
				
				}
			
			}
		
		iPos3 = fullPath.indexOf('.asp');
		pageName = fullPath.substring(iPos2+1,iPos3+4);
		
		if (typeof uid != 'undefined' && typeof userType != 'undefined' && typeof helpID != 'undefined' && typeof helpPath != 'undefined')
		{
		
			if(typeof forceHelpId == 'undefined') {
				url = helpPath + 'helpframe.asp?uid=' + uid + '&userType=' + userType + '&helpID=' + pageName;
			} else {
				url = helpPath + 'helpframe.asp?uid=' + uid + '&userType=' + userType + '&helpID=' + pageName + '&forceHelpId=' + forceHelpId;	
			}
			
			
			window.open(url,'_help','top=10,left=10,width=700,height=400,scrollbars=no');
		}
	}
