<!--//


function on(img)
{
  if (!document.images) return;
  document.images[img].src = "_img/#_cid_#/subnav_arrow_ON.gif";
}

function off(img)
{
  if (!document.images) return;
  document.images[img].src = "_img/#_cid_#/subnav_arrow_OFF.gif";
}

function getStyleObject(objectId) {
  // checkW3C DOM, then MSIE 4, then NN 4.
  //
  if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId).style;
   }
   else if (document.all && document.all(objectId)) {  
	return document.all(objectId).style;
   } 
   else if (document.layers && document.layers[objectId]) { 
	return document.layers[objectId];
   } else {
	return false;
   }
}
function changeObjectVisibility(objectId, newVisibility) {
    // first get the object's stylesheet
    var styleObject = getStyleObject(objectId);

    // then if we find a stylesheet, set its visibility
    // as requested
    //
    if (styleObject) {
	if(newVisibility=="visible") newVisibility = "block"; else newVisibility = "none";
	// styleObject.visibility = newVisibility;
	styleObject.display = newVisibility;
	return true;
    } else {
	return false;
    }
}

function TemplatePicked(whch) {
	if(whch==0) {
		changeObjectVisibility("topt1","visible");
		changeObjectVisibility("topt2","hidden");
		changeObjectVisibility("topt3","hidden");
		changeObjectVisibility("topt4","hidden");
		changeObjectVisibility("topt5","hidden");
	}
	if(whch==1 || whch==2) {
		changeObjectVisibility("topt1","hidden");
		changeObjectVisibility("topt2","visible");
		changeObjectVisibility("topt3","hidden");
		changeObjectVisibility("topt4","hidden");
		changeObjectVisibility("topt5","hidden");
	}
	if(whch==3 || whch==4) {
		changeObjectVisibility("topt1","hidden");
		changeObjectVisibility("topt2","visible");
		changeObjectVisibility("topt3","visible");
		changeObjectVisibility("topt4","hidden");
		changeObjectVisibility("topt5","hidden");
	}
	if(whch==5 || whch==6) {
		changeObjectVisibility("topt1","hidden");
		changeObjectVisibility("topt2","hidden");
		changeObjectVisibility("topt3","hidden");
		changeObjectVisibility("topt4","visible");
		changeObjectVisibility("topt5","hidden");
	}
	if(whch==7 || whch==8) {
		changeObjectVisibility("topt1","hidden");
		changeObjectVisibility("topt2","hidden");
		changeObjectVisibility("topt3","hidden");
		changeObjectVisibility("topt4","hidden");
		changeObjectVisibility("topt5","visible");
	}
}


function ToggleMetaFields() {
	if(document.getElementById && document.getElementById("metafields")) {
		var curr = document.getElementById("metafields").style.display;
		if(curr=="block") var newcurr = "none"; else var newcurr = "block";
		if(curr=="block") var newplmn = "expand"; else var newplmn = "collapse";
		document.getElementById("metafields").style.display = newcurr;
		document.getElementById("plmin").src = "images/" + newplmn + ".gif";
	} else if (document.all && document.all("metafields")) {
		var curr = document.all("metafields").style.display;
		if(curr=="block") var newcurr = "none"; else var newcurr = "block";
		if(curr=="block") var newplmn = "expand"; else var newplmn = "collapse";
		document.all("metafields").style.display = newcurr;
		document.all("plmin").src = "images/" + newplmn + ".gif";
	}
	return false;
}

function ToggleArtSkills() {

	if(document.getElementById && document.getElementById("artdisc")) {
		var sel = document.getElementById("artdisc").value;
		document.getElementById("chkdance").style.display = 'none';
		document.getElementById("chkmusic").style.display = 'none';
		document.getElementById("chkdrama").style.display = 'none';
		document.getElementById("chk"+sel).style.display = 'block';
	} else if (document.all && document.all("artdisc")) {
		var sel = document.all("artdisc").value;
		document.all("chkdance").style.display = 'none';
		document.all("chkmusic").style.display = 'none';
		document.all("chkdrama").style.display = 'none';
		document.all("chk"+sel).style.display = 'block';
	}
	return false;
}

