// JavaScript Document

var $j = jQuery.noConflict();

$j(function(){
//===================================== section ========================================//

//===================================== drop down menu ==========================================//
/*

 $j("ul.dropdown li").hover(function(){
    
        $j(this).addClass("hover");
        $j('ul:first',this).css('visibility', 'visible');
    
    }, function(){
    
        $j(this).removeClass("hover");
        $j('ul:first',this).css('visibility', 'hidden');
    
    });
    
    $j("ul.dropdown li ul li:has(ul)")
		.find("a:first")
		//.append(" &raquo; ") THIS PUTS THE >> AFTER THE WORD/
		.prepend(" &laquo; ") //THIS PUTS THE << BEFORE TO THE WORD/
		;

*/
//change the link on the login screen.
$j('#login h1 a[title]').each(function() {
    var $t = $j(this);
    $t
	
	.removeAttr('title')
    .attr('title','Impact United Soccer Club')
	
	.removeAttr('href')
    .attr('href','http://impactunited.com');
});


//===================================== equalout the sidebar and main content area ==========================================//	


var s = $j('#sidebar1').height();
var c = $j('#mainContent').height();

/*alert('s= ' + s + ' c= ' + c );*/

/*top links is 38px + s - 25px content padding - 2px for content border= 648*/
var newHeight = 38 + s - 27;
	if(c < newHeight){
		
		$j("#mainContent").height(newHeight);
	}



//===================================== animated banner ==========================================//

	


setInterval( "slideSwitch1()", 5000 );
setTimeout( "ss2()" ,2000);
setTimeout( "ss3()" ,6000);
setTimeout( "ss4()" ,4000);

	
//===================================== end ==========================================//	
});//doc ready
	
function ss2(){
	setInterval( "slideSwitch2()", 5000 );
}	
function ss3(){
	setInterval( "slideSwitch3()", 5000 );
}	
function ss4(){
	setInterval( "slideSwitch4()", 5000 );
}

function slideSwitch1() {
    var $active = $j('#slideshow1 IMG.active');

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

    var $next =  $active.next().length ? $active.next()
        : $j('#slideshow1 IMG:first');

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

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch2() {
    var $active = $j('#slideshow2 IMG.active');

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

    var $next =  $active.next().length ? $active.next()
        : $j('#slideshow2 IMG:first');

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

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch3() {
    var $active = $j('#slideshow3 IMG.active');

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

    var $next =  $active.next().length ? $active.next()
        : $j('#slideshow3 IMG:first');

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

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch4() {
    var $active = $j('#slideshow4 IMG.active');

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

    var $next =  $active.next().length ? $active.next()
        : $j('#slideshow4 IMG:first');

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

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








	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
