        $(function() {

			if ($('body').hasClass('home')){
				$('#slideshow').children().removeClass().parent().randomChild();
		//		$('#slideshow').children("img").each(function() {
		//			if($('img').hasClas('active')) {
		//				$(this).removeClass();
			//		}
				//})
				
			//	setInterval( "slideSwitch()", 5000 );
			}

		
			var $items = new Array();
			var item = $items[0];

			$('#LHS li,#RHS li').each(function(){
					$items.push($(this));
			})
			init();
			bonanza();
			bonanza();
			bonanza();
			function init(){
				$('#LHS ul li').animate({opacity: .2},500);
				$('#RHS ul li').animate({opacity: .2},500);
				$('form li p').hide();
				
			}

			function bonanza(){
				var x = Math.floor(Math.random() * $items.length);
				item = $items[x];
				item.animate({opacity:0.3},200).animate({opacity:0.99},1000).animate({opacity:1},3000);
				item.animate({opacity:0.3},700);
				item.animate({opacity:0.2},2000);
			}
    		setInterval( bonanza, 3000 );
    		setInterval( bonanza, 2500 );
    		setInterval( bonanza, 2000 );
    		setInterval( bonanza, 1800 );
    		setInterval( bonanza, 3600 );
    		setInterval( bonanza, 3200 );



        });
function slideSwitch() {
	
    var $active = $('#slideshow IMG.active');

	$active.siblings().animate({opacity:0},300);

    if ( $active.length == 0 ) $active = $('#slideshow img:last');

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

    // uncomment below to pull the divs randomly
    var $sibs  = $active.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length );
    var $next  = $( $sibs[ rndNum ] );

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 300, function() {
            $active.removeClass('active last-active');
        })
		.siblings().animate({opacity:0},300);
}
