//Fix for IE6 image flicker
if(document.uniqueID && !window.XMLHttpRequest ){
	document.execCommand("BackgroundImageCache",false,true)
}

/********************************************************
Name: 			javascript stylesheet
Description: 	loads javascript specific stylesheet
********************************************************/

document.write('<link rel="StyleSheet" href="/css/airboxJavascript.css" type="text/css" media="screen" />');


function fnConfig(){
	fnInitShowHide();
	}

	
function fnInitShowHide() {
	if(document.getElementById("showHideLinks")){
		var shLinks = document.getElementById("showHideLinks").getElementsByTagName("A");
	
		for( var i=0; i < shLinks.length; i++ ){
			shLinks[i].onclick = function(){
				
				fnAnchorShowHide(this);
				fnSelectMe(this);
				return false;
	
				}
			}	
		}	
	}	
	

/********************************************************************************
 
Name:			fnAnchorShowHide
Description:	Show / Hide the tabbed content.  Non-Js fall back to link to page anchors. 
				Anchor contains link to ID of element to show/hide.  JS takes the 
				url, splits string to get ID after the "#", and uses this ID to target
				element to show/hide.

*********************************************************************************/	
	
function fnAnchorShowHide(targ) {
	
	var itDetails = document.getElementById("showHideWrapper").getElementsByTagName("DIV");
	
	for (i=0;i<itDetails.length;i++) { /* Loop through to hide all items */
		itDetails[i].style.display = "none";	
		}	
	
	var showItem = targ.href.split("#")[1];	/* Get ID from link */
	
	var showItem = targ.href.split("#")[1];	/* Get ID from link */
	document.getElementById(showItem).style.display = "block";	
		
	}	
	


/********************************************************************************
 
Name:     		fnSelectMe
Description: 	Sets class "selected" on the LI in the nav list that is 
				clicked on

*********************************************************************************/	
function fnSelectMe(obj) {
	var listItems = document.getElementById("showHideLinks").getElementsByTagName("LI");
	
	for (i=0;i<listItems.length;i++) {
		listItems[i].className = "";
	}	
	
	obj.parentNode.className = "selected";
}	
