<!--
/* -- The University of RIo Grande JavaScript Library */

//RIO GRANDE QUICKLINKS//
//Contents for menu "EVENT CALENDARS"
var menu1=new Array()
menu1[0]='<a href="http://webevent.rio.edu/webevent.pl?cmd=listweek&de=1&tf=0&sib=1&sb=0&sa=0&ws=0&stz=Default&sort=e,m,t&cat=&swe=1&cf=list&set=1&cal=cal7,cal11,cal12,cal14,cal1,cal6,cal13,cal9,cal2,cal8">THIS WEEK @ RIO</a>'
menu1[1]='<a href="http://webevent.rio.edu/webevent.pl?cmd=opencal&cal=cal7">ACADEMICS</a>'
menu1[2]='<a href="http://webevent.rio.edu/webevent.pl?cmd=opencal&cal=cal11">ADMINISTRATION</a>'
menu1[3]='<a href="http://webevent.rio.edu/webevent.pl?cmd=opencal&cal=cal12">ADMISSIONS</a>'
menu1[4]='<a href="http://webevent.rio.edu/webevent.pl?cmd=opencal&cal=cal14">ALUMNI</a>'
menu1[5]='<a href="http://webevent.rio.edu/webevent.pl?cmd=opencal&cal=cal1">COMMUNITY EVENTS</a>'
menu1[6]='<a href="http://webevent.rio.edu/webevent.pl?cmd=opencal&cal=cal6">EXCUSED ABSENCES</a>'
menu1[7]='<a href="http://webevent.rio.edu/webevent.pl?cmd=opencal&cal=cal8">FINE ARTS</a>'
menu1[8]='<a href="http://webevent.rio.edu/webevent.pl?cmd=opencal&cal=cal9">HOLIDAYS</a>'
menu1[9]='<a href="http://webevent.rio.edu/webevent.pl?cmd=opencal&cal=cal13">LA101 EVENTS</a>'

