﻿// JScript File
<!--


 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function swapMenuClass(d1, d2)
{
    document.getElementById(d1).style.display='block';
    document.getElementById(d2).style.display='none';
}

function movePic(id, amount)
{

   // document.getElementById(id).style.backgroundPosition=amount;
    
    if (navigator.appName.indexOf('Netscape') != -1)   {       
        // changes the position accordingly     
        var style = document.getElementById(id).style;
        style.backgroundPosition  = amount;    
        }
    else
    {
        var style = document.getElementById(id).style;
        style.backgroundPosition = amount;
    }
}

function align()
{

   // document.getElementById(id).style.backgroundPosition=amount;
    
   // if (navigator.appName.indexOf('Firefox/') != -1)   {  
   if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){     
        // changes the position accordingly     
         var style = document.getElementById('header_search').style;
         style.top="23px"; 
         style.left="11px";   
         
      }
      
    else
    {
        }
}
function showhide_topsubnav(e1,sh,e2,bg)
{

    document.getElementById(e1).style.display=sh;
    document.getElementById(e2).style.backgroundColor = bg;
    showhide_topExtraSearch('showExtraSearch2','none','header_search','#666666');
}

function showhide_searchnav(e1,sh,e2,bg)
{
    document.getElementById(e1).style.display=sh;
    document.getElementById(e2).style.backgroundColor = bg;
}


function showhide_topExtraSearch(e1,sh,e2,bg)
{
    document.getElementById(e1).style.display=sh;  
    //document.getElementById('ctl00_Header_SearchBox1_ctl00_ctl00_queryText').focus();   
}

function setSearchToNone()
{
    document.getElementById('ctl00_Header_SearchBox1_ctl00_ctl00_queryText').style.display=none  
}

var done;

function showExtraSearch(){
   
   if(done!=1){
      // create a DIV element, using the variable eDIV as a reference to it
    eDIV = document.createElement("div");
    //use the setAttribute method to assign it an id
    eDIV.setAttribute("id","extraSearch");
    //eDIV.setAttribute("style","background-color:#000000; height: 50px;");
    // create your anchor element
    eAnchor = document.createElement("a");
    // set its href attribute with the setAttribute method
    eAnchor.setAttribute("href","~/Academics/Majors.aspx");
    eAnchor.setAttribute("style","color:#007FAC; text-decoration:none; background-color:#000000; filter: alpha(opacity=73);-moz-opacity: 0.73; height: 50px;");
   
    // add the text "hello world" to the anchor element
    eAnchor.appendChild(document.createTextNode("Search for majors"));
    // append your newly created anchor element to the div
    eDIV.appendChild(eAnchor);
    // append your newly created DIV element to an already existing element.
    document.getElementById("showExtraSearch").appendChild(eAnchor);
    }
    done=1;
}
//-->

