// Break out of everyone's frames -- except for typo3:
if (top.location!=location && !document.location.href.match("headerForFrames") && !/typo3/.test(top.location.href) && !/formreg/.test(top.location.href)) 
  //alert(top.location.href);
  //alert(document.location.href);
  top.location.href = document.location.href;

var activeTxtClr='#465019';
var inactiveTxtClr='#a5926c';
var overlayBannerX=null;
var overlayBannerY=null;
var overlayBannerText=null;
// Banner variables
var d=document;
var dobj=new Array();
var zInterval=null;
var current=0;
var pause=false;
// Banner variables end here

function qLinksRedirect(opt) {
  var s=opt[opt.selectedIndex].value;
  var sa=s.split('^');
  var h=sa.shift();
  var target=sa.shift();
  if(target) window.open(h);
  else location.href=h;
} // End qLinksRedirect

function checkBoxOLD(id,sType,baseURL,numChoices) { // for checkboxes
  var ck=document.getElementById('checkbox'+id);
  var im=document.getElementById('searchImg'+id);
  var ch=document.getElementById('choice'+id);
  if(ck.value==sType) {
    ck.value='';
    ch.style.color=inactiveTxtClr;
    im.src=baseURL+'/fileadmin/templates/3.0/images/searchbox.gif';
  }else{
    ck.value=sType;
    ch.style.color=activeTxtClr;
    im.src=baseURL+'/fileadmin/templates/3.0/images/searchbox_checked.gif';
  }
} // End function checkBox

function checkBox(id,sType,baseURL,numChoices,reload) { // for radio buttons
  for(var i=1; i<=numChoices; i++) {
    if(i==id) {
      document.getElementById('checkbox'+i).value=sType;
      document.getElementById('searchImg'+i).src=baseURL+'/fileadmin/templates/3.0/images/searchbox_selected.gif';
      document.getElementById('choice'+i).style.color=activeTxtClr;
    }else{
      document.getElementById('checkbox'+i).value='';
      document.getElementById('searchImg'+i).src=baseURL+'/fileadmin/templates/3.0/images/searchbox.gif';
      document.getElementById('choice'+i).style.color=inactiveTxtClr;
    }
    if(document.getElementById('mainSearch').value!='' && reload=='yes') {
		document.getElementById('checkbox'+i).value=sType;
		document.getElementById('wwuSearch').submit();
	}
    //alert(document.getElementById('mainSearch').value);
    //document.getElementById('wwuSearch').submit();
  }
} // End function checkBox

function fixCheckboxes(max,checked) { // NOT CURRENTLY USED
  document.getElementById('checkbox1').value=checked;
  document.getElementById('choice1').style.color=activeTxtClr;;
  for(var i=2; i<max; i++) {
    document.getElementById('checkbox'+i).value='';
    document.getElementById('choice'+i).style.color=inactiveTxtClr;
  }
} // End function fixCheckboxes

function setBgImage(id,photoFileName) {
  var elm=document.getElementById(id);
  elm.style.backgroundImage='url('+photoFileName+')';
} // End function setBgImage 

function chooseHeaderPhoto(templateName) {
  var photos = document.getElementsByName('headerPhotoURL');
  if(photos.length<1) {
    if(templateName=='acadDepartment') { 
      document.getElementById('photoHeader').style.display='none';
    }
    return;
  }
  var randNum = rand(photos.length)-1;
  document.getElementById('photoHeader').style.backgroundImage='url('+photos[randNum].value+')';
  if(templateName=='homepage') {
    overlayBannerX=document.getElementsByName('hpOverlayX')[randNum].value;
    overlayBannerY=document.getElementsByName('hpOverlayY')[randNum].value;
//    alert(overlayBannerX+':'+overlayBannerY);
    overlayBannerText=document.getElementsByName('overlayBannerText');
//    for(i=0;i<overlayBannerText.length;i++) alert(overlayBannerText[i].value);
 	var backContainer = createCSS('#backContainer',' padding-left: '+overlayBannerX+'px; padding-top: '+overlayBannerY+'px;');
	var backContainerImg = createCSS('#backContainer img',' position: absolute; ');
	var textContainer = createCSS('#imageContainer',' position: absolute; ');
	var textContainerImg = createCSS('#imageContainer span',' display: none; position: absolute; color: #D7D0C9; width: 500px; height: 45px; text-align: center; letter-spacing: 1.7px; line-height: 1.6;');
//	so_init(overlayBannerX,overlayBannerY);
  }
} // End function chooseHeaderPhoto

