<!--

// Creates variables for footer
	var a;
	a = new Date(document.lastModified);
	lm_year = a.getYear(); lm_year = ((lm_year<1000)?((lm_year<70)?2000:1900):0) + lm_year;
	lm_month = a.getMonth() + 1; lm_month = ((lm_month<10)?'':'') + lm_month;
	lm_date = a.getDate(); lm_date = ((lm_date<10)?'':'') + lm_date;

	monthName = new Array(12);
	monthName[0] = 'January';
	monthName[1] = 'February';
	monthName[2] = 'March';
	monthName[3] = 'April';
	monthName[4] = 'May';
	monthName[5] = 'June';
	monthName[6] = 'July';
	monthName[7] = 'August';
	monthName[8] = 'September';
	monthName[9] = 'October';
	monthName[10] = 'November';
	monthName[11] = 'December';
	
	lstring = document.location.href + "";

// Expand/collapse for local area navigation. Expands menu for current link.

function pde_init()
{

/* CSS class names, change if needed */
	var mp='pde_nav';
	var hp='pde_hide';
	var sp='pde_show';
	var pp='pde_parent';
	var pa='pde_active';
	var cu='current';
	
	var d,uls,i;
	if(!document.getElementById && !document.createTextNode){return;}

/* navigation ID, change if needed */
	d=document.getElementById('localNavList');

	if (!d){return;}
	pde_addclass(d,mp)
	uls=d.getElementsByTagName('ul');
	for (i=0;i<uls.length;i++)
	{
		if(pde_checkcurrent(uls[i]))
		{
			pde_addclass(uls[i].parentNode.firstChild,pa);
		} else {
			pde_addclass(uls[i],hp);
			pde_addclass(uls[i].parentNode.firstChild,pp);
			uls[i].parentNode.firstChild.onclick=function()
			{
				pde_swapclass(this,pp,pa);
				pde_swapclass(this.parentNode.getElementsByTagName('ul')[0],hp,sp);
				return false;
			}
		}
	}
	function pde_checkcurrent(o){
		if(pde_check(o.parentNode,cu)){return true;}
		for(var i=0;i<o.getElementsByTagName('li').length;i++)
		{
			if(pde_check(o.getElementsByTagName('li')[i],cu)){return true;}
		}
		return false;
	}
	function pde_swapclass(o,c1,c2)
	{
		var cn=o.className
		o.className=!pde_check(o,c1)?cn.replace(c2,c1):cn.replace(c1,c2);
	}
	function pde_addclass(o,c)
	{
		if(!pde_check(o,c)){o.className+=o.className==''?c:' '+c;}
	}
	function pde_check(o,c)
	{
	 	return new RegExp('\\b'+c+'\\b').test(o.className);
	}
}

// Behavior for search box

function clearDefault(){ 

	var dbg='#F3F7FB'; // Background color, Default
	var fbg='#FFFFFF'; // Background color, onFocus 

		var tI = document.getElementsByTagName('input'); var tT = document.getElementsByTagName('textarea');

		for (var i = 0; i < tI.length; i++) { 
			if (tI[i] && tI[i].getAttribute('type') != '' && tI[i].getAttribute('type').toLowerCase() == 'text' || tI[i].getAttribute('type').toLowerCase() == 'password') 
			{tI[i].style.backgroundColor = dbg; thisValue = tI[i].getAttribute("title");
				if (thisValue){	tI[i].value = thisValue;} 
				tI[i].onfocus = function(){this.style.backgroundColor = fbg; if (this.value != this.getAttribute("title") && this.value != '') {return;} 
				else {this.value = '';}};
				tI[i].onblur = function(){this.style.backgroundColor = dbg; if (this.value == ''){this.value = this.getAttribute("title");}};}} 
		for (var i = 0; i < tT.length; i++){if (tT[i]){tT[i].style.backgroundColor = dbg; thisValue = tT[i].getAttribute("title");if (thisValue){tT[i].value = thisValue;} 
				tT[i].onfocus = function(){this.style.backgroundColor = fbg; if (this.value != this.getAttribute("title") && this.value != ''){return;}
				else {this.value = '';}};
				tT[i].onblur = function(){this.style.backgroundColor = dbg;if (this.value == ''){this.value =  this.getAttribute("title");}};}} 
}

function cleanup(f) {
	for(var i=0; i<f.elements.length; i++){
		var eleme = f.elements[i];
		if(eleme.value == "keyword"){
			eleme.value= "";
			break;
		}
	}
f.action = 'http://gsearch2.ipfw.edu/search';
}

// Sets tallest column div within #innerWrap to position:relative so footer positions correctly

	function setTallestDivToRelativePosition() {
		var localNavWrapElement = document.getElementById('localNavWrap');
		var mainContentWrapElement = document.getElementById('mainContentWrap');
		var outerCalloutWrapElement = document.getElementById('outerCalloutWrap');
		
		var localNavWrapHeight = document.getElementById('localNavWrap').offsetHeight;
		var mainContentWrapHeight = document.getElementById('mainContentWrap').offsetHeight;
		var outerCalloutWrapHeight = document.getElementById('outerCalloutWrap').offsetHeight;

		if (localNavWrapHeight > mainContentWrapHeight && localNavWrapHeight > outerCalloutWrapHeight) {
			localNavWrapElement.style.position = 'relative';
			mainContentWrapElement.style.position = 'absolute';
			outerCalloutWrapElement.position = 'absolute';
		}
		
		else {
			if (mainContentWrapHeight > localNavWrapHeight && mainContentWrapHeight > outerCalloutWrapHeight) {
				localNavWrapElement.style.position = 'absolute';
				mainContentWrapElement.style.position = 'relative';
				outerCalloutWrapElement.position = 'absolute';
				
			}
			
			else {
				if (outerCalloutWrapHeight > localNavWrapHeight && outerCalloutWrapHeight > mainContentWrapHeight) {
					localNavWrapElement.style.position = 'absolute';
					mainContentWrapElement.style.position = 'absolute';
					outerCalloutWrapElement.style.position = 'relative';
				}
			}
		}
	}

// intelliResponse

var defaultStr = 'What&rsquo;s your question?';
 
function isBlank(q) {
  var whitespace = new String(" \t\n\r");
 
  for (var i = 0; i<q.length; i++) {
    if (whitespace.indexOf(q.charAt(i)) == -1) {
      return false;
    }
  }
 
  return true;
}
 
function submitForm(){
  var d = document.questionForm;
  if (!isValidForm())
    return;
 
  d.submit();
}
 
function isValidForm(){
  var d = document.questionForm;
  if (d.question.value==defaultStr  ||  isBlank(d.question.value)) {
    return false;
  }
 
  d.action=' http://ipfw.intelliresponse.com/results.jsp';
  d.requestType.value='NormalRequest';
  return true;
}
 
function topTen(){
  var d = document.questionForm;
  d.action=' http://ipfw.intelliresponse.com/topQuestions.jsp';
  d.submit();
}
 
function clearForm(){
  var d = document.questionForm;
  d.id.value=-1;
  d.reset();
  d.question.focus();
  d.question.value='';
}

window.onload=function(){
	// Add functions here:
	pde_init();
	clearDefault();
	setTallestDivToRelativePosition();	
}

window.onresize = function() {
	setTallestDivToRelativePosition();
}
//-->
