if(document.getElementById('showpic'))
	var pop = document.getElementById('showpic');

if(pop){

	var xoffset = 25;
	var yoffset = 20;
	
	document.onmousemove = function(e) {
	  var x, y, right, bottom;
	  
	  try { x = e.pageX; y = e.pageY; } // FF
	  catch(e) { x = event.x; y = event.y; } // IE
	
	  right = (document.documentElement.clientWidth || document.body.clientWidth || document.body.scrollWidth);
	  bottom = (window.scrollY || document.documentElement.scrollTop || document.body.scrollTop) + (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || document.body.scrollHeight);
	
	  x += xoffset;
	  y += yoffset;
	
	  if(x > right-pop.offsetWidth)
		x = right-pop.offsetWidth;
	 
	  if(y > bottom-pop.offsetHeight)
		y = bottom-pop.offsetHeight;
	  
	  pop.style.top = y+'px';
	  pop.style.left = x+'px';
	
	}
	
	function tooltip(text) {
	  pop.innerHTML = text;
	  pop.style.display = 'block';
	}
}

function email(name, domain, suffix, text)
{
   var address = name + "\u0040" + domain + "." + suffix;
   var url = "mailto:" + address;

   if( ! text )
   {
      text = address;
   }

   document.write("<a href=\"" + url + "\">" + text + "</a>");
}

function toggleRow(whichLayer, tbut, origcap){
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"none";
		var tb = document.getElementById(tbut);
		tb.value = (tb.value=="Cancel")? origcap:"Cancel";
}

function homeUnitNav(){
	
	var unitNav ="<a href=\"/unit/u1/\" onmouseover=\"popover('<b>Unit 1:</b> Unit 1 Residence Halls, Channing-Bowditch, and Jackson House')\" onmouseout=\"popout()\"><img src=\"/images/h-u1-off.jpg\" alt=\"Unit 1\" name=\"Image1\" border=\"0\" id=\"Image1\" hspace=\"2\" /></a><a href=\"/unit/u2/\" onmouseover=\"popover('<b>Unit 2:</b> Unit 2 Residence Halls')\" onmouseout=\"popout()\"><img src=\"/images/h-u2-off.jpg\" alt=\"Unit 2\" name=\"Image2\" border=\"0\" id=\"Image2\" hspace=\"2\" /></a><a href=\"/unit/u3/\"  onmouseover=\"popover('<b>Unit 3:</b> Unit 3 Residence Halls, Beverly Cleary, and Manville')\" onmouseout=\"popout()\"><img src=\"/images/h-u3-off.jpg\" alt=\"Unit 3\" name=\"Image3\" border=\"0\" id=\"Image3\" hspace=\"2\" /></a><a href=\"/unit/u4/\"  onmouseover=\"popover('<b>Unit 4:</b> Foothill, Bowles, and Stern')\" onmouseout=\"popout()\"><img src=\"/images/h-u4-off.jpg\" alt=\"Foothill, Bowles, Stern\" name=\"Image4\" border=\"0\" id=\"Image4\" hspace=\"2\" /></a><a href=\"/unit/u5/\" onmouseover=\"popover('<b>Unit 5:</b> Clark Kerr Campus')\" onmouseout=\"popout()\"><img src=\"/images/h-u5-off.jpg\" alt=\"Clark Kerr Campus\" name=\"Image5\" border=\"0\" id=\"Image5\" hspace=\"2\" /></a><a href=\"/unit/uva/\"  onmouseover=\"popover('<b>UVA:</b> University Village Apartments at Albany')\" onmouseout=\"popout()\"><img src=\"/images/h-uva-off.jpg\" alt=\"University Village, Albany\" name=\"Image6\" border=\"0\" id=\"Image6\" hspace=\"2\" /></a>";
	
	document.write(unitNav);
	
}

function showpic(text) {
	pop.innerHTML = "<img src='2006/"+text+"'>";
	pop.style.display = 'block';
}

function popover(text) {
  pop.innerHTML = text;
  pop.style.display = 'block';
}

function popout() {
  pop.style.display = 'none';
}

//

function popup(url){
	window.open(url,'','toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=530,height=600')
}
function rounded_tab_on(){
   document.getElementById('rounded-top').style.backgroundImage='url(/site-images/round-top-on.gif)';
}

function rounded_tab_off(){
   document.getElementById('rounded-top').style.backgroundImage='url(/site-images/round-top.gif)';
}

