// JavaScript Document
<!--//---------------------------------+
//  Developed by Roshan Bhattarai 
//  Visit http://roshanbh.com.np for this script and more.
//  This notice MUST stay intact for legal use
// --------------------------------->
/*$(document).ready(function()
{
	//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
	$("#firstpane p.menu_head").click(function()
    {
		$(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
       	$(this).siblings().css({backgroundImage:"url(left.png)"});
	});
	//slides the element with class "menu_body" when mouse is over the paragraph
	$("#secondpane h1.menu_head").mouseover(function()
    {
		$(this).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");	     		
		$(this).siblings().css({backgroundImage:"url(left1.png)"});
	});
});*/

<!-- *************************** -->
$('#search input').keydown(function(e) {
	if (e.keyCode == 13) {
		moduleSearch();
	}
});

function moduleSearch() {
	
	url = 'store/index.php?route=product/search';
	
	var filter_keyword = $('#filter_keyword').attr('value')
	
	if (filter_keyword) {
		url += '&keyword=' + encodeURIComponent(filter_keyword);
	}
	
	var filter_category_id = $('#filter_category_id').attr('value');
	
	if (filter_category_id) {
		url += '&category_id=' + filter_category_id;
	}
		
	location = url;
}

$("#accordion > li").click(function(){
									
	alert( 'ooook' );
	if(false == $(this).next().is(':visible')) {
		$('#accordion > ul').slideUp(300);
	}
	$(this).next().slideToggle(300);
});

$('#accordion > ul:eq(0)').show();



$(document).ready(function(){
	
	$('#filter_keyword').focus(function(){
		if( $('#filter_keyword').val() == 'Enter tool model no' )
			$('#filter_keyword').val('');
		});

	
	$('#filter_keyword').keydown(function(e) {
		if (e.keyCode == 13) {
			moduleSearch();
		}
	});

});

