// JavaScript Document
jQuery(document).ready(function() {
//jQuery(document).ready( jQuery('#search').keyup(function(){jQuery('*').stop(true,true).delay(800); liveSearch();}) );

		

jQuery(function(){
      jQuery('#search')
        .data('timeout', null)
        .keyup(function(){jQuery('#search_autocomplete').hide();
            clearTimeout(jQuery(this).data('timeout'));
            jQuery(this).data('timeout', setTimeout(liveSearch, 800));
        }).blur(function(){jQuery('#search_autocomplete').fadeOut()});
		

    });
	

	
jQuery('.drop-down-category').hover(
function (){jQuery(this).children('#directoryWarp').stop(true,true).delay(100).fadeIn(100)},
function (){jQuery(this).children('#directoryWarp').stop(true,true).delay(1000).fadeOut(100)}
)	
jQuery('.drop-down-category ul#directoryBox li').hover(	
function (){jQuery(this).addClass('hover')},
function (){jQuery(this).removeClass('hover')}
)
jQuery('.search-select-box').hover(
function (){jQuery(this).children('#arrow').addClass('drop-down-activation')},
function (){jQuery(this).children('#arrow').removeClass('drop-down-activation')}
)
jQuery('.search-select-box').click(
function (){jQuery(this).children('#catalogListBox').slideToggle()}
)	
/*jQuery('#catalogBox').focusout (

function (){alert('1');//+jQuery(this).children('#catalogListBox').text()
}
)*/	
jQuery('.search-category li').hover(
function (){jQuery(this).addClass('hover')},
function (){jQuery(this).removeClass('hover')}
)
jQuery('.search-category li').click(
function(){
	jQuery('#catalog').val(jQuery(this).text())
	jQuery('#catalogId').val(jQuery(this).attr('catalogid'))
	
	}
)	
	
	
jQuery('.cb_btn').children().click(
function ()
{	var btn=jQuery(this).parent().next();
	btn.slideToggle();
		

});

jQuery('.car_back').children().click(
function ()
{	SlideLeft(this);
		

});
jQuery('.car_next').children().click(
function ()
{	SlideRight(this);
		

});

jQuery('.autohide').children().blur(
	function ()
	{ var btn=jQuery(this).parent().next();
		btn.slideToggle();}
	);


jQuery('.product_btn_title ul li a').each(
	
	function(){
		
jQuery(this).click( 


function (){
jQuery('.product_btn_title ul li').each( function(){
jQuery(this).removeClass('active');	} )

jQuery(this).parent().addClass('active');
jQuery('div.product_txt_value div.value').each( function(){ jQuery(this).hide(); })
jQuery('div.'+this.className).show();
	
	}	
	



	) } )
	
	
jQuery('.minicb').each(
	
	function(){
		
	jQuery(this).click(
	function (){
	
		jQuery(this).next().slideToggle();
		jQuery(this).toggleClass('colosape');
		if (jQuery(this).hasClass('hd').toString()=='true')
		jQuery(this).remove();

		
	}
	 );	
		
		
		
		
	}
	);
	
	
jQuery('div.slide_category').each(
	
	function(){
		
	jQuery(this).hover(
	function (){
	
		jQuery('.all_category').next().stop(true, true).delay(500).show(100);
		

		
	},
		function (){
	
		jQuery('.all_category').next().stop(true, true).delay(1000).hide(100);
				
	})	
	});
		
jQuery('li.parent_left, #directoryWarp ul li.level1').each(
	
	function(){

	jQuery(this).hover(
	function (){
		jQuery(this).addClass('hover');
		jQuery(this).children('a').addClass('hover');
		//jQuery(this).children('a').css('line-height','20px');
		//jQuery(this).children('a').css('margin-left','-1px');
		//jQuery(this).children('a').css('background-color','#F2F2F2');
		//jQuery(this).children('a').css('z-index','10001');
        //jQuery(this).children('.plist').css('left',jQuery(this).width()-1+'px');
		jQuery(this).children('.plist').css('top','0');
		//jQuery(this).children('.plist').css('z-index','10000');
		jQuery(this).children('.plist').children('i').css('height',jQuery(this).children('a').height()+4+'px');
		jQuery(this).children('.plist').stop(true, true).show();
		

		
	},
		function (){
        jQuery(this).removeClass('hover');
		jQuery(this).children('a').removeClass('hover');
		jQuery(this).children('.plist').stop(true, true).delay().hide();
		//jQuery(this).children('a').css('line-height','22px');
		//jQuery(this).children('a').css('margin-left','0px');
		//jQuery(this).children('a').css('background-color','');
				
	})	
	});		
	

});

function SlideLeft(el)
{   var cur=jQuery('.car_ul');
	var position =cur.position();
	if (position.left<=-48)
	cur.animate({"left":position.left+48},300)

	//if (position.left==46) el.hide();
}
function SlideRight(el)
{

    var cur=jQuery('.car_ul');
	var position =cur.position();
	if (position.left>(cur.children().length-1)*-48)
	cur.animate({"left":position.left-48},300)
	
	//if (position.left>0) jQuery('.car_back a').show();
}





	

