
/////////////////////////////////////////////////////////////////////
////ONLY/////////////////////////////////////////////////////////////
////////SIFR/////////////////////////////////////////////////////////
////////////ABOVE////////////////////////////////////////////////////
/////////////////THIS////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////


function toggleStep(area, current) {
	alert(area);
	alert(current);
	var currentObj = $(current);

	var areaObj = $("#"+area);
		alert('togglar');

	//alert(area.attr('id'));
	//alert(current.attr('id'));
	areaObj.css('border', '1px solid red');

	$(".consumer button").removeClass("buttonhover");
	currentObj.addClass("buttonhover");

	if(visible(areaObj)) {

		$(".accordion:visible").slideUp("fast", function() {});
		areaObj.slideDown();
	} else {
		areaObj.slideUp("fast");
	}
}
function visible(e) {
	if(e.css("display") != "none") {
		return false;
	} else {
		return true;
	}
}
$(document).ready(function() {
	$("p:first-child").addClass("first");
	$("p:last-child").addClass("last");
	$("ul.tabs li:first-child").addClass("first");
	$("ul.tabs li:last-child").addClass("last");
	//$("#thumbnails_list li:nth-child(3n)").addClass("last");
	$("td:last-child").addClass("text_right");
	$("th:last-child").addClass("text_right");

	$('#productmenu ul.menu li:first-child').addClass("firstmenuitem");
	$('#productmenu ul.menu li:last-child').addClass("lastmenuitem");

	$('#no_reg').click(function() {
		$('div.consumer div.accordion').hide();
		$('div.consumer div#noRegister').toggle();
	});
	$('#already_customer').click(function() {
		$('div.consumer div.accordion').hide();
		$('div.consumer div#alreadyClient').toggle();
	});
	$('#new_customer').click(function() {
		$('div.consumer div.accordion').hide();
		$('div.consumer div#createUser').toggle();
	});


	$('.consumer button').hover(function() {
  		$(this).addClass('buttonhover');
	}, function() {
  		$(this).removeClass('buttonhover');
	});
})
$(document).ready(function() {
	$('ul.tabs li.privatpooler a').attr('target', '_blank');

	$('.spot').each(function () {

		var link = $(this).find('a:first').attr('href');
		var target = $(this).find('a:first').attr('target');

		var image = $(this).find('a img').wrap('<div class="spotimage"/>');
		$(this).find('a').parent().append(image.parent());
		$(this).find('div.spotimage').append('<div class="overlay"><h3>' + image.attr('alt') + '</h3></div>');
		$(this).find('a').remove();

		//$(this).find('div.overlay').css( 'opacity', '0.5' );
		//$(this).find('div.overlay').fadeTo('slow', 1);

		if (link  != '') {
			var html = $(this).html();
			$(this).empty();
			$(this).prepend('<a href="#"></a>');
			$(this).find(' a').prepend(html);
			$(this).find('a').attr('href', link);
			$(this).find('a').attr('target', target);
		}
	});
});
