/*
############################################################
##########	Custom Javascripts
############################################################
*/


function ConfirmClick(delUrl, message) {
	if (confirm(message)) {
		document.location = delUrl;
	}
}

function stateClick(el){
	var href = el.name;
	var contentDiv = $('gradeContent');
	var holderDiv = $('gradeHolder');
	var content = '';
	content += "<table border=0>\n";
	content += "<tr><td colspan='2' align='center'>" + el.innerHTML + "</td></tr>\n";
	content += "<tr><td valign='top'>\n";
	content += "<a href='" + href + "-k.htm'>Kindergarten</a><br/>\n";
	content += "<a href='" + href + "-1.htm'>First Grade</a><br/>\n";
	content += "<a href='" + href + "-2.htm'>Second Grade</a><br/>\n";
	content += "<a href='" + href + "-3.htm'>Third Grade</a><br/>\n";
	content += "</td><td valign='top'>\n";
	content += "<a href='" + href + "-4.htm'>Fourth Grade</a><br/>\n";
	content += "<a href='" + href + "-5.htm'>Fifth Grade</a><br/>\n";
	content += "<a href='" + href + "-6.htm'>Sixth Grade</a><br/>\n";
	content += "<a href='" + href + ".htm'>All Grades</a><br/>\n";
	content += "</td></tr></table>";
	contentDiv.innerHTML = content;
	holderDiv.style.display = '';
}

function ChangeClass(id, newClass) {
	identity=document.getElementById(id);
	identity.className=newClass;
}

function HideBlock(myID){
        var myproperty = document.getElementById(myID).style.display;
        if(myproperty == "none"){
                document.getElementById(myID).style.display = 'block';
        }else{
                document.getElementById(myID).style.display = 'none';
        }
}

function createWindow(cUrl,cName,cFeatures) {
	var xWin = window.open(cUrl,cName,cFeatures)
}


function myResourceType(){

         var myElement = document.getElementById('type');
         var myValue = myElement.options[myElement.selectedIndex].value;

	if(myValue == "link"){
                document.getElementById("link").style.display = 'block';
                document.getElementById("html").style.display = 'none';
                document.getElementById("download").style.display = 'none';
	}else if(myValue == "html"){
                document.getElementById("html").style.display = 'block';
                document.getElementById("link").style.display = 'none';
                document.getElementById("download").style.display = 'none';
	}else if (myValue == "download"){
                document.getElementById("download").style.display = 'block';
                document.getElementById("link").style.display = 'none';
                document.getElementById("html").style.display = 'none';
	}
}

function prettyTable(el, color1, color2){
   var table = document.getElementById(el);
   if(typeof(table) != 'undefined'){
	   for(var i = 0; i < table.rows.length; i++){
       	table.rows[i].style.backgroundColor = ((i%2)?color1:color2);
   	}
   }
}
