// JavaScript Document
function externalLinks() { 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && 
			(anchor.getAttribute("rel") == "external" || anchor.getAttribute("rel") == "external nofollow") )
			anchor.target = "_blank"; 
	} 
}
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

ClientInfo = function(id){
	$('.clientinfo').hide();
	$('#'+id+'info').show();
	$('.contentbutton').attr('class','contentbutton');
	$('#'+id).attr('class','contentbutton cbactive');
}
LoadSched = function(id){
	$('.sched').hide();
	$('#'+id+'info').show();
	$('.loadlist a').attr('class','');
	$('#'+id).attr('class','llactive');
}
LoadEpisodes = function(id){
	$('#programme a').attr('class','');
	$('#'+id).attr('class','llactive');
	$('.ep').hide();
	$('.ep a').attr('class','');
	$('#'+id+'ep').show();
}
LoadSynop = function(id){
	$('.ep a').attr('class','');
	$('#'+id).attr('class','llactive');
	$('.synop').hide();
	$('#'+id+'info').show();
}
LoadVideo = function(id){
	$('.loadlist a').attr('class','');
	$('#'+id).attr('class','llactive');
	$('#loadvideo').load('/programming/video/loadvideo.asp?video='+id);
};

if (window.attachEvent) window.attachEvent("onload", sfHover);
window.onload = function() {
	externalLinks();
}
