// DATE FUNCTION 
function write_date()
{

  var today=new Date();
  if (today.getDay() == 0) {document.write("Sunday, ");}
  if (today.getDay() == 1) {document.write("Monday, ");}
  if (today.getDay() == 2) {document.write("Tuesday, ");}
  if (today.getDay() == 3) {document.write("Wednesday, ");}
  if (today.getDay() == 4) {document.write("Thursday, ");}
  if (today.getDay() == 5) {document.write("Friday, ");}
  if (today.getDay() == 6) {document.write("Saturday, ");}

  if (today.getMonth() == 0) {document.write("January ");}
  if (today.getMonth() == 1) {document.write("February ");}
  if (today.getMonth() == 2) {document.write("March ");}
  if (today.getMonth() == 3) {document.write("April ");}
  if (today.getMonth() == 4) {document.write("May ");}
  if (today.getMonth() == 5) {document.write("June ");}
  if (today.getMonth() == 6) {document.write("July ");}
  if (today.getMonth() == 7) {document.write("August ");}
  if (today.getMonth() == 8) {document.write("September ");}
  if (today.getMonth() == 9) {document.write("October ");}
  if (today.getMonth() == 10) {document.write("November ");}
  if (today.getMonth() == 11) {document.write("December ");}

  document.write(today.getDate()+", ");
  var year=today.getYear();
  if (year < 2000) {year = year + 1900;}
  document.write(year);
}

// ROLLOVER IMAGES
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_over = newImage("/images/home-over.jpg");
		about_over = newImage("/images/about-over.jpg");
		board_over = newImage("/images/board-over.jpg");
		superintendent_over = newImage("/images/superintendent-over.jpg");
		staff_over = newImage("/images/staff-over.jpg");
		resources_over = newImage("/images/resources-over.jpg");
		district_over = newImage("/images/district-over.jpg");
		sitemap_over = newImage("/images/sitemap-over.jpg");
		pill_search_over = newImage("/images/pill_search-over.jpg");
		preloadFlag = true;
	}
}

// RANDOM IMAGE

var imagenumber = 15 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1]  = "/images/big_image01.jpg"
images[2]  = "/images/big_image02.jpg"
images[3]  = "/images/big_image03.jpg"
images[4]  = "/images/big_image04.jpg"
images[5]  = "/images/big_image05.jpg"
images[6]  = "/images/big_image06.jpg"
images[7]  = "/images/big_image07.jpg"
images[8]  = "/images/big_image08.jpg"
images[9]  = "/images/big_image09.jpg"
images[10] = "/images/big_image01.jpg"
images[11] = "/images/big_image02.jpg"
images[12] = "/images/big_image03.jpg"
images[13] = "/images/big_image04.jpg"
images[14] = "/images/big_image05.jpg"
images[15] = "/images/big_image06.jpg"
var image = images[rand1]


// POPUP MENUS
var linkset=new Array()

//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT

//ADMINISTRATIVE SERVICES

linkset[0]='<div class="menuitems"><a href="http://www.bcoe.org/admin/forms/">Forms Index</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[0]+='<div class="menuitems"><a href="http://www.bcoe.org/admin/ap/">Accounts Payable</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[0]+='<div class="menuitems"><a href="http://www.bcoe.org/admin/mof/">Maintenance/Ops. & Facilities</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[0]+='<div class="menuitems"><a href="http://www.bcoe.org/admin/its/">Information Technology Services</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[0]+='<div class="menuitems"><a href="http://www.bcoe.org/admin/is/">Information Systems</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[0]+='<div class="menuitems"><a href="http://www.bcoe.org/admin/ds/">District Business Services</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[0]+='<div class="menuitems"><a href="http://www.bcoe.org/admin/budget/">Budgets</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[0]+='<div class="menuitems"><a href="http://www.bcoe.org/admin/financial/">Financial</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[0]+='<div class="menuitems"><a href="http://www.bcoe.org/admin/op/procedures.htm">Procedures</a><br><img src="http://www.bcoe.org/images/spacer.gif" alt="" width="200" height="1" border="0"></div>'

//CALIFORNIA MINI-CORPS
linkset[1]= '<div class="menuitems"><a href="http://www.bcoe.org/minicorps/syp/">School Year Program</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[1]+='<div class="menuitems"><a href="http://www.bcoe.org/minicorps/sp/">Summer Program</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[1]+='<div class="menuitems"><a href="http://www.bcoe.org/minicorps/pe/">Program Evaluation</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[1]+='<div class="menuitems"><a href="http://www.bcoe.org/minicorps/sd/">Staff Development</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[1]+='<div class="menuitems"><a href="http://www.bcoe.org/minicorps/mcps/">Mini-Corps Program Sites</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[1]+='<div class="menuitems"><a href="http://www.bcoe.org/minicorps/forms/">Program Forms</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[1]+='<div class="menuitems"><a href="http://www.bcoe.org/minicorps/resources/">Instructional Resources</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'

