/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch() {
	$('#feature_slide_show IMG:not(first)').css('display','none');
    var $active = $('#feature_slide_show IMG.active');

    if ( $active.length == 0 ) $active = $('#feature_slide_show IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#feature_slide_show IMG:first');
	

    $active.addClass('last-active');
	$('#feature_slide_show IMG:last,#feature_slide_show IMG.active').fadeOut("slow"); 
	
	bg=$next.attr('alt');
	title=$next.attr('title');
	content=$next.attr('content');
	head_top=$next.attr('head_top');
	head_left=$next.attr('head_left');
	content_top=$next.attr('content_top');
	content_left=$next.attr('content_left');
	head_color=$next.attr('head_color');
	message_color=$next.attr('message_color');
	
    $next.addClass('active')
	$next.fadeIn("slow"); 
    $('#feature_bg').attr('style','background:url('+bg+')');
	
	$('#feature_title').html('<h2 class="feature_head" style="color:#'+head_color+';">'+title+'</h2>');
	$('#feature_title').attr('style','position:absolute; left:'+head_left+'px; top:'+head_top+'px; z-index:20');
	
	$('#feature_con').html(content);
	$('#feature_con').attr('style','line-height:23px; font-size:15px;color:#'+message_color+';position:absolute; left:'+content_left+'px; top:'+content_top+'px; z-index:20');
    
    $active.removeClass('active last-active');
}

$(document).ready(function(){
		   $('#feature_slide_show IMG:last').hide();
    setInterval( "slideSwitch()", 5000 );
});
