//preload ptl_header buttons
var toolsoff = new Image();
toolsoff.src = "/images/buttons_tools.gif";

var tool_emailon = new Image();
tool_emailon.src = "/images/buttons_tools_email.gif";

var tool_calon = new Image();
tool_calon.src = "/images/buttons_tools_calendar.gif";

var tool_webon = new Image();
tool_webon.src = "/images/buttons_tools_websites.gif";

// * IMAGE ROLLOVER FUNCTION *

function roll(img_name, img_src)
{
   document[img_name].src = img_src;
}

function OpenWin01(URL, myname, w, h, scroll,resize,tool,menu,status) {
var winl = (screen.width - w - 20);
winprops = 'height='+h+',width='+w+',top='+5+',left='+winl+',scrollbars='+scroll+',resizable='+resize+',toolbar='+tool+',menubar='+menu+',status='+status+''
win = window.open(URL, myname, winprops)
win.focus();
if (parseInt(navigator.appVersion) >= 4) { win.focus(); }
}

function OpenWin02L(URL, myname, w, h, scroll,resize,tool,menu,status) {
//var winl = (screen.width - w - 20);
winprops = 'height='+h+',width='+w+',top='+1+',left='+1+',scrollbars='+scroll+',resizable='+resize+',toolbar='+tool+',menubar='+menu+',status='+status+''
win = window.open(URL, myname, winprops)
win.focus();
if (parseInt(navigator.appVersion) >= 4) { win.focus(); }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function placeFocus() {
if (document.forms.length > 0) {
var field = document.forms[0];
for (i = 0; i < field.length; i++) {
if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
document.forms[0].elements[i].focus();
break;
         }
      }
   }
}



//######AUTO TAB FUNCTION BASED ON MAXLENGH OF TEXTBOX##########################
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}
//##############################################################################


// FORMAT TARGET WINDOW FOR NEWSLETTER ##########################################
//THIS ONE IS FOR A 500 WIDTH X 400 HEIGHT WINDOW (THE NEWSLETTER)
var myHeight = 500;
var isResizable = true;
var win2 = (screen.width - 636);

function createTarget(form) {
_target = form.target;
_colon = _target.indexOf(":");
if(_colon != -1) {
form.target = _target.substring(0,_colon);
form.args = _target.substring(_colon+1);
} else if(typeof(form.args)=="undefined") {
form.args = "";
}
if(form.args.indexOf("{")!=-1) {
_args = form.args.split("{");
form.args = _args[0];
for(var i = 1; i < _args.length;i++) {
_args[i] = _args[i].split("}");
form.args += eval(_args[i][0]) + _args[i][1];
   }
}
form.args = form.args.replace(/ /g,"");
_win = window.open('',form.target,form.args);
if(typeof(focus)=="function")
_win.focus();
return true;
}

//##############################################################################


// CENTERED POPUP (Mainly for Games)###############################################################
function OpenCtr(mypage, myname, w, h, scroll, resize) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize+''
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//##############################################################################

// CENTERED POPUP 2 (Added toolbar, menu, status optopns)#############
function OpenCtr2(mypage,myname,w,h,scroll,resize,tool,menu,status) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize+',toolbar='+tool+',menubar='+menu+',status='+status+''
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//##############################################################################


//###################################
//Keeps new window focus//
function openFocus(url) { 
var win = window.open(url, '_new', ''); 
win.focus(); 
return false;
}
//#####################################


//###################################
//redirects links to the opener window or else it opens is same window. Used basiacally for links back to powertolearn.com//
function OpenGo(url) {
if (window.opener && !window.opener.closed) {
opener.location.href = url;
opener.focus();
}
else {
var win = open(url); 
}
}
//#####################################

//Diasbale Submit Button on Form
//<form method="POST" onSubmit="submitonce(this)">
function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}


//Changes Submit Button to Sending while processind
//use onSubmit="return submitForm(this.submitbutton)"
function submitForm(s)  {
s.value = "Sending...";
s.disabled=true;
return true;
}



