// XMLHTTP JS class is is developed by Alex Serebryakov (#0.9.1)
// For more information, consult www.ajaxextended.com

// What's new in 0.9.1:
// - fixed the _createQuery function (used to force multipart requests)
// - fixed the getResponseHeader function (incorrect search)
// - fixed the _parseXML function (bug in the ActiveX parsing section)
// - fixed the _destroyScripts function (DOM errors reported)

var XMLHTTP = function() {

  // The following two options are configurable
  // you don't need to change the rest. Plug & play!
  var _maximumRequestLength = 1500
  var _apiURL = 'http://ucommxsrv1.unl.edu/xmlhttp/'

  this.status = null
  this.statusText = null
  this.responseText = null
  this.responseXML = null
  this.synchronous = false
  this.readyState = 0
  
  this.onreadystatechange =  function() { }
  this.onerror = function() { }
  this.onload = function() { }
  
  this.abort = function() {
    _stop = true
    _destroyScripts()
  }
  
  this.getAllResponseHeaders = function() {
    // Returns all response headers as a string
    var result = ''
    for (property in _responseHeaders)
      result += property + ': ' + _responseHeaders[property] + '\r\n'
    return result
  }
  
  this.getResponseHeader = function(name) {
    // Returns a response header value
    // Note, that the search is case-insensitive
    for(property in _responseHeaders) {
      if(property.toLowerCase() == name.toLowerCase())
        return _responseHeaders[property]
    }
    return null
  }
  
  this.overrideMimeType = function(type) {
    _overrideMime = type
  }
  
  this.open = function(method, url, sync, userName, password) {
    // Setting the internal values
    if (!_checkParameters(method, url)) return
    _method = (method) ? method : ''
    _url = (url) ? url : ''
    _userName = (userName) ? userName : ''
    _password = (password) ? password : ''
    _setReadyState(1)
  }
  
  this.openRequest = function(method, url, sync, userName, password) {
    // This method is inserted for compatibility purposes only
    return this.open(method, url, sync, userName, password)
  }
  
  this.send = function(data) {
    if (_stop) return
    var src = _createQuery(data)
    _createScript(src)
//    _setReadyState(2)
  }
  
  this.setRequestHeader = function(name, value) {
    // Set the request header. If the defined header
    // already exists (search is case-insensitive), rewrite it
    if (_stop) return
    for(property in _requestHeaders) {
      if(property.toLowerCase() == name.toLowerCase()) {
        _requestHeaders[property] = value; return
      }
    }
    _requestHeaders[name] = value
  }
  
  var _method = ''
  var _url = ''
  var _userName = ''
  var _password = ''
  var _requestHeaders = {
    "HTTP-Referer": escape(document.location),
    "Content-Type": "application/x-www-form-urlencoded"
  }
  var _responseHeaders = { }
  var _overrideMime = ""
  var self = this
  var _id = ''
  var _scripts = []
  var _stop = false
  
  var _throwError = function(description) {
    // Stop script execution and run
    // the user-defined error handler
    self.onerror(description)
    self.abort()
    return false
  }
  
  var _createQuery = function(data) {
    if(!data) data = ''
    var headers = ''
    for (property in _requestHeaders)
      headers += property + '=' + _requestHeaders[property] + '&'
    var originalsrc = _method
    + '$' + _id
    + '$' + _userName
    + "$" + _password
    + "$" + headers
    + '$' + _escape(data)
    + '$' + _url
    var src = originalsrc
    var max =  _maximumRequestLength, request = []
    var total = Math.floor(src.length / max), current = 0
    while(src.length > 0) {
      var query = _apiURL + '?'
      + 'multipart' 
      + '$' + _id
      + '$' + current++
      + '$' + total
      + '$' + src.substr(0, max)
      request.push(query)
      src = src.substr(max)
    }
    if(request.length == 1)
      src = _apiURL + '?' + originalsrc
    else
      src = request
    return src
  }
  
  var _checkParameters = function(method, url) {
    // Check the method value (GET, POST, HEAD)
    // and the prefix of the url (http://)
    if(!method)
      return _throwError('Please, specify the query method (GET, POST or HEAD)')
    if(!url)
      return _throwError('Please, specify the URL')
    if(method.toLowerCase() != 'get' &&
      method.toLowerCase() != 'post' &&
      method.toLowerCase() != 'head')
      return _throwError('Please, specify either a GET, POST or a HEAD method')
    if(url.toLowerCase().substr(0,7) != 'http://')
      return _throwError('Only HTTP protocol is supported (http://)')
    return true
  }

  var _createScript = function(src) {
    if ('object' == typeof src) {
      for(var i = 0; i < src.length; i++)
        _createScript(src[i]);
      return true;
    }
    // Create the SCRIPT tag
    var script = document.createElement('script');
    script.src = src;
    script.type = 'text/javascript';
    if (navigator.userAgent.indexOf('Safari')){
      script.charset = 'utf-8'; // Safari bug
    }
    script = document.getElementsByTagName('head')[0].appendChild(script);
    _scripts.push(script);
    return script;
  }
  
  var _escape = function(string) {
    // Native escape() function doesn't quote the plus sign +
    string = escape(string)
    string = string.replace('+', '%2B')
    return string
  }
  
  var _destroyScripts = function() {
    // Removes the SCRIPT nodes used by the class
    for(var i = 0; i < _scripts.length; i++)
      if(_scripts[i].parentNode)
        _scripts[i].parentNode.removeChild(_scripts[i])
  }
  
  var _registerCallback = function() {
    // Register a callback variable (in global scope)
    // that points to current instance of the class
    _id = 'v' + Math.random().toString().substr(2)
    window[_id] = self
  }
  
  var _setReadyState = function(number) {
    // Set the ready state property of the class
    self.readyState = number
    self.onreadystatechange()
    if(number == 4) self.onload()
  }
    
  var _parseXML = function() {
      var type = self.getResponseHeader('Content-type') + _overrideMime
      if(!(type.indexOf('html') > -1 || type.indexOf('xml') > -1)) return
      if(document.implementation &&
	      document.implementation.createDocument &&
	      navigator.userAgent.indexOf('Opera') == -1) {
        var parser = new DOMParser()
        var xml = parser.parseFromString(self.responseText, "text/xml")
        self.responseXML = xml
      } else if (window.ActiveXObject) {
        var xml = new ActiveXObject('MSXML2.DOMDocument.3.0')
        if (xml.loadXML(self.responseText))
        	self.responseXML = xml
      } else {
        var xml = document.body.appendChild(document.createElement('div'))
        xml.style.display = 'none'
        xml.innerHTML = self.responseText
        _cleanWhitespace(xml, true)
        self.responseXML = xml.childNodes[0]
        document.body.removeChild(xml)
     }
  }
  
  var _cleanWhitespace = function(element, deep) {
    var i = element.childNodes.length; if(i == 0) return
    do {
      var node = element.childNodes[--i]
      if (node.nodeType == 3 && !_cleanEmptySymbols(node.nodeValue))
        element.removeChild(node)
      if (node.nodeType == 1 && deep)
        _cleanWhitespace(node, true)
    } while(i > 0)
  }

  var _cleanEmptySymbols = function(string) {
    string = string.replace('\r', '')
    string = string.replace('\n', '')
    string = string.replace(' ', '')
  	return (string.length == 0) ? false : true 
  }
 
  this._parse = function(object) {
    // Parse the received data and set all
    // the appropriate properties of the class
    if(_stop) return true;
    if(object.multipart) return true;
    if(!object.success)
      return _throwError(object.description);
    _responseHeaders = object.responseHeaders;
    this.status = object.status;
    this.statusText = object.statusText;
    this.responseText = object.responseText;
    _parseXML();
    _destroyScripts();
    _setReadyState(4);
    return true;
  }
    
   _registerCallback()

}
function rotateImg(imgArray_str,elementId_str,secs_int,thisNum_int){
	function showIt() {
		if(obj.src!=null && eval(imgArray_str+"["+thisNum_int+"][0]")!=null)
			obj.src=eval(imgArray_str+"["+thisNum_int+"][0]");
		if(obj.alt!=null && eval(imgArray_str+"["+thisNum_int+"][1]")!=null)
			obj.alt=eval(imgArray_str+"["+thisNum_int+"][1]");
		if(obj.parentNode.href!=null && eval(imgArray_str+"["+thisNum_int+"][2]")!=null) {
			obj.parentNode.href=eval(imgArray_str+"["+thisNum_int+"][2]");
			if(eval(imgArray_str+"["+thisNum_int+"][3]")!=null) {
				var clickEvent = eval(imgArray_str+"["+thisNum_int+"][3]");
				obj.parentNode.onclick=function() {eval(clickEvent);}
			}
			else
				obj.parentNode.onclick=null;
		}
		else
			obj.parentNode.href='#';
	}
	if(thisNum_int==null)
		thisNum_int=Math.floor(Math.random()*eval(imgArray_str+".length"));
	if(thisNum_int >= eval(imgArray_str+".length"))
		thisNum_int = 0;
	if(eval(imgArray_str+"["+thisNum_int+"]")!=null){
		// Try and set img
		var obj = MM_findObj(elementId_str);
		showIt();
	}
	thisNum_int++;
	if(secs_int>0) {
		return setTimeout("rotateImg('"+imgArray_str+"','"+elementId_str+"',"+secs_int+","+thisNum_int+")",secs_int*1000);
	} else {
		return true;
	}
}
function executeQuery( form, typeOperation, doSubmit)
{

	var ind = document.getElementById('whichDatabase').selectedIndex;
	var redirURL = document.getElementById('whichDatabase').options[ind].value+escape(form.q.value);
	if (form.q.value.length < 1)
	{
		alert ( "There is an empty query. Please enter a valid one" );
		form.q.focus();
		return false;
	}
	else
	{
		if(redirURL.indexOf("http://www.google.com/search") != -1) {
			window.open(redirURL);
		}
		else if(redirURL.indexOf("http://ucommxsrv1.unl.edu/peoplefinder/") != -1) {
			window.open(redirURL,'peoplefindpop','scrollbars=1,width=325,height=500,innerwidth=325,innerheight=500');
		}
		else {
			location.href = redirURL;
		}
		return false;
	}
	return false;
}
function MM_findObj(n, d) { //v3.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); return x;
}

