$(function() {

  $(".faq h2").click(function() {
    $(".faq div").hide();
    $(this).parent().find("div").show();
  });
	
  $("#varSelect").bind("change", function() {
    $("input[name=aid]").val($(this).val());
    $("input[name=anid]").val($(this).val());
  });

  $("#checkAll").click(function() {
    if ($(this).attr("checked")) {
      $(".checkRem").each(function() {
        $(this).attr("checked", "checked");
      });
    } else {
      $(".checkRem").each(function() {
        $(this).attr("checked", "");
      });
    }
  });

  $("#searchbox .searchinput").click(function() {
    $(this).val("");
  });
  
  $("#quotationbtn").click(function(){
    $("input[name=cl]").val("quote");
    $("input[name=fnc]").val("");
    $("#tobasketform").attr("target", "_blank");
  });

  $("#basketbtn").click(function(){
    $("input[name=cl]").val("details");
    $("input[name=fnc]").val("tobasket");
    $("#tobasketform").removeAttr("target");
  });

  $(".btn").button();
  $(".prevbtn").button({ icons: {primary: 'ui-icon-arrowthick-1-w'} });
  $(".nextbtn").button({ icons: {secondary: 'ui-icon-arrowthick-1-e'} });
  $(".upbtn, .asc").button({ icons: {primary: 'ui-icon-arrowthick-1-n'} });
  $(".dwnbtn, .desc").button({ icons: {primary: 'ui-icon-arrowthick-1-s'} });
  $(".zoombtn").button({ icons: {primary: 'ui-icon-search'} });
  $(".cartbtn").button({ icons: {primary: 'ui-icon-cart'} });
  $(".quotationbtn").button({ icons: {primary: 'ui-icon-calculator'} });

  $(".toparticles.carousel").carousel({dispItems:1,slideEasing:"easeInOutCirc",animSpeed:"slow"});
  $(".product .carousel").carousel({dispItems:3});

  $("a.external").attr("target", "_blank");

});

