/* Include append_session.js */
var s;

// SV 5/16/08 cdn_path is the url of the akamai servers. this checks to see if the cdn_path is defined on the page, and if not assignes it a value of null
try {
	if(cdn_path) {
		// do nothing
	} 
} catch(e) {
	cdn_path = '';
}

// SV 10/28/08 redirect users to the proper domain name if they arrive at a vanity url or are missing the www
var str = location.href;
str = str.toString();
str = str.toLowerCase();
//alert("str: " + str + " domain: " + domain + " pathname: " + myPath + " search: " + mySearch);
if (str.indexOf('.com')==-1 && str.indexOf('.ca')==-1 && str.indexOf('.eu')==-1 ){ 
	// don't do anything if you aren't accessing the site through regular domain name
} else if(str.indexOf('://www.optionsxpress')==-1 && str.indexOf('eqdesign.optionsxpress')==-1 && str.indexOf('oxint.eqdesign.optionsxpress')==-1 && str.indexOf('www2.optionsxpress')==-1 && str.indexOf('www3.optionsxpress')==-1 && str.indexOf('www4.optionsxpress')==-1 && str.indexOf('oxint.optionsxpress')==-1 && str.indexOf('www.brokersxpress')==-1 && str.indexOf('www.advisersxpress')==-1 && str.indexOf('ox.optionsxpress')==-1 && str.indexOf('jv.optionsxpress')==-1 && str.indexOf('beta.optionsxpress')==-1 && str.indexOf('opx.optionsxpress')==-1 && str.indexOf('broker.optionsxpress')==-1 && str.indexOf('ca.ua.optionsxpress')==-1 && str.indexOf('search.optionsxpress')==-1 && str.indexOf('mosearch')==-1 && str.indexOf('eqsearch')==-1 && str.indexOf('bxadvisors')==-1 ){ // SV 4/4/08 redirects you if you are on a "misspelled" domain or are missing www
	var domain = location.host;
	var myPath = location.pathname;
	var myFirm = getFirmType();
	if (str.indexOf('?') != -1 ){
		mySearch = location.search + '&url=' + domain;
	} else {
		mySearch = '?url=' + domain;
	}
	if (myFirm == 'OX') {
		location.href = 'http://www.optionsxpress.com' + myPath + mySearch
	} else if (myFirm == 'OXI'){
		location.href = 'http://oxint.optionsxpress.com' + myPath + mySearch
	} else if (myFirm == 'CA') {
		location.href = 'http://www.optionsxpress.ca' + myPath + mySearch
	} else if (myFirm == 'EU') {
		location.href = 'http://www.optionsxpress.eu' + myPath + mySearch
	} else if (myFirm == 'SN') {
		location.href = 'http://www.optionsxpress.com.sg' + myPath + mySearch
	} else if (myFirm == 'OB') {
		location.href = 'http://www.optionsxpress.com.au' + myPath + mySearch
	} else if (myFirm == 'BX') {
		location.href = 'http://www.brokersxpress.com' + myPath + mySearch
	} else if (myFirm == 'AX') {
		location.href = 'http://www.advisersxpress.com' + myPath + mySearch
	} else { // redirect to OX domestic if all else fails
		location.href = 'http://www.optionsxpress.com' + myPath + mySearch
	}
}
// 

//sv 10/29/08 parses out querystrings
function getQuerystring(myValue) {
	var sSearch = window.location.search.substring(1); 
	var Parameters = new Object(); 
	var sNameValuePairs = sSearch.split('&'); 
	var sNameValuePair; 
	for (var i = 0; i < sNameValuePairs.length; i++) { 
		sNameValuePair = sNameValuePairs[i].split('='); 
		Parameters[sNameValuePair[0]] = sNameValuePair[1]; 
	} 
	return Parameters[myValue];
}


function GetSessionID() {  //onsite version
	var sSessionID='0';
	var sQueryString=location.search.substring(1);
	var aQueryStringVars=sQueryString.split("&");

	for (var i=0; i<aQueryStringVars.length; i++){
		var nPos=aQueryStringVars[i].indexOf('=');
		var sParamName=aQueryStringVars[i].substring(0,nPos);
			
		if ((nPos==-1) || (sParamName.toLowerCase()!='sessionid')) continue;
		sSessionID=aQueryStringVars[i].substring(nPos+1);
		if (sSessionID==''){
			sSessionID='0';
		}
			break;
		}
		return sSessionID;
}

