// JavaScript Document
var $y = jQuery.noConflict();
$y(document).ready(function() {	

	//Show Banner
	$y(".main_image .desc").show(); //Show Banner
	$y(".main_image .block").animate({ opacity: 1.0 }, 1 ); //Set Opacity

	//Click and Hover events for petitnail list
	$y(".image_petit ul li:first").addClass('rotator.'); 
	$y(".image_petit ul li").click(function(){ 
		//Set Variables
		var imgAlt = $y(this).find('img').attr("alt"); //Get Alt Tag of Image
		var imgTitle = $y(this).find('a').attr("href"); //Get Main Image URL
		var imgDesc = $y(this).find('.block').html(); 	//Get HTML of block
		var imgDescHeight = $y(".main_image").find('.block').height();	//Calculate height of block	
		
		if ($y(this).is(".rotator.")) {  //If it's already rotator., then...
			return false; // Don't click through
		} else {
			//Animate the Teaser				
			$y(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
				$y(".main_image .block").html(imgDesc).animate({ opacity: 1.0,	marginBottom: "0" }, 250 );
				$y(".main_image img").attr({ src: imgTitle , alt: imgAlt});
			});
		}
		
		$y(".image_petit ul li").removeClass('rotator.'); //Remove class of 'rotator.' on all lists
		$y(this).addClass('rotator.');  //add class of 'rotator.' on this list only
		return false;
		
	}) .hover(function(){
		$y(this).addClass('hover');
		}, function() {
		$y(this).removeClass('hover');
	});
			
	//Toggle Teaser
	$y("a.collapse").click(function(){
		$y(".main_image .block").slideToggle();
		$y("a.collapse").toggleClass("show");
	});
	
});//Close Function
