



document.writeln('<style type="text/css">');
document.writeln('.lnews .lnewsBox, .lnews .newsCont {display:none;}');
document.writeln('.lnews #lnewsBox1, .lnews #newsCont1 {display:block;}');
document.writeln('</style>');

/********************* Begin slideshow module *********************/
var delay = 5000; //in milliseconds
var ssTouts = new Array(), ssNums = new Array(), ssBtns = new Array();
var ppBtn, timer1;

/* Load all components on the page */
function initSSComponents() {
	var ssCtrl = document.getElementById('lnewsCtrlNums').parentNode;
	ssCtrl.style.display = "block";
	
	ssNums = document.getElementById('lnewsCtrlNums').getElementsByTagName('a');
	ssNums[0].className = "on";
	
	for (var i = 0; i < ssNums.length; i++) {
		var anchor = ssNums[i];
		anchor.count = i;
		tii_addEventHandler(anchor, "click", function(event) {
			var eventSource = typeof event.target != 'undefined' ? event.target : window.event.srcElement;
			doNumber(eventSource.count);
		}, false);
	}
	
	ssBtns = document.getElementById('lnewsCtrlBtns').getElementsByTagName('a');
	tii_addEventHandler(ssBtns[0], "click", function(event) {
		doNumber((currPic+totalPic-1)%totalPic);
	}, false);
	tii_addEventHandler(ssBtns[1], "click", doButton, false);
	tii_addEventHandler(ssBtns[2], "click", function(event) {
		doNumber((currPic+1)%totalPic);
	}, false);
	
	var ssTout_temp = document.getElementById('lnewsCol1').childNodes;
	for (var i = 0; i < ssTout_temp.length; i++) {
		if (ssTout_temp[i].className == "lnewsBox") {
			ssTouts.push(ssTout_temp[i]);
		}
	}
	for (var i = 1; i < ssTouts.length; i++) {
		ssTouts[i].style.display = "none";
	}
	
	ppBtn = document.getElementById('ppBtn');
	doImageSwap();
	
	if (!paused) {
		timer1 = setTimeout('timedStory()', delay);	
	}
}

/* change picture, wait some seconds, repeat */
function timedStory() {
	currPic = (currPic + 1) % totalPic;
	change(currPic);
	timer1 = setTimeout('timedStory()', delay);
}

/* executed when the play/pause button is selected */
function doButton() {
	paused = !paused;
	doImageSwap();
	if (paused) {
		clearTimeout(timer1); /* stop the image loop */
	} else {
		timedStory(); /* restart the image loop */
	}
}

/*executed when a number link is selected */
function doNumber(num) {
	paused = true;
	doImageSwap();
	clearTimeout(timer1);
	change(num);
} 

/* update the play/pause button image */
function doImageSwap() {
	ppBtn.className = paused ? 'play' : 'pause';
}

tii_callFunctionOnElementLoad ("lnewsAfter", function () {
	initSSComponents();
});
/********************* End slideshow module *********************/

