<!-- 

/* Coded by Danny Famularo 4/06/07
  
   Functions show() and hide() are use to show and hide sub menus
   Functions hold() and release() hold the current menu option colour
   
*/
function navActionOver(){//navActionOver(holdid, showid, hideid1, hideid2, hideid3...)
	for (var i = 0; i < 1; i ++) { //holds main nav
	document.getElementById(arguments[i]).style.background="#ebebe5";
	document.getElementById(arguments[i]).style.borderBottom="1px solid #ebebe5";
	document.getElementById(arguments[i]).style.background="#ebebe5 url(/CN/_images/system/Menu_bg_down.gif) no-repeat left"
	}
	for (var i = 1; i < 2; i ++) { //shows main nav
	document.getElementById(arguments[i]).style.display="block";
	}
	for (var i = 2; i < arguments.length; i++) { //hides remaining ID's
	document.getElementById(arguments[i]).style.display="none"
	}
}

function navActionOff(){//navActionOff(releaseid, hideid1, hideid2, hideid3...)
	for (var i = 0; i < 1; i++){ //releases main nav
	document.getElementById(arguments[i]).style.background="#5c5c5c";
	document.getElementById(arguments[i]).style.borderBottom="1px solid #fff";
	document.getElementById(arguments[i]).style.background="#5c5c5c url(/CN/_images/system/Menu_bg.gif) no-repeat left"
	}
	for (var i = 1; i < arguments.length; i++) { //hides remaining ID's
	document.getElementById(arguments[i]).style.display="none"
	}
}
//showid, holdMenuid, releaseMenuid1, releaseMenuid2, releaseMenuid3, releaseMenuid4, hideid1, hideid2, hideid3, hideid4
//'smenu1', 'smenu2', 'smenu3', 'smenu4', 'smenu5', 'm1', 'm2', 'm3', 'm4', 'm5'

function showID(){
	for (var i = 0; i < arguments.length; i++){
		document.getElementById(arguments[i]).style.display="block"
	}
}

function hideID(){
	for (var i = 0; i < arguments.length; i++){
		document.getElementById(arguments[i]).style.display="none"
	}	
}

function holdID(){
	for (var i = 0; i < arguments.length; i++){
	document.getElementById(arguments[i]).style.color="#5c5c5c";
	document.getElementById(arguments[i]).style.background="#ebebe5";
	document.getElementById(arguments[i]).style.borderBottom="1px solid #ebebe5";
	document.getElementById(arguments[i]).style.background="#ebebe5 url(/CN/_images/system/Menu_bg_down.gif) no-repeat left"
	}	
}

function releaseID(){
	for (var i = 0; i < arguments.length; i++){
	document.getElementById(arguments[i]).style.color="#fff"	
	document.getElementById(arguments[i]).style.background="#5c5c5c";
	document.getElementById(arguments[i]).style.borderBottom="1px solid #fff";
	document.getElementById(arguments[i]).style.background="#5c5c5c url(/CN/_images/system/Menu_bg.gif) no-repeat left"
	}		
}

function toggleLayer( whichLayer ){  

	var elem, vis;  
	if( document.getElementById ) // this is the way the standards work   
		elem = document.getElementById( whichLayer );  
	else if( document.all ) // this is the way old msie versions work      
		elem = document.all[whichLayer]; 
	else if( document.layers ) // this is the way nn4 works    
		elem = document.layers[whichLayer];  
	vis = elem.style;  // if the style.display value is blank we try to figure it out here  
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined){    
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
		}
	vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

	
function toggle( elem, color, image, whichLayer )
{	
	var style2 = elem.style;
	var elem, vis;  
	style2.backgroundColor = style2.backgroundColor? "": color ;
	style2.backgroundImage = style2.backgroundImage? "":"url("+ image +")";
	style2.color = style2.color? "":"#FFFFFF";
	if( document.getElementById ) // this is the way the standards work   
		elem = document.getElementById( whichLayer );  
	else if( document.all ) // this is the way old msie versions work      
		elem = document.all[whichLayer]; 
	else if( document.layers ) // this is the way nn4 works    
		elem = document.layers[whichLayer];  
	vis = elem.style;  // if the style.display value is blank we try to figure it out here  
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined){    
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
		}
	vis.display = (vis.display==''||vis.display=='block')?'none':'block';
} 