//Contents for menu "SPORTS CALENDARS"
var menu2=new Array()
menu2[0]='<a href="http://athletics.rio.edu/index.php?module=PostCalendar&func=view&tplview=default&viewtype=month&pc_username=&pc_category=4&pc_topic=5">BASEBALL</a>'
menu2[1]='<a href="http://athletics.rio.edu/index.php?module=PostCalendar&func=view&tplview=default&viewtype=month&pc_username=&pc_category=2&pc_topic=3">M-BASKETBALL</a>'
menu2[2]='<a href="http://athletics.rio.edu/index.php?module=PostCalendar&func=view&tplview=default&viewtype=month&pc_username=&pc_category=3&pc_topic=4">W-BASKETBALL</a>'
menu2[3]='<a href="http://athletics.rio.edu/index.php?module=PostCalendar&func=view&tplview=default&viewtype=month&pc_username=&pc_category=9&pc_topic=8">CROSS COUNTRY</a>'
menu2[4]='<a href="http://athletics.rio.edu/index.php?module=PostCalendar&func=view&tplview=default&viewtype=month&pc_username=&pc_category=11&pc_topic=9">M-SOCCER</a>'
menu2[5]='<a href="http://athletics.rio.edu/index.php?module=PostCalendar&func=view&tplview=default&viewtype=month&pc_username=&pc_category=15&pc_topic=15">W-SOCCER</a>'
menu2[6]='<a href="http://athletics.rio.edu/index.php?module=PostCalendar&func=view&tplview=default&viewtype=month&pc_username=&pc_category=5&pc_topic=6">SOFTBALL</a>'
menu2[7]='<a href="http://athletics.rio.edu/index.php?module=PostCalendar&func=view&tplview=default&viewtype=month&pc_username=&pc_category=6&pc_topic=10">INDOOR TRACK</a>'
menu2[8]='<a href="http://athletics.rio.edu/index.php?module=PostCalendar&func=view&tplview=default&viewtype=month&pc_username=&pc_category=7&pc_topic=11">OUTDOOR TRACK</a>'
menu2[9]='<a href="http://athletics.rio.edu/index.php?module=PostCalendar&func=view&tplview=default&viewtype=month&pc_username=&pc_category=12&pc_topic=7">VOLLEYBALL</a>'

		
//Contents for menu "QUICK LINKS"		
var menu3=new Array()
menu3[0]='<a href="http://www.rio.edu/catalog/index.php">2007-09 CATALOG</a>'
menu3[1]='<a href="http://mail.rio.edu">RIO EMAIL</a>'
menu3[2]='<a href="http://www.rio.edu/academics/index.php">ACADEMICS</a>'
menu3[3]='<a href="http://www.rio.edu/studentservices/page.php?ID=payingyourbill">ACCOUNTING</a>'
menu3[4]='<a href="http://www.rio.edu/admissions/index.php">ADMISSIONS</a>'
menu3[5]='<a href="http://www.rio.edu/alumni/">ALUMNI/FRIENDS</a>'
menu3[6]='<a href="http://www.athletics.rio.edu/">ATHLETICS</a>'
menu3[7]='<a href="http://www.rio.edu/campusmap/CampusMap.php">CAMPUS MAP</a>'
menu3[8]='<a href="http://www.rio.edu/facultystaff/page.php?ID=campuscomputing">CAMPUS NETWORKING</a>'
menu3[9]='<a href="http://www.rio.edu/studentservices/page.php?ID=campuspolice">CAMPUS POLICE</a>'
menu3[10]='<a href="http://www.rio.edu/studentservices/page.php?ID=campussafety">CAMPUS SAFETY</a>'
menu3[11]='<a href="http://www.rio.edu/studentservices/page.php?ID=careeradvising">CAREER SERVICES</a>'
menu3[12]='<a href="http://www.rio.edu/admissions/page.php?ID=financialaid">FINANCIAL AID</a>'
menu3[13]='<a href="http://www.rio.edu/academics/page.php?ID=graduateeducation">GRADUATE STUDIES</a>'
menu3[14]='<a href="http://www.rio.edu/studentservices/page.php?ID=healthservices">HEALTH SERVICES</a>'
menu3[15]='<a href="http://library.rio.edu">LIBRARY</a>'
menu3[16]='<a href="http://www.rio.edu/academics/page.php?ID=onlinelearning">ONLINE LEARNING</a>'
menu3[17]='<a href="http://www.rio.edu/academics/page.php?ID=recordsoffice">RECORDS OFFICE</a>'
menu3[18]='<a href="http://www.rio.edu/sitemap/index.php">SITE MAP</a>'
menu3[19]='<a href="http://www.rio.edu/studentservices/index.php">STUDENT SERVICES</a>'
menu3[20]='<a href="https://hope.rio.edu/studentspace/signup.aspx">STUDENT SPACE</a>'
menu3[21]='<a href="http://www.rio.edu/admissions/page.php?ID=studyabroad">STUDY ABROAD</a>'
menu3[22]='<a href="http://webct.rio.edu">WEBCT</a>'


		
var menuwidth='140px' //default menu width
var menubgcolor='#FFFFFF'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

/// VARIOUS JAVASCRIPTS TO USE///

