 function clear_searchbox() {
   if (document.frmSearch.in_tx_query.value == 'Search Site')
     document.frmSearch.in_tx_query.value = '';
}

	function pageWidth() { 																			
		return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;	
	}																								
																									
	function pageHeight() {																			
		return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;	
	}																								
																									
	function getposOffset(what, offsettype) {														
		var totaloffset = (offsettype=='left') ? what.offsetLeft : what.offsetTop;					
		var parentEl = what.offsetParent;															
		while(parentEl != null) {																	
			totaloffset = (offsettype=='left') ? totaloffset + parentEl.offsetLeft : totaloffset + parentEl.offsetTop;	
			parentEl = parentEl.offsetParent;														
		}																							
		return totaloffset;																			
	}																								
																									
	//Creates a new shim for the menu																
	function createMenuShim(menu) {																	
		if (menu==null) return null;																
		var shim = document.createElement("<iframe scrolling='no' frameborder='0' style='position:absolute; top:0px; left:0px; display:none'></iframe>"); 
		shim.name = getShimId(menu);																
		shim.id = getShimId(menu);																	
		window.document.body.appendChild(shim);														
		return shim;																				
	}																								
																									
	//Opens a shim, if no shim exists for the menu, one is created									
	function openShim(menu) {																		
		if (menu==null) return;																		
		var shim = getShim(menu);																	
		if (shim==null) shim = createMenuShim(menu,getShimId(menu));								
																									
		shim.style.width = menu.offsetWidth;														
		shim.style.height = menu.offsetHeight;														
		shim.style.top = getposOffset(menu, 'top');													
		shim.style.left = getposOffset(menu, 'left');												
		shim.style.zIndex = menu.style.zIndex - 1;													
		shim.style.position = 'absolute';															
		shim.style.display = 'block';																
	}																								
																									
	//Closes the shim associated with the menu														
	function closeShim(menu) {																		
		if (menu==null) return;																		
		var shim = getShim(menu);																	
		if (shim!=null) shim.style.display = 'none';												
	}																								
																									
	//Creates an id for the shim based on the menu id												
	function getShimId(menu) {																		
		if (menu.id==null) return '__shim';															
		return '__shim'+menu.id;																	
	}																								
																									
	//Returns the shim for a specific menu															
	function getShim(menu) {																		
		return document.getElementById(getShimId(menu));											
	}																								
																									
	function mover(el) {																			
		clearTimeout(el.outTimeout);																
		for (var i = 0; i < el.childNodes.length; i++) {											
			var node = el.childNodes[i];															
			if (node.nodeName.toLowerCase() == 'ul')												
			{																						
				node.style.display = 'block';														
				node.style.zIndex = 100;															
																									
				// If there's not enough vertical space for the flyout...							
				if(getposOffset(node, 'top') + node.offsetHeight > pageHeight()) {					
					// Then restrict its height to the available room and add a scroll bar.			
					node.style.height = pageHeight() - getposOffset(node, 'top');					
					node.style.overflowY = 'auto'; node.style.overflow.y = 'auto';					
				}																					
																									
				// If there's not enough space to the right to display the flyout...				
				if(getposOffset(node, 'left') + node.offsetWidth > pageWidth()) {					
					// Then move it back to the left until it fits.									
					node.style.left = (pageWidth()-(getposOffset(node,'left')+node.offsetWidth)).toString() + 'px';	
				}																					
																									
				if (typeof document.body.style.maxHeight == 'undefined' && document.readyState =='complete') // only for IE6 and lower	
					openShim(node);																	
			}																						
		}																							
	}																								
																									
	function stayopen(el) {																			
		clearTimeout(el.outTimeout);																
	}																								
																									
	function mout(el) {																				
		el.outTimeout = setTimeout(function() {mout2(el);},200);				
	}																								
																									
	function mout2(el) {																			
		for (var i = 0; i < el.childNodes.length; i++) {											
			var node = el.childNodes[i];															
			if (node.nodeName.toLowerCase() == 'ul')												
			{																						
				node.style.display = 'none';														
				if (typeof document.body.style.maxHeight == 'undefined') // only for IE6 and lower	
					closeShim(node);																
			}																						
		}																							
	}																								
																									
 function setActiveTab(tabID) {																	
		PTPortlet.setSessionPref('activeTabID', tabID);												
		//alert('Active Tab ID = ' + tabID);															
		return true;																				
 }																								