/*
	
*/ 
	function is_all_ws( nod )
	{
	  // Use ECMA-262 Edition 3 String and RegExp features
	  return !(/[^\t\n\r ]/.test(nod.data));
	}
	
	function is_ignorable( nod )
	{
	  return ( nod.nodeType == 8) || // A comment node
	         ( (nod.nodeType == 3) && is_all_ws(nod) ); // a text node, all ws
	}
	
	
	function node_before( sib )
	{
	  while ((sib = sib.previousSibling)) {
	    if (!is_ignorable(sib)) return sib;
	  }
	  return null;
	}
	
	
	function node_after( sib )
	{
	  while ((sib = sib.nextSibling)) {
	    if (!is_ignorable(sib)) return sib;
	  }
	  return null;
	}
	
	
	function last_child( par )
	{
	  var res=par.lastChild;
	  while (res) {
	    if (!is_ignorable(res)) return res;
	    res = res.previousSibling;
	  }
	  return null;
	}
	
	
	function first_child( par )
	{
	  var res=par.firstChild;
	  while (res) {
	    if (!is_ignorable(res)) return res;
	    res = res.nextSibling;
	  }
	  return null;
	}
	
	function child_nodes( elem ) {
    var childs = [];
    var elemLength = elem.childNodes.length;
    for( var i = 0; i < elemLength; i++ ) {
        if( is_ignorable( elem.childNodes[ i ] ) ) {
            continue;
        } else {
            childs.push( elem.childNodes[ i ] );
        }
    }
    return childs;
}

	
	function data_of( txt )
	{
	  var data = txt.data;
	  // Use ECMA-262 Edition 3 String and RegExp features
	  data = data.replace(/[tnr ]+/g, " ");
	  if (data.charAt(0) == " ")
	    data = data.substring(1, data.length);
	  if (data.charAt(data.length - 1) == " ")
	    data = data.substring(0, data.length - 1);
	  return data;
	}
	
	function addEvent(elem, evtType, func, capture) {
	   capture = (capture) ? capture : false;
	   if (elem.addEventListener) {
	      elem.addEventListener(evtType, func, capture);
	   } else if (elem.attachEvent) {
	      elem.attachEvent("on" + evtType, func);
	   } else {
	      // for IE/Mac, NN4, and older
	      elem["on" + evtType] = func;
	   }
	}
	
	function removeEvent(elem, evtType, func, capture) {
	   capture = (capture) ? capture : false;
	   if (elem.removeEventListener) {
	      elem.removeEventListener(evtType, func, capture);
	   } else if (elem.attachEvent) {
	      elem.detachEvent("on" + evtType, func);
	   } else {
	      // for IE/Mac, NN4, and older
	      elem["on" + evtType] = null;
	   }
	}
	
	function addOnLoadEvent(func) {
	    if (window.addEventListener || window.attachEvent) {
	        addEvent(window,"load", func, false);
	    } else {
	        var oldQueue = (window.onload) ? window.onload : function( ) {};
	        window.onload = function( ) {
	            oldQueue( );
	            func( );
	        }
	    }
	}
	
	function changeTabs() {
		var MODROOT = document.getElementById("what2cntID");		
		var MODROOT2 = document.getElementById("what2cntID2");		
		
		function init() {
			for(var i = 0; i < getTabMods().length; i++) {
				doTabs(getTabMods()[i]);
			}
		}
		
		
		function getTabMods() {
			var tabMods = new Array();
			
			var allDivs = MODROOT.getElementsByTagName("div");
			var allDivsLen = allDivs.length;
			for(var i = 0; i < allDivsLen; i++) {
				if(allDivs[i].className.toUpperCase() == "TABMOD") {
					tabMods.push(allDivs[i]);
				}
			}
			
			var allDivs = MODROOT2.getElementsByTagName("div");
			var allDivsLen = allDivs.length;
			for(var i = 0; i < allDivsLen; i++) {
				if(allDivs[i].className.toUpperCase() == "TABMOD") {
					tabMods.push(allDivs[i]);
				}
			}

			return(tabMods);
		}
		
	
		function doTabs(param) {
			var tabs = new Array();
			var allLIs = param.getElementsByTagName("li");
			var allLIsLen = allLIs.length;
			for(var i = 0; i < allLIsLen; i++) {
				if(allLIs[i].parentNode.className.toUpperCase() == "TABCNT") {
					tabs.push(allLIs[i]);
				}
			}
			
			var touts = new Array();
			var allDivs = param.getElementsByTagName("div");
			var allDivsLen = allDivs.length;
			for(var i = 0; i < allDivsLen; i++) {
				if(allDivs[i].parentNode.className.toUpperCase() == "TOUTCNT") {
					touts.push(allDivs[i]);
				}
			}
			
			for(var i = 0; i < tabs.length; i++) {
				first_child(tabs[i]).cur = i;
				addEvent(first_child(tabs[i]), "click", tabOn, false)
				addEvent(first_child(tabs[i]), "click", toutOn, false)
			}
			
			function tabOn(evt) {
				var evt = (evt) ? evt : window.event;
				var elem = (evt.target) ? evt.target : evt.srcElement;
				for(var i = 0; i < elem.parentNode.parentNode.childNodes.length; i++) {
					if(elem.parentNode.parentNode.childNodes[i].nodeType == 1) {
						tabOff(elem.parentNode.parentNode.childNodes[i]);
					}
				}
				if(elem.parentNode.className.indexOf("first") == -1) {
					elem.parentNode.className = "on";
				} else {
					elem.parentNode.className = "first on";
				}
			}
			
			function tabOff(elem) {
				if(elem.className.indexOf("first") == -1) {
					elem.className = "";
				} else {
					elem.className = "first";
				}
			}
			
			function toutOn(evt) {
				var evt = (evt) ? evt : window.event;
				var elem = (evt.target) ? evt.target : evt.srcElement;
				for(var i = 0; i < touts.length; i++) {
					touts[i].className = "contCnt";
				}
				touts[elem.cur].className = "contCnt on";
			}
			
		}
		
		init();
		
	}
	
	addOnLoadEvent(changeTabs);
	
	
/**
 *
 * Foo.
 *
 * @object	TabConfig	Foo.
 * @param	tabModID	Foo.
 * @param	config		Foo.
 *
 */

