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 autotab(original,destination){
/*	if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()*/
}


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,sizes) {
window.open(theURL,winName,sizes);
}

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;
}
}

/*
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);

*/


function disableForm(theform) {
if (document.all || document.getElementById) {
for (i = 0; i < theform.length; i++) {
var tempobj = theform.elements[i];
if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
tempobj.disabled = true;
}
return true;
} else {
return false;
}
}

