//vpsBible js

  var $j = jQuery.noConflict();
		$j(function(){

//pitchBox					
$j('#pitchBtn').click(function(){
    $j('div#pitchBoxWrap').modal();
return false;
});


			$j("#pitchWhy-button,#pitchHow-button,#pitchLove-button").css({
				opacity: 0.4
			});
            $j("#pitchBox .menu div.button").click(function(){
            	$jclicked = $j(this);
            	// if the button is not already "transformed" AND is not animated
            	if ($jclicked.css("opacity") != "1" && $jclicked.is(":not(animated)")) {
            		$jclicked.animate({
            			opacity: 1,
            			borderWidth: 5
            		}, 400 );
            		// each button div MUST have a "xx-button" and the target div must have an id "xx" 
            		var idToLoad = $jclicked.attr("id").split('-');
            		//we search trough the content for the visible div and we fade it out
            		$j("#pitchText").find("div:visible").fadeOut("fast", function(){
            			//once the fade out is completed, we start to fade in the right div
            			$j(this).parent().find("#"+idToLoad[0]).fadeIn();
            		})
            	}
            	//we reset the other buttons to default style
            	$jclicked.siblings(".button").animate({
            		opacity: 0.2,
            		borderWidth: 1
            	}, 600 );
            });
//headBar			
			$j("#login").click(function(){
				$j("div#logBox").slideDown("slow");
                                $j("div#login").hide();
                                $j("div#loginClose").fadeIn("slow");
				return false;	
			});	
			$j("#loginClose").click(function(){
				$j(this).css("display","none");
                                $j("#logBox").slideUp("slow");	
				$j("#login").fadeIn("slow");
			});					
//translator
                        $j(".openLanguage").click(function(){
                                $j("#language").slideToggle('slow');
                                return false;
                        });

//tagPanel
			$j(".tagsBtn").click(function(){
				$j(".jqSlider").slideToggle('medium');
			});
			$j('.tagsBtn').toggle(
			  function () {
				$j(this).addClass("activeBack");
			  },
			  function () {
				$j(this).removeClass("activeBack");
			  }
			);
//series-indexes
			$j(".toggleButton").click(function () {
				$j(".toggleOS,.vpsIntro").toggle('slow');
				$j(".toggleButton").toggle();
			});
                        $j(".toggleIndexButton").click(function () {
                                $j(".toggleIndex").slideToggle('slow');
                        });
//stackscripts
                        $j(".toggleScriptBtn").click(function () {
                                $j(".toggleScript,.toggleScriptBtn").slideToggle('slow');
                        });
//more!
		});
