
<!--

function IsBrowserCompatibleWithThisScript()
{
	
	///////////////////////////////////////////////////////
	///////////////////////////////////////////////////////
	///////////////////////////////////////////////////////
	// BEGIN - BROWSER SNIFFER CODE
	///////////////////////////////////////////////////////
	///////////////////////////////////////////////////////
	///////////////////////////////////////////////////////

	// Convert all characters to lowercase to simplify testing.
	var agt=navigator.userAgent.toLowerCase();
	
	var is_major = parseInt(navigator.appVersion);	
	var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
			&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1));

	//It is possible that Netscape 4.72 doesn't report 'mozilla'
	// Consider removing this as time goes on...
	if (!is_nav)
	{
		if (agt.indexOf('Netscape') != -1)
		{
			is_nav = true;
		}
	}

	var is_nav4 = (is_nav && (is_major == 4));
	var is_nav6up = (is_nav && (is_major >= 5));
	var is_gecko = (agt.indexOf('gecko') != -1);

	var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	var is_ie3 = (is_ie && (is_major < 4));
	var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 4") != -1) );
	var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5") != -1) );
	var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6") != -1) );
	var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
	var is_ie6up = (is_ie && !is_ie3 && !is_ie4 && !is_ie5);

	var is_opera = (agt.indexOf("opera") != -1);
	var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
	var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
	var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
	var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
	var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5);

	var is_konqueror = ((agt.indexOf("konqueror") != -1) && (agt.indexOf("mozilla") != -1));

	///////////////////////////////////////////////////////
	///////////////////////////////////////////////////////
	///////////////////////////////////////////////////////
	// END - BROWSER SNIFFER CODE
	///////////////////////////////////////////////////////
	///////////////////////////////////////////////////////
	///////////////////////////////////////////////////////

   //Is the client browser one of the
   // ones this script supports?
   if ((is_ie5up) ||
		(is_nav4) ||
		(is_nav6up) ||
		(is_konqueror))
   {
      return true;
   } 

   //If we got here, then they are
   // using a browser that is not supported
   // by this script.
   return false;
}

function IsBrowserNotNetscape4()
{
	// Convert all characters to lowercase to simplify testing.
	var agt = navigator.userAgent.toLowerCase();

	var is_major = parseInt(navigator.appVersion);	
	var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
			&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1));
	var is_nav4 = (is_nav && (is_major == 4));
		
	return !is_nav4;
}

function GetImageFromName(strName)
{
	if (window.document.images)
	{
		var nIndex = 0;
		var nCount = window.document.images.length;
		for (nIndex = 0; nIndex < nCount; nIndex++)
		{
			if (window.document.images[nIndex].name == strName)
			{
				return window.document.images[nIndex];
			}
		}
	}

	return null;
}

function CacheImages(theImage, strImageNormal, strImageHover)
{
	if (!theImage.imgNormal)
	{
		theImage.imgNormal = new Image();
		theImage.imgNormal.src = strImageNormal;
	}

	if (!theImage.imgHover)
	{
		theImage.imgHover = new Image();
		theImage.imgHover.src = strImageHover;
	}
}

function OnMouseOver(strElementName, strImage, strStatus)
{
	window.status = strStatus;

	//Load up the hover image
	var theImage = GetImageFromName(strElementName);
	if (theImage)
	{
		if (!theImage.imgHover)
		{
			theImage.imgHover = new Image();
			theImage.imgHover.src = strImage;
		}

		theImage.src = theImage.imgHover.src;
	}
}

function OnMouseOut(strElementName, strImage)
{
	//Load up the normal image
	var theImage = GetImageFromName(strElementName);
	if (theImage)
	{
		if (!theImage.imgNormal)
		{
			theImage.imgNormal = new Image();
			theImage.imgNormal.src = strImage;
		}

		theImage.src = theImage.imgNormal.src;
	}	
	
	window.status = '';
}

function OnMouseClick(strURL)
{
	window.location.href = strURL;
}


function GetCookieValue(strPropertySource)
{
	var strValue = new String('');
	var strProperty = new String(strPropertySource);

	if (strProperty.length > 0)
	{
		var theCookies;
		theCookies = document.cookie;
		
		var strPropertyPlusEqual = strProperty + '=';

		var nStart = theCookies.indexOf(strPropertyPlusEqual);
		if (nStart != -1)
		{
			//Move start passed property name
			nStart += strPropertyPlusEqual.length;

			var nEnd = theCookies.indexOf(';', nStart);
			if (nEnd == -1)
			{
				nEnd = theCookies.length;
			}

			strValue = theCookies.substring(nStart, nEnd);						
		}
	}

	return strValue;
}

