// init page
jQuery(window).load(function() {
	initDrop();
	//initHeight();	
})

// initDrop
function initDrop() {
	var nav = jQuery('#nav'),
		lis = jQuery('> li', nav),
		w = nav.width(),
		delta = -10,
		position = nav.css('position'),
		t,
		delay = 1000;
		activeLi = jQuery('#nav > li.section');
	nav.addClass('relative');
	
	lis.each(function() {
		var li = jQuery(this),
			drop = jQuery('> .drop', this),
			dropArea = jQuery('.drop-area', this)
			pl = li.position().left;
		
		drop.css({
			width: w - pl + delta
		})
		
		li.mouseenter(function() {
			if (t) clearTimeout(t);
			lis.not(li).removeClass('hover');
			//lis.not(li).removeClass('section');
			li.addClass('hover');
		}).mouseleave(function() {
			if (t) clearTimeout(t);
			t = setTimeout(function() {
				li.removeClass('hover');
				//activeLi.addClass('section');
			}, delay)
		})
	})
	
	nav.removeClass('relative');
}
 
// initHeight
function initHeight() {
	var content = jQuery('#content'),
		textPlace = jQuery('.text-place', content),
		imgList = jQuery('.img-list', content),
		textPlaceH = textPlace.outerHeight(true),
		imgListH = imgList.outerHeight(true),
		contentH = content.height();
	
	if (textPlaceH + imgListH > contentH) imgList.hide();
}


(function($){$(function(){ 
	$(".scroll-pane").jScrollPane();
		
	//collectionpage
	$('#productholderinner').fadeIn();
	$('li.prodicon a ').live('click', function(){
		var img = '<img class="ajaxloader" src="themes/promiss2011/images/ajax-loader.gif" />';
		
		$('#productholder').html(img).load($(this).attr('href') + '?ajax=1', function() {
		 	$('#productholderinner').fadeIn(1000);
		});	
		return false;
	});
	
	
	
	
	
	
	
});})(jQuery);