function displayCorrectQuickLinks() {
	var browser=navigator.appName;
	if (browser == "Microsoft Internet Explorer") {
		var alldivs = document.getElementsByTagName("div");
		var divarray = new Array();
		for (i=0,iarr=0;i<alldivs.length;i++) {
			attribs = alldivs[i].getAttribute("name");
			if (attribs == "typo3-added-navLink") {
				divarray[iarr] = alldivs[i];
				iarr++;
			}
		}
		if (divarray.length<1) {
			document.getElementById('defaultQLinks').style.display='inline';
		}
	}
	else {
		if(document.getElementsByName('typo3-added-navLink').length<1) 
			document.getElementById('defaultQLinks').style.display='inline';
	}
} // End function displayCorrectQuickLinks

function checkRelatedLinks() {
  return; // This function replaced on 10/1/2008 by php code.  -Sid
  var len = document.getElementsByName('typo3-added-navLink').length;
  if(len<1) {
    document.getElementById('relatedLinksTitle').style.display='none';
    document.getElementById('relatedLinks').style.display='none'; 
  } else {
    var pb = (3 - len) * 15;
    if(pb>0) document.getElementById('relatedLinks').style.paddingBottom=pb + 'px';
  }
  //alert(pb);
} // End function checkRelatedLinks

function pageSetup(templateName) { // call whatever functions you need to run at the end of page load here:
  if (document.getElementById('LogonForm') != null) document.getElementById('LogonUsername').focus();
  //else if(document.getElementById('mainSearch')) document.getElementById('mainSearch').focus();
  if(templateName=='department' && document.getElementById('contactSet')==null && document.getElementById('deptChair')==null && document.getElementById('deptContactContainer')!=null) {
    document.getElementById('deptContactContainer').style.display='none';
  }
  checkForRandomLinks();
} // End function pageSetup

function checkForRandomLinks() {
  if(!document.getElementById('randomLink_1')) return;
  var i=1;
  while(document.getElementById('randomLink_'+i)) i++;
  var r=rand(i-1);
  document.getElementById('randomLink_'+r).style.display='inline';
} // End function checkForRandomLinks

function rand ( n ) { // returns a random number between 1 and n
  return ( Math.floor ( Math.random ( ) * n + 1 ) );
} // End function rand 

// functions addLink|editLinks added by Sid for myLINKS 12/2006 //
function addLink(url) {
	vHWin=window.open('http://www.wallawalla.edu/change/editMyLinks.php?url='+ url +'&title='+ document.title,'addLink','height=125,width=500,status=no,toolbar=no,directories=no,menubar=no,resizable=no,titlebar=no,scrollbars=no,location=no');
	vHWin.focus();
} // End function addLink

function editLinks() {
	vHWin=window.open('http://www.wallawalla.edu/change/editMyLinks.php?edit=mine','editLinks','height=545,width=750,status=no,menubar=no,titlebar=no,toolbar=no,directories=no,scrollbars=yes,location=no');
	vHWin.focus();
} // End function editLinks

//This function is for the blocker rollovers
function movepic(img_name,img_src){
  document.getElementById(img_name).src=img_src;
}

// Banner Cross-fade Functions

