function goURL(s) {       
	var d = s.options[s.selectedIndex].value
    window.top.location.href = d
    s.selectedIndex=0
}

//-----------------------------
 //dropout tree menu script //
//---------------------------- 
/*
if (document.getElementById){  //sets initial state of the menu to hidden - block this code to initially show
	document.write('<style type="text/css">\n')
	document.write('.submenu{display: none;margin-bottom: 15px;}\n')
	document.write('</style>\n')
}
*/
function show(id) { //onclick either shows or hides the current dropout

	var inspired = document.getElementById('inspired');
	var vintage = document.getElementById('vintage');

	if(inspired.style.display != "block" && id == 'inspired')
		inspired.style.display = "block";
		else inspired.style.display = "none";
	
	if(vintage.style.display != "block" && id == 'vintage')
		vintage.style.display = "block";
		else vintage.style.display = "none";
}

function showHide(obj) { //onclick either shows or hides the current dropout
	
	var showEl = document.getElementById(obj);
	var showAr = document.getElementById("navMenu").getElementsByTagName("span");
	if(showEl.style.display != "block"){ 
		showEl.style.display = "block";
	} else {
		showEl.style.display = "none";
	}
}

function openWin(theURL,winName,w,h,scroll) { 

	if ((screen.width<=1024) && (screen.height<=768)) {
		settings = 'height='+screen.height*.95+',width='+screen.width*.95+',scrollbars='+scroll+',resizable=no,toolbars=no';
	} else {
		LeftPosition =0;
	    TopPosition = 0;
	    settings ='height='+screen.height+',width='+screen.width+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,fullscreen=yes,resizable=no';
	}
	window.open(theURL,winName,settings);
}

function swapImageViewed(image){
	//var newImage = selectedView + currentImage;
	window.document.imageViewed.src = 'images/catalog/'+image;
}

function userFormCheck(formobj){
	// name of mandatory fields
	var fieldRequired = Array("name", "username", "password", "password2", "permission", "email");
	// field description to appear in the dialog box
	var fieldDescription = Array("Name", "Username", "Password", "Verify Password", "permission", "Email");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}

function dropDown(id) {
		var menu = document.getElementById(id)
		menu.style.visibility = "visible";	
}

function dropUp(id) {
		var menu = document.getElementById(id)
		menu.style.visibility = "hidden";
}

/*
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

*/