

//dhtml menus
var cnnDocumentOnClickFunc = '';
		var cnnCurrDisplayBBinDhtmlMenuId = '';
		var cnnCurrDisplayBBinDhtmlStatus = 'hidden';
		function cnnCloseBBinDhtmlMenu()
		{
			cnnFlipDisplayIdNode(cnnCurrDisplayBBinDhtmlMenuId);
			cnnCurrDisplayBBinDhtmlStatus = 'visible';
		}
		function cnnFlipDisplayIdNode(id,position)
		{
			var nodeToMod= document.getElementById(id);
			if(nodeToMod && nodeToMod.style)
			{
				var currDisplayValue = '';
				if((cnnCurrDisplayBBinDhtmlStatus=='visible') && (id==cnnCurrDisplayBBinDhtmlMenuId))
				{
					document.onclick=cnnDocumentOnClickFunc;
					cnnDocumentOnClickFunc='';
					nodeToMod.style.visibility='hidden';
					cnnCurrDisplayBBinDhtmlStatus = 'hidden';
				}
				else
				{
					if(position) { nodeToMod.style.left = position;}
					nodeToMod.style.visibility='visible';
					cnnCurrDisplayBBinDhtmlStatus = 'visible';
					cnnDocumentOnClickFunc = document.onclick;
					cnnCurrDisplayBBinDhtmlMenuId = id;
					document.onclick = cnnCloseBBinDhtmlMenu;
				}
			}
		}
		
//navbar
function cnnSetHoverClass(obj, className, direction)
		{
			if(obj)
			{
				if(direction)
				{
					if(obj.className=='') {obj.className = className;}
				}
				else
				{
					if(obj.className==className) { obj.className = '';}
				}
			}
		}




//Domestic main page show strip
function cnnShowImgSwap( strId, intSwap ) {
	// assumes 2 images: image.gif and image_over.gif
	var imgObj = document.getElementById( strId );
	var strTemp = imgObj.src;
	var intStrLength = strTemp.length;
	var intChop, strEnd; 
	
	if ( intSwap ) {
		if (strTemp.indexOf('_over.gif') == -1) {
			intChop = intStrLength - 4;	
			strEnd = '_over.gif';
		}
	} else {
		if (strTemp.indexOf('_over.gif') > -1) {	
			intChop = intStrLength - 9;	
			strEnd = '.gif';
		}
	}
	
	if (typeof(intChop) != "undefined") {
		strTemp = strTemp.substring( 0, intChop );
	}
	
	if (typeof(strEnd) != "undefined") {
		imgObj.src = strTemp + strEnd;
	}	
}

function cnnPreloadImages() {
	var myimages = new Array();
	for (i=0; i < cnnPreloadImages.arguments.length; i++){
		myimages[i]=new Image();
		myimages[i].src = cnnPreloadImages.arguments[i];
	}
}

/*__________________________________ restyling 2.0 */
function CNN_navHor( tableCellRef, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#ffc000';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#fff';
				}
		}
	} else {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#990000';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#fff';
				}
		}
	}
}

function cnnImgSwap( strId, intSwap ) {
	cnnShowImgSwap( strId, intSwap );
}


	