function popUp(url, winWidth, winHeight){

var winWidth
var winHeight

winHeight = parseInt(winHeight);
winWidth = parseInt(winWidth);

winWidth = winWidth + 17  // this is to account for room in the scrollbar for IE
			
popUpWindow = window.open(url, null,' menu=1,menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,top=120,left=115,width=' + winWidth + ',height=' + winHeight);
//popUpWindow.focus();  //this line of code causes Access is Denied error pop up message in IE 4.0
} 
//------------------------------------------------------------
// Start search page function
//------------------------------------------------------------
function searchValidateNewSearch() {
	if (document.search.query.value.length > 0) {
		return true;
	} else {
		document.search.query.focus();
		return false;
	}
}

function searchSyncInput(passedVal) {
	document.search.txtquery.value = passedVal;
	document.search.txtquerybot.value = passedVal;
}

function searchQueryCriteriaChanged() {
	var df = document.search;
	
	if (df.txtquery.value.toLowerCase() != df.query.value.toLowerCase() ||
		df.txtquerybot.value.toLowerCase() != df.query.value.toLowerCase()) {
		
		if (df.txtquery.value != df.query.value) {
			df.txtquerybot.value = df.txtquery.value;
			df.query.value = df.txtquery.value;
		}
		
		if (df.txtquerybot.value != df.query.value) {
			df.txtquery.value = df.txtquerybot.value;
			df.query.value = df.txtquerybot.value;
		}
		
		return true;
	} else {
		return false;
	}
}

function searchValidate() {
	if (searchQueryCriteriaChanged()) {
		document.search.page.value = 0;
	}
	return true;
}

function searchViewResultsPage(passedVal) {
	document.search.page.value = passedVal;
	if (searchQueryCriteriaChanged()) {
		document.search.page.value = 0;
	}
	document.search.submit();
}

function searchShowDocSummaries(passedVal) {
	document.search.showDocSummaries.value = passedVal;
	searchValidate();
	document.search.submit();
}

// Global Get browser function - returns Netscape for Firefox / Netscape and Internet Explorer for MSIE
function getBrowser() {
	var browser=navigator.appName;
	return browser;
}

//Calculate Total height of page - Generally used to create a greyed out cover layer. 
function getH(){		
	var divh = 10
	divh = divh + document.getElementById("mainHeadContainer").offsetHeight;
	divh = divh + document.getElementById("navContainer").offsetHeight;
	divh = divh + document.getElementById("subNavContainer").offsetHeight;
	divh = divh + document.getElementById("contentContainer").offsetHeight;
	// Accounts for IE not including the footer container in calulation of total height.
		if (getBrowser() == "Netscape"){
		divh = divh + document.getElementById("footerContainer").offsetHeight;
		}
	return divh
} 

//Must be included on the onload event listener to enable DHTML popup. Sets the height of the grey cover and the popupcontainer divs
function initPopUp(){
	document.getElementById("coverPopUpContainer").style.height = getH() + "px";
	document.getElementById("cover").style.height = getH() + "px";
}

function showPopUp(popUp, position){
	showID('cover','coverPopUpContainer', popUp)
	document.getElementById(popUp).style.marginTop = position + "px";
}

function hidePopUp(popUp){
	hideID('cover','coverPopUpContainer', popUp)
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

/*------------------------------------------------------------
	Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
	Web Site: http://txkang.com
	Script featured on Dynamic Drive (http://www.dynamicdrive.com)
	
	Please retain this copyright notice in the script.
	License is granted to user to reuse this code on 
	their own website if, and only if, 
	this entire copyright notice is included.
--------------------------------------------------------------*/

//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','td','tr','h1','h2','h3','h4','h5','h6','p','a');

//Specify spectrum of different font sizes:
var szs = new Array( '13px','15px','16px','17px','19px','21px');
var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 5 ) sz = 5;
	startSz = sz;
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}