
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	
	if (document.images) {
		newu_on = newImage("/images/splash/newu_on.gif");
		preloadFlag = true;

		login_on = newImage("/images/splash/login_on.gif");
		preloadFlag = true;

		about_01_over = newImage("/images/splash/about_01-over.gif");
		preloadFlag = true;

		tour_on = newImage("/images/splash/tour_on.gif");
		preloadFlag = true;

		tour_on = newImage("/images/splash/tour_on.gif");
		preloadFlag = true;
	}

}


// check pge Error
function QueryString(key)
{
	var value = null;
	for (var i=0;i<QueryString.keys.length;i++)
	{
		if (QueryString.keys[i]==key)
		{
			value = QueryString.values[i];
			break;
		}
	}
	return value;
}

QueryString.keys = new Array();
QueryString.values = new Array();

function QueryString_Parse()
{
	var query = window.location.search.substring(1);
	var pairs = query.split("&");
	
	for (var i=0;i<pairs.length;i++)
	{
		var pos = pairs[i].indexOf('=');
		if (pos >= 0)
		{
			var argname = pairs[i].substring(0,pos);
			var value = pairs[i].substring(pos+1);
			QueryString.keys[QueryString.keys.length] = argname;
			QueryString.values[QueryString.values.length] = value;		
		}
	}

}
QueryString_Parse();

function checkError()
{
if (QueryString("error") == "True")
{
	
	if ((QueryString("uname") != "") && (QueryString("pword") != ""))
		{
			document.getElementById("myDiv").style.display="";
			document.frm1.cgiusername.value = QueryString("uname");
			//document.frm1.cgipassword.value = QueryString("pword");
		}

}

}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	var win1=(screen.width-750)/2;
	var win2=(screen.height-600)/2;
  window.open(theURL,winName,features+',left='+win1+',top='+win2);
}

function parseNavigation(ob) {
// dropdown-only-some-new-window
toBeBrokenDown = ob.options[ob.selectedIndex].value.split("|");

targetWindow = toBeBrokenDown[0];
targetURL    = toBeBrokenDown[1];

    if (targetWindow!=='') {
    // if a new Window name is specified, then it will
    // open in a new Window.
	var win1=(screen.width-750)/2;
	var win2=(screen.height-600)/2;

    window.open(targetURL,targetWindow,'width=750,height=600,resizable=1,left='+win1+',top='+win2);
    // if we open a new window, then we have to re-set
    // the select box to the first option
    // which should have no value
    ob.selectedIndex = 0;
        } else {
    // or else it will open in the current window        
    window.open(targetURL,'_top')
    }
}

function speed_bump(curr_elem) {
	if (confirm("You are now leaving HedgeFund.net. HFN/Access is operated by Wall Street Access under a licensing agreement with HedgeFund.net.  By advancing to HFN/Access, you agree to be bound by the terms of use contained therein.  Additionally, you acknowledge that HedgeFund.net may share your contact information with Wall Street Access for purposes of fulfilling regulatory compliance including, but not limited to establishing your accreditation credentials.") == true)  {
		curr_elem.href="/access/";
	} 
	else {
		curr_elem.href="welcome.cfm";
	}
}

//for redirection
function redirectURL(pageName)
{
	window.parent.opener.location.href=pageName;
	window.parent.close();
}
//function used for Search Options in New Design - Poorna
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}