// JavaScript Document

var $ = jQuery;


  //hide items
 $("#tab1").hide();
  $("#tab2").hide(); $("#tab3").hide(); $("#tab4").hide(); $("#tab5").hide();
 $("#whiteStrip").hide();

$("#homeTitleImg").hide(); 
 $("#shield").hide();
$("#glassImg").hide();
$("#shadowImg").hide();

 

 var pop_delay = 0
 
 
 function dan_slideDown(target, delay_time, fadetime) {
	
	var origPos = $(target).css("left")
	
	var startPos = origPos + 50;
	
	var target2 = $(target+ " div");
	$(target2).css({'background': labelImageFile});

	
	 $(target).css({'left': '500px', 'opacity':'0'})
$(target).delay(delay_time * 1000).show( 1, function () {
$(target).animate({opacity: '1'}, { duration: 1500 , queue: false });
	  $(target).animate({left: origPos}, 700, 'easeOutBack');


}

);

function tfn() {
	alert("yes it works")
}

};
 
 
function dan_fadein(target, delay_time, fadetime) {
$(target).delay(delay_time * 1000).fadeIn(fadetime * 1000);

};
  
function dan_tab( thislink, mybutton, target, mylink, mydelay ) {

	  var origbackground = $(target).css("background-image");
	  
	  var clearimage = $(".tab_holder_buttons").css("background-image");
	  
	  var glowbackground = $(mybutton).css("background-image");
	
	var me_id = $(target).attr("id");
	var button_id = $(mybutton).attr("id");
	
$(mybutton).css({'background': clearimage});
	document.getElementById(button_id).style.backgroundRepeat = 'repeat';
	
	
	//MAKE LINK

	  
	//button.onclick= "location.href='http://www.google.com'" ;
	// button.style= "cursor:pointer"
	
	  
		function gotabs()
		{
		  $(target).css({'top': '180px'});
		  
		  $(target).show();
		  $(target).animate({top: '40px'}, 1500, 'easeInOutElastic');
		  
		  
		  $(mybutton).mouseenter(function() { 
		  
		  $(target).animate({top: '15px'}, 500, 'easeOutBack');
		 
		$(target).css({'background': glowbackground});
		 document.getElementById(me_id).style.backgroundPosition = '0px 50px';
		  document.getElementById(me_id).style.backgroundRepeat = 'no-repeat';
		  
		  }); // END MOUSE ENTER FN
		  
		  
		  $(mybutton).mouseleave(function() { 
		  
		  $(target).animate({top: '40px'}, 500, 'easeOutBack')
		  $(target).css({'background': origbackground});
		  document.getElementById(me_id).style.backgroundPosition = '0px 50px';
		  document.getElementById(me_id).style.backgroundRepeat = 'no-repeat';
		  
		  }); // END MOUSE LEAVE
		  
		   $(mybutton).click(function() { 
		  
		window.location = thislink;
		
		  
		  }); // END MOUSE LEAVE
		
		}

setTimeout(gotabs,mydelay * 1000);





};
  

 function dan_zoom(target, time, limited ) {
	 
	 var parent = $(target).closest("div");
	 var startH = $(target).height() +"px"
	 var startW = $(target).width() +"px"
	 var startY = $(target).height() / 2 +"px"
     
	 var startX = $(target).width() / 2 +"px"
	 var startTop = $(target).css("top")
	 var ph = $(parent).height();
	
	 
	 if ( limited == true) {
		 
		startY = $(target).css("top");
		 
	 };
     
    
	 var xoffset =  ($(parent).width() - $(target).width())  / 2 
	 
	 var easing1 = 'easeInOutQuint';
	 
	 $(target).css( {"top": startY, "left": startX } );
	 

	 
	//$(target).fadeTo( 10, 0.01)
	$(target).height('1px');
	$(target).width('1px');

	
  $(target).show();
 // $(target).fadeIn( time * 400); //anim just opacity
   
    //$(target).animate({"opacity": 1}, time * 400); //anim just opacity
	
	$(target).animate({ 
	height: startH, 
	width: startW,
	top: [startTop, 'easeInOutBack'],
	left: xoffset
	 },  { duration: 1000 * time, queue: false, easing: easing1 });
	

	
	 
 };
 


$(window).load(function() {


 
dan_zoom("#glassImg", 5, false)
dan_zoom("#shadowImg", 5, true )
dan_zoom("#ty", 5, true )
dan_fadein("#shield", 5, 2 )
dan_tab(link366, "#tab_btn_1", "#tab1", "link", 5 );
dan_tab(link270, "#tab_btn_2","#tab2", "link", 5.2 );
dan_tab(link272, "#tab_btn_3","#tab3", "link", 5.3 );
dan_tab(link180 , "#tab_btn_4","#tab4", "link", 5.4 );
dan_tab(linki81 , "#tab_btn_5","#tab5", "link", 5.6 );


dan_slideDown("#homeTitleImg", 8, 2)

$(".tab_holder_buttons").css('display', 'block !important')
$(".tab_holder_buttons").show();

var tu = 'url('+labelImageFile+')';

$('.tab div').css('backgroundImage', tu);


//$("p").addClass("myClass yourClass");





  
  


});