/* This is the navigation hide list JS @alvin.W */
var dc={

	
	init:function(e){		
		
	/* variable initialization */
	var ndiv = document.getElementById('navlinks');
	var ul1 = ndiv.getElementsByTagName('ul');
		
		/* get the number of LI within an UL, and within that ul and so on..... */
		for( var k=0; k<ul1.length; k++){
		var li1 = ul1[k].getElementsByTagName("li");
			
			for(var z=0; z<li1.length; z++){
				var ul2 = li1[z].getElementsByTagName("ul");
				
				for(var t=0; t<ul2.length; t++){
					var li2 = ul2[t].getElementsByTagName("li");		
					
					for(var v=0; v<li2.length-1; v++){
						for(var q=0; q<li2[v].childNodes.length; q++) {
							if (li2[v].childNodes[q].innerHTML) {
								while (li2[v].childNodes[q].innerHTML.substring(li2[v].childNodes[q].innerHTML.length-1, li2[v].childNodes[q].innerHTML.length) == ' ') {
									li2[v].childNodes[q].innerHTML = li2[v].childNodes[q].innerHTML.substring(0,li2[v].childNodes[q].innerHTML.length-1);
								}
							} else {
								try {
									li2[v].childNodes[q].removeNode();
								} catch(e) {}
							}
						}
						var comma = document.createTextNode(', ');
						li2[v].appendChild(comma);
					}
					/* hide LI after the first five */
					if (li2.length > 5){
						
						for( var i=5; i<li2.length; i++){
							li2[i].style.display = 'none';
						}
						
						/* automatically insert ... characters after the fifth list to indicate more links */
						var para = document.createElement("li");
						para.style.display = 'inline';
						var text = document.createTextNode("more ...");
						var elip_link = document.createElement('a');
						elip_link.href = '#';
						elip_link.onclick = showAllNavlinks;
						elip_link.appendChild(text);
						para.appendChild(elip_link);
						ul2[t].appendChild(para);
						
						/*turn on action link*/
						var show1 = document.getElementById("showlink");
						if (show1) {
							show1.style.display = 'inline';
						} else {
							var d = document.createElement('div');
							d.id = 'showlink';
							show1 = document.createElement('a');
							show1.href = '#';
							show1.onclick = showAllNavlinks;
							d.appendChild(show1);
							ndiv.appendChild(d);
						}
					}
				}
			}
		}
		
	},
	
	/* substitute window.onload */
	addEvent: function(elm, evType, fn, useCapture){
		if (elm.addEventListener) 
		{
			elm.addEventListener(evType, fn, useCapture);
			return true;
		} else if (elm.attachEvent) {
			var r = elm.attachEvent('on' + evType, fn);
			return r;
		} else {
			elm['on' + evType] = fn;
			return true;
		}
	}
		
}
dc.addEvent(window, 'load', dc.init, false);

