// JavaScript Document

//disable elememt
function disableElement(id){
document.getElementById(id).setAttribute('disabled', 'disabled');
}
//enable elememt
function enableElement(id){
document.getElementById(id).removeAttribute('disabled');
}

//preload all images
var myimages = new Array();

function preloading(){
for (x=0; x<preloading.arguments.length; x++){
myimages[x] = new Image();
myimages[x].src = "splash_images/"+preloading.arguments[x];
}
}

preloading("header_bg.jpg", "header.jpg", "body_bg.jpg", "fundraising_out.jpg", "bucks_out.jpg", "corporate_out.jpg", "parties_out.jpg", "clubs_out.jpg", "fundraising_over.jpg", "bucks_over.jpg", "corporate_over.jpg", "parties_over.jpg", "clubs_over.jpg", "PN_out.jpg", "PN_over.jpg", "CMG_out.jpg", "CMG_over.jpg", "PP_out.jpg", "PP_over.jpg", "FQ_out.jpg", "FQ_over.jpg", "IPT_out.jpg", "IPT_over.jpg");


//change text of element by id - pairs must be separated by "," - name/values separated by "+"
function changeHtml(string){
var idAndSrc=string.split(",");
var x;
for(x=0; x<=idAndSrc.length-1; x++){
var pair=idAndSrc[x].split("+");
document.getElementById(pair[0]).innerHTML=pair[1];
}
}

//hide elements by id - string values must be separated by ","
function hide(string){
var ids = string.split(",");
var x;
for(x=0; x<=ids.length-1; x++){
document.getElementById(ids[x]).style.display="none";
}
}
//show elements by id - string values must be separated by ","
function show(string){
var ids = string.split(",");
var x;
for(x=0; x<=ids.length-1; x++){
document.getElementById(ids[x]).style.display="";
}
}



//rollover and out - name/value pair separated by "+", pairs separated by ","
function nav(string){
var idAndSrc=string.split(",");
var x;
for(x=0; x<=idAndSrc.length-1; x++){
var pair=idAndSrc[x].split("+");
document.getElementById(pair[0]).src="splash_images/"+pair[1];
}
}


