function startTabs(){
  $("#tab1").show();
  $("a[rel=tab1]").addClass("activ_tab");
  $("#tab_nav a").click(function(){
    $("#tab_nav a").removeClass("activ_tab");
    $(this).addClass("activ_tab");
    $("#tabs div").hide();
    $("#" + $(this).attr("rel")).show();
  });
}

function startMenu(){
  $("#nav a").hover(function(){
    offset = $(this).offset();
    left = offset.left;
    if($(this).parent().parent().attr("id") == "nav"){
      $("div[rel='pm']").hide();
      id = "#pm" + $(this).attr("rel");
      $(id).css("position","absolute");
      if($.browser.msie == true && $.browser.version == '6.0'){
        lbar = $("#header").offset();
        left = left - 75 - lbar.left;
        $(id).css("top","50px");
      }
      $(id).css("left",left + "px");
      if($(id + " li").length > 0){
        $(id).show(0);
        $(id + " ul").mouseout(function(){
          $(this).parent().fadeOut(10000);
        });
      }
    }
    $("*").click(function(){
       $("div[rel='pm']").hide();
    });
    
  });
}

$(document).ready(function(){
    startMenu();
    startTabs();
    Tabs();
  }
);
function Tabs(){
  $("#faq1").show();
  $("a[rel=faq1]").addClass("activ_tab");
  $("#faq_tabs a").click(function(){
    $("div.faq_img").hide();
    id = "#" + $(this).attr("rel"); 
    $("#faq_tabs a").removeClass("activ_tab");
    $(this).addClass("activ_tab");
    $(id).show();
  });
}