/* GetElementsByClass by Dustin Diaz */
function getElementsByClass(node,searchClass,tag) {
var classElements = new Array();
var els = node.getElementsByTagName(tag); // use "*" for all elements
var elsLen = els.length;
var pattern = new RegExp("\\b"+searchClass+"\\b");
for (i = 0, j = 0; i < elsLen; i++) {
 if ( pattern.test(els[i].className) ) {
 classElements[j] = els[i];
 j++;
 }
}
return classElements;
}


// Controls entire layout.
/* Viewport resize script (simon collison)*/
var wraphandler = {

  init: function() {

    if (!document.getElementById) return;

    // set up the appropriate wrapper

    wraphandler.setWrapper();

    // and make sure it gets set up again if you resize the window

    wraphandler.addEvent(window,"resize",wraphandler.setWrapper);

  },



  setWrapper: function() {



    var theWidth = 0;

    if (window.innerWidth) {

	theWidth = window.innerWidth

    } else if (document.documentElement &&

                document.documentElement.clientWidth) {

	theWidth = document.documentElement.clientWidth

    } else if (document.body) {

	theWidth = document.body.clientWidth

    }

    if (theWidth != 0) {

      if (theWidth > 1270) {

        document.getElementById('main_right').className = 'altwrapper';

      } else {
		
			version=0
			if (navigator.appVersion.indexOf("MSIE")!=-1){
			temp=navigator.appVersion.split("MSIE")
			version=parseFloat(temp[1])
			}
			if (version>=5.5) {
				if(theWidth < 1000){
				document.getElementById('container').className = 'ieminwidth';
				}
			}
			document.getElementById('main_right').className = 'mainwrapper';
      }

    }

  },



  addEvent: function( obj, type, fn ) {

    if ( obj.attachEvent ) {

      obj['e'+type+fn] = fn;

      obj[type+fn] = function(){obj['e'+type+fn]( window.event );}

      obj.attachEvent( 'on'+type, obj[type+fn] );

    } else {

      obj.addEventListener( type, fn, false );

    }

  }

}



