// Global Variable Declarations
ns4 = (document.layers)? true:false; // netscape 4?
ie4 = (document.all)? true:false; // internet explorer 4/5?
ns6 = (ns4|ie4)? false:true; // (Netscape 6)

var isLoaded=false;
var page_position_left = 0;

// Submits a form
function submitForm()
{
	document.forms[0].submit();
	return true;
}

// Global Functions


// Adds appropriate targets to anchor tags.
function processAnchorTargets()
{
	if (!document.getElementsByTagName) return;

	var anchors = document.getElementsByTagName("a");
	
	for (var i=0; i < anchors.length; i++)
	{
		var anchor = anchors[i];
		
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "popup")
		{
			anchor.target = "_blank";
		}
	}
}

// Submit Target Form
function submitTargetForm(formIndex)
{
	document.forms[formIndex].submit();
	return true;
}


// Image Swaps
function imageSwap(in_Name,in_State) {
	if (!isLoaded) {
		return true;
	}
	document.images[in_Name].src = eval(in_Name + "_" + in_State + ".src");
}

// Window Openders
function popWindow(in_TargetURI, in_WindowParameters)
{
	//windowParameters are very browser dependent.  Be sure to test in all browswers when
	//changing window parameters.

	//For instance for Both IE and Netscape browsers to absolutely position a window properly 2 sets
	// of dimensions should be included example: screenX=0,screenY=0,left=0,top=0
	//To set the height and width of the windows example: width=625,height=400
	//A Good PopupWindow in all browsers with no toolbar, no scrollbar, and not resizable.
	//windowParameters = "scrollbars=no,width=625,height=400";
	
	if ( in_WindowParameters.length == 0 )
	{
		in_WindowParameters = "resizable,dependent,toolbar,scrollbars,location,status,menubar";
	}
	
	popupWin = window.open(in_TargetURI,'PopupWindow',in_WindowParameters);
}

// Global Initialization

function globalInit()
{
    //window.onresize=function () {location.reload(); };
	processAnchorTargets();

	/*
	topnav_about_us_off = new Image;
	topnav_about_us_off.src = js_root + "images/common/nav_top_about_us_off_" + in_LocaleCode + ".gif";
	topnav_about_us_roll = new Image;
	topnav_about_us_roll.src = js_root + "images/common/nav_top_about_us_roll_" + in_LocaleCode + ".gif";
	*/
	
	isLoaded=true;
}
