/* Javascript common */

/*
-------------------------------
Confirm Delete script
Usage Example:
				<a href="javascript:confirmDelete('?hej')">Confirm Delete</a>
		
-------------------------------
*/
function confirmDelete(delUrl) {
  if (confirm("Är du säker på att du vill radera?")) {
    document.location = delUrl;
  }
}


// When DOM ready
$(function(){
	
	// FOOTER SLIDE MENU
	$('ul.f-subLevel').hide();
	$('a.viewMore').click(function() {
		$('ul.f-subLevel').slideUp('normal');
		if($(this).next().is(':hidden') == true) {
			$(this).next().slideDown('normal');
		} 
	});
	
	// 2 PAGE FADER
	$('#page1').addClass('active');
	$('.page2').hide();
	$('#page1').click(function(){
		$('#page1').addClass('active');
		$('#page2').removeClass('active');
		$('.page2').hide();
		$('.page1').fadeIn();
	});
	$('#page2').click(function(){
		$('#page1').removeClass('active');
		$('#page2').addClass('active');
		$('.page1').hide();
		$('.page2').fadeIn();
	});
	
	// GALLERY MAIN
	$('div.show_more').hide();
	$('a.show_more').click(function() {
		$('a.show_more').text("Visa fler bilder");
		$(this).text("Visa fler bilder");
		$('div.show_more').slideUp('normal');
		if($(this).prev().is(':hidden') == true) {
			$(this).text("Visa färre bilder");
			$(this).prev().slideDown('normal');
		} 
	});
	// GALLERY MAIN
	$('div.show_more').hide();
	$('a.show_more_esp').click(function() {
		$('a.show_more_esp').text("Ver más fotos");
		$(this).text("Ver más fotos");
		$('div.show_more').slideUp('normal');
		if($(this).prev().is(':hidden') == true) {
			$(this).text("Ver menos fotos");
			$(this).prev().slideDown('normal');
		} 
	});
	
	
	// PIROBOX GALLERY
	$().piroBox({
		my_speed: 400, //animation speed
		bg_alpha: 0.5, //background opacity
		slideShow : 'true', // true == slideshow on, false == slideshow off
		slideSpeed : 3, //slideshow
		close_all : '.piro_close' // add class .piro_overlay(with comma)if you want overlay click close piroBox
		});
	
		
	$.prettySociable();	
	
});









