function open_window(url, wi, hi) {
	PopUp = window.open(url,'PopUp','toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+wi+',height='+hi);
	thisWindowFocus(PopUp);
}
function thisWindowFocus(whichWindow)
{
   var ISP = "";
   if (navigator.appVersion.indexOf("AOL") != -1) { ISP="AOL"; }
   if ( ISP != "AOL")
   {
   	whichWindow.focus();
   }
}
function SearchCheck(){
        if(document.search.query_string.value==' search') document.search.query_string.value='';
        else if(document.search.query_string.value=='') document.search.query_string.value=' search';
}
function CheckSearchSubmit(){
        if(document.search.query_string.value==' search'){ 
                alert('Enter search term(s) first!');document.search.query_string.focus();return false;}
        else return true;
}





// custom scripts by Preston. Needed for old content to work
//Links to outside sites
function bye(theURL,new_window,w_height,w_width) {
	if(!w_height) {
		w_height = "600";
	}
	if(!w_width) {
		w_width = "800";
	}

  if (confirm("You are about to leave San Mateo Credit Union's Web site.\r\r San Mateo Credit Union's (SMCU) Web site contains links to sources outside the Credit Union that we believe are useful to visitors and members. Once you are linked to another site, you are subject to the privacy and security policies and the terms of use of the new site. SMCU is not responsible for the content presented within the third-party Web site.  Any transaction entered on the third party's Web site will be solely between you and the third party.\r\r Click OK to continue or CANCEL to stay on SMCU's Web site.") )
    {
      if (new_window == 'yes') {
      window.open(theURL,'the_New_Window','height=' + w_height + ' ,width=' + w_width + ' ,resizable=yes, scrollbars=yes')
	}

  else {
       parent.location= theURL;
       }
    }
  }
  


//email address alert
function email_alert(address) {

	if (confirm("Please note - DO NOT send confidential information by e-mail as it is not a secure way to communicate. Please reserve this address for asking general questions only. \r\rClick OK to send an e-mail or Cancel to exit.") )
	{
		parent.location= address;
	}
}

// Macromedia function for opening windows (just cause I know it works)
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



// Example: obj = findObj("image1");
function findObj (theObj, theDoc) {
	var p, i, foundObj;
	if(!theDoc) theDoc = document;
	if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
		{
			theDoc = parent.frames[theObj.substring(p+1)].document;
			theObj = theObj.substring(0,p);
		}
		if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
		for (i=0; !foundObj && i < theDoc.forms.length; i++) 
			foundObj = theDoc.forms[i][theObj];
			for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
				foundObj = findObj(theObj,theDoc.layers[i].document);
				if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
				return foundObj;
}

// * Dependencies * 
// this function requires the following snippets:
// JavaScript/readable_MM_functions/findObj
// Accepts a variable number of arguments, in triplets as follows:
// arg 1: simple name of a layer object, such as "Layer1"
// arg 2: ignored (for backward compatibility)
// arg 3: 'hide' or 'show'
// repeat...
// Example: showHideLayers(Layer1,'','show',Layer2,'','hide');
function showHideLayers(obj) { 
	if (document.getElementById(obj)) {
		if (document.getElementById(obj).style.display == 'none') {
			action = 'block';
		} else {
			action = 'none';
		}
		document.getElementById(obj).style.display = action 
	}
}

// Functions for SMCU OnLine sign in




NS4 = (document.layers) ? true : false;

function checkEnter(event)
{
    var code = 0;
    if (NS4)
        code = event.which;
    else
        code = event.keyCode;
    if (code==13)
        validate();

}
  
	function validate(){
	var loginForm = document.forms['frmLogin'];
	if(!document.formLogin.authUserID.value.length > 0 || !document.formLogin.authPassword.value.length > 0)
	{
		alert('User ID and Password are required fields. Please enter values');
	}
	else
		document.formLogin.submit();
	}

	function wFocus(){
		document.formLogin.authUserID.focus();
	}

// function to launch window to Andera for online membership applications

function join(){ var cfgToken=''; var w=766; var h=screen.height*0.75; var winl=(screen.width-w)/2; var wint=((screen.height-h)/2)*0.75; if(join.arguments.length){cfgToken="&selectedProducts="+join.arguments[0];} window.open('https://secure.andera.com/index.cfm?fiid=7D0E93790AAF475BA280E5CFFAE4A9F0'+cfgToken,'openAccount','height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,menubar=no,status=yes,toolbar=no,resizable=yes'); }













// end comment