function AddKeyword(whch, kwd) {
	if (window.opener && !window.opener.closed) {
		if(whch=="curr") var nowval = window.opener.document.SearchForm.tcurriculummeta.value;
		if(whch=="emerg") var nowval = window.opener.document.SearchForm.temergentmeta.value;
		if(whch=="child") var nowval = window.opener.document.SearchForm.tchildhoodmeta.value;
		if(nowval=="") var cma = ""; else var cma = ", ";
		var newval = nowval + cma + kwd;
		if(whch=="curr") window.opener.document.SearchForm.tcurriculummeta.value = newval;
		if(whch=="emerg") window.opener.document.SearchForm.temergentmeta.value = newval;
		if(whch=="child") window.opener.document.SearchForm.tchildhoodmeta.value = newval;
	}
}

function ToggleQuizOptions (whch, vl) {
	var disp = 'none';
	var disp2 = 'none';
	if(vl==1) var disp = 'block';
	if(vl==2) var disp2 = 'block';
	if(document.getElementById && document.getElementById("editmode")) {
		document.getElementById("qoptions"+whch).style.display = disp;
		document.getElementById("qanswers"+whch).style.display = disp2;
	} else if (document.all && document.all("editmode")) {
		document.all("qoptions"+whch).style.display = disp;
		document.all("qanswers"+whch).style.display = disp2;
	}
}

function confirmSubmit() {
	var agree = confirm("Are you sure you wish to delete this item?");
	if (agree) return true; else return false;
}

function winBRopen2(theURL, Name, popW, popH, scroll, resize, tool, loc, stat, menu) {
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+',toolbar='+tool+',location='+loc+',status='+stat+',menubar='+menu;
	Win = window.open(theURL, Name, winProp);
	if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}

function winBRopen3(theURL, Name, popW, popH, scroll, resize, tool, loc, stat, menu) {
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+',toolbar='+tool+',location='+loc+',status='+stat+',menubar='+menu;
	ChatWin = window.open(theURL, Name, winProp);
	if (parseInt(navigator.appVersion) >= 4) { ChatWin.window.focus(); }
}

function winBRopen4(theURL, Name, popW, popH, scroll, resize, tool, loc, stat, menu, offset) {
	//	this version has an OFFSET variable so windows can be STAGGERED
	var winleft = ((screen.width - popW) / 2) + offset;
	var winUp = ((screen.height - popH) / 2) + offset;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+',toolbar='+tool+',location='+loc+',status='+stat+',menubar='+menu;
	ChatWin = window.open(theURL, Name, winProp);
	if (parseInt(navigator.appVersion) >= 4) { ChatWin.window.focus(); }
}


// if (ChatWin.closed) {
// 	alert("chat session ended");
// }


function ToggleSubInstruct () {
	if(document.getElementById && document.getElementById("tquizes")) {
		var vl = document.getElementById("tquizes").value;
	} else if (document.all && document.all("subinstruct")) {
		var vl = document.all("tquizes").value;
	}
	if(vl==2) var disp = "block"; else var disp = "none";
	if(document.getElementById && document.getElementById("tsubinstruct")) {
		document.getElementById("tsubinstruct").style.display = disp;
	} else if (document.all && document.all("tsubinstruct")) {
		document.all("tsubinstruct").style.display = disp;
	}
}

function AddUploadFile(whchid) {

	var currentTime = new Date();
	var mm = currentTime.getMonth() + 1;
	var dd = currentTime.getDate();
	var yy = currentTime.getFullYear();
	var hh = currentTime.getHours();
	var nn = currentTime.getMinutes();
	var ss = currentTime.getSeconds();
	var toadd = "<input type=file name=qfile" + mm + dd + yy + hh + nn + ss + "><br>";
	if(document.getElementById && document.getElementById(whchid)) {
		document.getElementById(whchid).innerHTML = document.getElementById(whchid).innerHTML + toadd;
	} else if (document.all && document.all(whchid)) {
		document.all(whchid).innerHTML = document.all(whchid).innerHTML + toadd;
	}
}

function ToggleVisibility(nmb) {
	if(document.getElementById && document.getElementById("anngroup"+nmb)) {
		if(document.getElementById("anngroup"+nmb).style.display=="block") var dsp = "none"; else dsp = "block";
		document.getElementById("anngroup"+nmb).style.display = dsp;
		if(dsp=="none") var img = "plmn"; else var img = "plmn2";
		document["toggleimg"+nmb].src = "images/" + img + ".gif";
	} else if (document.all && document.all("anngroup"+nmb)) {
		if(document.all("anngroup"+nmb).style.display=="block") var dsp = "none"; else dsp = "block";
		document.all("anngroup"+nmb).style.display = dsp;
		if(dsp=="none") var img = "plmn"; else var img = "plmn2";
		document["toggleimg"+nmb] = "images/" + img + ".gif";
	}
}



//-->