// cahoot JavaScript Libraby 2006
var i=0;
//writes the question link in top nav
function writeQuestions() {
	    document.write('<a href="questions.html" onclick="javascript:popupWindow(); return false;" accesskey="6" title="Any Questions (opens new window)">Any Questions<span class="mask"> (opens new window)</span></a>')
	}
// Used under purple box in subproduct pages
function writeBack() {
	    document.write('<a href="javascript:history.back();" class="buttonBack">back</a>')
	}
// Used in bottom left
function writeBackBottom() {
	    document.write('<a href="javascript:history.back();" class="buttonBackAligned">back</a>')
	}
// Used in top right of content pages
function writeBackTop() {
	    document.write('<a href="javascript:history.back();" class="buttonBackTop">back</a>')
	}
// Used by previous rates and webcard pages
function closewindow() {
	document.write('<a href="javascript:window.close();" class="buttonClose">close window</a>')
}

// Self Service Help window function
 function popupWindow(question) {
	popuppopupwindow = window.open("http://wss.cahoot.com/html/frameset_wss_popup.html" , "anyquestions", 'left=10,top=180,width=509,height=330,status=no,scrollbars=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no');

 }
 
// This is used to launch previous rates
function openPreviousRates(theURL,winName) { 
		//v2.0
	  remote = window.open(theURL, winName, 'width=620,height=480,scrollbars=yes,menubar=no,toolbar=no,resizable=yes');
	  if (remote != null) {
	  remote.focus();
	  }
}
 
 function closePopupWindow() { //v2.0
mywindow = window.open("","anyquestions","left=2000,top=2000,width=0,height=0");
mywindow.close("","anyquestions","");

 }
//CR883 this is the code that will forward you to the third party site after a time delayed holding page
//Declare a variable to share between two pages.
var insurance = null;
//Function to display the POPUP
function displayPopUp(URL, varInsurance) {
               
                //Set the insurance variable
                insurance = varInsurance;
                popupwindow = window.open(URL, "InsuranceWindow");
}
var timerid = null;
var menuArray = new Array ('home','log_in','apply','shopping','remote_banking','about_us','accessibility','site_map','contact_us','any_questions');

// Not sure whether in use
function adv_flash_detect () {
	var flash_detect = 0;
	if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
		if (navigator.plugins && navigator.plugins["Shockwave Flash"])
			return flash_detect = 1;
	}
}
// END Any Question Script

// Not sure whether in use
function flash_detect() {
	// assumes that the frame name is global_nav
	flash_detect = 0;
	if (parent.global_nav.isFlash)	{
		flash_detect = 1;
		// window.status='Using flash';
		}
	else {
		// window.status = 'Using HTML';
	}
	return flash_detect;
}

// Not sure whether in use
function flash_nav(path_nav, file_name, href_class) {
	if (href_class == null || href_class == "") {
		var write_class = '';
	}
	else {
		var write_class = ' class="' + href_class + '" ';
	}
		
	if (flash_detect()) {
		document.write('<a href="' + path_nav + file_name + write_class + '>');
	}
	else {
		document.write('<a href="' + path_nav + file_name + write_class + '>'); 
	}
}

// Matching columns script. How it works: just apply the CSS class="column" to the columns you want to match.
matchColumns=function(){ 

     var divs,contDivs,maxHeight,divHeight,d; 

     divs=document.getElementsByTagName('div'); 

     contDivs=[]; 

     maxHeight=0; 

     for(var i=0;i<divs.length;i++){ 

          if(/\bcolumn\b/.test(divs[i].className)){ 

                d=divs[i]; 

                contDivs[contDivs.length]=d;  

                if(d.offsetHeight){ 

                     divHeight=d.offsetHeight; 					

                } 

                else if(d.style.pixelHeight){ 

                     divHeight=d.style.pixelHeight;					 

                } 

                maxHeight=Math.max(maxHeight,divHeight); 

          } 

     } 

     for(var i=0;i<contDivs.length;i++){ 

          contDivs[i].style.height=maxHeight + "px"; 

     } 

} 

window.onload=function(){ 

     if(document.getElementsByTagName){ 

          matchColumns();			 

     } 

}
// END column match script