	function Right(str, n){
	    if (n <= 0)
	       return "";
	    else if (n > String(str).length)
	       return str;
	    else {
	       var iLen = String(str).length;
	       return String(str).substring(iLen, iLen - n);
	    }
	}	

	function poplogin(pstype){
		var url = '/Root/PopupLoginNat.asp?jscall=submitfrm&jsvar=login&ltype=' + pstype + '&feature=Course Reviews';
		OpenIt2('Login',url,400,370,'');
	}

	function submitfrm(psType){
		pleasewait();
		var psaction = document.location.href ;
		if (Right(psaction,1)=='/'){
			psaction = psaction + 'default.asp'
		}
		document.frmReload.action=psaction;
		document.frmReload.submit();
	}

	function pleasewait()
	{ 
		var piTop = document.body.scrollTop + 100;
		var piLeft = 160;
		
		var currentstyle=document.getElementById( "divWait" ).style.display;
		if (currentstyle=="inline"){
			document.getElementById( "divWait" ).style.display = "none"; 
		}else{
			document.getElementById( "divWait" ).style.display = "inline"; 
			document.getElementById( "divWait" ).style.top = piTop; 
			document.getElementById( "divWait" ).style.left = piLeft; 
		}
		
	}
	
	function closewait()
	{
		document.getElementById( 'divWait' ).style.display = 'none'
	}
	
	function whatsthis(){
		var mouseX = window.event.x + document.body.scrollLeft; 
		var mouseY = window.event.y + document.body.scrollTop; 
		var pageheight = document.body.clientHeight + document.body.scrollTop; 
		var thisDIV = document.getElementById( "divWhatsThis" );
		var currentstyle=thisDIV.style.display;
		var divHeight = 0;
		var totalHeight = 0;
		if (currentstyle=="inline"){
			thisDIV.style.display = "none"; 
		}else{
			thisDIV.style.display = "inline"; 
			divHeight = thisDIV.offsetHeight;
			totalHeight = mouseY+divHeight;
			thisDIV.style.left = 75;//mouseX-400;
			divHeight = divHeight + 15 
			//if (totalHeight < pageheight){
			//	thisDIV.style.top = mouseY-75; 
			//}else{
				thisDIV.style.top = mouseY-(divHeight-75); 
			//}
		}
	}





//----------------------------------------------------------------------------
	function poplogindiv(){
		//THIS FUNCTION IS NOT BEING USED - DELETE WHEN CONFIRMED
		var mouseX = window.event.x + document.body.scrollLeft; 
		var mouseY = window.event.y + document.body.scrollTop; 
		var pageheight = document.body.clientHeight + document.body.scrollTop; 
		var thisDIV = document.getElementById( "divLogin" );
		var currentstyle=thisDIV.style.display;
		var divHeight = 0;
		var totalHeight = 0;
		if (currentstyle=="inline"){
			thisDIV.style.display = "none"; 
		}else{
			thisDIV.style.display = "inline"; 
			divHeight = thisDIV.offsetHeight;
			totalHeight = mouseY+divHeight;
			thisDIV.style.left = mouseX-400;
			divHeight = divHeight + 15 
			//if (totalHeight < pageheight){
			//	thisDIV.style.top = mouseY-75; 
			//}else{
				thisDIV.style.top = mouseY-10; 
			//}
		}
	}