last_tab = 'tab1';
function show(layerName) { 
	document.getElementById(layerName).style.display = '';
	//return 'background-image:url(./images/ltab_blue.gif);';
} 

function hide(layerName) { 
	document.getElementById(layerName).style.display = 'none';
	//return 'background-image:url(./images/ltab_blue.gif);';
}	
function show_next(tab_name) {
	document.getElementById(last_tab).className = 'tab';
	var curr = document.getElementById(tab_name);
	curr.className='tab_hover';
	hide(last_tab+'_data');
	show(tab_name+'_data');
	last_tab=tab_name;
}
last_tab2 = 'tab21';
function show2(layerName) { 
	document.getElementById(layerName).style.display = '';
} 

function hide2(layerName) { 
	document.getElementById(layerName).style.display = 'none';
}	
function show_next2(tab_name) {
	document.getElementById(last_tab2).className = 'tab2';
	var curr = document.getElementById(tab_name);
	curr.className='tab_hover2';
	hide2(last_tab2+'_data');
	show2(tab_name+'_data');
	last_tab2=tab_name;
}
function makeSecure() {
	var sSSL;
	var bCookieEnabled;
	bCookieEnabled = IsCookieEnabled();
	//alert(navigator.cookieEnabled);
	document.frmLogin.hidCookieEnabled.value = bCookieEnabled;
	sSSL = document.frmLogin.hidSSL.value;
	sURL = sSSL + "://" + location.host + "/login.asp";
	document.frmLogin.action = sURL;
	
	return CheckForm();
}

// function for free downloads to submit and take user to next page
function appendQueryString(el) {
	if (document.form_educationalContent.slt_tutorial.value == ''){
		alert('Please select a free download');
		return false;
	}
	var s = GetSessionID();
	if (s == '0') {
		el.action = el.action + '?tutorial=' + el.slt_tutorial.value;
		return true;
	} else {
		el.action = el.action + '?tutorial=' + el.slt_tutorial.value;
		return true;
	}
}

