/*!
* VL scripts visionarylabs.com
*/
$(document).ready(function(){
	
	$('.monogram_row').hide();
	$('#monogram_text').keyup(function(e){
		var thisVal = $(this).val();
		var isDown = false;
		if(thisVal != '' && isDown == false){
			isDown = true;
			$('.monogram_row select.type').val('B1');
			$('.monogram_row select.pos').val('Right Cuff');
			$('.monogram_row select.color').val('black');			
			$('.monogram_row').slideDown();			
		}else{
			isDown = false;
			$('.monogram_row select').val('--');		
			$('.monogram_row').slideUp();
		}
	});
	
	
	$('#main>ul.nav>li>ul').hide();	
	var heightArray = [];
	$('#main>ul.nav>li').each(function(i){
		var elem = $(this);		
		elem.prepend("<span class=\"num\" style=\"display: none;\">"+i+"</span>");
		var thisHeight = elem.find('ul.dropDown').height();
		heightArray.push(thisHeight);
	});	
	$('#main>ul.nav>li').hover(function(){
		var elem = $(this);						   		   
		var arrayId = elem.find('span.num').html();
		var startHeight = heightArray[arrayId];
		elem.find('ul.dropDown').css("height","0px");
		elem.find('ul.dropDown').show();
		elem.find('ul.dropDown').stop().animate(
			{height: startHeight},
			{queue:false, duration:500, easing: 'easeInQuad'}
			);	
		}
		,
		function(){ 	 	
		var elem = $(this);
		elem.find('ul.dropDown').stop().animate(
			{height: "0px"},
			{queue:false, duration:500, easing: 'easeInQuad',
				complete: function(){
					elem.find('ul.dropDown').hide();				
				}
			}						  
		);//end animate
	});//end HOVER	
	
	
	//NEWS COLUMNS
	var newsHeight = 0;
	var thisHeight = 0;
	var elem;
	$('.news .content').each(function(i){
		elem = $(this);				
		thisHeight = elem.height();
		if(thisHeight > newsHeight)			
		{
			newsHeight = thisHeight;
		}
	});
	$('.news .content').height(newsHeight);

	$.ajaxSetup ({
		 cache: false
	});

});//end JQ