function IsLoggedIn()
{
	var strValue = GetCookieValue('UserID');
	if (strValue.length > 0)
	{
		var nNumber = new Number(strValue);
		if (nNumber > 0)
		{
			return true;
		}
	}
				
	return false;
}

function BeginMainTable()
{
	//Create the main table that will wrap the buttons and main content
	var str;
	str = "<table border=0 width=100%><tr><td width=\"1%\" valign=top>";
	document.write(str);

	CreateButtons();

	str = "</td><td width=\"99%\" valign=top><table border=0 width=100% cellspacing=\"20\" cellpadding=\"0\"><tr><td valign=top>";
	document.write(str);

}

function EndMainTable()
{
	var str = '</td></tr></table></td></tr></table>';
	document.write(str);
}

function CreateToolbarButton(strName, strStatus, strURL, strImageNormal, strImageHover)
{
	var str;


	if (IsBrowserNotNetscape4())
	{
		str = "<tr><td>";
		str += "<img src=\"" + strImageNormal + "\" ";
		str += "onMouseOver=\"OnMouseOver('toolbar" + strName + "', '" + strImageHover + "', '" + strStatus + "'); return true;\" ";
		str += "onMouseOut=\"OnMouseOut('toolbar" + strName + "', '" + strImageNormal + "');\" ";		
		str += "onClick=\"OnMouseClick('" + strURL + "');\" ";		
		str += "name=\"toolbar" + strName + "\" id=\"toolbar" + strName + "\" ";
		str += "onLoad=\"CacheImages(this, '" + strImageNormal + "', '" + strImageHover + "');\">";
		str += "<br><br>";
		str += "</td></tr>";
	}
	else
	{
		//Netscape 4 should fall off the planet, but
		// until then, we have to support it!
		str = "<tr><td>";
		str += "<a href=\"" + strURL + "\" ";
		str += "onMouseOver=\"OnMouseOver('toolbar" + strName + "', '" + strImageHover + "', '" + strStatus + "'); return true;\" ";
		str += "onMouseOut=\"OnMouseOut('toolbar" + strName + "', '" + strImageNormal + "');\">";
		str += "<img src=\"" + strImageNormal + "\" ";
		str += "name=\"toolbar" + strName + "\" id=\"toolbar" + strName + "\" ";
		str += "onLoad=\"CacheImages(this, '" + strImageNormal + "', '" + strImageHover + "');\">";
		str += "</a><br><br>";
		str += "</td></tr>";
	}
	
	//Let the browser client have the toolbar button!
	document.write(str);
}

function CreateButtons()
{
	var str = '<table border=0 width=1%><tr><td>';
	document.write(str);

	CreateToolbarButton('News', 'Click here for latest News...', 'default.asp', 'images/News.gif', 'images/NewsHover.gif');
	CreateToolbarButton('Support', 'Click here for viewing and adding support requests...', 'support.asp', 'images/Support.gif', 'images/SupportHover.gif');
	CreateToolbarButton('KnowledgeBase', 'Click here for the E-Prime Knowledge Base...', 'kb.asp', 'images/KnowledgeBase.gif', 'images/KnowledgeBaseHover.gif');
	CreateToolbarButton('Download', 'Click here for E-Prime dowload area...', 'download.asp', 'images/Download.gif', 'images/DownloadHover.gif');
	CreateToolbarButton('Samples', 'Click here for E-Prime samples...', 'samples.asp', 'images/Samples.gif', 'images/SamplesHover.gif');
	CreateToolbarButton('UserInfo', 'Click here to view/modify your user account...', 'userinfo.asp', 'images/UserInfo.gif', 'images/UserInfoHover.gif');
	CreateToolbarButton('ep2beta', 'Click here for the E-Prime 2.0 BETA area...', 'ep2beta.asp', 'images/ep2beta.gif', 'images/ep2betaHover.gif');
			
	document.write('</td></tr></table>');		
}


function OnLoad()
{
	if (!IsBrowserCompatibleWithThisScript())
	{
		window.location.href = "disqualify.asp";
	}

	//EndMainTable();			
}


function DoLoginCheck()
{
	if (!IsLoggedIn())
	{
		document.cookie = "jump=" + document.location + ';';
		window.location.href = "login.asp";
	}	
}

function TransferFile(objElement, strURL)
{
	var strEscape;
	strEscape = "http://www.pstnet.com/e-prime/support/transfer.asp?Location=" + escape(strURL);
	objElement.href = strEscape;
	return true;
}

-->