$(document).ready(function(){
	
	if($.browser.msie) {
		$("#makeHome").bind("click", function(){
			this.style.behavior='url(#default#homepage)';
			this.setHomePage('http://www.canoe.ca');
			return false;
		});
	} else if($.browser.mozilla) {
		$("#makeHome").bind("click", function(){
			window.open("/Homepage/includes/popups/mozilla.html",null,"height=290,width=520,status=no,toolbar=no,menubar=no,location=no");
			return false;
		});
	} else if($.browser.safari) {
		$("#makeHome").bind("click", function(){
			window.open("/Homepage/includes/popups/safari.html",null,"height=200,width=520,status=no,toolbar=no,menubar=no,location=no");
			return false;
		});
	} else if($.browser.opera) {
		$("#makeHome").bind("click", function(){
			window.open("/Homepage/includes/popups/opera.html",null,"height=200,width=520,status=no,toolbar=no,menubar=no,location=no");
			return false;
		});
	} else {
		$("#makeHome").bind("click", function(){
			window.open("/Homepage/includes/popups/browsers.html",null,"height=590,width=520,status=no,toolbar=no,menubar=no,location=no");
			return false;
		});
	}
	
	
	$('a[@rel$="blank"]').click(function(){ // Sets links with the rel of "blank" to open in a new window
		this.target = "_blank";
	});
	
	dlNumTabs = $(".dlTab").size(); //Checks how many tabs there are
	dlToggle();
	$("ul#dlTabs a").bind("click", function(){ //binds function to dl tabs
		if(dlRunning) dlToggle();
		dlSwitch($(this).attr("href").substring(4));
		return false;
	});
	$("ul#dlNav 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;
	});
	document.onkeydown = arrowSwitch;
	document.onkeyup = arrowCancel;

	setTimeout("window.location.reload()",600000);
	
});
