// JavaScript Document


function on(divId)
{
sectionVar = document.getElementById(divId);
imageVar = 'url(pics/'+divId+'_on.gif)';
//window.alert(imageVar);
sectionVar.style.backgroundImage=imageVar;
}
function off(divId)
{
sectionVar = document.getElementById(divId);
imageVar = 'url(pics/'+divId+'_off.gif)';
//window.alert(imageVar);
sectionVar.style.backgroundImage=imageVar;
}



/* old blankIt
function blankIt(thisDiv) { 
formVal = document.getElementById(thisDiv).value;
if (formVal != '') {
document.getElementById(thisDiv).value='';
}
}
*/

// new blankIt
function blankIt(thisDiv) { 
formVal = document.getElementById(thisDiv).value;
if (formVal != '') {
document.getElementById(thisDiv).id='unpwoff';
document.getElementById(thisDiv).value='';
}
}


//move and select from one select box to the other
//function moveSelected not working in Firefox 
function moveSelected(formName,fromlist,tolist){

	if(document.layers){
		var formref =  document.layers['maincontent'].document.forms[formName];
	}
	if(document.all){
		var formref = this.document.forms[formName];
	}

	var formref = this.document.forms[formName];
	var fromlistref = formref.elements[fromlist];
	var tolistref = formref.elements[tolist];
	
	for(i = 0; i < fromlistref.length; i++){
		if(fromlistref.options[i].selected){
			newOption = new Option;
			newOption.text = fromlistref.options[i].text;
			newOption.value = fromlistref.options[i].value;
			tolistref.options[tolistref.length] = newOption;
			fromlistref[i] = null;
			i = i - 1; 
		}
	}
}

//function selectAllOptions not working in Firefox 
function selectAllOptions(form,list){
	
	var formref = this.document.forms[form];
	
	for(i = 0; i < formref.elements[list].length; i++){
		formref.elements[list].options[i].selected = true;
	}
	return false;
}

function checkAndSelect(){

	 selectAllOptions('addNetwork','ncode');
	selectAllOptions('addNetwork','nacode');

}

function playSelectedFlashVideo(sMoviePath,sObjectName,sPlayerDivName,iWidth,iHeight,iBitDepth,sBackgroundColour) {
	document.getElementById(sPlayerDivName).innerHTML = "";
	var so = new SWFObject("/frontPromo.swf", sObjectName, iWidth, iHeight, iBitDepth, sBackgroundColour);
	so.addVariable("moviePath", sMoviePath); 
	so.write(sPlayerDivName);
}