//#####################################
//Format Phone Number MAX 2 FORM FIELDS MAKE SURE TO ADD 2 PHONE FIELDS phone1, phone2
//use onblur="FixPhone();" in form field.
var nums=new Array('document.forms[0].phone1', 'document.forms[0].phone2');

function FixPhone(){

var re= /\D/;
// test for this format: (xxx)xxx-xxxx
var re2 = /^\({1}\d{3}\)\d{3}-\d{4}/; 
// test for this format: xxx-xxx-xxxx
//var re2 = /^\d{3}-\d{3}-\d{4}/;

for (i=0; i<nums.length;i++){
var num=eval(nums[i]+'.value');

var newNum;
 if (num != "" && re2.test(num)!=true){
   if (num != ""){
     while (re.test(num)){
     num = num.replace(re,"");
     }
   }

  if (num.length != 10){
    alert('Please enter a 10 digit phone number');
    eval(nums[i]).select();
    break;
    }
   else {
     // for format (xxx)xxx-xxxx
     newNum = '(' + num.substring(0,3) + ')' + num.substring(3,6) + '-' + num.substring(6,10);
     // for format xxx-xxx-xxxx
     // newNum = num.substring(0,3) + '-' + num.substring(3,6) + '-' + num.substring(6,10);
     eval(nums[i]).value=newNum;
     }
   }
  }
}


//alternate row colors for tables!!##You may want to 'alternate' the colour of the rows. This can be done using a simple JavaScript Using the same table example above we have added the JavaScript. You will need to add the 'onload' command to your <body> tag at the top of the template and the 'table ID' to the table. If you are using a 'header' row you can set the x=0 to be x=1 and it will start at row 2. Simply change the two 'backgroundColor' values to the colour you want.
function ezcolrow(el)
{
var ele = document.getElementById(el);
for(x = 0; x < ele.rows.length; x++)
{
ele.rows[x].style.height = "20px"
if (x%2 == 0)
{
ele.rows[x].style.backgroundColor = "#ECECEC";
}
else
{
ele.rows[x].style.backgroundColor = "#F6F5F5";
}
}
}


//COOKIE FUNCTIONS FOR MENU STATE - Specifically for pages such as Gadget Gals that show up in both Teachers and Parents Menu but is same sontent. Cookie will set Teacher or Parent Menu was clicked or whatever.
function setCookie (name, value, expires) {
	document.cookie = name + "=" + escape(value) + "; path=/" +
	((expires == null) ? "" : ";expires=" +
	  expires.toGMTString());
}

var exp = new Date();
exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 1));

function getCookie(name) {
	var cname = name + "=";
	var dc = document.cookie;
	if (dc.length > 0) {
		begin = dc.indexOf(cname);
		if (begin != -1) {
			begin += cname.length;
			end = dc.indexOf(";", begin);
			if (end == -1) end = dc.length;
			return unescape(dc.substring(begin, end));
		}
	}
	return null;
}

function delCookie(name) {
	document.cookie = name + "=; expires=Thu, 01-Jan-70	00:00:01 GMT" + "; path=/";
}

// END COOKIE FUNCTIONS

// BEGIN MENU STATE FUNCTIONS ##################################################
var menu_id

//MENU 1 HOME

//MENU 1a Triple Play

//MENU 2 PRODUCTS & SERVICES
if (menu_id == "2") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub2 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}