function ClearForms(){
if(document.all.credential_0.value != 'ResComp ID'){
}
else{
          document.all.credential_0.value = '';
}
}

function goToURL(url) {
window.location = url; }

function fdisable(theform) {
theform.className = "disabled";
theform.value = "Submitting... Please Wait";
}

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];}
}

matchColumns=function(){ 
     var divs,contDivs,maxHeight,divHeight,d; 
     // get all <div> elements in the document 
     divs=document.getElementsByTagName('div'); 
     contDivs=[]; 
     // initialize maximum height value 
     maxHeight=0; 
     // iterate over all <div> elements in the document 
     for(var i=0;i<divs.length;i++){ 
          // make collection with <div> elements with class attribute 'container' 
          if(/\bcolumn\b/.test(divs[i].className)){ 
                d=divs[i]; 
                contDivs[contDivs.length]=d; 
                // determine height for <div> element 
                if(d.offsetHeight){ 
                     divHeight=d.offsetHeight; 					
                } 
                else if(d.style.pixelHeight){ 
                     divHeight=d.style.pixelHeight;					 
                } 
                // calculate maximum height 
                maxHeight=Math.max(maxHeight,divHeight); 
          } 
     } 
     // assign maximum height value to all of container <div> elements 
     for(var i=0;i<contDivs.length;i++){ 
          contDivs[i].style.height=maxHeight + "px"; 
     } 
} 
function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
	}
}
function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
	}
}

/* Quickmenu */

