// Copyright 2007,2008 Joe R. Jah
function cursor(e){
  posx=0;posy=0;
  if(!e) var e=window.event;
  if(e.pageX||e.pageY){
    posx=e.pageX;posy=e.pageY;
  }else if(e.clientX||e.clientY){
    posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;
    posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;
  }
  tipW=tipO.offsetWidth?tipO.offsetWidth:(tipO.style.pixelWidth?tipO.style.pixelWidth:280);
  tipH=tipO.offsetHeight?tipO.offsetHeight:(tipO.style.pixelHeight?tipO.style.pixelHeight:280);
  tipL=posx-tipW-5;tipT=posy-tipH-5;
  scT=(document.documentElement.scrollTop?document.documentElement.scrollTop:(document.body.scrollTop?document.body.scrollTop:85));
  scL=(document.documentElement.scrollLeft?document.documentElement.scrollLeft:(document.body.scrollLeft?document.body.scrollLeft:85));
  if(tipT<scT)tipT=tipT+tipH+10;
  if(tipL<scL)tipL=scL;
  if(navigator.appName=='Netscape'){
    tipO.style.left=tipL+"px";tipO.style.top=tipT+"px";
  }else{
    tipO.style.left=tipL;tipO.style.top=tipT;
  }
  tipO.style.visibility="visible";
}
function ShowDea(CRN,CRS,EC,C2,AC,DR,e){
  tipO=document.all?document.all('d1'):document.getElementById('d1');
  if(tipO!=null){
    tipO.innerHTML='<table><tr><th class="tip" colspan="2">'+CRS+' (CRN '+CRN+')</th></tr><tr><td class="tip">Last Day To Add:</td><th class="tip">'+EC+'</th></tr><tr><td class="tip">Last Day To Drop For Refund:</td><th class="tip">'+C2+'</th></tr><tr><td class="tip">Last Day To Drop For Without "W" and To Request P/NP (pass/nopass) and To Drop In Order To Receive A 50%(Half) Non-Resident Refund:</td><th class="tip">'+AC+'</th></tr><tr><td class="tip">Last Day To Drop With "W" and To Apply For Leave Of Absence:</td><th class="tip">'+DR+'</th></tr><!-- tr><th colspan="2"><input type="button" value=" OK " onClick="hideD()"></th></tr --></table>';
    cursor(e)
  }
}
function ShowFin(CRN,CRS,FD,FT,FB,FC,e){
  tipO=document.all?document.all('d1'):document.getElementById('d1');
  if(tipO!=null){
    if(FT=='0:-0:AM'){
      tipO.innerHTML='<table width="100%"><tr><th>'+CRS+' (CRN '+CRN+')</th></tr><tr><td class="tip">For Final Exam please see instructor</td></tr><!-- tr><th colspan=\"2\"><input type="button" value=" OK " onClick="hideD()"></th></tr --></table>';
    }else if(FC=='C'){
      tipO.innerHTML='<table width="100%"><tr><th>'+CRS+' (CRN '+CRN+')</th></tr><tr><td class="tip">Final Exam: '+FT+' '+FD+' in '+FB+'</td></tr><tr><td class=\"red\">Note: Final Examination meeting for this class has been adjusted.</td></tr><!-- tr><th colspan=\"2\"><input type="button" value=" OK " onClick="hideD()"></th></tr --></table>';
    }else if(FT){
      tipO.innerHTML='<table width="100%"><tr><th>'+CRS+' (CRN '+CRN+')</th></tr><tr><td class="tip">Final Exam: '+FT+' '+FD+' in '+FB+'</td></tr><!-- tr><th colspan=\"2\"><input type="button" value=" OK " onClick="hideD()"></th></tr --></table>';
    }else{
      tipO.innerHTML='<table width="100%"><tr><th>'+CRS+' (CRN '+CRN+')</th></tr><tr><td>Final Exam: At the last class meeting.</td></tr><!-- tr><th colspan=\"2\"><input type="button" value=" OK " onClick="hideD()"></th></tr --></table>';
    }
    cursor(e)
  }
}
function ShowADA(AD,BL,RM,e){
  tipO=document.all?document.all('d1'):document.getElementById('d1');
  if(tipO!=null){
    if(AD=="A"){
      tipO.innerHTML='<table width="100%"><tr><th>'+BL+' '+RM+'</th></tr><tr><td class="tip">Accessible: This room is fully ADA code compliant. Access Information Only Call: 452-5481</td></tr></table>';
    }else if(AD=="U"){
      tipO.innerHTML='<table width="100%"><tr><th>'+BL+' '+RM+'</th></tr><tr><td class="tip">Usable: This room is partially ADA code compliant, allowing for wheelchair access and presents limited barriers. Access Information Only Call: 452-5481</td></tr></table>';
    }else if(AD=="N"){
      tipO.innerHTML='<table width="100%"><tr><th>'+BL+' '+RM+'</th></tr><tr><td class="red">Not Accessible: This room is not accessible.  Physical barriers such as steps prohibits wheelchair access. Access Information Only Call: 452-5481</td></tr></table>';
    }else{
      tipO.innerHTML='<table width="100%"><tr><th>'+BL+' '+RM+'</th></tr><tr><td class="tip">ADA Accessibility: No current data is available for this room. Access Information Only Call: 452-5481</td></tr></table>';
    }
    cursor(e)
  }
}
function ShowMor(MO,e){
  tipO=document.all?document.all('d1'):document.getElementById('d1');
  if(tipO!=null){
    tipO.innerHTML=MO;
    cursor(e)
  }
}
function hideD(){
  var tipO=(document.getElementById)?document.getElementById('d1'):eval("document.all['d1']");
  if (tipO!=null){
    tipO.style.visibility="hidden";
  }
}
function cW(U,N){
 var HW=window.open(U,N,'top,left=200,width=800,height=600,location,menubar,toolbar,resizable,scrollbars,status');
 HW.focus();
}
function cC(U,N){
 var HW=window.open(U,N,'top,left=200,width=600,height=300,location=no,resizable,scrollbars,status=no');
 HW.focus();
}