function createCSS(selector, declaration) {  
	// test for IE  
	var ua = navigator.userAgent.toLowerCase();  
	var isIE = (/msie/.test(ua)) && !(/opera/.test(ua)) && (/win/.test(ua));  
	
	// create the style node for all browsers  
	var style_node = document.createElement("style");  
	style_node.setAttribute("type", "text/css");  
	style_node.setAttribute("media", "screen");   
	
	// append a rule for good browsers  
	if (!isIE) style_node.appendChild(document.createTextNode(selector + " {" + declaration + "}"));  
	
	// append the style node  
	document.getElementsByTagName("head")[0].appendChild(style_node);  
	
	// use alternative methods for IE  
	if (isIE && document.styleSheets && document.styleSheets.length > 0) {  
		var last_style_node = document.styleSheets[document.styleSheets.length - 1];  
		if (typeof(last_style_node.addRule) == "object") last_style_node.addRule(selector, declaration);  
	}  
} // End function createCSS

/*****

Image Cross Fade Redux
Version 1.0
Last revision: 02.15.2006
steve@slayeroffice.com

Please leave this notice intact. 

Rewrite of old code found here: http://slayeroffice.com/code/imageCrossFade/index.html


*****/

window.addEventListener?window.addEventListener("load",xfade_init,false):window.attachEvent("onload",xfade_init);

function xfade_init() {
	if (!d.getElementById || !d.createElement)return;
	if (d.getElementById("photoBannerText") == null)return;

//	// DON'T FORGET TO GRAB THIS FILE AND PLACE IT ON YOUR SERVER IN THE SAME DIRECTORY AS THE JAVASCRIPT!
//	// http://slayeroffice.com/code/imageCrossFade/xfade2.css
//	css = d.createElement("link");
//	css.setAttribute("href","xfade2.css");
//	css.setAttribute("rel","stylesheet");
//	css.setAttribute("type","text/css");
//	d.getElementsByTagName("head")[0].appendChild(css);

	dobj = d.getElementById("imageContainer").getElementsByTagName("span");

	for(i=1;i<dobj.length;i++) dobj[i].xOpacity = 0;
	dobj[0].style.display = "block";
	dobj[0].xOpacity = .99;
	
	setTimeout(xfade,3000);
} // End function xfade_init

function xfade() {
	cOpacity = dobj[current].xOpacity;
	nIndex = dobj[current+1]?current+1:current;

	nOpacity = dobj[nIndex].xOpacity;
	
	cOpacity-=.05; 
	nOpacity+=.05;
	
	dobj[nIndex].style.display = "block";
	dobj[current].xOpacity = cOpacity;
	dobj[nIndex].xOpacity = nOpacity;
	
	setOpacity(dobj[current]); 
	setOpacity(dobj[nIndex]);
	
	if(cOpacity<=0) {
		dobj[current].style.display = "none";
		current = nIndex;
		setTimeout(xfade,3000);
	} else {
		setTimeout(xfade,50);
	}
	
	function setOpacity(obj) {
		if(obj.xOpacity>.99) {
			obj.xOpacity = .99;
			return;
		}
		obj.style.opacity = obj.xOpacity;
		obj.style.MozOpacity = obj.xOpacity;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")";
	}
	
} // End function xfade

// End Banner functions


