/**
 * @author daviest
 */

 jQuery(document).ready(function(){
 	 
	jQuery('.prerr').hide();
	jQuery('.cats').hide();
	
	
jQuery("#login_form").submit(function()
{
	
  	jQuery('.prerr').hide();
	var model = jQuery("#model").val(); 
	var modeltype = jQuery("#modeltype").val(); 
	
	if(model == "")
	{
		jQuery('.prerr').show();
		jQuery("#model").focus();
		return false;
	}
	if(model.length<3)
	{
		jQuery('.prerr').show();
		jQuery("#model").focus();
		return false;
	}
	  // validate and process form here
	 
	jQuery.post(
	"df/prodsearch.php",
   { prcode: model, prtype: modeltype },
   	function(data){
		 jQuery('#prodres').html(data);
		 
		 }
		 );
	 
return false;
});


jQuery('.gocat').click(function(){
	
	var incat = this.id;
	
	jQuery.post(
		"df/prodsearch.php",
   		{ prcat: incat },
   		function(data){
			 jQuery('#prodres').html(data);
		 }
		 );
	
	
	return false;
	
	
	
	
});

jQuery('.parcat').click(function(){
	var inid = this.id;
	var openthis = "#ct" + inid.substr(2);
	jQuery('.slist').slideUp('slow');
	jQuery(openthis).slideDown("slow");
});

jQuery('.nosubs').click(function(){
		jQuery('.slist').slideUp('slow'); 
});


$(".slitem").hover(
      function () {
        $(this).addClass('handon');
      }, 
      function () {
        $(this).removeClass('handon');
      }
    );

$(".slist").hover(
      function () {
        $(this).addClass('handon');
      }, 
      function () {
        $(this).removeClass('handon');
      }
    );

$(".parcat").hover(
      function () {
        $(this).addClass('handon');
      }, 
      function () {
        $(this).removeClass('handon');
      }
    );



});
  