//EDUCATIONAL SUPPORT SERVICES
linkset[2]= '<div class="menuitems"><a href="http://www.bcoe.org/ess/asp/">After School</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/btsa/">BTSA/Credentialing</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/cdl/">CADRE</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/cd/">Child Development</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/training/">Computer Training</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/data/">Data</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/dsc/">Designated Subjects Credentials</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/ds/">Direct Support</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/ell/">English Language Learners</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/hp/">Health and Safety</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/av/">Library Media Services</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/maa/">MAA</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/math/">Mathematics</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/reading/">Reading</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[2]+='<div class="menuitems"><a href="http://www.bcoe.org/ess/tech/">Technology in Curriculum</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'

//MIGRANT EDUCATION
linkset[3]= '<div class="menuitems"><a href="http://www.bcoe.org/migrant/ir/">Identification & Recruitment</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[3]+='<div class="menuitems"><a href="http://www.bcoe.org/migrant/ftp/">First Teacher Program</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[3]+='<div class="menuitems"><a href="http://www.bcoe.org/migrant/is/">Instructional Services</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[3]+='<div class="menuitems"><a href="http://www.bcoe.org/migrant/hs/">Health Services</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[3]+='<div class="menuitems"><a href="http://www.bcoe.org/migrant/pass/">PASS/Cyber High</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[3]+='<div class="menuitems"><a href="http://www.bcoe.org/migrant/meap/">MEAP - Advisor Program</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[3]+='<div class="menuitems"><a href="http://www.bcoe.org/migrant/msis/">MSIS - Information System</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[3]+='<div class="menuitems"><a href="http://www.bcoe.org/migrant/osy/">Out of School Youth Services</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[3]+='<div class="menuitems"><a href="http://www.bcoe.org/migrant/pei/">Parent Education/Involvement</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[3]+='<div class="menuitems"><a href="http://www.bcoe.org/migrant/sfs/">Summer Food Services</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[3]+='<div class="menuitems"><a href="http://www.bcoe.org/migrant/events/">Special Events & Calendar</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[3]+='<div class="menuitems"><a href="http://www.bcoe.org/migrant/forms/">Migrant Education Forms</a><br><img src="http://www.bcoe.org/images/spacer.gif" alt="" width="200" height="1" border="0"></div>'

//STUDENT PROGRAMS & SERVICES
linkset[4]= '<div class="menuitems"><a href="http://www.bcoe.org/sps/schools/">BCOE Schools</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[4]+='<div class="menuitems"><a href="http://www.bcoe.org/sps/cwat/">Child Welfare and Attendance</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[4]+='<div class="menuitems"><a href="http://www.bcoe.org/sps/homeless/">Homeless Education</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[4]+='<div class="menuitems"><a href="http://www.bcoe.org/evenstart/">Migrant Education Even Start</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[4]+='<div class="menuitems"><a href="http://www.bcoe.org/rop/">Regional Occupational Program</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[4]+='<div class="menuitems"><a href="http://www.bcoe.org/sps/se/">Special Education</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[4]+='<div class="menuitems"><a href="http://www.bcoe.org/sps/casd/">Curriculum/Assessments/<br />&nbsp;Staff Development</a><br><img src="http://www.bcoe.org/images/spacer.gif" alt="" width="200" height="1" border="0"></div>'

//HUMAN RESOURCES
linkset[5]= '<div class="menuitems"><a href="http://www.bcoe.org/hr/payroll/default.htm">Payroll</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[5]+= '<div class="menuitems"><a href="http://www.bcoe.org/hr/forms/default.htm ">Forms</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[5]+= '<div class="menuitems"><a href="http://www.bcoe.org/hr/credentials.htm ">Credentials</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'
linkset[5]+= '<div class="menuitems"><a href="http://www.bcoe.org/hr/staff.htm">Staff</a><br><img src="http://www.bcoe.org/images/blackDot.gif" alt="" width="200" height="1" border="0"></div>'


////No need to edit beyond here

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers

function showmenu(e,which){

if (!document.all&&!document.getElementById&&!document.layers)
return

clearhidemenu()

menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

if (ie4||ns6)
menuobj.innerHTML=which
else{
menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
menuobj.document.close()
}

menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
eventX=ie4? event.clientX : ns6? e.clientX : e.x
eventY=ie4? event.clientY : ns6? e.clientY : e.y

//Find out how close the mouse is to the corner of the window
var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.thestyle.left=ie4? document.body.scrollLeft+194 : ns6? window.pageXOffset+194 : 194

//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.thestyle.top=ie4? document.body.scrollTop+eventY-menuobj.contentheight : ns6? window.pageYOffset+eventY-menuobj.contentheight : eventY-menuobj.contentheight
else
menuobj.thestyle.top=ie4? document.body.scrollTop+event.clientY : ns6? window.pageYOffset+eventY : eventY
menuobj.thestyle.visibility="visible"
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
}

function dynamichide(e){
if (ie4&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
if (ie4||ns6||ns4)
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

function highlightmenu(e,state){
if (document.all)
source_el=event.srcElement
else if (document.getElementById)
source_el=e.target
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
else{
while(source_el.id!="popmenu"){
source_el=document.getElementById? source_el.parentNode : source_el.parentElement
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
}
}
}

if (ie4||ns6)
document.onclick=hidemenu


