	function workBtn(whichItem, what) {
		var baseUrl = whichItem.src;
		if(what == "on") {
			baseUrl = baseUrl.replace("off", "ov");
		} else {
			baseUrl = baseUrl.replace("ov", "off");
		}
		whichItem.src = baseUrl;
	}
	function getPop(popURL) {
		var theUrl = "/" + popURL + ".html";
		window.open(theUrl, "popWin", "width=500, height=350");
	}

function setNav(which) {
	var theNavItem = document.getElementById(which);
	theNavItem.style.color = "#dd7f2d";
}
function setSubNav(which) {
	var theNavItem = document.getElementById(which);
	theNavItem.style.color = "#FFFFFF";
}

function showNav(which, what) {
	var theMenu = document.getElementById(which);
	if(what == "on") {
		theMenu.style.display = "block";
	} 
	if(what == "off") {
		theMenu.style.display = "none";
	}
}
	function checkForm() {
		
		var msg = "Please correct the following errors:<ul>";
		var ok = true;
		if(!document.getElementById('first_name').value) {
			msg += "<li>Please enter your First Name</li>";
			ok = false;
		}

		if(!document.getElementById('last_name').value) {
			msg += "<li>Please enter your Last Name</li>";
			ok = false;
		}

		if(!document.getElementById('address_1').value) {
			msg += "<li>Please enter your street Address</li>";
			ok = false;
		}

		if(!document.getElementById('city').value) {
			msg += "<li>Please enter your City</li>";
			ok = false;
		}

		if(!document.getElementById('state').value) {
			msg += "<li>Please enter your State/Province</li>";
			ok = false;
		}
		var theMenu = document.getElementById('country');
		var countrySel = theMenu.options[theMenu.selectedIndex].value
		if(!countrySel || countrySel == "Select a Country") {
			msg += "<li>Please select your Country</li>";
			ok = false;
		}		
		if(!document.getElementById('email').value) {
			msg += "<li>Please enter your email address</li>";
			ok = false;
		}
		
		// Now check all the password stuff
		var newPass1 = document.getElementById('password_new').value;
		var newPass2 = document.getElementById('password_confirm').value;
		
		if(newPass1) {
			if(newPass1 != newPass2) {
				msg += "<li>Please reconfirm your new password</li>";
				ok = false;
			}
		} 
		if(!ok){
			msg += "</ul>";
			document.getElementById('error').innerHTML=msg;
		} else {
			document.getElementById('error').innerHtml="";
		}
		return ok;
	}
	

	function setCountry(which) {
		var theMenu = document.getElementById('country');
		for(var i=0; i<theMenu.options.length; i++) {
			if(theMenu.options[i].value == which) {
				theMenu.options[i].selected = true;
				break;
			}
		}
	}
function parseGetVars() {
	  var getVars = new Array();
	  var qString = unescape(top.location.search.substring(1));
	  var pairs = qString.split(/\&/);
	  for (var i in pairs) {
	   var nameVal = pairs[i].split(/\=/);
	   getVars[nameVal[0]] = nameVal[1];
	   } 
	  return getVars;
	 }
	function checkLogin() {
		
		var msg = "Please correct the following errors:<ul>";
		var ok = true;
		if(!document.getElementById('username').value) {
			msg += "<li>Please enter your username</li>";
			ok = false;
		}

		if(!document.getElementById('password').value) {
			msg += "<li>Please enter your password</li>";
			ok = false;
		}

		if(!ok){
			msg += "</ul>";
			document.getElementById('error').innerHTML=msg;
		} else {
			document.getElementById('error').innerHtml="";
		}
		return ok;
	}

