jQuery.extend(jQuery.validator.messages, {
       required: "",
       email: "Ange en korrekt epostaddress."
});

$(document).ready(function(){
	
	if(jQuery.browser.msie & parseInt(jQuery.browser.version) <= 6) {
		$("img[src$=.png]").ifixpng();
	}
	
	$("#logotype .flash").flash({
	    src: '/login/images/vardeord.swf',
	    width: 239,
	    height: 63
	},{ update: false });
	
	if($("#header img").is(".flash")) {
		src = "/login/images/upload/" + $("#header img").attr("alt")
		$("#header").flash({
		    src: src,
		    width: 950,
		    height: 250
		},{ expressInstall: true });
	}

	$("table").attr("cellpadding","0").attr("cellspacing","0").attr("border","0").attr("border","0");
	$("table tr").attr("valign","top");
	$("#inp_save").css("display","none");
	
	$("#save_lable").click(function() {
		if(document.forms[0].save.checked) {
			document.forms[0].save.checked = false;
			$("#save_lable").css("text-decoration","none").css("font-weight","normal");
		} else {
			document.forms[0].save.checked = true;
			$("#save_lable").css("text-decoration","underline").css("font-weight","bold");
		}
	});
	
	$(".item img").each(function() {
		$(this).replaceWith("<div class='image' style='background-image: url(" + $(this).attr("src") + ");'></div>");
	});
	
	$("a[href^=http://]").attr("target","_blank");
	
	$("#popupmessage").each(function() {
		if($.cookie('login_popup_show') != "no") $.popup.show("Meddelande", $(this).html());
	});
	
	$("#twocolumn, #fourcolumn").append("<div class='clear'></div>");
	
	$("#twocolumn, #fourcolumn").css("width","950px");
	
	$("a[href*='#']").each(function() {
		if($($(this).attr("href")).length>0) {
			$(this).click(function() {
				$.popup.show("", $($(this).attr("href")).html());
			});
		}
	});
	
	if(location.hash.length>1) {
		if($(location.hash).length>0) $.popup.show("", $(location.hash).html());
	}
	
	$("#formlogin").validate();
	
	//$("label").inFieldLabels();
		
});


