$(document).ready(function(){  
	
	if ($('#slideshow_wrapper').length > 0) {
		//$('#slidevisible').html($('#slide1').html());
		 slide1();  
	}
	if ($('#slideshow_wrapper2').length > 0) {
		//$('#slidevisible').html($('#slide1').html());
		 slide1x();  
	}

});

var to1

function slide1() {
		$('#slideshow_wrapper').html($('#slide1').html()).fadeIn(700);
		//$('#slideshow_wrapper').css('background-image','url("/asset
		clearTimeout(to1);
		to1 = setTimeout("slide2();",6000);
}
function slide2() {
		$('#slideshow_wrapper').html($('#slide2').html()).fadeIn(700);
		clearTimeout(to1);
		to1 = setTimeout("slide3();",6000);
}
function slide3() {
		$('#slideshow_wrapper').html($('#slide3').html()).fadeIn(700);
		clearTimeout(to1);
		to1 = setTimeout("slide1();",6000);
}


function slide1x() {
		$('#slide1x').css('z-index',5).fadeIn(700, function() {
		 	$('#slide3x').css('z-index',0).hide();
		});
		clearTimeout(to1);
		to1 = setTimeout("slide2x();",6000);
}
function slide2x() {
		$('#slide2x').css('z-index',5).fadeIn(700, function() {
		 	$('#slide1x').css('z-index',0).hide();
		});
		clearTimeout(to1);
		to1 = setTimeout("slide3x();",6000);
}
function slide3x() {
		$('#slide3x').css('z-index',5).fadeIn(700, function() {
		 	$('#slide2x').css('z-index',0).hide();
		});
		clearTimeout(to1);
		to1 = setTimeout("slide1x();",6000);
}
