function gotoPage(url){
	window.location=url;
	return false;
}
function confirmURL(url){
	var confirmAnswer=confirm('Are you sure?');
	if(confirmAnswer==true){
		window.location=url;
	}
}
function setMinHeight(target,minHeight){
	$(target).addClass('pageStretch');
	$(target).css('min-height',minHeight+'px');
	$(target).css('height:',minHeight+'px');
	
	//fix for IE7 (of course)
	var columnHeight=$("#contentContainer").height();
	$("#sideContainerSub").height(columnHeight);
}
function stretchPage(){
	var winHeight=window.innerHeight;
	if(jQuery.browser.msie){
		winHeight=document.documentElement.clientHeight;
	}
	setMinHeight($("#contentContainer"),winHeight);
	var contentHeight=winHeight-325;
	setMinHeight($("#content"),contentHeight);
}
$(document).ready(function(){
	//add browser specific class
	if(jQuery.browser.msie && (jQuery.browser.version < 7)){
		$('body').addClass('IE6');
	}
	
	//make page stretch down to fit window unless IE6 (breaks)
	if(!(jQuery.browser.msie && (jQuery.browser.version < 7)) && $('body').hasClass('stretch')){
		stretchPage();
	}
	
	//popup links
	$(".popuplink").click(function(e){
		var url=$(this).attr("href");
		newwindow=window.open(url,'newWin');
		if (window.focus) {newwindow.focus()}
		return false;
	});
	
	$(".confirmlink").click(function(e){
		var url=$(e.target).attr("href");
		confirmURL(url);
		return false;
	});
	
	$("#emailListAddress").click(function(){
		var curVal=$(this).attr('value');
		if(curVal=='email'){
			$(this).attr('value','');
			$(this).removeClass('lightText');
		}
	});
	
	$("#emailListName").click(function(){
		var curVal=$(this).attr('value');
		if(curVal=='name'){
			$(this).attr('value','');
			$(this).removeClass('lightText');
		}
	});
});
