
	
	
	function slideSwitch() {
	//alert('TEST');
    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}, 1000, function() {
            $active.removeClass('active last-active');
			
		clearTime();// run the clearTime after the second image fades in
		
		

        });
}

var interval;
var int_select;

$(function() {
	
	//slideSwitch();
	
    interval = setInterval( "slideSwitch()", 1500 ); // start the slideSwitch function in 1.5 seconds
	
	int_select = 1; // set this to 1
	

});

function clearTime() {
	
	
	if(int_select == 1) { // if  int_selct is set to 1
	
	clearInterval(interval); // clear the 1.5 second interval
	
	interval = setInterval( "slideSwitch()", 5000 ); // set a new interval for fading images to 5 seconds
	
	int_select = 0; // set int_select to 0 
	
	} else if (int_select == 0) { // else if int_select is set to 0
		
		//alert('Hello'); do thing nothing and let r' run!
	}
	
	
}


$(document).ready(function() {

});
