var div_el;
 
function initiate(pages,expand)
{
var temp=document.getElementById("masterdiv").getElementsByTagName("span");
for (var i=0; i<temp.length;i++)
	{
	if (temp[i].className=="submenu") temp[i].style.display = (expand=="True")?"block":"none";
	} 
}       


 function SwitchMenu(obj){
 	if(document.getElementById){
 	var el = document.getElementById(obj);
 	var ar = document.getElementById("masterdiv").getElementsByTagName("span");
 		if(el.style.display != "block"){
 			for (var i=0; i<ar.length; i++){
 				if (ar[i].className=="submenu")
 				ar[i].style.display = "none";
 			}
 			el.style.display = "block";
 		}else{
 			el.style.display = "none";
 		}
 	}
 }

function changeBGImage(whichImage){
if (document.body){
document.body.background = whichImage;
//var ran_number=Math.floor(Math.random()*500);
//document.body.background = "http://www.wardfamily.plus.com/Recordings/Covers/"+ran_number+".jpg";
}
}



function loadXMLDoc(url, element) 
{
    if (window.XMLHttpRequest)
	{
        // branch for native XMLHttpRequest object
    	req = new XMLHttpRequest();
	}
    else if (window.ActiveXObject)
	{
        // branch for IE/Windows ActiveX version
    	req = new ActiveXObject("Microsoft.XMLHTTP");
	}
        
    if (req)
	{
	if (element) {div_el=document.getElementById(element);}
		else {div_el=document.getElementById("art_rec_detail");}

	req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send(null);
     	}
    
}
    
function processReqChange(el) 
{
    // only if req shows "complete"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            //x=document.getElementById('art_rec_detail');
    	//	alert(req.responseText);
			div_el.innerHTML=req.responseText;
        } else {
            alert("There was a problem retrieving the XML data:\n" + req.statusText);
        }
    }
}    

    





function updateArtistRecDetail()
{
if (xmlhttp.readyState==4)
  {// 4 = "loaded"
  if (xmlhttp.status==200)
    {// 200 = "OK"
    document.getElementById("art_rec_detail").innerHTML=xmlhttp.responseText;
    }
  else
    {
    alert("Problem retrieving data" + xmlhttp.statusText);
    }
  }
}