function depNavColorSet() {
  var headerName = document.getElementById('headerName').innerHTML;
  if(headerName=='') {
    headerName = document.getElementById('slid_field_deptname').value;
    document.getElementById('headerName').innerHTML = headerName;
  }
  var clr = document.getElementById('deptNavColor').value;
  //alert(clr);
  if(!clr) clr = document.getElementById('slid_field_deptnavbgcolor').value;
  //alert(clr);
  if(clr=='') clr='#c88000';
  //alert(clr);
  document.write("<style>\n");
  //document.getElementById('leftNavigationNew').style.backgroundColor = clr;
  document.write("#leftNavigationNew,#sideBar { background-color: "+clr+"; }\n");
  document.write(".keylinesClear{ background-image: url('/fileadmin/templates/3.0/images/department/keylines_"+clr.substr(1,6)+".gif'); }\n");
  //if(isUndefined(document.getElementById('c28913'))) document.write(".keylinesClear{ height:262px; }\n");
  var diff = 15;
  var R = parseInt(clr.substr(1,2),16)-diff;
  var G = parseInt(clr.substr(3,2),16)-diff;
  var B = parseInt(clr.substr(5,2),16)-diff;
  if(R<1) R=0; if(G<0) G=0; if(B<0) B=0;
  var hClr = RGBtoHEX(R,G,B);
  //alert(hClr);
  document.write(".nav1ACTH,.nav1CUR,.nav2NOH,.nav2CURH,.nav3NOH { background-color:"+hClr+"; }\n");
  //R += 2 * diff;  G += 2 * diff;  B += 2 * diff;
  R = parseInt(clr.substr(1,2),16)+diff;
  G = parseInt(clr.substr(3,2),16)+diff;
  B = parseInt(clr.substr(5,2),16)+diff;
  if(R>255) R=255; if(G>255) G=255; if(B>255) B=255;
  hClr = RGBtoHEX(R,G,B);
  //alert(hClr);
  document.write(".nav1CUR,.nav1CURH,.nav2CUR,.nav2CURH { background-color:"+hClr+"; }\n");
  document.write(".nav1UL,.nav2UL,.nav3UL div { border-bottom: 1px solid "+clr+"; }\n");
  document.write("#cutCorner,.acadColor { background-color: "+clr+"; }\n");
  if(document.getElementById('pageTable')) document.write("#relatedLinks div { border-bottom: 1px solid "+clr+"; }\n");
  document.write("</style>\n");
} // End function depNavColorSet

function RGBtoHEX(R,G,B) { // Takes RGB decimal color numbers and returns hex format, like #0d586b
  var r = R.toString(16); var g = G.toString(16); var b = B.toString(16); 
  if(r.length<2) r='0'+r; if(g.length<2) g='0'+g; if(b.length<2) b='0'+b;
  return '#' + r + g + b;
} // End function RGBtoHEX

function setupFlash() {
	var flashPath = document.getElementById('flashPath').value;
	var flashWidth = document.getElementById('flashWidth').value;
	if(flashWidth<1) flashWidth='246';
	var flashHeight = document.getElementById('flashHeight').value;
	if(flashHeight<1) flashHeight='175';
	var flashID = document.getElementById('flashID').value;
	var flashBGcolor = document.getElementById('flashBGcolor').value;
	if(flashBGcolor=='') flashBGcolor='#000000';
	var flashVer = document.getElementById('flashVer').value;
	if(flashVer=='') flashVer='1';
	var flashQuality = document.getElementById('flashQuality').value;
		var xmlDataPath = document.getElementById('xmlDataPath').value;
	//alert(flashPath+','+flashID+', '+flashWidth+', '+flashHeight+', '+ flashVer+', '+ flashBGcolor+', '+ flashQuality);
	var so = new SWFObject(flashPath, flashID, flashWidth, flashHeight, flashVer, flashBGcolor, flashQuality);
	//xml file use - Added by Eric Lien.

	so.addVariable("xmlDataPath", xmlDataPath);
	// end xml file use
	so.useExpressInstall('/javascript/swfobject/expressinstall.swf');
  so.write("flashcontent");
} // End setupFlash

var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
function simpleEncode(input) {  // same as PHP base64_encode
  var output = "";  
  var chr1, chr2, chr3, enc1, enc2, enc3, enc4;  
  var i = 0;  

  input = utf8_encode(input);  

  while (i < input.length) {  

      chr1 = input.charCodeAt(i++);  
      chr2 = input.charCodeAt(i++);  
      chr3 = input.charCodeAt(i++);  

      enc1 = chr1 >> 2;  
      enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);  
      enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);  
      enc4 = chr3 & 63;  

      if (isNaN(chr2)) {  
          enc3 = enc4 = 64;  
      } else if (isNaN(chr3)) {  
          enc4 = 64;  
      }  

      output = output +  
      keyStr.charAt(enc1) + keyStr.charAt(enc2) +  
      keyStr.charAt(enc3) + keyStr.charAt(enc4);  

  }  

  return output;  
}  