wraphandler.addEvent(window,"load",wraphandler.init);

/*	sIFR 2.0.2
	Copyright 2004 - 2006 Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben

	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/

var hasFlash=function(){var a=6;if(navigator.appVersion.indexOf("MSIE")!=-1&&navigator.appVersion.indexOf("Windows")>-1){document.write('<script language="VBScript"\> \non error resume next \nhasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & '+a+'))) \n</script\> \n');if(window.hasFlash!=null)return window.hasFlash}if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){var b=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;return parseInt(b.charAt(b.indexOf(".")-1))>=a}return false}();String.prototype.normalize=function(){return this.replace(/\s+/g," ")};if(Array.prototype.push==null){Array.prototype.push=function(){var i=0,a=this.length,b=arguments.length;while(i<b){this[a++]=arguments[i++]}return this.length}}if(!Function.prototype.apply){Function.prototype.apply=function(a,b){var c=[];var d,e;if(!a)a=window;if(!b)b=[];for(var i=0;i<b.length;i++){c[i]="b["+i+"]"}e="a.__applyTemp__("+c.join(",")+");";a.__applyTemp__=this;d=eval(e);a.__applyTemp__=null;return d}}function named(a){return new named.Arguments(a)}named.Arguments=function(a){this.oArgs=a};named.Arguments.prototype.constructor=named.Arguments;named.extract=function(a,b){var c,d;var i=a.length;while(i--){d=a[i];if(d!=null&&d.constructor!=null&&d.constructor==named.Arguments){c=a[i].oArgs;break}}if(c==null)return;for(e in c)if(b[e]!=null)b[e](c[e]);return};var parseSelector=function(){var a=/^([^#.>`]*)(#|\.|\>|\`)(.+)$/;function r(s,t){var u=s.split(/\s*\,\s*/);var v=[];for(var i=0;i<u.length;i++)v=v.concat(b(u[i],t));return v}function b(c,d,e){c=c.normalize().replace(" ","`");var f=c.match(a);var g,h,i,j,k,n;var l=[];if(f==null)f=[c,c];if(f[1]=="")f[1]="*";if(e==null)e="`";if(d==null)d=document;switch(f[2]){case "#":k=f[3].match(a);if(k==null)k=[null,f[3]];g=document.getElementById(k[1]);if(g==null||(f[1]!="*"&&!o(g,f[1])))return l;if(k.length==2){l.push(g);return l}return b(k[3],g,k[2]);case ".":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;k=f[3].match(a);if(k!=null){if(g.className==null||g.className.match("(\\s|^)"+k[1]+"(\\s|$)")==null)continue;j=b(k[3],g,k[2]);l=l.concat(j)}else if(g.className!=null&&g.className.match("(\\s|^)"+f[3]+"(\\s|$)")!=null)l.push(g)}return l;case ">":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;j=b(f[3],g,">");l=l.concat(j)}return l;case "`":h=m(d,f[1]);for(i=0,n=h.length;i<n;i++){g=h[i];j=b(f[3],g,"`");l=l.concat(j)}return l;default:if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;l.push(g)}return l}}function m(d,o){if(o=="*"&&d.all!=null)return d.all;return d.getElementsByTagName(o)}function o(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:", "")==q.toLowerCase()}return r}();var sIFR=function(){var a="http://www.w3.org/1999/xhtml";var b=false;var c=false;var d;var ah=[];var al=document;var ak=al.documentElement;var am=window;var au=al.addEventListener;var av=am.addEventListener;var f=function(){var g=navigator.userAgent.toLowerCase();var f={a:g.indexOf("applewebkit")>-1,b:g.indexOf("safari")>-1,c:navigator.product!=null&&navigator.product.toLowerCase().indexOf("konqueror")>-1,d:g.indexOf("opera")>-1,e:al.contentType!=null&&al.contentType.indexOf("xml")>-1,f:true,g:true,h:null,i:null,j:null,k:null};f.l=f.a||f.c;f.m=!f.a&&navigator.product!=null&&navigator.product.toLowerCase()=="gecko";if(f.m&&g.match(/.*gecko\/(\d{8}).*/))f.j=new Number(g.match(/.*gecko\/(\d{8}).*/)[1]);f.n=g.indexOf("msie")>-1&&!f.d&&!f.l&&!f.m;f.o=f.n&&g.match(/.*mac.*/)!=null;if(f.d&&g.match(/.*opera(\s|\/)(\d+\.\d+)/))f.i=new Number(g.match(/.*opera(\s|\/)(\d+\.\d+)/)[2]);if(f.n||(f.d&&f.i<7.6))f.g=false;if(f.a&&g.match(/.*applewebkit\/(\d+).*/))f.k=new Number(g.match(/.*applewebkit\/(\d+).*/)[1]);if(am.hasFlash&&(!f.n||f.o)){var aj=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;f.h=parseInt(aj.charAt(aj.indexOf(".")-1))}if(g.match(/.*(windows|mac).*/)==null||f.o||f.c||(f.d&&(g.match(/.*mac.*/)!=null||f.i<7.6))||(f.b&&f.h<7)||(!f.b&&f.a&&f.k<312)||(f.m&&f.j<20020523))f.f=false;if(!f.o&&!f.m&&al.createElementNS)try{al.createElementNS(a,"i").innerHTML=""}catch(e){f.e=true}f.p=f.c||(f.a&&f.k<312);return f}();function at(){return{bIsWebKit:f.a,bIsSafari:f.b,bIsKonq:f.c,bIsOpera:f.d,bIsXML:f.e,bHasTransparencySupport:f.f,bUseDOM:f.g,nFlashVersion:f.h,nOperaVersion:f.i,nGeckoBuildDate:f.j,nWebKitVersion:f.k,bIsKHTML:f.l,bIsGecko:f.m,bIsIE:f.n,bIsIEMac:f.o,bUseInnerHTMLHack:f.p}}if(am.hasFlash==false||!al.getElementsByTagName||!al.getElementById||(f.e&&(f.p||f.n)))return{UA:at()};function af(e){if((!k.bAutoInit&&(am.event||e)!=null)||!l(e))return;b=true;for(var i=0,h=ah.length;i<h;i++)j.apply(null,ah[i]);ah=[]}var k=af;function l(e){if(c==false||k.bIsDisabled==true||((f.e&&f.m||f.l)&&e==null&&b==false)||(al.body==null||al.getElementsByTagName("body").length==0))return false;return true}function m(n){if(f.n)return n.replace(new RegExp("%\d{0}","g"),"%25");return n.replace(new RegExp("%(?!\d)","g"),"%25")}function as(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:", "")==q.toLowerCase()}function o(p,q,r,s,t){var u="";var v=p.firstChild;var w,x,y,z;if(s==null)s=0;if(t==null)t="";while(v){if(v.nodeType==3){z=v.nodeValue.replace("<","&lt;");switch(r){case "lower":u+=z.toLowerCase();break;case "upper":u+=z.toUpperCase();break;default:u+=z}}else if(v.nodeType==1){if(as(v,"a")&&!v.getAttribute("href")==false){if(v.getAttribute("target"))t+="&sifr_url_"+s+"_target="+v.getAttribute("target");t+="&sifr_url_"+s+"="+m(v.getAttribute("href")).replace(/&/g,"%26");u+='<a href="asfunction:_root.launchURL,'+s+'">';s++}else if(as(v,"br"))u+="<br/>";if(v.hasChildNodes()){y=o(v,null,r,s,t);u+=y.u;s=y.s;t=y.t}if(as(v,"a"))u+="</a>"}w=v;v=v.nextSibling;if(q!=null){x=w.parentNode.removeChild(w);q.appendChild(x)}}return{"u":u,"s":s,"t":t}}function A(B){if(al.createElementNS&&f.g)return al.createElementNS(a,B);return al.createElement(B)}function C(D,E,z){var p=A("param");p.setAttribute("name",E);p.setAttribute("value",z);D.appendChild(p)}function F(p,G){var H=p.className;if(H==null)H=G;else H=H.normalize()+(H==""?"":" ")+G;p.className=H}function aq(ar){var a=ak;if(k.bHideBrowserText==false)a=al.getElementsByTagName("body")[0];if((k.bHideBrowserText==false||ar)&&a)if(a.className==null||a.className.match(/\bsIFR\-hasFlash\b/)==null)F(a, "sIFR-hasFlash")}function j(I,J,K,L,M,N,O,P,Q,R,S,r,T){if(!l())return ah.push(arguments);aq();named.extract(arguments,{sSelector:function(ap){I=ap},sFlashSrc:function(ap){J=ap},sColor:function(ap){K=ap},sLinkColor:function(ap){L=ap},sHoverColor:function(ap){M=ap},sBgColor:function(ap){N=ap},nPaddingTop:function(ap){O=ap},nPaddingRight:function(ap){P=ap},nPaddingBottom:function(ap){Q=ap},nPaddingLeft:function(ap){R=ap},sFlashVars:function(ap){S=ap},sCase:function(ap){r=ap},sWmode:function(ap){T=ap}});var U=parseSelector(I);if(U.length==0)return false;if(S!=null)S="&"+S.normalize();else S="";if(K!=null)S+="&textcolor="+K;if(M!=null)S+="&hovercolor="+M;if(M!=null||L!=null)S+="&linkcolor="+(L||K);if(O==null)O=0;if(P==null)P=0;if(Q==null)Q=0;if(R==null)R=0;if(N==null)N="#FFFFFF";if(T=="transparent")if(!f.f)T="opaque";else N="transparent";if(T==null)T="";var p,V,W,X,Y,Z,aa,ab,ac;var ad=null;for(var i=0,h=U.length;i<h;i++){p=U[i];if(p.className!=null&&p.className.match(/\bsIFR\-replaced\b/)!=null)continue;V=p.offsetWidth-R-P;W=p.offsetHeight-O-Q;aa=A("span");aa.className="sIFR-alternate";ac=o(p,aa,r);Z="txt="+m(ac.u).replace(/\+/g,"%2B").replace(/&/g,"%26").replace(/\"/g, "%22").normalize() + S + "&w=" + V + "&h=" + W + ac.t;F(p,"sIFR-replaced");if(ad==null||!f.g){if(!f.g){if(!f.n)p.innerHTML=['<embed class="sIFR-flash" type="application/x-shockwave-flash" src="',J,'" quality="best" wmode="',T,'" bgcolor="',N,'" flashvars="',Z,'" width="',V,'" height="',W,'" sifr="true"></embed>'].join("");else p.innerHTML=['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" sifr="true" width="',V,'" height="',W,'" class="sIFR-flash"><param name="movie" value="',J,"?",Z,'"></param><param name="quality" value="best"></param><param name="wmode" value="',T,'"></param><param name="bgcolor" value="',N,'"></param> </object>'].join('')}else{if(f.d){ab=A("object");ab.setAttribute("data",J);C(ab,"quality","best");C(ab,"wmode",T);C(ab,"bgcolor",N)}else{ab=A("embed");ab.setAttribute("src",J);ab.setAttribute("quality","best");ab.setAttribute("flashvars",Z);ab.setAttribute("wmode",T);ab.setAttribute("bgcolor",N)}ab.setAttribute("sifr","true");ab.setAttribute("type","application/x-shockwave-flash");ab.className="sIFR-flash";if(!f.l||!f.e)ad=ab.cloneNode(true)}}else ab=ad.cloneNode(true);if(f.g){if(f.d)C(ab,"flashvars",Z);else ab.setAttribute("flashvars",Z);ab.setAttribute("width",V);ab.setAttribute("height",W);ab.style.width=V+"px";ab.style.height=W+"px";p.appendChild(ab)}p.appendChild(aa);if(f.p)p.innerHTML+=""}if(f.n&&k.bFixFragIdBug)setTimeout(function(){al.title=d},0)}function ai(){d=al.title}function ae(){if(k.bIsDisabled==true)return;c=true;if(k.bHideBrowserText)aq(true);if(am.attachEvent)am.attachEvent("onload",af);else if(!f.c&&(al.addEventListener||am.addEventListener)){if(f.a&&f.k>=132&&am.addEventListener)am.addEventListener("load",function(){setTimeout("sIFR({})",1)},false);else{if(al.addEventListener)al.addEventListener("load",af,false);if(am.addEventListener)am.addEventListener("load",af,false)}}else if(typeof am.onload=="function"){var ag=am.onload;am.onload=function(){ag();af()}}else am.onload=af;if(!f.n||am.location.hash=="")k.bFixFragIdBug=false;else ai()}k.UA=at();k.bAutoInit=true;k.bFixFragIdBug=true;k.replaceElement=j;k.updateDocumentTitle=ai;k.appendToClassName=F;k.setup=ae;k.debug=function(){aq(true)};k.debug.replaceNow=function(){ae();k()};k.bIsDisabled=false;k.bHideBrowserText=true;return k}();

if(typeof sIFR == "function" && !sIFR.UA.bIsIEMac){
	sIFR.setup();
};
var wait = false;
var unlwebcam = 'http://www.unl.edu/unlpub/cam/cam1.jpg';
var pfreq = new XMLHTTP();
var calreq = new XMLHTTP();
var weatherreq = new XMLHTTP();
var pfreq_q;
if (!pfreq)
	alert("Error initializing XMLHttpRequest!");
function tabExpand() {
	var tab = document.getElementById('sitetools');
	if (tab.style.display=='none') {
		displayCalendar();
		displayUNLWeather();
		updateWebcam(unlwebcam);
		tab.style.display='block';
	} else {
		tab.style.display='none';
	}
	if (!sIFR.UA.bIsIE) {
		var sifr1 = document.getElementById('titlegraphic').getElementsByTagName('h1');
		var sifr2 = document.getElementById('titlegraphic').getElementsByTagName('h2');
		if (tab.style.display=='block') {
			sifr1[0].style.display='none';
			sifr2[0].style.display='none';
		} else {
			sifr1[0].style.display='block';
			sifr2[0].style.display='block';
		}
	}
	return false;
}
function pf_getUID(uid) {
	var url = "http://ucommxsrv1.unl.edu/peoplefinder/service.php?uid="+uid+"&format=hcard";
	if (wait==true) {
		pfreq.abort();
		pfreq = new XMLHTTP();
	}
	pfreq.open("GET", url, true);
	pfreq.onreadystatechange = updatePeopleFinderResults;
	pfreq.send(null);
	wait=true;
	return false;
}
function updateWebcam(camuri) {
	document.getElementById('webcamuri').src = camuri;
	unlwebcam = camuri;
}
function queuePFRequest() {
	clearTimeout(pfreq_q);
	var q = document.getElementById("pq").value;
	if (q.length > 3) {
		document.getElementById("pfresults").innerHTML = '';
		document.getElementById("pfprogress").src = '/ucomm/templatedependents/templatecss/images/loading.gif';
		pfreq_q = setTimeout('getPeopleFinderResults()',400);
	} else if (q.length>0) {
		document.getElementById("pfprogress").src = '/ucomm/templatedependents/templatecss/images/transpixel.gif';
		document.getElementById("pfresults").innerHTML = 'Please enter more information.';
	} else {
		document.getElementById("pfprogress").src = '/ucomm/templatedependents/templatecss/images/transpixel.gif';
		document.getElementById("pfresults").innerHTML = 'Search for People.';
	}
}
function getPeopleFinderResults() {
	var q = document.getElementById("pq").value;
	var url = "http://ucommxsrv1.unl.edu/peoplefinder/service.php?q=" + escape(q);
	if (wait==true) {
		pfreq.abort();
		pfreq = new XMLHTTP();
	}
	pfreq.open("GET", url, true);
	pfreq.onreadystatechange = updatePeopleFinderResults;
	pfreq.send(null);
	wait=true;
}
function updatePeopleFinderResults() {
	if (pfreq.readyState == 4) {
		if (pfreq.status == 200) {
			document.getElementById("pfresults").innerHTML = pfreq.responseText;
		} else {
			document.getElementById("pfresults").innerHTML = 'Error loading results.';
		}
	}
	document.getElementById("pfprogress").src = '/ucomm/templatedependents/templatecss/images/transpixel.gif';
	wait = false;
	pfreq = new XMLHTTP();
}
function displayCalendar() {
	var calurl = "http://events.unl.edu/?format=hcalendar";
	calreq.open("GET", calurl, true);
	calreq.onreadystatechange = updateCalendarResults;
	calreq.send(null);
}
function updateCalendarResults()
{
	if (calreq.readyState == 4) {
		if (calreq.status == 200) {
			document.getElementById("calcontent").innerHTML = calreq.responseText;
		} else {
			document.getElementById("calcontent").innerHTML = 'Error loading results.';
		}
	}
	wait = false;
	calreq = new XMLHTTP();
}


function displayUNLWeather() {
	var weatherurl = "http://www.unl.edu/ucomm/templatedependents/templatesharedcode/scripts/current.html";
	weatherreq.open("GET", weatherurl, true);
	weatherreq.onreadystatechange = updateWeatherResults;
	weatherreq.send(null);
}
function updateWeatherResults()
{
	if (weatherreq.readyState == 4) {
		if (weatherreq.status == 200) {
			document.getElementById("weatherresults").innerHTML = weatherreq.responseText;
		} else {
			document.getElementById("weatherresults").innerHTML = 'Error loading results.';
		}
	}
	wait = false;
	weatherreq = new XMLHTTP();
}

function showAllNavlinks(){ 
	/* propagate down the list to get the to the last LI */
	var scan = document.getElementById("navlinks");
	var scanlist = scan.getElementsByTagName("li");
	for(var x=0; x<scanlist.length; x++){
		var scannestlist = scanlist[x].getElementsByTagName("ul");
	
		for(var f=0; f<scannestlist.length; f++){
			var finalist = scannestlist[f].getElementsByTagName("li");								
			for(var l=5; l<finalist.length; l++){
				/*display the rest of the list*/
				var nextSibStatus = (finalist[l].style.display == 'none') ? 'inline' : 'none';
				finalist[l].style.display = nextSibStatus;
			}
		}
	}
	return false;						
}
