// jQuery INT Document
$(document).ready(function() {

//class "blank" - opening in new window
$(".blank").attr("target", "_blank");

// Hyperfoot
//global variables
var hf_folder_logos = "http://hyperinzerce.cz/images/hyperfoot/cs/";
var hf_folder_imgs = "http://hyperinzerce.cz/images/hyperfoot/";


//temp variables
var hf_preload = new Array();
var hf_spreload = new Array();
var hf_defaultTxt = $("#hyperfoot-text").html();
var hf_defaultLogo = $("#hyperfoot-logo").attr("src");
var hf_defaultHref = $("#hyperfoot-logo").parent().attr("href");
var hf_defaultTitle = $("#hyperfoot-logo").parent().attr("title");
var hf_lastActive = "";

//name of images (logos)
var hf_logos = new Array("hp-logo-hyperinzerce.png","hp-logo-adresarfirem.png","hp-logo-hyperreality.png","hp-logo-hyperbydleni.png","hp-logo-hyperprace.png","hp-logo-hypersouteze.png",
                         "hp-logo-nahraj.png","hp-logo-rychlesms.png","hp-logo-katalogmobilu.png","hp-logo-katalognotebooku.png","hp-logo-katalogfotoaparatu.png","hp-logo-katalogmonitoru.png",
                         "hp-logo-katalogautomobilu.png","hp-logo-katalogmotocyklu.png","hp-logo-katalogtiskaren.png","hp-logo-svetpejsku.png", "hp-logo-videoinzerce.png", "hp-logo-seznamka.png",
                         "hp-logo-hyperzbozi.png", "hp-logo-hyperslevy.png", "hp-logo-vyberslev.png", "hp-logo-aktualnivozy.png", "hp-logo-poptavky.png", "hp-logo-arank.png");

//name of hover images
var hf_active = new Array("hp-icon-inzerce-active.png","hp-icon-adresare-active.png","hp-icon-reality-active.png","hp-icon-bydleni-active.png","hp-icon-prace-active.png","hp-icon-souteze-active.png",
                          "hp-icon-nahraj-active.png","hp-icon-sms-active.png","hp-icon-katalogmobilu-active.png","hp-icon-katalognotebooku-active.png","hp-icon-katalogfotoaparatu-active.png",
                          "hp-icon-katalogmonitoru-active.png","hp-icon-katalogautomobilu-active.png","hp-icon-katalogmotocyklu-active.png","hp-icon-katalogtiskaren-active.png","hp-icon-svetpejsku-active.png",
                          "hp-icon-videoinzerce-active.png", "hp-icon-seznamka-active.png", "hp-icon-hyperzbozi-active.png", "hp-icon-hyperslevy-active.png", "hp-icon-vyberslev-active.png", "hp-icon-aktualnivozy-active.png",
                          "hp-icon-poptavky-active.png", "hp-icon-arank-active.png");

//preloading image
for (var i=0;i<=20;i++) {
    hf_preload[i] = new Image();
    hf_preload[i].src = hf_folder_logos + hf_logos[i];
    hf_spreload[i] = new Image();
    hf_spreload[i].src = hf_folder_imgs + hf_active[i];
}

//image changer
$("#hyperfoot td a").mouseout(function(){
  var id = $(this).attr("id");
  id = id.split("-");
  if (id[0] == "hyperfoot") {
     $(this).find("img").attr("src", hf_lastActive);
     $("#hyperfoot-logo").attr("src", hf_defaultLogo);
     $("#hyperfoot-text").html(hf_defaultTxt);
     $("#hyperfoot-logo").parent().attr("href", hf_defaultHref);
     $("#hyperfoot-logo").parent().attr("title", hf_defaultTitle);

  }
});
$("#hyperfoot td a").mouseover(function(){
  var id = $(this).attr("id");
  id = id.split("-");
  if (id[0] == "hyperfoot") {
     $("#hyperfoot-logo").parent().attr("href", $(this).attr("href"));
     $("#hyperfoot-logo").parent().attr("title", $(this).attr("title"));
     $("#hyperfoot-logo").attr("src", hf_folder_logos + hf_logos[id[1]]);
     $("#hyperfoot-text").html($(this).attr("title"));
     hf_lastActive = $(this).find("img").attr("src");
     $(this).find("img").attr("src", hf_folder_imgs + hf_active[id[1]]);
  }
});



});