function simpleDecode(input) {  // same as PHP base64_decode
  var output = "";  
  var chr1, chr2, chr3;  
  var enc1, enc2, enc3, enc4;  
  var i = 0;  

  input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");  

  while (i < input.length) {  

      enc1 = keyStr.indexOf(input.charAt(i++));  
      enc2 = keyStr.indexOf(input.charAt(i++));  
      enc3 = keyStr.indexOf(input.charAt(i++));  
      enc4 = keyStr.indexOf(input.charAt(i++));  

      chr1 = (enc1 << 2) | (enc2 >> 4);  
      chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);  
      chr3 = ((enc3 & 3) << 6) | enc4;  

      output = output + String.fromCharCode(chr1);  

      if (enc3 != 64) {  
          output = output + String.fromCharCode(chr2);  
      }  
      if (enc4 != 64) {  
          output = output + String.fromCharCode(chr3);  
      }  

  }  

  output = utf8_decode(output);  

  return output;  

}  

function utf8_encode(string) {  
   string = string.replace(/\r\n/g,"\n");  
   var utftext = "";  
 
   for (var n = 0; n < string.length; n++) {  
 
       var c = string.charCodeAt(n);  
 
       if (c < 128) {  
           utftext += String.fromCharCode(c);  
       }  
       else if((c > 127) && (c < 2048)) {  
           utftext += String.fromCharCode((c >> 6) | 192);  
           utftext += String.fromCharCode((c & 63) | 128);  
       }  
       else {  
           utftext += String.fromCharCode((c >> 12) | 224);  
           utftext += String.fromCharCode(((c >> 6) & 63) | 128);  
           utftext += String.fromCharCode((c & 63) | 128);  
       }  
 
   }  
 
   return utftext;  
}  
 
function utf8_decode(utftext) {  
   var string = "";  
   var i = 0;  
   var c = c1 = c2 = 0;  
 
   while ( i < utftext.length ) {  
 
       c = utftext.charCodeAt(i);  
 
       if (c < 128) {  
           string += String.fromCharCode(c);  
           i++;  
       }  
       else if((c > 191) && (c < 224)) {  
           c2 = utftext.charCodeAt(i+1);  
           string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));  
           i += 2;  
       }  
       else {  
           c2 = utftext.charCodeAt(i+1);  
           c3 = utftext.charCodeAt(i+2);  
           string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));  
           i += 3;  
       }  
 
   }  
 
   return string;  
}  

function decodeEmail(input)	{
	//alert(simpleDecode(input));
  location.href = 'mailto:'+simpleDecode(input);
}

function isIEObject(a) {
  return isObject(a) && typeof a.constructor != 'function';
} // END function 

// This function returns true if a is an array, meaning that it was produced 
//by the Array constructor or by the [ ] array literal notation.
function isArray(a) {
  return isObject(a) && a.constructor == Array;
} // END function 

// This function returns true if a is one of the Boolean values, true or false.
function isBoolean(a) {
  return typeof a == 'boolean';
} // END function 

// This function returns true if a is an object or array or function containing no enumerable members.
function isEmpty(o) {
    if (isObject(o))
{
         for (var i in o)
 {
              return false;
         }
    }
    return true;
} // END function isEmpty


// This function returns true if a is a function. Beware that some native 
//functions in IE were made to look like objects instead of functions. 
//This function does not detect that.Netscape is better behaved in this regard.
function isFunction(a) {
    return typeof a == 'function';
} // END function 

// This function returns true if a is the null value.
function isNull(a) {
    return typeof a == 'object' && !a;
} // END function 

// This function returns true if a is a finite number. It returns false if a is NaN or Infinite. 
//It also returns false if a is a string that could be converted to a number.
function isNumber(a) {
    return typeof a == 'number' && isFinite(a);
} // END function 

