/*
All Code Copyright 2003 Matthew Knight for RackitTechnology.com
Don't steal this.  You don't see me stealing your stuff, now do you?  So go write your own.
All Rights Reserved, blah blah blah.
*/

// the customer login 'palette'
function cLoginOff() {	
	var s = gE('searchtable'); if (s) sE(s);
	switchImg('clogin','/img/clogin_top0.gif');
	toggleExplore(1);	
}
function toggleExplore(b) {
	var expl = gE("explore_dropdown");
	if (expl) { b ? sE(expl) : hE(expl); }
}
function triggerMenu(id) {
	if (CURR_MENU != id) {
		unhiliteMenu(CURR_MENU);
	} 
	CURR_MENU = id;
}
function doSearch(s) {
	if (isWhitespace(s)) {
		alert(" Please enter your search criteria. ");
		return false;
	} else {
		return true;
	}
}
function focusSearch(fe) {
	glideNavMenu.hide('menu1');
	if (fe.value=='Search Rackit') fe.value = "";
}
function doCustomerLogin(f) {
	if (isEmail(f.email_address.value) && !isWhitespace(f.password.value)) {
		setCookie('RACKIT_CUSTOMER_EMAIL',f.email_address.value,expiration(365));
		return true;
	} else {
		alert(" Please check your login information and try again. ");
		return false;
	}
}
function tryLogin() {
	f = document.clogin_panel;
	if (event.keyCode==13) {
		// check login form, carbon copy of above
		if (isEmail(f.email_address.value) && !isWhitespace(f.password.value)) {
			setCookie('RACKIT_CUSTOMER_EMAIL',f.email_address.value,expiration(365));
			f.submit();
		} else {
			alert(" Please check your login information and try again. ");
		}
	}
}
function checkQty(qty) {
	var q = qty.value;
	if (isInteger(q) && q>0) return true;
	else {
		alert(" Please enter a valid quantity. ");
		qty.focus();
		return false;
	}
}
