
// horizontal navigation buttons on HTML pages
a1 = new Image(); 
a1.src = "/img/SAT.jpg"; // when mouse is not over the image
a2 = new Image(); 
{a2.src = "/img/SATDown.jpg";} // when mouse is over the image
b1 = new Image(); 
b1.src = "/img/PSAT.jpg"; // when mouse is not over the image
b2 = new Image(); 
{b2.src = "/img/PSATDown.jpg";} // when mouse is over the image
j1 = new Image(); 
j1.src = "/img/ACT.jpg"; // when mouse is not over the image
j2 = new Image(); 
{j2.src = "/img/ACTDown.jpg";} // when mouse is over the image 


//change button image on mouseover
function PicChange(ImageName,NewImage) 
{
document.images[ImageName].src = eval(NewImage + ".src");
}

//change button color on mouseover
function ButtonHL(obj,NewClass) {
   			obj.className=NewClass;
  }		

//user Home screen navigation to new page within frame "FEATURE"   -  onclick          
function framesNav(NewPage) {
		   parent.frames['FEATURE'].location=NewPage;
}  

//main site Home screen navigation to new page   -  onclick          
function mainNav(NewPage) {
		   parent.window.location=NewPage;
}

//exam screen navigation to new page   -  onclick          
function examNav(NewPage) {

		   top.location=NewPage;
}	

//exam screen navigation to new page   -  onclick          
function verifyUser(NewPage,v_license_id) {
var license = eval(v_license_id);
var queryStr = "?" + "i_license_id=" + license.value;
var newUrl = NewPage + queryStr;
		   top.location= newUrl;
} 	

//exam screen navigation to report card   -  onclick          
function gotoReport(NewPage,v_exam_id) {
var exam = eval(v_exam_id);
var queryStr = "?" + "i_exam_id=" + exam.value;
var newUrl = NewPage + queryStr;
		   window.location= newUrl;
} 	

//exam screen navigation to new page   -  onclick          
//function nextsection(NewPage,v_exam_id,current_section) {
//var exam = eval(v_exam_id);
//var section = eval(current_section);
//var queryStr = "?" + "i_exam_id=" + exam + "&" + "i_section_num=" + section;
//var newUrl = NewPage + queryStr;
		   //new.location= newUrl;
//}

function LogOut1() {
		 top.location="testprep/admin.log_out";
}		

function LogOut2() {
		 top.location="admin.log_out";
}	

//function winClose() {
//     myWindow.close()
//}
//myWindow = window.open("", "tinyWindow", 'width=150, height=110')
//myWindow.document.write("This window will close automatically after five seconds. Thanks for your patience")
//self.setTimeout('winClose()', 5000) 

//test tips drop-down list navigation
function goA(){
location = document.testtips.basic.options[document.testtips.basic.selectedIndex].value
 		   	  }
	
function goB(){
if (document.testtips.verbal.options[document.testtips.verbal.selectedIndex].value != "none") {
location = document.testtips.verbal.options[document.testtips.verbal.selectedIndex].value
}
 		      }

function goC(){
if (document.testtips.writing.options[document.testtips.writing.selectedIndex].value != "none") {
location = document.testtips.writing.options[document.testtips.writing.selectedIndex].value
}
 		      }

function goD(){
if (document.testtips.math.options[document.testtips.math.selectedIndex].value != "none") {
location = document.testtips.math.options[document.testtips.math.selectedIndex].value
}
 		      }
			  
function goE(){
if (document.testtips.keyfacts.options[document.testtips.keyfacts.selectedIndex].value != "none") {
location = document.testtips.keyfacts.options[document.testtips.keyfacts.selectedIndex].value
}
 		      }
			  
function goF(){
if (document.testtips.english.options[document.testtips.english.selectedIndex].value != "none") {
location = document.testtips.english.options[document.testtips.english.selectedIndex].value
}
 		      }
			  
function goG(){
if (document.testtips.actmath.options[document.testtips.actmath.selectedIndex].value != "none") {
location = document.testtips.actmath.options[document.testtips.actmath.selectedIndex].value
}
 		      }
			  
function goH(){
if (document.testtips.reading.options[document.testtips.reading.selectedIndex].value != "none") {
location = document.testtips.reading.options[document.testtips.reading.selectedIndex].value
}
 		      }
			  
function goI(){
if (document.testtips.science.options[document.testtips.science.selectedIndex].value != "none") {
location = document.testtips.science.options[document.testtips.science.selectedIndex].value
}
 		      }			  	
			  