// This function returns true if a is an object, array, or function. 
//It returns false if a is a string, number, Boolean, null, or undefined.
function isObject(a) {
   return (typeof a == 'object' && !!a) || isFunction(a);
} // END function 

// This function returns true if a is a string.
function isString(a) {
   return typeof a == 'string';
} // END function 

// This function returns true if a is the undefined value. 
//You can get the undefined value from an uninitialized variable or from an object's missing member.
function isUndefined(a) {
   return typeof a == 'undefined';
} // END function 

function resize_iframe(obj) {
  if(! isObject(document.getElementById("docIframe"))) return;
  /*
docHeight = docIframe.document.body.scrollHeight;
obj.style.height = docHeight + 'px';
 return;
 */
  var ffHeight=ieHeight=high=0;
  high=window.innerHeight-55; //Firefox & most other browsers
	if (!high) high=document.documentElement.clientHeight-70; //IE
	if (!high) high=document.body.clientHeight-70; //IE or something weird
	var bifrm=document.getElementById("docIframe");
	var bHeight=parseInt(high - bifrm.offsetTop);
	//if(bHeight<740) bHeight=740;
	//bHeight=1100;
	bifrm.style.height=bHeight+"px";
	//alert(bHeight);
} // End function resize_iframe

function resize_iframe2(obj) {
  var iFrameHeight = parseInt(obj.scrollHeight);
  var bodyHeight = parseInt(document.body.scrollHeight);
  obj.style.height='1000px';
  //alert(iFrameHeight+', '+bodyHeight+', '+obj.style.height);
  //alert(obj.contentWindow.scrollMaxY);
  //alert(obj.offsetHeight+' '+obj.clientHeight);
  //alert(obj.scrollHeight+' '+obj.clientHeight);
  //alert(document.cookie);
} // End function resize_iframe2

function resize_iframe3(obj) {
  //var iFrameHeight = parseInt(obj.scrollHeight);
  //var bodyHeight = parseInt(document.body.scrollHeight);
  //obj.style.height='1000px';
  obj.style.height=parseInt(document.body.scrollHeight)+'px';
  //alert(iFrameHeight+', '+bodyHeight+', '+obj.style.height);
  //alert(obj.contentWindow.scrollMaxY);
  //alert(obj.offsetHeight+' '+obj.clientHeight);
  //alert(obj.scrollHeight+' '+obj.clientHeight);
  //alert(document.cookie);
} // End function resize_iframe2

function setIframeHeight(h) {
  //document.getElementById("plan_gs_Iframe").style.height=h+'px';
} // End function setIframeHeight

function ExternalDocSetup() {
  //alert(document.location.href);
  var formName=document.getElementById('formName').value;
  var extDocURL=document.getElementById('extDocURL').value;
  if(formName!='') {
    document.write("<style>#rightBorderDiv{width:9px;}</style>");
    document.write("<iframe id='formIframe' width='730' SRC='/form/?"+formName+"&typo3=true' HSPACE='0' VSPACE='0' frameborder='0' scrolling='no' marginwidth='0' marginheight='0' ></iframe>");
  }
  else if(extDocURL!='' && extDocURL.match("plan.gs")) {
    document.write("<iframe id='plan_gs_Iframe' name='plan_gs_Iframe' width='730' onLoad='resize_iframe2(this);' SRC='"+extDocURL+"' HSPACE='0' VSPACE='0' frameborder='0' scrolling='auto' marginwidth='0' marginheight='0' ></iframe>");
    var iFrameWidthInPixels=document.getElementById('iFrameWidthInPixels').value;
    if(iFrameWidthInPixels!=0) document.write("<style>#docIframe{width:"+iFrameWidthInPixels+"px;}</style>");
    document.write("<style>#rightBorderDiv{width:9px;} #plan_gs_Iframe{margin:9px;margin-right:9px;}</style>");
    var ifrm=document.getElementById('plan_gs_Iframe');
    //ifrm.height=ifrm.scrollHeight;
    //alert(ifrm.scrollHeight);
    //alert('client: '+ifrm.clientHeight+'. scroll: '+ifrm.scrollHeight);
  }
  else if(extDocURL!='') {
    document.write("<style>#rightBorderDiv{width:0px;}</style>");
    document.write("<iframe id='docIframe' name='docIframe' width='730' onLoad='resize_iframe(this);' SRC='"+extDocURL+"' HSPACE='0' VSPACE='0' frameborder='0' scrolling='auto' marginwidth='0' marginheight='0' ></iframe>");
    var iFrameWidthInPixels=document.getElementById('iFrameWidthInPixels').value;
    if(iFrameWidthInPixels!=0) document.write("<style>#docIframe{width:"+iFrameWidthInPixels+"px;}</style>");
  }
  else if(formName!='' || extDocURL!='') {
  	var ua = navigator.userAgent.toLowerCase();  
	  var isIE = (/msie/.test(ua)) && !(/opera/.test(ua)) && (/win/.test(ua));  
    if(isIE) document.write("<style>#formIframe,#docIframe{margin-bottom: 0px;}</style>");
  }
} // End function ExternalDocSetup