//Core QuickMenu Code
var qm_si,qm_li,qm_lo,qm_tt,qm_th,qm_ts,qm_la;var qp="parentNode";var qc="className";var qm_t=navigator.userAgent;var qm_o=qm_t.indexOf("Opera")+1;var qm_s=qm_t.indexOf("afari")+1;var qm_s2=qm_s&&window.XMLHttpRequest;var qm_n=qm_t.indexOf("Netscape")+1;var qm_v=parseFloat(navigator.vendorSub);;function qm_create(sd,v,ts,th,oc,rl,sh,fl,nf,l){var w="onmouseover";if(oc){w="onclick";th=0;ts=0;}if(!l){l=1;qm_th=th;sd=document.getElementById("qm"+sd);if(window.qm_pure)sd=qm_pure(sd);sd[w]=function(e){qm_kille(e)};document[w]=qm_bo;sd.style.zoom=1;if(sh)x2("qmsh",sd,1);if(!v)sd.ch=1;}else  if(sh)sd.ch=1;if(sh)sd.sh=1;if(fl)sd.fl=1;if(rl)sd.rl=1;sd.style.zIndex=l+""+1;var lsp;var sp=sd.childNodes;for(var i=0;i<sp.length;i++){var b=sp[i];if(b.tagName=="A"){lsp=b;b[w]=qm_oo;b.qmts=ts;if(l==1&&v){b.style.styleFloat="none";b.style.cssFloat="none";}}if(b.tagName=="DIV"){if(window.showHelp&&!window.XMLHttpRequest)sp[i].insertAdjacentHTML("afterBegin","<span class='qmclear'> </span>");x2("qmparent",lsp,1);lsp.cdiv=b;b.idiv=lsp;if(qm_n&&qm_v<8&&!b.style.width)b.style.width=b.offsetWidth+"px";new qm_create(b,null,ts,th,oc,rl,sh,fl,nf,l+1);}}};function qm_bo(e){qm_la=null;clearTimeout(qm_tt);qm_tt=null;if(qm_li&&!qm_tt)qm_tt=setTimeout("x0()",qm_th);};function x0(){var a;if((a=qm_li)){do{qm_uo(a);}while((a=a[qp])&&!qm_a(a))}qm_li=null;};function qm_a(a){if(a[qc].indexOf("qmmc")+1)return 1;};function qm_uo(a,go){if(!go&&a.qmtree)return;if(window.qmad&&qmad.bhide)eval(qmad.bhide);a.style.visibility="";x2("qmactive",a.idiv);};;function qa(a,b){return String.fromCharCode(a.charCodeAt(0)-(b-(parseInt(b/2)*2)));};function qm_oo(e,o,nt){if(!o)o=this;if(qm_la==o)return;if(window.qmad&&qmad.bhover&&!nt)eval(qmad.bhover);if(window.qmwait){qm_kille(e);return;}clearTimeout(qm_tt);qm_tt=null;if(!nt&&o.qmts){qm_si=o;qm_tt=setTimeout("qm_oo(new Object(),qm_si,1)",o.qmts);return;}var a=o;if(a[qp].isrun){qm_kille(e);return;}qm_la=o;var go=true;while((a=a[qp])&&!qm_a(a)){if(a==qm_li)go=false;}if(qm_li&&go){a=o;if((!a.cdiv)||(a.cdiv&&a.cdiv!=qm_li))qm_uo(qm_li);a=qm_li;while((a=a[qp])&&!qm_a(a)){if(a!=o[qp])qm_uo(a);else break;}}var b=o;var c=o.cdiv;if(b.cdiv){var aw=b.offsetWidth;var ah=b.offsetHeight;var ax=b.offsetLeft;var ay=b.offsetTop;if(c[qp].ch){aw=0;if(c.fl)ax=0;}else {if(c.rl){ax=ax-c.offsetWidth;aw=0;}ah=0;}if(qm_o){ax-=b[qp].clientLeft;ay-=b[qp].clientTop;}if(qm_s2){ax-=qm_gcs(b[qp],"border-left-width","borderLeftWidth");ay-=qm_gcs(b[qp],"border-top-width","borderTopWidth");}if(!c.ismove){c.style.left=(ax+aw)+"px";c.style.top=(ay+ah)+"px";}x2("qmactive",o,1);if(window.qmad&&qmad.bvis)eval(qmad.bvis);c.style.visibility="inherit";qm_li=c;}else  if(!qm_a(b[qp]))qm_li=b[qp];else qm_li=null;qm_kille(e);};function qm_gcs(obj,sname,jname){var v;if(document.defaultView&&document.defaultView.getComputedStyle)v=document.defaultView.getComputedStyle(obj,null).getPropertyValue(sname);else  if(obj.currentStyle)v=obj.currentStyle[jname];if(v&&!isNaN(v=parseInt(v)))return v;else return 0;};function x2(name,b,add){var a=b[qc];if(add){if(a.indexOf(name)==-1)b[qc]+=(a?' ':'')+name;}else {b[qc]=a.replace(" "+name,"");b[qc]=b[qc].replace(name,"");}};function qm_kille(e){if(!e)e=event;e.cancelBubble=true;if(e.stopPropagation&&!(qm_s&&e.type=="click"))e.stopPropagation();};function qm_pure(sd){if(sd.tagName=="UL"){var nd=document.createElement("DIV");nd.qmpure=1;var c;if(c=sd.style.cssText)nd.style.cssText=c;qm_convert(sd,nd);var csp=document.createElement("SPAN");csp.className="qmclear";csp.innerHTML=" ";nd.appendChild(csp);sd=sd[qp].replaceChild(nd,sd);sd=nd;}return sd;};function qm_convert(a,bm,l){if(!l){bm.className=a.className;bm.id=a.id;}var ch=a.childNodes;for(var i=0;i<ch.length;i++){if(ch[i].tagName=="LI"){var sh=ch[i].childNodes;for(var j=0;j<sh.length;j++){if(sh[j]&&(sh[j].tagName=="A"||sh[j].tagName=="SPAN"))bm.appendChild(ch[i].removeChild(sh[j]));if(sh[j]&&sh[j].tagName=="UL"){var na=document.createElement("DIV");var c;if(c=sh[j].style.cssText)na.style.cssText=c;if(c=sh[j].className)na.className=c;na=bm.appendChild(na);new qm_convert(sh[j],na,1)}}}}}