function goJ(){
if (document.testtips.essay.options[document.testtips.essay.selectedIndex].value != "none") {
location = document.testtips.essay.options[document.testtips.essay.selectedIndex].value
}
 		      }						  		  			  			  

  
//exam list menu and submenus 
 function InitMenu()
   {
     var bar = menuBar.children     

     for(var i=0;i < bar.length;i++) 
        {
          var menu=eval(bar[i].menu)
          menu.style.visibility = "hidden"
          bar[i].onmouseover = new Function("ShowMenu("+bar[i].id+")")
          var Items = menu.children
          for(var j=0; j<Items.length; j++)
            {
              var menuItem = eval(Items[j].id)
                
                if(menuItem.menu != null)
                   { 
                    //**adds arrow**//menuItem.innerHTML += "<Span Id="+menuItem.id+"_Arrow class='Arrow'>4</Span>"
                    //var tmp = eval(menuItem.id+"_Arrow")
                    // tmp.style.pixelLeft = menu.getBoundingClientRect().Right //- tmp.offsetWidth - 15
                    FindSubMenu(menuItem.menu) }
               
                 if(menuItem.cmd != null) 
                   {
                   menuItem.onclick = new Function("Do("+menuItem.id+")") } 
                   
              menuItem.onmouseover = new Function("highlight("+Items[j].id+")")
            
            }    
        
        }  
   }
   
   function FindSubMenu(subMenu)
   {
         var menu=eval(subMenu)
         var Items = menu.children
          for(var j=0; j<Items.length; j++)
            {
              menu.style.visibility = "hidden"
              var menuItem = eval(Items[j].id)
              
              
              if(menuItem.menu!= null)
                 {
                    //menuItem.innerHTML += "<Span Id="+menuItem.id+"_Arrow class='Arrow'>4</Span>"
                    // var tmp = eval(menuItem.id+"_Arrow")
                    //tmp.style.pixelLeft = 35 //menuItem.getBoundingClientRect().right - tmp.offsetWidth - 15
                    FindSubMenu(menuItem.menu)
                 }

                 if(menuItem.cmd != null) 
                   {
                   menuItem.onclick = new Function("Do("+menuItem.id+")") } 
                  
              menuItem.onmouseover = new Function("highlight("+Items[j].id+")")
                 
            }  
   } 
   
   function ShowMenu(obj)
   {
     HideMenu(menuBar)
     var menu = eval(obj.menu)
     var bar = eval(obj.id)
     bar.className="barOver"
     menu.style.visibility = "visible"
     menu.style.pixelTop =  obj.getBoundingClientRect().top + obj.offsetHeight + Bdy.scrollTop
     menu.style.pixelLeft = obj.getBoundingClientRect().left + Bdy.scrollLeft + 50
   }
   
   function highlight(obj)
   {
     var PElement = eval(obj.parentElement.id)
     if(PElement.hasChildNodes() == true)
     {  var Elements = PElement.children
       for(var i=0;i<Elements.length;i++)
       {
          TE = eval(Elements[i].id)
          TE.className = "menuItem"
       }
      } 
     obj.className="ItemMouseOver"
     window.defaultStatus = obj.title
     ShowSubMenu(obj)
   }
   
   function Do(obj)
   {
    var cmd = eval(obj).cmd	
    window.navigate(cmd)
     
   }
   
   function HideMenu(obj)
   {
          if(obj.hasChildNodes()==true)
              {  
                 var child = obj.children     
                 
                 for(var j =0;j<child.length;j++)
                  {
                     if (child[j].className=="barOver")
                     {var bar = eval(child[j].id)
                      bar.className="Bar"}
                      
                     if(child[j].menu != null)
                       {
                          var childMenu = eval(child[j].menu)
                          if(childMenu.hasChildNodes()==true) 
                               HideMenu(childMenu)
                          
                           childMenu.style.visibility = "hidden" 
                         }
                  }
              
              }
   }
   
  function ShowSubMenu(obj)
  {
     PMenu = eval(obj.parentElement.id)
      HideMenu(PMenu)
     if(obj.menu != null)
     {
     var menu = eval(obj.menu)
     menu.style.visibility = "visible"
     menu.style.pixelTop =  obj.getBoundingClientRect().top + Bdy.scrollTop
     menu.style.pixelLeft = obj.getBoundingClientRect().right + Bdy.scrollLeft
     if(menu.getBoundingClientRect().right > window.screen.availWidth )
       menu.style.pixelLeft = obj.getBoundingClientRect().left - menu.offsetWidth
    }
  } 

	