// functions for site customization
function checkFont(){
	if (getCookie('oxps_sizing')) {
		document.cookie = 'oxps_sizing' + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
	if (getCookie('oxps_font')) {
		document.cookie = 'oxps_font' + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
	if (getCookie('oxps_color')) {
		document.cookie = 'oxps_color' + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
	
	if(parent.frames[0]){
		if(parent.frames[0].document.getElementById('spSiteStyleFontSize')){
			if(parent.frames[0].document.getElementById('spSiteStyleFontSize').childNodes[0]){
				if(parent.frames[0].document.getElementById('spSiteStyleFontSize').childNodes[0].nodeValue!='' || parent.frames[0].document.getElementById('spSiteStyleFontSize').childNodes[0].nodeValue!=null){
					var myFont = parent.frames[0].document.getElementById('spSiteStyleFontSize').childNodes[0].nodeValue;
					setStylesheet(myFont);
				}		
			}
		}
		checkColor();
	}
}

function checkColor(){
	if(parent.frames[0]){	
		if(parent.frames[0].document.getElementById('spSiteStyleColor')){
			if(parent.frames[0].document.getElementById('spSiteStyleColor').childNodes[0]){
				if(parent.frames[0].document.getElementById('spSiteStyleColor').childNodes[0].nodeValue!='' || parent.frames[0].document.getElementById('spSiteStyleColor').childNodes[0].nodeValue!=null){
					var myColor = parent.frames[0].document.getElementById('spSiteStyleColor').childNodes[0].nodeValue;
					setStylesheet(myColor);
				}		
			}	
		}
		//resize();
	}
}

function resize(){
	if(parent.frames[0]){	
		if(parent.frames[0].document.getElementById('spSiteStyleAlignment')){
			if(parent.frames[0].document.getElementById('spSiteStyleAlignment').childNodes[0]){
				if(parent.frames[0].document.getElementById('spSiteStyleAlignment').childNodes[0].nodeValue!='' || parent.frames[0].document.getElementById('spSiteStyleAlignment').childNodes[0].nodeValue!=null){
					var mySize = parent.frames[0].document.getElementById('spSiteStyleAlignment').childNodes[0].nodeValue;
					setStylesheet(mySize);
				}		
			}		
		}
		//resizeHeader();
	}
}

function styleTab(){  //writes element to frameset file so we can detect and display "site layout" tab after reload
	var d = parent.document.createElement('div'); 
    d.id = 'prefs'; 
	var el = parent.document.getElementsByTagName('noframes');
	if(el[0]){
	    el[0].parentNode.appendChild(d); 	
	}
}

function setStylesheet(styleTitle){
//	if(document.location.href && document.location.href.indexOf('broker_view')==-1){ //don't apply styles to web broker
//		if(document.getElementsByTagName('STYLE')){
//			var s = document.getElementsByTagName('STYLE'); 
//			if(s[0]){
//				newStyle=document.createElement('Link');
//				newStyle.rel="stylesheet";
//				newStyle.type="text/css";
//				newStyle.href="/inc/"+styleTitle+".css";
//				s[0].parentNode.appendChild(newStyle);
//			}
//		}
//	}
}

//dm - 9/22/06 - resize headers based on page width
function resizeHeader(){
	if(document.getElementById('mainTable')){
		var a = document.getElementById('mainTable');
		var mt = parseInt(a.scrollWidth);
		var lmt = parseInt(a.offsetLeft);
	}
	if(document.getElementById('content')){	
		var b = document.getElementById('content').clientWidth;
	}

	subArray = new Array();
	subArray[0] = "welcome";
	subArray[1] = "account";
	subArray[2] = "trade";
	subArray[3] = "quotes";
	subArray[4] = "toolbox";
	subArray[5] = "educate";
	subArray[6] = "help";
	
	if(document.getElementById('sidebar')){
		var c = document.getElementById('sidebar').clientWidth;
		var x = b+c;
	}
	else{
		var x = b;
	}
	
	if(parent.frames[0]){	
		if(parent.frames[0].document.getElementById('spSiteStyleAlignment')){
			if(parent.frames[0].document.getElementById('spSiteStyleAlignment').childNodes[0]){
				if(parent.frames[0].document.getElementById('spSiteStyleAlignment').childNodes[0].nodeValue!='' || parent.frames[0].document.getElementById('spSiteStyleAlignment').childNodes[0].nodeValue!=null){
					var cSize = parent.frames[0].document.getElementById('spSiteStyleAlignment').childNodes[0].nodeValue;
				}		
			}		
		}
	}
	if(cSize){
		if(cSize.indexOf('_sm')!=-1 && x >=700){
			var smResize = true;
		}
	}

	if(x >= 835 || smResize == true){ 
		var y = document.body.clientWidth;
		document.getElementById('header_table').style.width = x+'px';	
	
		document.getElementById('header_wrapper').style.width = x+'px';	

		for(i=0;i<subArray.length;i++){
			document.getElementById('sub_'+subArray[i]).style.width = x-13+'px';
		}
		if(document.getElementById('footer')){
			document.getElementById('footer').style.width = x+'px';
		}
		if(document.getElementById('Footer')){
			document.getElementById('Footer').style.width = x +'px';	
		}
		document.getElementById('mainTable').style.width = x +'px';
	}
}
function getCookie(name){
  var cname = name + "=";               
  var dc = document.cookie;             
  if (dc.length > 0) {              
    begin = dc.indexOf(cname);       
    if (begin != -1) {           
      begin += cname.length;       
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
        return unescape(dc.substring(begin, end));
    } 
  }
  return null;
}

function setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) + 
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
}

function delCookie (name,path,domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}


//DM 11/21/05
function getFirmType(){
	var urlFirm = location.href;
	urlFirm = urlFirm.toLowerCase();
	var firm = '';
	if(urlFirm.indexOf('.sg')!=-1 || urlFirm.indexOf('sg.eqdesign')!=-1 || getCookie('Firm')=='SN'){
		firm = 'SN';
	}
	else if(urlFirm.indexOf('.ca')!=-1 || urlFirm.indexOf('ca.eqdesign')!=-1 || getCookie('Firm')=='CA'){
		firm = 'CA';
	}
	else if(urlFirm.indexOf('.au')!=-1 || urlFirm.indexOf('au.eqdesign')!=-1 || getCookie('Firm')=='OB'){
		firm = 'OB';
	}
	else if(urlFirm.indexOf('brokersxpress')!=-1 || urlFirm.indexOf('bx.eqdesign')!=-1 || getCookie('Firm')=='BX'){
		firm = 'BX';
	}
	else if(urlFirm.indexOf('advisorsxpress')!=-1 || urlFirm.indexOf('ax.eqdesign')!=-1 || getCookie('Firm')=='AX'){
		firm = 'AX';
	}
	else if(urlFirm.indexOf('optionsxpress.europe')!=-1 || urlFirm.indexOf('optionsxpress.eu')!=-1 || urlFirm.indexOf('eu.eqdesign')!=-1 || getCookie('Firm')=='EU'){
		firm = 'EU';
	}
	else if(urlFirm.indexOf('oxint')!=-1 || urlFirm.indexOf('oxint.eqdesign')!=-1 || getCookie('Firm')=='OXI'){
		firm = 'OXI';
	}	
	else {
		firm = 'OX';
	}
	//alert(firm);
	return firm;
}

//DM - 3/28/06 - Code to hide links in OXI header
function hideOxiLink(){
	var f=getFirmType();
	//alert(f);
	if(f=='OXI'){
		var m = document.getElementById("menu");
		var lis = m.getElementsByTagName("LI");
		var hLI = lis.length;
		for(var i=0;i<hLI;i++){
			if(lis[i].id.indexOf('oxiHide')!=-1){
				lis[i].style.display='none';
			}
		}
	}
	if (navigator.appVersion.indexOf('Mac') != -1){
		if(document.getElementById('searchL')){
	 	 document.getElementById('searchL').style.display='none';
	  	 document.getElementById('searchR').style.display='none';
	  	 document.getElementById('qt').style.background='none';	 
	  	 document.getElementById('qt').style.border='1px solid silver';	 
		 }
	}
	//randomSearch();
}

function randomSearch(){
//	var f=getFirmType();
//	var sID = GetSessionID();
//	var rNumber;
	
//	searchQ = new Array();
//	searchQ[0]="Account Transfers"
//	searchQ[1]="Do you have load funds?"
//	searchQ[2]="How do I wire funds?"
//	searchQ[3]="Can I set up ACH?"
//	searchQ[4]="Can I trade futures?"
//	searchQ[5]="What is Xtrends?"
//	searchQ[6]="How do I fund my account?"
//	searchQ[7]="What are Chart Patterns?"	
//	searchQ[8]="Money Market Interest Rate"
//	searchQ[9]="I want to learn about ETFs"
//	searchQ[10]="Account minimums and fees"
//	searchQ[11]="Can I cross margin futures?"
//	searchQ[12]="Do options trade after hours?"

//	if(f=='OX' || f=='BX'){
//		searchQ[13]="Can I trade options in IRA?";
//		rNumber = Math.floor(Math.random()*14);
//		if(sID=='0'){
//			searchQ[14]="How do I open an account?";
//			rNumber = Math.floor(Math.random()*15);
//		}
//	}
//	else{
//		if(sID=='0'){
//			searchQ[13]="How do I open an account?";
//			rNumber = Math.floor(Math.random()*14);
//		}
//		else{
//			rNumber = Math.floor(Math.random()*13);
//		}
//	}
	
//	if(document.getElementById('qt')){
//		document.getElementById('qt').value = searchQ[rNumber];
//	}
}

function OpenChildWindowSizeable(sURL, sName, sWidth, sHeight){

	var sName;
	var sFeatures;
	sFeatures='width=' + sWidth + ',height=' + sHeight + ',toolbar=no,scrollbars=yes,resizable=yes';
	
	window.open(sURL,sName,sFeatures);
}
// SPR Search Functions
var searchSite = "";
var searchClient = "";
var searchStyleSheet = "";
searchFocus = 'false';

function populateSearch() {
	var myFirm = getFirmType();
	
	if (myFirm == 'OX') {
		searchSite = "ox_public";
		searchClient = "ox_public";
		searchStyleSheet = "ox_public";
	} else if (myFirm == 'OXI') {
		searchSite = "oxint_public";
		searchClient = "oxint_public";
		searchStyleSheet = "oxint_public";
	} else if (myFirm == 'CA') {
		searchSite = "ca_public";
		searchClient = "ca_public";
		searchStyleSheet = "ca_public";
	} else if (myFirm == 'EU') {
		searchSite = "eu_public";
		searchClient = "eu_public";
		searchStyleSheet = "eu_public";
	} else if (myFirm == 'SN') {
		searchSite = "sg_public";
		searchClient = "sg_public";
		searchStyleSheet = "sg_public";
	} else if (myFirm == 'OB') {
		searchSite = "au_public";
		searchClient = "au_public";
		searchStyleSheet = "au_public";
	} else if (myFirm == 'BX') {
		searchSite = "bx_public";
		searchClient = "international_public";
		searchStyleSheet = "international_public";
	} else if (myFirm == 'AX') {
		searchSite = "";
		searchClient = "";
		searchStyleSheet = "";
	} else { // redirect to OX domestic if all else fails

	}
	
	// return searchSite;
	// return searchClient;
	// return searchStyleSheet;
}

populateSearch();

function searchSubmit(bFramed) {
	if(searchFocus == 'true'){

	if(document.forms[0]){
		for(i=0;i<document.forms[0].elements.length;i++){  
    	        document.forms[0].elements[i].disabled = true; // disable form for enter key submit on search
		}
	}
	window.onUnload = enableForm();
	var isFramed = bFramed;
	
	//var s;
	//s=GetSessionID();
	
	var searchValue = document.getElementById("qt").value;
	searchValue = StripIllegalChars(searchValue);
	
	if (searchValue != "") {
		if (isFramed == "1") { // Used for triple framed pages
			parent.location.href =  "http://search.optionsxpress.com/search?q=" + searchValue + "&site=" + searchSite + "&client=" + searchClient + "&proxystylesheet=" + searchStyleSheet + "&output=xml_no_dtd&proxyreload=1";
		} else if (isFramed == "0") { // Used for non-session and two framed pages
			var is_opera = navigator.userAgent.toLowerCase().indexOf("opera") != -1; 
			var is_mac = navigator.userAgent.toLowerCase().indexOf("mac") != -1; 			
			if(is_opera || is_mac){ // mac and opera have location.href issues
				parent.location.href = "http://search.optionsxpress.com/search?q=" + searchValue + "&site=" + searchSite + "&client=" + searchClient + "&proxystylesheet=" + searchStyleSheet + "&output=xml_no_dtd&proxyreload=1";
			}
			else{
				location.href = "http://search.optionsxpress.com/search?q=" + searchValue + "&site=" + searchSite + "&client=" + searchClient + "&proxystylesheet=" + searchStyleSheet + "&output=xml_no_dtd&proxyreload=1";
			}
		}
	} else {
		window.alert("Please enter your search request.");
		enableForm();
	}

	}else{
		return false;
	}
				
}

function enableForm(){
	if(document.forms[0]){
		for(i=0;i<document.forms[0].elements.length;i++){ 
    		document.forms[0].elements[i].disabled = false; // re-enable form on empty search query & back button
		}
	}
}

function disableEnterKey(e) {
	var key;

	if(window.event) {
		key = window.event.keyCode;     //IE
	} else {
		key = e.which;     //firefox
	}

	if(key == 13) {
		return false;
	} else {
		return true;
	}
}

//from parse.js

function StrReplace(sString,sFind,sReplace,bIgnoreCase) {
	var oRegExp;
	var sResult;
	var sRegExp;
	
	sRegExp='/'+sFind+'/g';
	if (bIgnoreCase==true)
		sRegExp+='i';	
	oRegExp=eval(sRegExp);
	sResult=sString.replace(oRegExp,sReplace);
	return(sResult);
}

function StripIllegalChars(sQueryStr) {
	sQueryStr=StrReplace(sQueryStr,"`","");
	sQueryStr=StrReplace(sQueryStr,"~","");
	sQueryStr=StrReplace(sQueryStr,"!","");
	sQueryStr=StrReplace(sQueryStr,"@","");
	sQueryStr=StrReplace(sQueryStr,"#","");
	sQueryStr=StrReplace(sQueryStr,"$","");
	sQueryStr=StrReplace(sQueryStr,"%","");
	sQueryStr=StrReplace(sQueryStr,"^","");
	//sQueryStr=StrReplace(sQueryStr,"*","");
	//sQueryStr=StrReplace(sQueryStr,"+","");

	sQueryStr=StrReplace(sQueryStr,"|","");
	
	sQueryStr=StrReplace(sQueryStr,";","");
	sQueryStr=StrReplace(sQueryStr,":","");
	sQueryStr=StrReplace(sQueryStr,"\'","");
	sQueryStr=StrReplace(sQueryStr,"\"","");
	
	sQueryStr=StrReplace(sQueryStr,",","");
	sQueryStr=StrReplace(sQueryStr,"<","");
	sQueryStr=StrReplace(sQueryStr,">","");
	//sQueryStr=StrReplace(sQueryStr,".","");
	sQueryStr=StrReplace(sQueryStr,"/","");
	//sQueryStr=StrReplace(sQueryStr,"?","");
	return(sQueryStr);
}


function enterLivePerson() {
		window.name = "lp_parent";

	domain = window.location.href; 
	if(domain.indexOf("brokersxpress") != -1 || domain.indexOf("bxadvisors") != -1 || domain.indexOf("bx.eqdesign") != -1 || domain.indexOf("ax.eqdesign") != -1 || domain.indexOf("equawebbx1") != -1){ 
		var url = "https://server.iad.liveperson.net/hc/29625551/?cmd=file&file=visitorWantsToChat&site=29625551";
	} else {		
		var url = "http://server.iad.liveperson.net/hc/LPoptionsxpress/?cmd=file&file=visitorWantsToChat&site=LPoptionsxpress";
	}

		var hWnd = window.open(url,"live_person","width=500,height=320,resizable=yes,scrollbars=yes");
		if (hWnd != null) { if (hWnd.opener == null) { hWnd.opener = self; window.name = "home"; hWnd.location.href=url; } }			
}
function popCheck(){
	var s=GetSessionID();
      if (pop == 1)
       {
         location.href="/faq/p_faq.aspx";
       }
      else
       {
         location.href="/faq/index.aspx";
       }  
	}
	
function OpenChildWindow(sURL, sName, sWidth, sHeight){

	var sName;
	var sFeatures;
	sFeatures='width=' + sWidth + ',height=' + sHeight + ',toolbar=no,scrollbars=yes';
	
	window.open(sURL,sName,sFeatures);
}

function OpenChildWindowNew(sURL, sName, sWidth, sHeight){

	var sName;
	var sFeatures;
	sFeatures='width=' + sWidth + ',height=' + sHeight + ',toolbar=no,scrollbars=no';
	
	window.open(sURL,sName,sFeatures);
}

function OpenCSWindow(sSubSelect) {
	var s;
	s=GetSessionID();
	OpenChildWindowNew('/welcome.asp?PageID=customerservice&SessionID='+s+'&hidSelValue='+sSubSelect,'','550','410');
}
/* for external links dm 10/20/04 */
function OpenExit(sLink,sName) {
	OpenChildWindowSizeable('/exit_popup.aspx?site=' + sLink + '&name=' + sName,'','405','295');
}

function SetContributionYear(sForm) {
	var nContributionID=sForm.lstContributionCode.value;

	if (nContributionID==6 || nContributionID==8 || nContributionID==9) {
		var todaysDate= new Date();	
		var year=todaysDate.getFullYear();
		sForm.lstContributionYear.value=year;
		sForm.lstContributionYear.disabled=true;
	}
	else {
		//sForm.lstContributionYear.value="";
		sForm.lstContributionYear.disabled=false;	
	}
}

function launchDisclaim(){
	var eduCookie = getCookie('agree');
	if(eduCookie=='true'){
		delayFLV();
	}
	else{
		GB_showCenter('Options Disclosure Documents','/educate/agree_popup.aspx',360,750);
	}
}

function getCookie(name){
  var cname = name + "=";               
  var dc = document.cookie;             
  if (dc.length > 0) {              
    begin = dc.indexOf(cname);       
    if (begin != -1) {           
      begin += cname.length;       
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
        return unescape(dc.substring(begin, end));
    } 
  }
  return null;
}

function PromptFocus(ctrlName, txtMessage)
{
	sCtrlType=ctrlName.type;
	if (sCtrlType==null)
		sCtrlType=ctrlName[0].type;
	
	if (sCtrlType=="text"){
		ctrlName.select();
		ctrlName.focus();
	}
	else if (sCtrlType=="password"){
		ctrlName.select();
		ctrlName.focus();
	}
	else if (sCtrlType=="textarea"){
		ctrlName.select();
		ctrlName.focus();
	}
	else if (sCtrlType=="checkbox"){
		ctrlName.focus();
	}
	else if (sCtrlType=="radio"){
		ctrlName[0].focus();
	}
    
	window.alert(txtMessage);

	if (sCtrlType=="text"){
		ctrlName.select();
		ctrlName.focus();
	}
    else if (sCtrlType=="password"){
		ctrlName.select();
		ctrlName.focus();
	}
	else if (sCtrlType=="textarea"){
		ctrlName.select();
		ctrlName.focus();
	}
	else if (sCtrlType=="checkbox"){
		ctrlName.focus();
	}
	else if (sCtrlType=="radio"){
		ctrlName[0].focus();
	}
	else if (sCtrlType=="select-one" || sCtrlType=="select-multiple") {
		ctrlName.focus();
	}
	return;
}