CSInit = new Array;
function CSScriptInit() {
if(typeof(skipPage) != "undefined") { if(skipPage) return; }
idxArray = new Array;
for(var i=0;i<CSInit.length;i++)
	idxArray[i] = i;
CSAction2(CSInit, idxArray);}
CSStopExecution=false;
function CSAction(array) {return CSAction2(CSAct, array);}
function CSAction2(fct, array) { 
	var result;
	for (var i=0;i<array.length;i++) {
		if(CSStopExecution) return false; 
		var aa = fct[array[i]];
		if (aa == null) return false;
		var ta = new Array;
		for(var j=1;j<aa.length;j++) {
			if((aa[j]!=null)&&(typeof(aa[j])=="object")&&(aa[j].length==2)){
				if(aa[j][0]=="VAR"){ta[j]=CSStateArray[aa[j][1]];}
				else{if(aa[j][0]=="ACT"){ta[j]=CSAction(new Array(new String(aa[j][1])));}
				else ta[j]=aa[j];}
			} else ta[j]=aa[j];
		}			
		result=aa[0](ta);
	}
	return result;
}
CSAct = new Object;
CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
CSIsW3CDOM = ((document.getElementById) && !(IsIE()&&CSBVers<6)) ? true : false;
function IsIE() { return CSAg.indexOf("MSIE") > 0;}
function CSIEStyl(s) { return document.all.tags("div")[s].style; }
function CSNSStyl(s) { if (CSIsW3CDOM) return document.getElementById(s).style; else return CSFindElement(s,0);  }
CSIImg=false;
function CSInitImgID() {if (!CSIImg && document.images) { for (var i=0; i<document.images.length; i++) { if (!document.images[i].id) document.images[i].id=document.images[i].name; } CSIImg = true;}}
function CSFindElement(n,ly) { if (CSBVers<4) return document[n];
	if (CSIsW3CDOM) {CSInitImgID();return(document.getElementById(n));}
	var curDoc = ly?ly.document:document; var elem = curDoc[n];
	if (!elem) {for (var i=0;i<curDoc.layers.length;i++) {elem=CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
	return elem;
}
function CSGetImage(n) {if(document.images) {return ((!IsIE()&&CSBVers<5)?CSFindElement(n,0):document.images[n]);} else {return null;}}
CSDInit=false;
function CSIDOM() { if (CSDInit)return; CSDInit=true; if(document.getElementsByTagName) {var n = document.getElementsByTagName('DIV'); for (var i=0;i<n.length;i++) {CSICSS2Prop(n[i].id);}}}
function CSICSS2Prop(id) { var n = document.getElementsByTagName('STYLE');for (var i=0;i<n.length;i++) { var cn = n[i].childNodes; for (var j=0;j<cn.length;j++) { CSSetCSS2Props(CSFetchStyle(cn[j].data, id),id); }}}
function CSFetchStyle(sc, id) {
	var s=sc; while(s.indexOf("#")!=-1) { s=s.substring(s.indexOf("#")+1,sc.length); if (s.substring(0,s.indexOf("{")).toUpperCase().indexOf(id.toUpperCase())!=-1) return(s.substring(s.indexOf("{")+1,s.indexOf("}")));}
	return "";
}
function CSGetStyleAttrValue (si, id, st) {
	var s=si.toUpperCase();
	var myID=id.toUpperCase()+":";
	var id1=s.indexOf(myID,st);
	if (id1==-1) return "";
	var ch=s.charAt(id1-1);
	if (ch!=" " && ch!="\t" && ch!="\n" && ch!=";" && ch!="{")
		return CSGetStyleAttrValue (si, id, id1+1);
	var start=id1+myID.length;
	ch=s.charAt(start);
	while(ch==" " || ch=="\t" || ch=="\n") {start++; ch=s.charAt(start);}
	s=s.substring(start,si.length);
	var id2=s.indexOf(";");
	return ((id2==-1)?s:s.substring(0,id2));
}
function CSSetCSS2Props(si, id) {
	var el=document.getElementById(id);
	if (el==null) return;
	var style=document.getElementById(id).style;
	if (style) {
		if (style.left=="") style.left=CSGetStyleAttrValue(si,"left",0);
		if (style.top=="") style.top=CSGetStyleAttrValue(si,"top",0);
		if (style.width=="") style.width=CSGetStyleAttrValue(si,"width",0);
		if (style.height=="") style.height=CSGetStyleAttrValue(si,"height",0);
		if (style.visibility=="") style.visibility=CSGetStyleAttrValue(si,"visibility",0);
		if (style.zIndex=="") style.zIndex=CSGetStyleAttrValue(si,"z-index",0);
	}
}
function CSRandomImg(action) { 
	var img = CSGetImage(action[1]);
	if (img) 
		{
		var v1 =  Math.floor(Math.random() * 10);
		var whichone = v1-(Math.floor(v1/8)*8);
		img.src = action[whichone+2];
		}
}

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 MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function m(el) {
      if ( el.defaultValue == el.value ) el.value = "";
}
//-->
