//global vars
var ie 					= (navigator.appName.toLowerCase().indexOf( "microsoft" ) != -1);
var ff					= (navigator.userAgent.toLowerCase().indexOf( "firefox" ) != -1);
var ns					= (navigator.userAgent.toLowerCase().indexOf( "netscape" ) != -1);
var opr					= window.opera;
var newWindow		= null;




function callFunc()
{
	//add functions to the window.onload event
	detectActiveXObject();
	printPage();
	bookmarkPage();
}



function ClearEmail()
{
	if (document.getElementById('signupforemail').value == '- enter email address -')
	{
		document.getElementById('signupforemail').value = "";
	}
}



function printPage()
{
	var btnPrint	= document.getElementById( "print" );
	if( btnPrint )
	{
		btnPrint.onclick = function()
		{
			window.print();
			return false;
		}
	}
}



function bookmarkPage()
{
	var btnBookmark					= document.getElementById( "bookmark" );
	if( btnBookmark )
	{
		var btnBookmark_parent	= btnBookmark.parentNode;
		var pageUrl							= document.location.href;
		var pageTitle						= document.title;

		if( ie && !opr )
		{
			btnBookmark.onclick = function()
			{
				window.external.AddFavorite( pageUrl, pageTitle );
				return false;
			}
		}
		else if( ff )
		{
			btnBookmark.onclick = function()
			{
				window.sidebar.addPanel( pageTitle, pageUrl, "" );
				return false;
			}
		}
		else
		{
			var tmp_var	= btnBookmark_parent.removeChild( btnBookmark );
		}
	}
}



function popUpWin( wUrl, wName, wType, wWidth, wHeight )
{
	var wAttributes = null;
	
	if( wType == "fullscreen" )
	{
		wWidth			= screen.availWidth - 10;
		wHeight			= screen.availHeight - 160;
	}
	if( !wWidth || !wHeight )
	{
		wWidth			= "675px";
		wHeight			= "700px";
	}
	
	if( !wType || wType == "console" )
	{
		//alert( "console width=" + wWidth + ",height=" + wHeight );
		wAttributes	= "resizable,toolbar=no,menubar=no,location=no,scrollbars=yes,width=" + wWidth + ",height=" + wHeight + ",left=0,top=0";
	}
	if( wType == "fullscreen" )
	{
		wAttributes	= "resizable,toolbar=no,menubar=no,location=no,scrollbars=yes,width=" + wWidth + ",height=" + wHeight + ",left=0,top=0";
	}
	
	newWindow			= window.open( wUrl, wName, wAttributes );
	newWindow.focus();
}



function toggleVisibility( thisObj, objId, objTriggerId, linkStatus )
{
	if( linkStatus == "hide" )
	{
		var objParent = thisObj.parentNode;
		objParent.parentNode.removeChild( objParent );
	}
	var obj 				= document.getElementById( objId );
	var objStyle 		= obj.style.display;
	
	if( objStyle == "none" )
	{
		obj.style.display = "block";
	}
	else
	{
		obj.style.display = "none";
	}
}
