$(document).ready(function() {
   $('.dotted').each(function(){
      $(this).easyTooltip({
        useElement: "tooltipContent_"+$(this).attr('class').match(/id([0-9]+)str([0-9]+)/)[1],
        xOffset: 20,
        yOffset: 0
      });
    });
    if ($('#picSmeg').length) {
       htmlOptions = { src: "image/smeg.swf", width: '100%', height: '150', wmode: 'transparent', replace: '' };
       $('#picSmeg').flash(htmlOptions, pluginOptions);
    }
    if ($('#picMiele').length) {
       htmlOptions = { src: "image/miele2_2.swf", width: '100%', height: '150', wmode: 'transparent', replace: '<div align="center"><img src="image/fon2_2.gif" width="621" height="150" alt="Miele" /></div>' };
       $('#picMiele').flash(htmlOptions, pluginOptions);
    }
    /*
    if ($('#picMiele2').length) {
       htmlOptions = { src: "image/miele3.swf", width: '100%', height: '150', wmode: 'transparent', replace: '<div align="center"><img src="image/fon3.gif" width="621" height="150" alt="Miele" /></div>' };
       $('#picMiele2').flash(htmlOptions, pluginOptions);
    }
    */
});

function showList(type, parts_id, firms_id, types_id) {
   var dataStr = 'type='+type+'&parts_id='+parts_id+'&firms_id='+firms_id+'&types_id='+types_id;
   if (type == 'duh') {
      dataStr = dataStr + '&duhspos='+$("#duh_spos").val();
      dataStr = dataStr + '&duhtype='+$("#duh_type").val();
   }
   if (type == 'hol') {
      dataStr = dataStr + '&holtype='+$("#hol_type").val();
      dataStr = dataStr + '&holrasp='+$("#hol_rasp").val();
      dataStr = dataStr + '&holcol='+$("#hol_col").val();
   }
   if (type == 'var') {
      dataStr = dataStr + '&vartype='+$("#var_type").val();
      dataStr = dataStr + '&varspos='+$("#var_spos").val();
      dataStr = dataStr + '&varust='+$("#var_ust").val();
   }
   $.ajax({
    type: "POST",
    url: "scripts/showlist.php",
    data: dataStr,
    success: function(response) {
       $("#filterList").empty().html(response);
    }
   });
}
