/* jquery head stuff */
$(document).ready(function(){
	//navigation
	$('div#pandaface ul li a').wrap("<span class='link'></span>");
	$('div#pandaface ul li span').css('text-indent','-2000px');
	$('ul.children').hide(); //hide extra menu items
	$('ul.children').parent().append("<span class='drop'></span>"); // add button
	
	$("div#pandaface ul li span.drop").click(function() { //When trigger is clicked...  
         $(this).parent().find("ul.children").slideDown('fast').show(); //Drop down the subnav on click     
         $(this).parent().hover(function() {  
         }, function(){  
             $(this).parent().find("ul.children").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up  
         });  
     });
     // end nav
   	
   	// rollover thumbnails
   	$('div#pandabody div.lines a span.details').hide();
   	
   	$('div#pandabody div.lines a').hover(function() {
   		$(this).find('span.details').fadeIn('fast');
   	}, function(){
   		$(this).find('span.details').fadeOut('slow');
   	});
   	// end rollover thumbnails
 			
	// random yeahs
	var totalYeahNum = 6;
	var yeahNum = Math.floor(Math.random() * totalYeahNum + 1);
	$("div#yeah").css("background-image","url(/wp-content/themes/sixty40/images/yeah-" + yeahNum  + ".png)");
	
	// random headers
	var totalheaderNum = 6;
	var headerNum = Math.floor(Math.random() * totalheaderNum + 1);
	$("div#pandahead").css("background-image","url(/wp-content/themes/sixty40/images/header-back-" + headerNum  + ".jpg)");
	
	// random desciptions
	var descriptions = new Array() 
	descriptions[0] = 'all awesome since 2000'
	descriptions[1] = 'concept. design. animation'	
	descriptions[2] = 'next time you think: think sixty40'	
	descriptions[3] = 'concept. design. animation'	
	descriptions[4] = 'concept. design. animation'	
	descriptions[5] = 'concept. animation. design. '
	
	var p = descriptions.length;
	var whichDescriptions = Math.floor(Math.random() * p);
	$("p#description").text( descriptions[whichDescriptions] );
	
	// latest flash
		
	// -----------------------------------------------------------------------------
	// Globals
	// Major version of Flash required
	var requiredMajorVersion = 10;
	// Minor version of Flash required
	var requiredMinorVersion = 0;
	// Minor version of Flash required
	var requiredRevision = 0;
	// -----------------------------------------------------------------------------
	
	var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if (!hasReqestedVersion) {
		$('span.vvqvimeo').html('<p style="text-align:center;"><a href="http://get.adobe.com/flashplayer/" target="_blank"><img id="upgrade" src="/wp-content/themes/sixty40/images/upgrade.gif" alt="Can\'t see the vid? You may need a new flash player" width="252" height="35"/></a></p>');
	}
	
});