function rc_drawmenu(){

document.write('<ul id=\"qm0\" class=\"qmmc\">');
document.write('<li><a id=\"gethelp\" class=\"qmparent\" href=\"/helpdesk/\"><span class=\"gethelp\"></span></a>');
document.write('	<ul>');
document.write('		<li><a href=\"/helpdesk/\">ResComp Helpdesk</a></li>');
document.write('		<li><a href=\"/helpdesk/schedule/\">Schedule RCC Appointment</a></li>');
document.write('		<li><a href=\"/helpdesk/hours/\">RCC Office Hours</a></li>');
document.write('		<li><a href=\"/infocards/\">Infocards</a></li>');
document.write('		<li><a href=\"/helpdesk/contact/\">Phone or Email an RCC</a></li>');
document.write('	</ul></li>');
document.write('<li><a class=\"qmparent\" href=\"/getconnected/\"><span class=\"getconnected\"></span></a>');
document.write('	<ul>');
document.write('		<li><a href=\"/register/\">Register In-Room Connection</a></li>');
document.write('		<li><span class=\"qmdivider qmdividerx\"></span></li>');
document.write('		<li><a href=\"/wireless/\">Wireless Networking</a></li>');
document.write('		<li><a href=\"/cable/\">Cable TV</a></li>');
document.write('		<li><a href=\"/conferences/\">Conference Services</a></li>');
document.write('	</ul></li>');
document.write('<li><a class=\"qmparent\" href=\"/stayconnected/\"><span class=\"stayconnected\"></span></a>');
document.write('	<ul>');
document.write('		<li><a href=\"/stayconnected/\">ResComp Policies</a></li>');
document.write('		<li><a href=\"/stayconnected/security/\">Security Tips</a></li>');
document.write('		<li><a href=\"/about/policy/\">Appropriate Use Policy</a></li>');
document.write('	</ul></li>');
document.write('<li><a class=\"qmparent\" href=\"/besecure/\"><span class=\"besecure\"></span></a>');
document.write('<li><a class=\"qmparent\" href=\"/unit/\"><span class=\"atmyunit\"></span></a>');
document.write('	<ul>');
document.write('		<li><a href=\"/unit/u1/\">Unit 1, Cha-Bo, Jackson House</a></li>');
document.write('		<li><a href=\"/unit/u2/\">Unit 2</a></li>');
document.write('		<li><a href=\"/unit/u3/\">Unit 3, Manville</a></li>');
document.write('		<li><a href=\"/unit/u4/\">Foothill, Bowles, Stern</a></li>');
document.write('		<li><a href=\"/unit/u5/\">Clark Kerr Campus</a></li>');
document.write('		<li><a href=\"/uva/\">University Village</a></li>');
document.write('		<li><span class=\"qmdivider qmdividerx\"></span></li>');
document.write('		<li><a href=\"/gogreen/\">Go Green Tips from ResComp</a></li>');
document.write('		<li><a href=\"/hiring/\">Job Opportunities</a></li>');
document.write('	</ul></li>');
document.write('<li><a class=\"qmparent\" href=\"/about/\"><span class=\"aboutrescomp\"></span></a>');
document.write('	<ul>');
document.write('		<li><a href=\"/about/\">About Residential Computing</a></li>');
document.write('		<li><a href=\"/about/directory/\">Staff Directory</a></li>');
document.write('		<li><a href=\"/hiring/\">Jobs and Hiring</a></li>');
document.write('		<li><a href=\"/video/\">Cal Connect Video</a></li>');
document.write('		<li><span class=\"qmdivider qmdividerx\"></span></li>');
document.write('		<li><a href=\"/about/privacy/\">Privacy Policy</a></li>');
document.write('		<li><a href=\"/contactus/\">Contact Us</a></li>');
document.write('	</ul></li>');
document.write('<li><a class=\"qmparent internal-wrapper\" href=\"/internal/\"><span class=\"internal\"></span></a>');
document.write('<li class=\"qmclear\">&nbsp;</li></ul>');
qm_create(0,false,0,0,false,false,false,false);
}

function rc_drawmenu_internal(){
document.write('<ul id=\"toplevel\">');
document.write('<li><a href=\"/\">Home</a></li>');
document.write('<li><a href=\"/internal/irc/\">IRC Manage</a></li>');
document.write('<li><a href=\"/cgi-bin/prot/schedule/index.pl\">Scheduler</a></li>');
document.write('<li><a href=\"/cgi-bin/prot/employees/list-employees\">Employees</a></li>');
document.write('<li><a href=\"https://bugzilla.rescomp.berkeley.edu\">BugZilla</a></li>');
document.write('<li><a href=\"/twiki/bin/view/Rescomp/WebHome\">Twiki</a></li>');
document.write('<li><a href=\"https://rt.rescomp.berkeley.edu/\">RT</a></li>');
document.write('<li><a href=\"/cgi-bin/prot/pandacon/pandacon_admin\">PandaCon</a></li>');
document.write('<li><a href=\"/cgi-bin/prot/inventory/inv_main\">Online Checkout</a></li>');
document.write('<li><a href=\"/phpbb/\">Forum</a></li>');
document.write('<li class=\"right\"><a href=\"/internal/\">Internals Home</a></li>');
document.write('</ul>');
}
