function toggleDiv(_id){_oDivStyle=document.getElementById(_id).style;(_oDivStyle.display=='block')?_oDivStyle.display='none':_oDivStyle.display='block';}

// window popups (PH: 10/12/04)

var w;
function getWindowCenter(_iX,_iY){
	var iWinX=(screen.width - _iX)/2;
	var iWinY=(screen.height - _iY)/2;
	return('top='+iWinY+',left='+iWinX);
}

function createWindowName(_sUrl){
	var _iLastSlash=_sUrl.lastIndexOf('/');
	var _iLastSlashMin=_sUrl.substring(0,(_iLastSlash-1)).lastIndexOf('/');
	return(_sUrl.substr(_iLastSlash,_sUrl.length).indexOf('.')>0)?('file_'+escape(_sUrl.substring(_iLastSlash+1,_sUrl.lastIndexOf('.')))):('file_'+ escape(_sUrl.substring((_iLastSlashMin+1),_iLastSlash)));
}

function createWindow(_sUrl,_sName,_sParams){
	w=window.open(_sUrl,_sName,_sParams);
	w.focus();
}

function popUp(_sUrl,_sType){
	var _sParams,_sName,_sWinPos,_iX,_iY;
	switch(_sType){
		case'form':
			_iX=645;
			_iY=440;
			_sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0;toolbars=0,resizable=0,status=1';
			_sName='form';
			break;
		case'note':
			_iX=645;
			_iY=500;
			_sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0;toolbars=0,resizable=0,status=1';
			_sName=createWindowName(_sUrl);
			break;
		case'img':
			_iX=500;
			_iY=380;
			_sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0;toolbars=0,resizable=1,status=1';
			_sName=createWindowName(_sUrl);
			break;
		case'xls':
		case'pdf':
			_iX=600;
			_iY=500;
			_sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0,toolbars=1,resizable=1,status=1';
			_sName='file';
			break;
	};
	_sWinPos=getWindowCenter(_iX,_iY);
	_sParams+=','+_sWinPos;
 	createWindow(_sUrl,_sName,_sParams);
}

// Search box

window.onload=function(){
 var _oSearchBox=document.getElementById('txtSearchHeader');
 _oSearchBox.value='Search the site';
 _oSearchBox.onfocus=function(){this.value='';};
};