// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// philau.js
//
// Javascript functions for the Philadelphia University Web site: 
// USE FOR ALL TOP LEVEL PAGES ALONG WITH MM_MENU.JS
//
// last updated 4/01/03
//
// Questions? Comments: <webmaster@PhilaU.edu>

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//

// ******************************************************************

// window shade code

var xs_bv=0;

// set horizontal position //

var xs_philauTop=-87;
var xs_philauHeight=210;
var xs_updown=1;
var xs_endpt=0;
var xs_ranonce=0;
var xs_philauDivSeen=0;
var xs_philauTuck=0;
var ua=navigator.userAgent.toLowerCase()
function xsGetCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function xsGetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return xsGetCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break; }
return null;
}
function xsSetCookie (name,value,expires,path,domain,secure) {
document.cookie = name + "=" + escape (value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
var xs_exp = new Date(); xs_exp.setTime(xs_exp.getTime()+(48*60*60*1000));
if ( (ua.indexOf("opera")==-1)&&((ua.indexOf("msie")!=-1)&&(ua.indexOf("windows")!=-1))||((ua.indexOf("msie 5")!=-1)&&(ua.indexOf("mac")!=-1)) ) {xs_bv=1}
function xs_philaudEx(){
var xs_philauopval = xsGetCookie('seenexp');
if ((xs_philauopval == null) || (xs_philauopval != "47")) {
xs_philauopval=47;
xsSetCookie('seenexp', xs_philauopval, xs_exp, "/");
var xs_ctest = (xsGetCookie('seenexp')=="47");
}
if((xs_bv)&&(!xs_ranonce)&&(xs_ctest!=null)){
// if((xs_bv)&&(!xs_ranonce)){
xs_philauDiv2.style.left=xs_philauDiv.style.left=((document.body.offsetWidth/2)-160)
xs_philaud();
}
else{
if(xs_philauTuck == 1){
if (xs_philauDivSeen != 1){
xs_philauDiv.style.clip="rect(0,320,210,0)";
xs_philauDiv.style.display="";
xs_philauDiv.style.top=31;
}
xs_endpt=(document.body.offsetWidth/2)-20; // # sets reset space of floater (higher = farther left) //
xs_tuck();
}
}
}
function xs_philaud(){
xs_ranonce=1;
if (((xs_philauHeight<210)&&(xs_updown==0)) || ((xs_philauHeight>3)&&(xs_updown==1))) {
if(xs_philauHeight==210){xs_philauDiv.style.display=""}
(xs_updown==0)?xs_philauHeight+=3:xs_philauHeight-=3;
(xs_updown==0)?xs_philauTop-=3:xs_philauTop+=3;
xs_philauDiv.style.clip="rect(" + xs_philauHeight + ",320,210,0)";
xs_philauDiv.style.top=xs_philauTop;
setTimeout("xs_philaud();",20);
}
else{
if (xs_updown==1){
xs_philauDiv.style.clip="rect(0,320,210,0)";
xs_philauDiv.style.top=122;
xs_updown=0;
xs_philauDiv2.style.display='';
setTimeout("xs_philaud();",9999);
}
else{
xs_philauDiv.style.display='none';
xs_philauDivSeen = 1;
xs_endpt=(document.body.offsetWidth/2)-160;
xs_tuck();
}
}
}
function xs_tuck(){
if(xs_endpt<(document.body.offsetWidth-490)){
xs_endpt+=3; // right point and speed of floater //
xs_philauDiv2.style.left=xs_endpt;
setTimeout("xs_tuck();",20);
}
else{xs_philauTuck = 1}
}
// end window shade

<!-- // one time pop-up code

var oneTimeWinName = "oneTimePop"
function openPopWinOnce(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
  var d_winLeft = 20  // default, pixels from screen left to window left
  var d_winTop = 20   // default, pixels from screen top to window top
  var popcookies = document.cookie
  if (openPopWinOnce.arguments.length >= 4)  // any additional features? 
    winFeatures = "," + winFeatures
  else 
    winFeatures = "" 
  if (openPopWinOnce.arguments.length == 6)  // location specified
    winFeatures += getLocationOne(winWidth, winHeight, winLeft, winTop)
  else
    winFeatures += getLocationOne(winWidth, winHeight, d_winLeft, d_winTop)
  if (popcookies.indexOf(oneTimeWinName) == -1){ // cookie not found 
    window.open(winURL, oneTimeWinName, "width=" + winWidth 
           + ",height=" + winHeight + winFeatures)
    document.cookie=oneTimeWinName+"=used"
    }
  }
function openPopWinOnceBack(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
  openPopWinOnce(winURL, winWidth, winHeight, winFeatures, winLeft, winTop)
  self.focus()
  }
function getLocationOne(winWidth, winHeight, winLeft, winTop){
  return ""
  }
//-->

// for Netscape 4+ and IE 4+
<!--
function getLocationOne(winWidth, winHeight, winLeft, winTop){
  var winLocation = ""
  if (winLeft < 0)
    winLeft = screen.width - winWidth + winLeft
  if (winTop < 0)
    winTop = screen.height - winHeight + winTop
  if (winTop == "cen")
    winTop = (screen.height - winHeight)/2 - 20
  if (winLeft == "cen")
    winLeft = (screen.width - winWidth)/2
  if (winLeft>0 & winTop>0)
    winLocation =  ",screenX=" + winLeft + ",left=" + winLeft	
                + ",screenY=" + winTop + ",top=" + winTop
  else
    winLocation = ""
  return winLocation
  }
//-->





<!-- // new button roller script will preload the images


//determine browser type
	  
	  browver1= parseInt(navigator.appVersion);
	  browtype1 = navigator.appName;
	  browsertype1 = "old";
	  if (browtype1 == "Netscape" && !(browver1 < 3)) {
	  browsertype1 = "new"; 
	  }
	  if (browtype1 == "Microsoft Internet Explorer" && !(browver1 < 4)) {
	  browsertype1 = "new";
	  }
	  
	  //new broswer definition of images
	  
	  if (browsertype1 == "new") {
	
	on_button_but1 = new Image(90, 15);
	on_button_but1.src = "buttons/aboutbutontopx.gif";
	off_button_but1 = new Image(90, 15);
	off_button_but1.src = "buttons/aboutbutontop.gif";
		
	
	  on_button_but2 = new Image(90, 15);
	  on_button_but2.src = "buttons/admissionsbut_f2.gif";
	  off_button_but2 = new Image(90, 15);
	  off_button_but2.src = "buttons/admissionswelcome.gif";
	  
	  on_button_but3 = new Image(90, 15);
	  	  on_button_but3.src = "buttons/academicsbut_f2.gif";
	  	  off_button_but3 = new Image(90, 15);
	  	  off_button_but3.src = "buttons/academicsbut.gif";
	  
	   on_button_but4 = new Image(90, 15);
	  	  on_button_but4.src = "buttons/studentbut_f2.gif";
	  	  off_button_but4 = new Image(90, 15);
	  	  off_button_but4.src = "buttons/studentbut.gif";
	  
	  on_button_but5 = new Image(90, 15);
	  	  	  on_button_but5.src = "buttons/athlbut_f2.gif";
	  	  	  off_button_but5 = new Image(90, 15);
	  	  	  off_button_but5.src = "buttons/athlbut.gif";
			  
	  on_button_but6 = new Image(180, 15);
	  	  	  on_button_but6.src = "buttons/alumdevbut_f2.gif";
	  	  	  off_button_but6 = new Image(180, 15);
	  	  	  off_button_but6.src = "buttons/alumdevbut.gif";
			  
	on_button_but7 = new Image(90, 15);
	on_button_but7.src = "buttons/aboutbutontopx.gif";
	off_button_but7 = new Image(90, 15);
	off_button_but7.src = "buttons/aboutbutwelcome.gif";
	  	  
		on_button_but8 = new Image(90, 15);
	on_button_but8.src = "buttons/alumdevbut_f2x.gif";
	off_button_but8 = new Image(90, 15);
	off_button_but8.src = "buttons/alumdevbutwelcome.gif";  
		
			on_button_but9 = new Image(90, 15);
	on_button_but9.src = "buttons/aboutbut_f2topx.gif";
	off_button_but9 = new Image(90, 15);
	off_button_but9.src = "buttons/aboutbutwelcome.gif"; 
		
		  on_button_but10 = new Image(90, 15);
	  on_button_but10.src = "buttons/admissionsbut_f2topx.gif";
	  off_button_but10 = new Image(90, 15);
	  off_button_but10.src = "buttons/admissionswelcome.gif";
		
		  on_button_but11 = new Image(90, 15);
	  on_button_but11.src = "buttons/devbut_f2topx.gif";
	  off_button_but11 = new Image(90, 15);
	  off_button_but11.src = "buttons/devbutwelcome.gif";
	  
			  on_button_but12 = new Image(90, 15);
	  on_button_but12.src = "buttons/alumbut_f2.gif";
	  off_button_but12 = new Image(90, 15);
	  off_button_but12.src = "buttons/alumbut.gif";
		
			  on_button_but14 = new Image(90, 15);
	  on_button_but14.src = "buttons/alumbut_f2x.gif";
	  off_button_but14 = new Image(90, 15);
	  off_button_but14.src = "buttons/alumbutwelcome.gif";
		
				  on_button_but15 = new Image(90, 15);
	  on_button_but15.src = "buttons/alumbut_f2x.gif";
	  off_button_but15 = new Image(90, 15);
	  off_button_but15.src = "buttons/alumbutwelcome.gif";
	  
	  				  on_button_but16 = new Image(90, 15);
	  on_button_but16.src = "buttons/alumbut_f2x.gif";
	  off_button_but16 = new Image(90, 15);
	  off_button_but16.src = "buttons/alumbutweek.gif";
	  
	  	
	on_button_but17 = new Image(151, 43);
	on_button_but17.src = "img/askastudenton.gif";
	off_button_but17 = new Image(151, 43);
	off_button_but17.src = "img/askastudentoff.gif";

on_button_but18 = new Image(151, 43);
	on_button_but18.src = "img/studentjournalson.gif";
	off_button_but18 = new Image(151, 43);
	off_button_but18.src = "img/studentjournalsoff.gif";

on_button_but19 = new Image(151, 43);
	on_button_but19.src = "img/applyon.gif";
	off_button_but19 = new Image(151, 43);
	off_button_but19.src = "img/applyoff.gif";		


on_button_but20 = new Image(151, 43);
	on_button_but20.src = "img/chaton.gif";
	off_button_but20 = new Image(151, 43);
	off_button_but20.src = "img/chatoff.gif";		
	
	on_button_but21 = new Image(151, 43);
	on_button_but21.src = "img/browseworkon.gif";
	off_button_but21 = new Image(151, 43);
	off_button_but21.src = "img/browseworkoff.gif";		
		
	
	  }
	  else if (browsertype1 == "old") {
	  }
	  function button_on(imgDocID,imgObjName){
	  if (browsertype1 == "new") {
	  document.images[imgDocID].src = eval(imgObjName + ".src")
	  }
	  
	  //display message text
	  
	  }
	  function message(text){
	  window.status= text
	  }
	
  
	  
<!-- // goThere from the popup

function goThere(linkid)
{
opener.location.href=linkid
self.close()
}

<!-- //  link window
		  
		  var linkWin = null
		  
		  function popWin(url) {    
		          
		          if (!linkWin || linkWin.closed) {
		          linkWin = open(url,"linkWindow","height=600,width=800,resizable=yes,history=no,toolbar=yes,location=no,menubar=yes,scrollbars=yes,statusbar=no")
		          }
		  
		             else {               
		                
		                          if (navigator.appName == "MSIE") {
		                          this.focus();
		                          }
		                          
		                          if (navigator.appName == "Netscape") {
		                          linkWin.focus();
		                          }
		             }    
		  
		  }
		  
		  // done hiding -->


<!-- //  link window2
		  
		  var linkWin = null
		  
		  function popWin2(url) {    
		          
		          if (!linkWin || linkWin.closed) {
		          linkWin = open(url,"linkWindow2","height=600,width=800,resizable=yes,history=no,toolbar=yes,location=no,menubar=yes,scrollbars=yes,statusbar=no")
		          }
		  
		             else {               
		                
		                          if (navigator.appName == "MSIE") {
		                          this.focus();
		                          }
		                          
		                          if (navigator.appName == "Netscape") {
		                          linkWin.focus();
		                          }
		             }    
		  
		  }
		  
		  // done hiding -->


<!-- //  link window3
		  
		  var linkWin = null
		  
		  function popWin3(url) {    
		          
		          if (!linkWin || linkWin.closed) {
		          linkWin = open(url,"linkWindow3","height=350,width=450,resizable=yes,history=no,toolbar=yes,location=no,menubar=yes,scrollbars=yes,statusbar=no")
		          }
		  
		             else {               
		                
		                          if (navigator.appName == "MSIE") {
		                          this.focus();
		                          }
		                          
		                          if (navigator.appName == "Netscape") {
		                          linkWin.focus();
		                          }
		             }    
		  
		  }
		  
		  // done hiding -->



<!-- //  link window4
		  
		  var linkWin = null
		  
		  function popWin4(url) {    
		          
		          if (!linkWin || linkWin.closed) {
		          linkWin = open(url,"linkWindow4","height=425,width=350,resizable=yes,history=no,toolbar=yes,location=no,menubar=yes,scrollbars=yes,statusbar=no")
		          }
		  
		             else {               
		                
		                          if (navigator.appName == "MSIE") {
		                          this.focus();
		                          }
		                          
		                          if (navigator.appName == "Netscape") {
		                          linkWin.focus();
		                          }
		             }    
		  
		  }
		  
		  // done hiding -->
  
		  // rollover sub-menus -->

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.0
  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 && document.getElementById) x=document.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 changeLocation()
	           {
	              index = window.document.theForm.theSelect.selectedIndex; 
	              location.href = window.document.theForm.theSelect.options[index].value;
	           }
			   
			   	           function changeLocation2()
	           {
	              index = window.document.theForm2.theSelect2.selectedIndex; 
	              location.href = window.document.theForm2.theSelect2.options[index].value;
	           }
			   
			   			   	           function changeLocation3()
	           {
	              index = window.document.theForm3.theSelect3.selectedIndex; 
	              location.href = window.document.theForm3.theSelect3.options[index].value;
	           }
	           

			     			   	           function changeLocation4()
	           {
	              index = window.document.theForm4.theSelect4.selectedIndex; 
	              location.href = window.document.theForm4.theSelect4.options[index].value;
	           }
			   
			     			   	           function changeLocation5()
	           {
	              index = window.document.theForm5.theSelect5.selectedIndex; 
	              location.href = window.document.theForm5.theSelect5.options[index].value;
	           }
	           
	           // -->

			   
	   


// end philau.js
