function setArtist(Category){
	var newElem;
	var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
	var artistChoose = Category.form.elements["artist_id"];
	while(artistChoose.options.length){
		artistChoose.remove(0);
	}
	var choice = Category.options[Category.selectedIndex].value;
	var artists = artistArray[choice];
	newElem = document.createElement("option");
	newElem.text = "select";
	newElem.value = "";
	artistChoose.add(newElem, where);
	if(choice != ""){
		for(var i = 0; i < artists.length; i++){
			newElem = document.createElement("option");
			newElem.text = artists[i].text;
			newElem.value = artists[i].value;
			artistChoose.add(newElem, where);
		}
	}	
}

function setClient(Category){
	var newElem;
	var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
	var clientChoose = Category.form.elements["client_id"];
	while(clientChoose.options.length){
		clientChoose.remove(0);
	}
	var choice = Category.options[Category.selectedIndex].value;
	var clients = clientArray[choice];
	newElem = document.createElement("option");
	newElem.text = "select";
	newElem.value = "";
	clientChoose.add(newElem, where);
	if(choice != ""){
		for(var i = 0; i < clients.length; i++){
			newElem = document.createElement("option");
			newElem.text = clients[i].text;
			newElem.value = clients[i].value;
			clientChoose.add(newElem, where);
		}
	}	
}

function preLoad(){
	var d=document; 
	var a=preLoad.arguments;
	for(i=0; i<a.length; i++){
		image_array = new Object();
		image_array[i]=new Image();
		image_array[i].src = preLoad[a.value];
	}
}

function setImage(pImageName, ID){
	var main_image = document.getElementById(ID);
	var image_block = document.getElementById("sidebarthumbfloat");
	main_image.src = pImageName;
	
	//sidebarfloat.style.display = 'block';
}


function clearImage(){
	var sidebarfloat = document.getElementById("sidebarthumbfloat");
	
	sidebarfloat.style.display = 'none';
}


activateMenu = function(nav) {

/* currentStyle restricts the Javascript to IE only */
	if (document.all &&
 document.getElementById(nav).currentStyle) {  
        var navroot = document.getElementById(nav);
        
        /* Get all the list items within the menu */

        var lis=navroot.getElementsByTagName("LI");  
        for (i=0; i<lis.length; i++) {
        
           /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
            
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {	
                
                   /* display the inner menu */
                   this.lastChild.style.display="block";
                }
                lis[i].onmouseout=function() {   
                   this.lastChild.style.display="none";
                }
            }
        }
    }
}
window.onload= function(){
    /* pass the function the id of the top level UL */

    /* remove one, when only using one menu */
    activateMenu('nav'); 
    activateMenu('vertnav'); 
}