////Products & Services Front Page
if (menu_id == "2ps") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub2 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m2ps {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////Triple Play for Education
if (menu_id == "2tp") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub2 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m2tp {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////Erate
if (menu_id == "2er") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub2 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m2er {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////Internet Connectivety
if (menu_id == "2ic") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub2 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m2ic {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////Email Tools
if (menu_id == "2et") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub2 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m2et {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////Email Login
if (menu_id == "2el") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub2 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m2el {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////Video Service
if (menu_id == "2vs") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub2 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m2vs {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////Product Partners
if (menu_id == "2pp") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub2 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m2pp {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////School Calendars
if (menu_id == "2sc") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub2 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m2sc {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////Contact your Rep
if (menu_id == "2cr") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub2 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m2cr {color:#333399; font-weight:bold;}')
document.write('</style>')
}

//MENU 3 CUSTOMER SUPPORT

//MENU 4 INTERNET SMARTS
////NOT OPEN
if (menu_id == "4") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub4 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}
////IS Front Page
if (menu_id == "4is") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub4 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m4is {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Interactive Case Studies
if (menu_id == "4cs") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub4 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m4cs {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Get Certified
if (menu_id == "4gc") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub4 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m4gc {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////The Guide
if (menu_id == "4tg") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub4 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m4tg {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Online Resources
if (menu_id == "4or") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub4 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m4or {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Parents Need to Know
if (menu_id == "4pnk") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub4 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m4pnk {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Digital Smarts Blog
if (menu_id == "4dsb") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub4 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m4dsb {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////////Ask the Expert - Detective Rory Forrestal 
if (menu_id == "4ae") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub4 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m4ae {color:#333399; font-weight:bold;}')
document.write('</style>')
}

//MENU 5 SCHOOL TO CAREER
if (menu_id == "5sc") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub5 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m5sc {color:#333399; font-weight:bold;}')
document.write('</style>')
}

//MENU 6 ASK THE EXPERT
if (menu_id == "6") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub6 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}
////Ask the Expert Front Page
if (menu_id == "6ae") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub6 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m6ae {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Marc Marone
if (menu_id == "6mm") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub6 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m6mm {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Rory Forestall
if (menu_id == "6rf") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub6 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m6rf {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Steve Lyons
if (menu_id == "6sl") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub6 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m6sl {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Heidi Cullen
if (menu_id == "6hc") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub6 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m6hc {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////George Kalinsky
if (menu_id == "6gk") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub6 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m6gk {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Expert Archive
if (menu_id == "6ea") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub6 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m6ea {color:#333399; font-weight:bold;}')
document.write('</style>')
}


////MENU 7 OTHER PROGRAMS
if (menu_id == "7") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}
////Other Programs Home Page
if (menu_id == "7op") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7op {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Charity Champions
if (menu_id == "7chch") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7chch {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Student Voices
if (menu_id == "7sv") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7sv {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Go Green
if (menu_id == "7gogr") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7gogr {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Healthy Kids
if (menu_id == "7hkids") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7hkids {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////School to Career
if (menu_id == "7sc") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7sc {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Programs Archive
if (menu_id == "7pa") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7pa {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Latino Student Athlete
if (menu_id == "7lsa") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7lsa {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Take a Vet to School Day
if (menu_id == "7tavts") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7tavts {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Earth Day
if (menu_id == "7ed") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7ed {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Financial Literacy Month
if (menu_id == "7flm") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7flm {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Hispanic Heritage Month
if (menu_id == "7hhm") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7hhm {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Election 2008
if (menu_id == "7ele08") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7ele08 {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Black History Month
if (menu_id == "7bhm") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7bhm {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Women's History Month
if (menu_id == "7whm") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7whm {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Long Island Discovery
if (menu_id == "7ld") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7ld {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Nat'l Vocabulary Championship
if (menu_id == "7vb") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7vb {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Hurricane Preparedness
if (menu_id == "7hp") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7hp {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Watershed Worries
if (menu_id == "7ww") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7ww {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Spotlight Archive
if (menu_id == "7sa") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub7 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m7sa {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////MENU 8 READING LOUNGE
if (menu_id == "8") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub8 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}
////Passport to Reading
if (menu_id == "8pr") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub8 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m8pr {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Reading Lounge Front Page
if (menu_id == "8rl") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub8 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m8rl {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Video Books
if (menu_id == "8vb") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub8 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m8vb {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Postcard Club
if (menu_id == "8pc") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub8 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m8pc {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Read to Achieve
if (menu_id == "8ra") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub8 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m8ra {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Summer Reading
if (menu_id == "8sr") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub8 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m8sr {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////MENU 9 IN YOUR COMMUNITY
if (menu_id == "9") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}
////In Your Community Front Page
if (menu_id == "9ic") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m9ic {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////New York City
if (menu_id == "9nyc") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m9nyc {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Hudson Valley
if (menu_id == "9hv") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m9hv {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////New Jersey
if (menu_id == "9nj") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m9nj {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Long Island
if (menu_id == "9li") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m9li {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Connecticut
if (menu_id == "9ct") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m9ct {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////School Web Sites
if (menu_id == "9sw") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m9sw {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////MENU 9.1 BLOGS
if (menu_id == "9.1") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9.1 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}
////Blogs Front Page
if (menu_id == "9-1bfp") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9-1 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m9-1bfp {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Digital Smarts Blog
if (menu_id == "9-1dsb") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9-1 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m9-1dsb {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Teachnology Blog
if (menu_id == "9-1tb") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9-1 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m9-1tb {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Teaching with Technology Podcast
if (menu_id == "9-1twtp") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub9-1 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m9-1twtp {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////MENU 10 GAMES
if (menu_id == "10") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub10 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}

if (menu_id == "10gm") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub10 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m10gm {color:#333399; font-weight:bold;}')
document.write('</style>')
}

//MENU 11 FOR TEACHERS
////NOT OPEN
if (menu_id == "11") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}
////Teachers Front Page
if (menu_id == "11tf") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m11tf {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Teachnology Blog
if (menu_id == "11tb") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m11tb {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Teaching with Technology
if (menu_id == "11tt") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m11tt {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Technology Resources for Teachers
if (menu_id == "11trt") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m11trt {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Software Reviews
if (menu_id == "11sr") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m11sr {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Teachnet Grant Program
if (menu_id == "11tng") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m11tng {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Teachner of the Month
if (menu_id == "11tom") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m11tom {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Cables Leaders in Learning Awards
if (menu_id == "11ll") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m11ll {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Teachers Network
if (menu_id == "11tn") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m11tn {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Lesson Activities
if (menu_id == "11la") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m11la {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Gadget Gals
if (menu_id == "11gg") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub11 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m11gg {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////MENU 12 FOR PARENTS
if (menu_id == "12") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub12 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}
////Parents Front Page
if (menu_id == "12pf") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub12 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m12pf {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Parenting with Teachnology
if (menu_id == "12pt") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub12 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m12pt {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Technology Resources for Parents
if (menu_id == "12trp") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub12 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m12trp {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////State Testing Info
if (menu_id == "12st") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub12 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m12st {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Parent Academy
if (menu_id == "12pa") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub12 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m12pa {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////TV Smarts
if (menu_id == "12tv") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub12 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m12tv {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Special Needs
if (menu_id == "12sn") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub12 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m12sn {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Software Reviews
if (menu_id == "12sr") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub12 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m12sr {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Gadget Gals
if (menu_id == "12gg") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub12 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m12gg {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////MENU 13 FOR STUDENT
if (menu_id == "13") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub13 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}
////Student Front Page
if (menu_id == "13sf") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub13 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m13sf {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Computers and Homework
if (menu_id == "13ch") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub13 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m13ch {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////MENU 14 MATH MVPS
if (menu_id == "14") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub14 {display: block;}')
document.write('.submenu {display: none;}')
document.write('</style>')
}
////Math MVPs Front Page
if (menu_id == "14fp") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub14 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m14fp {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Postcard Club
if (menu_id == "14pc") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub14 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m14pc {color:#333399; font-weight:bold;}')
document.write('</style>')
}
////Math Program
if (menu_id == "14mp") {	
document.write('<style type="text/css">')
document.write('.submenu, #sub14 {display: block;}')
document.write('.submenu {display: none;}')
document.write('#m14mp {color:#333399; font-weight:bold;}')
document.write('</style>')
}

////IF PAGE HAS NO MENU_IS DISPLAY CLOSED MENU LIKE HOME
else {
document.write('<style type="text/css">')
document.write('.submenu {display: none;}')
document.write('</style>')
}
//END MENU STATE FUNCTIONS ##################################################








// BEGIN DOM Image Rollover II used for form submit rollover button can be used for any image rollover ##########################################

//Effect Sample HTML 
// Rollover only on image. <img src="original.jpg" srcover="over.jpg"> 
// Rollover and Mousedown. <img src="original.jpg" srcover="over.jpg" srcdown="down.jpg">
// Rollover and Mousedown on submit button. <input type="image" name="submitimg" src="original.jpg" srcover="over.jpg" srcdown="down.jpg" border="0"> 


function imageholderclass(){
	this.over=new Array();
	this.down=new Array();
	this.src=new Array();
	this.store=store;
	
	function store(src, down, over){
		var AL=this.src.length;
		this.src[AL]=new Image(); this.src[AL].src=src;
		this.over[AL]=new Image(); this.over[AL].src=over;
		this.down[AL]=new Image(); this.down[AL].src=down;
	}
}

var ih = new imageholderclass();
var mouseisdown=0;

function preloader(t){
	for(i=0;i<t.length;i++){
		if(t[i].getAttribute('srcover')||t[i].getAttribute('srcdown')){
			
			storeimages(t[i]);
			var checker='';
			checker=(t[i].getAttribute('srcover'))?checker+'A':checker+'';
			checker=(t[i].getAttribute('srcdown'))?checker+'B':checker+'';
			
			switch(checker){
			case 'A' : mouseover(t[i]);mouseout(t[i]); break;
			case 'B' : mousedown(t[i]); mouseup2(t[i]); break;
			case 'AB' : mouseover(t[i]);mouseout(t[i]); mousedown(t[i]); mouseup(t[i]); break;
			default : return;			
			}
			
			if(t[i].src){t[i].setAttribute("oldsrc",t[i].src);}
		}
	}
}
function mouseup(t){
	var newmouseup;
	if(t.onmouseup){
		t.oldmouseup=t.onmouseup;
		newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");this.oldmouseup();}

	}
	else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");}}
	t.onmouseup=newmouseup;
}

function mouseup2(t){
	var newmouseup;
	if(t.onmouseup){
		t.oldmouseup=t.onmouseup;
		newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");this.oldmouseup();}
		}
	else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");}}
	t.onmouseup = newmouseup;
}

function mousedown(t){
	var newmousedown;
	if(t.onmousedown){
		t.oldmousedown=t.onmousedown;
		newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");this.oldmousedown();}}
	}
	else{newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");}}}
	t.onmousedown=newmousedown;
}

function mouseover(t){
	var newmouseover;
	if(t.onmouseover){
		t.oldmouseover=t.onmouseover;
		newmouseover=function(){this.src=this.getAttribute("srcover");this.oldmouseover();}
	}
	else{newmouseover=function(){this.src=this.getAttribute("srcover");}}
	t.onmouseover=newmouseover;
}

function mouseout(t){
	var newmouseout;
	if(t.onmouseout){
		t.oldmouseout=t.onmouseout;
		newmouseout=function(){this.src=this.getAttribute("oldsrc");this.oldmouseout();}
	}
	else{newmouseout=function(){this.src=this.getAttribute("oldsrc");}}
	t.onmouseout=newmouseout;
}

function storeimages(t){
	var s=(t.getAttribute('src'))?t.getAttribute('src'):'';
	var d=(t.getAttribute('srcdown'))?t.getAttribute('srcdown'):'';
	var o=(t.getAttribute('srcover'))?t.getAttribute('srcover'):'';
	ih.store(s,d,o);
}

function preloadimgsrc(){
	if(!document.getElementById) return;
	var it=document.getElementsByTagName('IMG');
	var it2=document.getElementsByTagName('INPUT');
	preloader(it);
	preloader(it2);
}

if(window.addEventListener){window.addEventListener("load", preloadimgsrc, false);} 
else{
	if(window.attachEvent){window.attachEvent("onload", preloadimgsrc);}
	else{if(document.getElementById){window.onload=preloadimgsrc;}}
}
//###END #################################################################################

