////////////////////////////////////////////////////////////////////////////////////////////
//   Script Name: header_functions.js
//        Author: Randy Carlson
//          Desc: Functions for the header
//  Date Created: 12/18/03
// Date Modified: 
////////////////////////////////////////////////////////////////////////////////////////////

function initNavHeader()	{
	if ( typeof(window["initPage"])=="function" ){
    	// Function exists in the browser
		initPage();
	}
}

function rollover(name,source){
	document.images[name].src=source;
}	

function checkFieldsSearch(frmName) {
	var frmName = frmName;
	var textcheck = "";
	var textSKUcheck = "";

	textcheck = document.searchForm.sSearch.value;
	//trim off trailing spaces
	while(''+textcheck.charAt(textcheck.length-1)==' '){
		textcheck=textcheck.substring(0,textcheck.length-1);
	}

	//trim off leading spaces
	while(''+textcheck.charAt(0)==' '){
		textcheck=textcheck.substring(1,textcheck.length);
	}

	textcheck = textcheck.toLowerCase();
	textSKUcheck = textcheck.toLowerCase();

	if (textcheck == "") {
		alert("\nPlease enter Search Information!");
		return false;
	} else if(textcheck =="the" || textcheck=="and" || textcheck =="or"){
			alert("\n\"" + textcheck + "\" is not a valid keyword.")
			return false;
	} else if (textcheck.length <= 2) {
			alert("\nPlease enter a value longer than two characters.")
			return false;
	} else {
		for(var i=0; i<textcheck.length; i++){
			if(textcheck.charAt(i) != " "){
				return true
			}
		}
		alert("\nPlease enter a valid keyword to search.")
		return false;
      }
}

function NRrollover(name,source){
	document.images[name].src=source;
}

function initNavHeader()	{
	if ( typeof(window["initPage"])=="function" ){
		// Function exists in the browser
		initPage();
	}
}

function showPopUp(URL, PopUpProperties)	{          
	var PopUp = window.open(URL, "PopUp", PopUpProperties);          
	if (PopUp.focus)	{               
		PopUp.focus()          
	}     
}

function showCorporateInfo(URL)	{				
	var CorporateInfo = window.open(URL,"CorporateInfo","toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,width=630,height=620");				
	if (CorporateInfo.focus) {				    
		CorporateInfo.focus()				
	}				
}	

function showStoreLocator(URL)	{				
	var StoreLocator = window.open(URL,"StoreLocator","toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,width=630,height=620");				
	if (StoreLocator.focus) {				    
		StoreLocator.focus()				
	}				
}	

 