//javascript 

$(document).ready(function(){

	$("#myController").jFlow({
		slides: "#mySlides",
		controller: ".jFlowControl", // must be class, use . sign
		slideWrapper : "#jFlowSlide", // must be id, use # sign
		selectedWrapper: "jFlowSelected",  // just pure text, no sign
		width: "960px",
		height: "380px",
		duration: 1800,
		prev: ".jFlowPrev", // must be class, use . sign
		next: ".jFlowNext" // must be class, use . sign
	});
});


   //SHOWCASE OF MERCH

$(function(){
				//Vertical Sliding
				$('.boxgrid.slidedown').hover(function(){
					$(".cover", this).stop().animate({top:'-170px'},{queue:false,duration:300});
				}, function() {
					$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
				});
					//Full Caption Sliding (Hidden to Visible)
				$('.boxgrid.captionfull').hover(function(){
					$(".cover", this).stop().animate({top:'170px'},{queue:false,duration:160});
				}, function() {
					$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
				});
				//Caption Sliding (Partially Hidden to Visible)
				$('.boxgrid.caption').hover(function(){
					$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
				}, function() {
					$(".cover", this).stop().animate({top:'220px'},{queue:false,duration:160});
				});
			});





// Add .last class to twitter lists
	$(document).ready(function(){
	$("#twitter_box li:last").addClass("last");
		});



//back to top

$(function() {
	$('.backtotop').click(function(){
		$('html, body').animate({scrollTop:0}, 'slow');
	});
});



//validation contact form

 $(document).ready(function(){
    $("#contact_form").validate();
  });





//REMOVE BODY BORDER IF USER' WINDOW IS SMALLER THEN 1000PX

	$(function(){
		var $normal_width = $('body'); //Change the CSS ID selector to whatever you want to check
		noborder_class = 'no_border'; //call that hides the border 
		width_to_hide = 1020;//What size to check for. DO NOT ADD "px"
		$(window).resize(function(){//When the browser resizes
			if($(this).width() < width_to_hide){ //If the browser width is LESS THAN 1000px
				$normal_width.css('display','block').addClass(noborder_class ); //Makes the border on side disapear
				//If you want it to FADE out instead of just disappear uncomment the line below and comment the line above
				//The 500 == 0.5 seconds. Change it to whatever speed you want
				// $normal_width.fadeOut(500).addClass(noborder_class);
			}
			//If the window is equal or MORE THAN 1000px AND has a class "hidden":
			if($(this).width() >= width_to_hide && $normal_width .hasClass(noborder_class )){
				$normal_width.css('display','block').removeClass(noborder_class ); //Make it appear again.
				//$normal_width.fadeIn(500).addClass(noborder_class );//Or, fade back in. Comment line above and uncomment this one
			}
		})
	});
	$(window).load(function(){$(window).resize();}); //On a COMPLETE page load fake a resize to run above function









//cufon




Cufon.replace('h2', {
		textShadow: '#ddd 1px 1px, #f9f9f9 -1px -1px'

						});

Cufon.replace('h4', {
						});

Cufon.replace('#abonnementform legend', {
						});

Cufon.replace('.col_sec_300 h4', {
						});

Cufon.replace('.post  h4', {
						});
						

Cufon.replace('#site_info h3',  {
textShadow: '#ddd 1px 1px, #f9f9f9 -1px -1px' 
});


Cufon.replace('label',  {
textShadow: '#ddd 1px 1px, #f9f9f9 -1px -1px'
});


Cufon.replace(' .col_main h2', {
	color: '-linear-gradient(#232526, #222)',
		textShadow: '#ddd 1px 1px, #f9f9f9 -1px -1px'
});




Cufon.replace('.col_sec_300 h2',  {
	textShadow: '#ddd 0px 1px, #f9f9f9 0px -1px',
	hover: true

});


Cufon.replace('.module_title h5',  {
	textShadow: '#ddd 0px 1px, #f9f9f9 0px -1px'
});


Cufon.replace('.module_title h4',  {
	textShadow: '#ddd 0px 1px, #f9f9f9 0px -1px'
});


Cufon.replace('#tabs div h4 a',  {
	hover: true
});



Cufon.replace(' body#video_page .col_main_sub h2', {
	textShadow: '#ddd 1px 1px, #fff -1px -1px'
});



Cufon.replace('.post h3',  {

});



Cufon.replace('.column h3',  {

});

Cufon.replace(' h2',  {

});

Cufon.replace(' h3',  {

});


//login toggle
	
$(function(){
		$("#open").click(function(){
		$("#panel").slideDown("slow");
		$("#open ").toggle("fade");
		$("a#logoutbutton  ").toggle("fade");
		return false;
	});
	
			$("a#logoutbutton").click(function(){
			$("#panel").slideUp("slow");
			$("#open ").toggle("fade");
			$("a#logoutbutton ").toggle("fade");
			return false;

	});
});


//tabs

$(function(){
$('#tabs div').hide();
$('#tabs div:first').show();
$('#tabs ul li:first').addClass('active');
$('#tabs ul li a').click(function(){ 
$('#tabs ul li').removeClass('active');
$(this).parent().addClass('active'); 
var currentTab = $(this).attr('href'); 
$('#tabs div').hide();
$(currentTab).show();
return false;
});
});


