
function pisoFotosDetalle() {
	$("#placeholder").load("casas/atico_cala_estancia_fotos.html");
}
function pisoFotosDetalle_en() {
	$("#placeholder").load("casas/atico_cala_estancia_fotos_en.html");
}

function pisoFotosDetalle2() {
	$("#placeholder").load("casas/planta_baja_cala_estancia_fotos.html");
}
function pisoFotosDetalle2_en() {
	$("#placeholder").load("casas/planta_baja_cala_estancia_fotos_en.html");
}


function pisoFotosDetalle3() {
	$("#placeholder").load("casas/coll_den_rabassa_fotos.html");
}
function pisoFotosDetalle3_en() {
	$("#placeholder").load("casas/coll_den_rabassa_fotos_en.html");
}


function pisoFotosDetalle_campos() {
	$("#placeholder").load("casas/campos/campos_fotos.html");
}
function pisoFotosDetalle_campos_en() {
	$("#placeholder").load("casas/campos/campos_fotos_en.html");
}






function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');


    $active.addClass('last-active');


    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active');
        });


}

$(function() {
    setInterval( "slideSwitch()", 4000 );
});

function slideSwitch2() {
    var $active2 = $('#slideshow2 IMG.active');
    
    if ( $active2.length == 0 ) $active2 = $('#slideshow2 IMG:last');

    
    var $next2 =  $active2.next().length ? $active2.next()
        : $('#slideshow2 IMG:first');


    $active2.addClass('last-active');


    $next2.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active2.removeClass('active last-active');
        });


}

$(function() {
    setInterval( "slideSwitch2()", 4000 );
});

function slideSwitch21() {
    var $active21 = $('#slideshow21 IMG.active');
    
    if ( $active21.length == 0 ) $active21 = $('#slideshow21 IMG:last');

    
    var $next21 =  $active21.next().length ? $active21.next()
        : $('#slideshow21 IMG:first');


    $active21.addClass('last-active');


    $next21.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active21.removeClass('active last-active');
        });


}

function slideSwitch22() {

    var $active22 = $('#slideshow22 IMG.active');
    
    if ( $active22.length == 0 ) $active22 = $('#slideshow22 IMG:last');
    
    var $next22 =  $active22.next().length ? $active22.next()
            : $('#slideshow22 IMG:first');

    $active22.addClass('last-active');

    $next22.css({opacity: 0.0})
    	.addClass('active')
    	.animate({opacity: 1.0}, 700, function() {
        	$active22.removeClass('active last-active');
    	});

}


function slideSwitch23() {

    var $active23 = $('#slideshow23 IMG.active');
    
    if ( $active23.length == 0 ) $active23 = $('#slideshow23 IMG:last');
    
    var $next23 =  $active23.next().length ? $active23.next()
            : $('#slideshow23 IMG:first');

    $active23.addClass('last-active');

    $next23.css({opacity: 0.0})
    	.addClass('active')
    	.animate({opacity: 1.0}, 700, function() {
        	$active23.removeClass('active last-active');
    	});

}

function slideSwitch24() {

    var $active24 = $('#slideshow24 IMG.active');
    
    if ( $active24.length == 0 ) $active24 = $('#slideshow24 IMG:last');
    
    var $next24 =  $active24.next().length ? $active24.next()
            : $('#slideshow24 IMG:first');

    $active24.addClass('last-active');

    $next24.css({opacity: 0.0})
    	.addClass('active')
    	.animate({opacity: 1.0}, 700, function() {
        	$active24.removeClass('active last-active');
    	});

}

$(function() {
    setInterval( "slideSwitch21()", 6000 );
    setTimeout("setInterval( 'slideSwitch22()', 6000 );",2000);
    setTimeout("setInterval( 'slideSwitch23()', 6000 );",3000);
    setInterval( "slideSwitch24()", 4000 );
});



function getQuerystring(key, default_)
{
  if (default_==null) default_="";
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
}
