var $SsCount = 11;
var $SsCurrent = 1;

function slideSwitch() { 
    
	var $active = $('#slideshow DIV.active');
	var $next = $('#slideshow DIV.next');	 
	 
	$next.css({opacity: 0.0})
		.animate({opacity: 1.0}, 1000);
		  
	$active.css("background-image", "url(includes/slideshow/"+$SsCurrent+".jpg)");
		  
	if ($SsCurrent == $SsCount)
	 	$SsCurrent = 1;
	 else
	 	$SsCurrent++;	  
		  
	$next.css("background-image", "url(includes/slideshow/"+$SsCurrent+".jpg)");
}

function StartMove() {
    var cssBGImage=new Image();
    cssBGImage.src="/banner.png";

    window.cssMaxWidth=cssBGImage.width;
    window.cssXPos=0;
    setInterval("MoveBackGround()",1);
}

function MoveBackGround () {
    window.cssXPos=window.cssXPos-1;
    if (window.cssXPos>=window.cssMaxWidth) {
    window.cssXPos=0;
    }
    toMove=document.getElementById("scroller");
    toMove.style.backgroundPosition=window.cssXPos+"px 0px";
}

function openPopup(){

    $("hr").wrap("<div class='hr'></div>");

    $("#dim").css("height", $(document).height());
    $("#dim").fadeIn();

    $(".closedim").click(function(){
        $("#dim").fadeOut();
        return false;
    });

      $(window).bind("resize", function(){
    $("#dim").css("height", $(window).height());
});

}

function joinPopup(){

    $("hr").wrap("<div class='hr'></div>");

    $("#joindim").css("height", $(document).height());
    $("#joindim").fadeIn();

    $(".joinclosedim").click(function(){
        $("#joindim").fadeOut();
        return false;
    });

      $(window).bind("resize", function(){
    $("#joindim").css("height", $(window).height());
});

}
