jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  { 
    jQuery("<img>").attr("src", arguments[i]); 
  } 
}



function prepare_nav_menus()
{
  $("ul.nav li").hover(function(){
      $("ul.nav li div.current").hide();
      $("ul.nav li div.display").hide();
      $(this).children(".display").show();
      $(this).children(".current").show();
      }, function(){
      $(this).children(".current").hide();
      $("ul.nav li div.display").show();
      });
  $("ul.nav li:eq(0)").click(function(){
      window.location.href = "/index.html";
      });
  $("ul.nav li:eq(1)").click(function(){
      window.location.href = "/process.html";
      });
  $("ul.nav li:eq(2)").click(function(){
      window.location.href = "/products.html";
      });
  $("ul.nav li:eq(3)").click(function(){
      window.location.href = "/online.html";
      });
}

function prepare_slide_menus()
{
  $("#imgswitch_og2008").mouseover(function(){
    if (current_list != 1)
    {
      $("#imgswitch_cs").fadeOut('fast', function(){
        $("#imgswitch_cs").attr("src", "images/cs/olympic2008.gif").fadeIn();
        });
      $(".text").hide();
      $("#imgswitch_label_og2008").show();
    }
    current_list = 1;
  });
  $("#imgswitch_co2011").mouseover(function(){
    if (current_list != 2)
    {
      $("#imgswitch_cs").fadeOut('fast', function(){
        $("#imgswitch_cs").attr("src", "images/cs/chinaopen2011.gif").fadeIn();
        });
      $(".text").hide();
      $("#imgswitch_label_co2011").show();
    }
    current_list = 2;
  });
  $("#imgswitch_th2011").mouseover(function(){
    if (current_list != 3)
    {
      $("#imgswitch_cs").fadeOut('fast', function(){
        $("#imgswitch_cs").attr("src", "images/cs/thu100.gif").fadeIn();
        });
      $(".text").hide();
      $("#imgswitch_label_th2011").show();
    }
    current_list = 3;
  });
  $("#imgswitch_device").mouseover(function(){
    if (current_list != 4)
    {
      $("#imgswitch_pp").fadeOut('fast', function(){
        $("#imgswitch_pp").attr("src", "images/pp/device.gif").fadeIn();
        });
      $(".text").hide();
      $("#imgswitch_label_device").show();
    }
    current_list = 4;
  });
  $("#imgswitch_printer").mouseover(function(){
    if (current_list != 5)
    {
      $("#imgswitch_pp").fadeOut('fast', function(){
        $("#imgswitch_pp").attr("src", "images/pp/printer.gif").fadeIn();
        });
      $(".text").hide();
      $("#imgswitch_label_printer").show();
    }
    current_list = 5;
  });
  $("#imgswitch_heat").mouseover(function(){
    if (current_list != 6)
    {
      $("#imgswitch_pp").fadeOut('fast', function(){
        $("#imgswitch_pp").attr("src", "images/pp/heat.gif").fadeIn();
      });
      $(".text").hide();
      $("#imgswitch_label_heat").show();
    }
    current_list = 6;
  });
  $("#imgswitch_label_og2008").fadeIn();
  $("#imgswitch_label_device").fadeIn();
}

function prepare_qp_nav()
{
  $(".quaproleft .price li").hover(function(){
      $(this).children("a").children("img").hide();
      $(".quaproleft .price li").children("a").children("strong").removeClass("current");
      $(this).children("a").children("strong").addClass("current");
    }, function(){
  });
  $("#tb_left").hover(function(){
      $(".quaproleft .price li").children("a").css("background", "")
      .children("img").show();
      $(this).css("background", "url(images/tb_left_bg.png) no-repeat");
      $(".quaproright").hide();
      $("#tb_right").show();
    }, function(){
  });
  $("#ta_left").hover(function(){
      $(".quaproleft .price li").children("a").css("background", "")
      .children("img").show();
      $(this).css("background", "url(images/ta_left_bg.png) no-repeat");
      $(".quaproright").hide();
      $("#ta_right").show();
    }, function(){
  });
  $("#te_left").hover(function(){
      $(".quaproleft .price li").children("a").css("background", "")
      .children("img").show();
      $(this).css("background", "url(images/te_left_bg.png) no-repeat");
      $(".quaproright").hide();
      $("#te_right").show();
    }, function(){
  });
  $("#ad_left").hover(function(){
      $(".quaproleft .price li").children("a").css("background", "")
      .children("img").show();
      $(this).css("background", "url(images/ad_left_bg.png) no-repeat");
      $(".quaproright").hide();
      $("#ad_right").show();
    }, function(){
  });
  $("#ac_left").hover(function(){
      $(".quaproleft .price li").children("a").css("background", "")
      .children("img").show();
      $(this).css("background", "url(images/ac_left_bg.png) no-repeat");
      $(".quaproright").hide();
      $("#ac_right").show();
    }, function(){
  });
  $("#sp_left").hover(function(){
      $(".quaproleft .price li").children("a").css("background", "")
      .children("img").show();
      $(this).css("background", "url(images/sp_left_bg.png) no-repeat");
      $(".quaproright").hide();
      $("#sp_right").show();
    }, function(){
  });
  $("#nk_left").hover(function(){
      $(".quaproleft .price li").children("a").css("background", "")
      .children("img").show();
      $(this).css("background", "url(images/nk_left_bg.png) no-repeat");
      $(".quaproright").hide();
      $("#nk_right").show();
    }, function(){
  });
  $("#as_left").hover(function(){
      $(".quaproleft .price li").children("a").css("background", "")
      .children("img").show();
      $(this).css("background", "url(images/as_left_bg.png) no-repeat");
      $(".quaproright").hide();
      $("#as_right").show();
    }, function(){
  });
  $("#tb_left").mouseover();
}

function prepare_tech_img()
{
  $(".technology li").hover(function(){
      $(".technology li img").show();
      $(this).children("img").hide();
      }, function(){
      $(".technology li img").hide();
      });
}

