﻿/*
    This function is used to make sure the "I Accept" 
    check box on landing pages is checked - BWH 01/30/07
*/
function acceptCheckScript(isForm) 
{
  var doc = document.forms[0];
	if (doc == null) return true;

	var checkAgree1 = null;
	var checkAgree2 = null;
	if (doc.chkAgree != null)
	{
		checkAgree1 = doc.chkAgree;
	}
	else
	{
//		alert("Check agree 1 is null");
	}
	
	if (doc.chkAgree2 != null)
	{
		checkAgree2 = doc.chkAgree2;
	}
	else
	{
//		alert("Check agree 2 is null");
	}

	if (checkAgree1 != null && checkAgree2 != null)
	{
		if (checkAgree1.checked || checkAgree2.checked)
		{
			return true;
		}
		alert("Please agree to our Terms and Conditions and then click \"Buy Now\"");
		return false;
	}
    
	if (checkAgree1 != null)
	{
		if (checkAgree1.checked)
		{
			return true;
		}
		alert("Please agree to our Terms and Conditions and then click \"Buy Now\"");
		return false;
	}

	if (checkAgree2 != null)
	{
		if (checkAgree2.checked)
		{
			return true;
		}
		alert("Please agree to our Terms and Conditions and then click \"Buy Now\"");
		return false;
	}
	
	return true;
}

/*
 Try to use the OpenWindow function to open pop-up windows whenever possible. - BWH 0201/07
 winURL = the URL of the page
 winParameters = all the specific window parameters
 EXAMPLE: OpenWindow('/members/sdb/blah.aspx', 'width=450, height=500')
 */
function OpenWindow(winUrl, winParameters)
{
	window.open(winUrl, "SIRWindow", winParameters);
}

function GetQuote()
{
	var strNewUrl;
	var strSearchTerm;

	strSymbol = document.getElementById("headerquote").value;
	strNewUrl = "/streetools/stock_quotes.aspx?ticker_symbol=" + escape(strSymbol);
	window.location = strNewUrl;
}

function prodpop(popupID)
{
	window.open("bernie_guidance.aspx?popupID=" + popupID,"prodpop","width=450,height=550, location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=10,top=10,screenx=10,screeny=10");
}

function prodpop1(popupID)
{
	window.open("Disclaimer.aspx?ProductLineID=" + popupID,"prodpop","width=450,height=550, location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=10,top=10,screenx=10,screeny=10");
}

function prodpop2(popupID)
{
	window.open("Disclaimer.aspx?DisclaimerID=" + popupID,"prodpop","width=450,height=550, location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=10,top=10,screenx=10,screeny=10");
}

