function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function aboutusmenu_over(){
	hide_all_menus();
	togglemenu('aboutusmenu',1);
}
function datesmenu_over(){
	hide_all_menus();
	togglemenu('datesmenu',1);
}
function newsmenu_over(){
	hide_all_menus();
	togglemenu('newsmenu',1);
}
function parentsmenu_over(){
	hide_all_menus();
	togglemenu('parentsmenu',1);
}
function studentsmenu_over(){
	hide_all_menus();
	togglemenu('studentsmenu',1);
}
function recruitmentmenu_over(){
	hide_all_menus();
	togglemenu('recruitmentmenu',1);
}
function boundry_over(){
	hide_all_menus();
}
function hide_all_menus(){
	togglemenu('aboutusmenu',0);
	togglemenu('datesmenu',0);
	togglemenu('newsmenu',0);	
	togglemenu('parentsmenu',0);	
	togglemenu('studentsmenu',0);	
	togglemenu('recruitmentmenu',0);	
}

function togglemenu(szDivID, iState) // 1 visible, 0 hidden
{
	
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}
function display_div(szDivID, iState) // 1 visible, 0 hidden
{
	
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].display = iState
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.display = iState
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.display = iState
    }
}


function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
}
// ****************
// NB: Don't Call JavaScript and ActionScript Functions the same name - breaks in IE!!!
// ****************
function UnselectFlashButtons()
{
	getFlashMovie('top_flash').asUnselectButtons();
}
function SelectFlashButtons(button_name)
{
	getFlashMovie('top_flash').asSelectButtons(button_name);
}
function SendFlashText(textbox_name,textbox_text,movie_name)
{
	getFlashMovie('top_flash').asSendFlashText(textbox_name,textbox_text,movie_name);
}
function LoadFlashImage(image_name,image_path)
{
	getFlashMovie('top_flash').asLoadFlashImage(image_name,image_path);
}
function SetFlashMode(flash_mode)
{
	getFlashMovie('top_flash').asSetFlashMode(flash_mode);
}
function CriticalIncident(ci)
{
	getFlashMovie('top_flash').asCriticalIncident(ci);
}
function positionmenus()
{

if (document.body.offsetWidth)
{
	if (document.body.offsetWidth<1024){
		aboutusmenu_left = 346
		datesmenu_left = 432
		newsmenu_left = 499
		parentsmenu_left = 564	
		studentsmenu_left = 640	
		recruitmentmenu_left = 686
		cimessage_left = 5
		ciupdated_left = 5		
		weekno_left = 686		
	}
	else {
		aboutusmenu_left = ((document.body.offsetWidth-778)/2)+260
		datesmenu_left = ((document.body.offsetWidth-778)/2)+346
		newsmenu_left = ((document.body.offsetWidth-778)/2)+413
		parentsmenu_left = ((document.body.offsetWidth-778)/2)+478
		studentsmenu_left = ((document.body.offsetWidth-778)/2)+554	
		recruitmentmenu_left = ((document.body.offsetWidth-778)/2)+637
		cimessage_left = ((document.body.offsetWidth-778)/2)-81	
		ciupdated_left = ((document.body.offsetWidth-778)/2)-81			
		weekno_left = ((document.body.offsetWidth-778)/2)+585		
	}
}
else if (window.innerWidth)
{
	if (document.body.offsetWidth<1024){
		aboutusmenu_left = 346
		datesmenu_left = 432
		newsmenu_left = 499
		parentsmenu_left = 564	
		studentsmenu_left = 640	
		recruitmentmenu_left = 686
		cimessage_left = 5
		ciupdated_left = 5		
		weekno_left = 686		
	}
	else {
		aboutusmenu_left = ((window.innerWidth-778)/2)+260
		datesmenu_left = ((window.innerWidth-778)/2)+346
		newsmenu_left = ((window.innerWidth-778)/2)+413
		parentsmenu_left = ((window.innerWidth-778)/2)+478	
		studentsmenu_left = ((window.innerWidth-778)/2)+554	
		recruitmentmenu_left = ((window.innerWidth-778)/2)+637				
		cimessage_left = ((window.innerWidth-778)/2)-81				
		ciupdated_left = ((window.innerWidth-778)/2)-81						
		weekno_left = ((window.innerWidth-778)/2)+585						
	}
}

    if(document.layers)	   //NN4+
    {
       document.layers['aboutusmenu'].left = aboutusmenu_left;
       document.layers['datesmenu'].left = datesmenu_left;
       document.layers['newsmenu'].left = newsmenu_left;
       document.layers['parentsmenu'].left = parentsmenu_left;
       document.layers['studentsmenu'].left = studentsmenu_left;
       document.layers['recruitmentmenu'].left = recruitmentment_left;
       document.layers['cimessage'].left = cimessage_left;	  
       document.layers['ciupdated'].left = ciupdated_left;	  	   
       document.layers['weekno'].left = weekno_left;	  	   	   
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById('aboutusmenu');
        obj.style.left = aboutusmenu_left+'px';
        var obj = document.getElementById('datesmenu');
        obj.style.left = datesmenu_left+'px';
        var obj = document.getElementById('newsmenu');
        obj.style.left = newsmenu_left+'px';
        var obj = document.getElementById('parentsmenu');
        obj.style.left = parentsmenu_left+'px';
        var obj = document.getElementById('studentsmenu');
        obj.style.left = studentsmenu_left+'px';
        var obj = document.getElementById('recruitmentmenu');
        obj.style.left = recruitmentmenu_left+'px';
        var obj = document.getElementById('cimessage');
        obj.style.left = cimessage_left+'px';		
        var obj = document.getElementById('ciupdated');
        obj.style.left = ciupdated_left+'px';				
        var obj = document.getElementById('weekno');
        obj.style.left = weekno_left+'px';						
    }
    else if(document.all)	// IE 4
    {
        document.all['aboutusmenu'].style.left = aboutusmenu_left;
        document.all['datesmenu'].style.left = datesmenu_left;
        document.all['newsmenu'].style.left = newsmenu_left;
        document.all['parentsmenu'].style.left = parentsmenu_left;
        document.all['studentsmenu'].style.left = studentsmenu_left;
        document.all['recruitmentmenu'].style.left = recruitmentmenu_left;
        document.all['cimessage'].style.left = cimessage_left;		
        document.all['ciupdated'].style.left = ciupdated_left;				
        document.all['weekno'].style.left = weekno_left;						
    }

}