function TabConfig( tabModID , configTimes ) {

	this.modID = document.getElementById( tabModID );
	this.cTimes = configTimes.times;
	this.mDefault = configTimes.masterDefault;	
	this.tCounter = 0;
	this.today = new Date();
    this.curDay = this.today.getDay();
    this.curHour = this.today.getHours();
    this.curMin = this.today.getMinutes();
    this.ct = ( ( this.curDay * 24 ) * 60 ) + ( this.curHour * 60 ) + ( this.curMin );
    
    var self = this;
	
	if( this.mDefault !== "" ) {
    	this.setTab( this.mDefault );
	} else {
		this.compTimes( this.cTimes[ this.tCounter ] );
	}
}


TabConfig.DAYS = {
    "MON" : 1 , "TUE" : 2 , "WED" : 3 , "THU" : 4 , "FRI" : 5 , "SAT" : 6 , "SUN" : 0 ,
    "MONDAY" : 1 , "TUESDAY" : 2 , "WEDNESDAY" : 3 , "THURSDAY" : 4 , "FRIDAY" : 5 , "SATURDAY" : 6 , "SUNDAY" : 0
};


TabConfig.prototype.compTimes = function( tObj ) {
	var sd = TabConfig.DAYS[ tObj.startDay.toUpperCase() ];
	
	if( tObj.startTime.split( ":" )[ 1 ].split( " " )[ 1 ].toUpperCase() === "PM" ) {
		if( tObj.startTime.split( ":" )[ 0 ] !== "12" ) {
			var sh = parseInt( tObj.startTime.split( ":" )[ 0 ] ) + 12;
		} else {
			var sh = 12;
		}
	} else {
		if( tObj.startTime.split( ":" )[ 0 ] === "12" ) {
			var sh = 0;
		} else {
			var sh = parseInt( tObj.startTime.split( ":" )[ 0 ] );
		}
	}
	
	var sm = parseInt( tObj.startTime.split( ":" )[ 1 ].split( " " )[ 0 ] );
	var ed = TabConfig.DAYS[ tObj.endDay.toUpperCase() ];
	
	if( tObj.endTime.split( ":" )[ 1 ].split( " " )[ 1 ].toUpperCase() === "PM" ) {
		if( tObj.endTime.split( ":" )[ 0 ] !== "12" ) {
			var eh = parseInt( tObj.endTime.split( ":" )[ 0 ] ) + 12;
		} else {
			var eh = 12;
		}
	} else {
		if( tObj.endTime.split( ":" )[ 0 ] === "12" ) {
			var eh = 0;
		} else {
			var eh = parseInt( tObj.endTime.split( ":" )[ 0 ] );
		}
	}
	
	var em = parseInt( tObj.endTime.split( ":" )[ 1 ].split( " " )[ 0 ] );
	
	var st = ( ( sd * 24 ) * 60 ) + ( sh * 60 ) + ( sm );
	var et = ( ( ed * 24 ) * 60 ) + ( eh * 60 ) + ( em );
	
	if( st <= this.ct && et >= this.ct ) {
		this.setTab( parseInt( tObj.activeTab ) );
	} else {
		this.tCounter++
    	if( this.tCounter < this.cTimes.length ) {
        	this.compTimes( this.cTimes[ this.tCounter ] );
    	}
	}
};


TabConfig.prototype.setTab = function( tab ) {
	//	window.alert( "Entering: setTab on " + this.modID.id + " to " + tab );
	//	window.alert( first_child( this.modID ).nodeName );
	
	if( tab > 0 && tab <= child_nodes( first_child( this.modID ) ).length ) {
		for( var i = 0; i < child_nodes( first_child( this.modID ) ).length; i++ ) {
			if( i != 0 ) {
				//window.alert( child_nodes( first_child( this.modID ) )[ i ].className );
				child_nodes( first_child( this.modID ) )[ i ].className = "";
				child_nodes( node_after( first_child( this.modID ) ) )[ i ].className = "contCnt";
			} else {
				child_nodes( first_child( this.modID ) )[ i ].className = "first";
				child_nodes( node_after( first_child( this.modID ) ) )[ i ].className = "contCnt";
			}
		}
		if( tab == 1 ) {
			child_nodes( first_child( this.modID ) )[ tab - 1 ].className = "first on";
			child_nodes( node_after( first_child( this.modID ) ) )[ tab - 1 ].className = "contCnt on";
		} else {
			child_nodes( first_child( this.modID ) )[ tab - 1 ].className = "on";
			child_nodes( node_after( first_child( this.modID ) ) )[ tab - 1 ].className = "contCnt on";
		}
	}
	//
	//window.alert( "Exitting: setTab on " + this.modID.id + " to " + tab );
};

/*
	
*/ 
 








