// JavaScript Document
//$("#leftcolumn").fadeTo(1, 0.5); // This sets the opacity of the thumbs to fade down to 60% when the page loads
	$(".p_1 img").fadeTo(1, 1.0); // This sets the opacity of the thumbs to fade down to 60% when the page loads
	$(window).bind("load",function(){ 
		$("#leftcolumn").fadeTo("slow", 0.5); 
		$('#leftcolumn').one("mousemove", function(e){
			$("#leftcolumn").stop().fadeTo(250, 0.9);
		});
	});
	$("#leftcolumn").hover(function(){
	$(this).stop().fadeTo(250, 0.9); // This should set the opacity to 100% on hover
	},function(){
		$(this).stop().fadeTo(550, 0.5); // This should set the opacity back to 60% on mouseout
	});


	$(".p_1 img").hover(function(){
		$(this).stop().fadeTo(250, 0.8); // This should set the opacity to 100% on hover
	},function(){
		$(this).stop().fadeTo(550, 1.0); // This should set the opacity back to 60% on mouseout
	});
	var position = location.href.split("/").pop().split(".").shift();
	var posA = $("a[href='"+position+".html']");
	if (position != "index") {
		posA.addClass("active");
	}
	var posHash = posA.attr("name");
	if (posHash != undefined) {
		posHash = posHash.split("-");
		if (posHash != "") {
			for  (var i  = 0; i < posHash.length; i++) {
				if (posHash[i] != "index") {
					$("#"+posHash[i]).addClass("selected");		
				}	
			}
		}
	}
	$(document).ready(function() {
		switch (position) {
		case "kopevillkor":
			$("#printcell").prepend('<a href="#"><img src="../images/gui/print.gif" width="24" height="22" border="0" /></a>');
		break;
		case "spakampanj":
			$("#printcell").prepend('<a href="#"><img src="images/gui/print.gif" width="24" height="22" border="0" /></a>');
		break;		
		default:
			$("#printcell").prepend('<a href="#"><img src="../../images/gui/print.gif" width="24" height="22" border="0" /></a>');
		break;	
		}
		$("#printcell a").click(function(event) { 
			window.print(); 
			event.preventDefault();
		});
	});
	$(window).bind('load',function() {
		var images = $('.overlay_image').length;
		var place = 1;
		$("#img_1").hide();
		$("img.no_1").show();
		$("#slider").click(function(event) {
			var imgNumber;
			if ($(event.target).is('img')) {
				imgNumber = event.target.id.replace(/\D+/, '');
				$("img.overlay_image").hide();
				$("#slider img").show();
				$(event.target).hide();
				$("img.no_"+imgNumber).show();
				place = imgNumber;
			}
		});
		$("#imgnext, #imgprev").click(function(event) {
			if (this.id == "imgnext") {
				if (place < images) {
					place++;
				}
				else {
					place = 1;
				}
			}
			else {
				if (place > 1) {
					place--;
				}
				else {
					place = images;
				}
			}
			$("img.overlay_image").hide();
			$("#slider img").show();
			$("#img_"+place).hide();
			$("img.no_"+place).show();
		});
	});
	
	
// Fade Spa main column 

	$(".close_main").click(function () {
      $("#fadetest").nextAll().fadeOut("slow");
    });
	$('.close_main a').click(function(event) { event.preventDefault(); });
	
