function switchpage(select) {
	var index;
  	for(index=0; index<select.options.length; index++) {
		if(select.options[index].selected) {
        	if(select.options[index].value!="") {
          		window.location.href=select.options[index].value;
				break;
			}
		}
	}
}

function CreateBookmarkLink(title) {
 	url = self.location;
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); 
	} else if(window.opera && window.print) { // Opera Hotlist
		return true; 
	} else {
		return false;
	}
}

function tab1(){
	$("#tabContent1").show();
	$("#tabContent2").hide();
	$("#tabContent3").hide();
	$(".tabHeaderActive").removeClass("tabHeaderActive");
	$("#tab1").parents("li").addClass("tabHeaderActive");
}
function tab2(){
	$("#tabContent1").hide();
	$("#tabContent2").show();
	$("#tabContent3").hide();
	$(".tabHeaderActive").removeClass("tabHeaderActive");
	$("#tab2").parents("li").addClass("tabHeaderActive");
}
function tab3(){
	$("#tabContent1").hide();
	$("#tabContent2").hide();
	$("#tabContent3").show();	
	$(".tabHeaderActive").removeClass("tabHeaderActive");
	$("#tab3").parents("li").addClass("tabHeaderActive");
}
function clearTabs(){
	$(".tabHeaderActive").removeClass("tabHeaderActive");
}

$(document).ready(function(){
	// Email center tabs
	$(".tab").click( function() { return false; } );
	tab1();
	$("#tab1").click( function() { tab1(); } );
	$("#tab2").click( function() { tab2(); } );
	$("#tab3").click( function() { tab3(); } );
	$("#tabscontent tr:not(.echead)").hover(
		function(){$(this).addClass("altrow");},
		function(){$(this).removeClass("altrow");}
	);
	// Form highlighting and checkbox/radio toggling
	$(".textfield, .select, .textarea, .email").focus(function(){
		$(this).toggleClass("highlight");
	});
	$(".textfield, .select, .textarea, .email").blur(function(){
		$(this).toggleClass("highlight");
	});
	$(".radio_label").click(function(){
		$(this).prev("input").attr("checked","checked");
		$(this).prev("input").focus();
	});
	$(".checkbox_label").click(function(){
		$(this).prev("input").focus();
	});
	// Open all pdfs in a new window
	$("a[@href$='.pdf'], a[@href$='.doc'], a.external").click(function(){
		$(this).attr('target', '_blank');
	});
});

// Suckerfish menu hover
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"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);