$(document).ready(function () {
	$('#pics').cycle({fx:'fade',speed: 2500});

	$("a.pflink").fancybox({
		'titleShow' : true,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'titlePosition' : 'over'
	});

        $('#tac').jScrollPane({scrollbarWidth:10, scrollbarMargin:10});
        $.localScroll();

	$('#filtertable').show();

        $(".filter").change(function() {
        	var filterclass = "";
              	for (i=0;i<=5;i++) {
        	        filtbox = "#filterbox-"+i;
                	filtervalue = $(filtbox).attr("value");
                	if (filtervalue) {
                		filterclass += filtervalue;
                	}
     		}

                $(".filterline").slideUp();
                $(filterclass).slideDown(function() {
                });
      	});

        $('div.pages').pwPagination({
            items : 'div.prod_box', // string (selector) - the items to paginate
            items_per_page : 15, // integer - items per page
            start_page : 1, // integer - the page to start on
            menu_before : true, // boolean - show the pagination links before the parent/wrapper
            menu_after : true, // boolean - show the pagination links after the parent/wrapper
            contain_class : 'pagination', // string - the class name of the pagination links wrapper (generated div)
            list_class : 'pagination', // string - the class name of the pagination list (generated ul)
            list_item_class : 'paginaton', // string - the class name of the pagination list item (generated li)
            active_class : 'active' // string - the class name of an active pagination link
        });


});


function lookup(inputString) {
   if(inputString.length == 0 || inputString == "") {
      $('#suggestions').fadeOut(); // Hide the suggestions box
   } else {
      $.post("/search-ajax.php", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
         $('#suggestions').fadeIn(); // Show the suggestions box
         $('#suggestions').html(data); // Fill the suggestions box
      });
   }
}



