/*___________________________
   | crawler
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ */
crawl();
setTimeout('fctDcopt();',1);
setInterval("swaptvnnews()",7000);
/*  ________________________________
   | Meteo
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ */
	CanoeMeteo.loadMeteo(true);

/* Tab switcher megatop */

$(document).ready(function(){
	currentTab=1;		//Keeps track of the current tab for rotating.
	firstLoad = true;	//Modifies the Toggle function on the first page load.
	dlFade = false;		//Keeps track of fading well it is occuring.
	if(dlRunning) {
		clearInterval(dlRotate);
		dlRunning = false;
	}
	
	//Takes care of the dynamic leads if they exist.
	if($(".rotateBox").size() != 0) {
		if($(".rotateBox.rotateFade").size() != 0) dlIsFade = true; //Checks if the tabs should fade

		dlNumTabs = $(".rotateItem").size(); //Checks how many tabs there are
		dlToggle();
		if($(".rotateBox .tab").size != 0) { //Checks if there are tabs
			dlIsTabs = true;
			$(".rotateBox .tab a").bind("click", function(){ //binds function to dl tabs
				if(dlRunning) dlToggle();
				dlSwitch($(this).attr("href").substring(4));
				return false;
			});
		}

		$(".rotateNav a").bind("click", function(){ //binds functions to dl nav
			if($(this).attr("href")=="#toggle"){
				dlToggle();
			} else {
				if(dlRunning) dlToggle();
				dlCycle($(this).attr("href").substring(1));
			}
			return false;
		});

		if($(".rotateCount").size() != 0) { //Checks if there is a counter that needs to be updated
			dlIsCount = true;
			$(".rotateCount").html("<span>1</span> of "+dlNumTabs)	
		}

		document.onkeydown = arrowSwitch;
		document.onkeyup = arrowCancel;
	}

	//dlSlideCookie(); //Changes the default slider value for the DLs if a cookie is set
});
