function decision(url,delete_what){
	var message = "Are you sure that you want to delete " + delete_what + "?";
	if(confirm(message)) window.location.href = url;
}

function decisionSubmit(delete_what){
	var message = "Are you sure that you want to delete " + delete_what + "?";
	if(confirm(message)) document.deleteImage.submit();
}

function submitenter(myfield,e){
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	
	if (keycode == 13)  {
		document.login.submit();
		return false;
	} else {
		return true;
	}
}

$(document).ready(function(){

	//Remove outline from links
	$("a").focus(function(){
		$(this).blur();
	});

	$("a").removeAttr("title");
	$("img").removeAttr("alt");
	
	var y_pos = new Array("0","-27px","-54px","-81px","-108px","-135px");
	var selected_index = -1;
	
	$("#primary-nav li").each(function(index) {
		if($(this).hasClass('selected') == true) {
			selected_index = index;
		}
	});
	
	if(selected_index == -1)  {
		selected_index = 5;
	}
	
	$("#primary-nav").css({backgroundPosition: "0px " + y_pos[selected_index]});

	$("#primary-nav li").each(function(index) {
		var current_id = $(this).attr("id");
		$("#" + current_id).mouseover(function() {
			$("#primary-nav").css({backgroundPosition: "0px " + y_pos[index]});
		}).mouseout(function(){
			$("#primary-nav").css({backgroundPosition: "0px " + y_pos[selected_index]});
		});
	});
	
	var footer_height = $("#wrapper").height() - ($("#header").height() + $("#bar").height() + $("#main-wrapper").height() + 9);
	
	//alert(footer_height);
	
	if(footer_height < 100)  footer_height = 100;
	
	$("#footer").css({"height" : footer_height});
	
});