function xmlhttpPost(strURL) {
    //strURL='http://www.wallawalla.edu/form/';
    var http_request = false;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        http_request = new XMLHttpRequest();
   /*
   try {
        netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
       } catch (e) {
        alert("Permission UniversalBrowserRead denied.");
       }
    */
    }
    // IE
    else if (window.ActiveXObject) {
        http_request = new ActiveXObject("Microsoft.XMLHTTP");
    }
    if (!http_request) {
      alert('Cannot create XMLHTTP instance');
      return false;
    }
    http_request.open('POST', strURL, true);
    http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http_request.onreadystatechange = function() {
        if (http_request.readyState == 4) {
          if(request.status == 200) {
            alert('OK');
            return http_request.responseText;
          } else {
            alert("didn't get 200 status");
          }
        }else {
            alert("didn't get 4 status");
        }
    }
    //http_request.send(getquerystring());
} // End function xmlhttpPost

function createContactInfo() {
  var labels=document.getElementsByName('label');
  var phones=document.getElementsByName('phone');
  var faxs=document.getElementsByName('fax');
  var emails=document.getElementsByName('email');
  var personNames=document.getElementsByName('personName');
  var personTitles=document.getElementsByName('personTitle');
  var personEmails=document.getElementsByName('personEmail');
  var elementNumber=labels.length-1;
  var label=labels[elementNumber].value;
  document.write("<div class='deptContact deptContactName'>"+label+"</div>\n");
  var phone=phones[elementNumber].value;
  if(phone) document.write("<div class='deptContact'>Phone: "+phone+"</div>\n");
  var fax=faxs[elementNumber].value;
  if(fax) document.write("<div class='deptContact'>FAX: "+fax+"</div>\n");
  var email=emails[elementNumber].value;
  var emailCode=simpleEncode(email);
  var emailText=email.replace('@','(AT)');
  if(email) document.write("<div class='deptContact'><a href='javascript:decodeEmail(\""+emailCode+"\")'>"+emailText+"</a></div>\n");
  var personName=personNames[elementNumber].value;
  if(!personName) return;
  var personTitle=personTitles[elementNumber].value;
  if(personTitle) personTitle=personTitle+': ';
  var personEmail=personEmails[elementNumber].value;
  emailCode=simpleEncode(personEmail);
  document.write("<div class='deptContact'>"+personTitle);
  if(personEmail) document.write("<a href='javascript:decodeEmail(\""+emailCode+"\")'>"+personName+"</a></div>\n");
  else document.write(personName+"</div>\n");
} // End function createContactInfo

function ttnews_simlink(elid) {
	var attrval=document.getElementById(elid).innerHTML;
	var result=attrval.replace(/^.*href="/,'');
	result=result.replace(/".*$/,'');
	document.location.href="/"+result;
}

