﻿/// <reference path="jquery-1.3.2-vsdoc2.js" />


function formatText(index, panel) {
  return index + "";
}

//CMS class

function cms(){
  this.Search = function(q){
    if (q.length > 2) {
      var qs = "?q=" + encodeURIComponent(q);
      window.location.href = "/hr/trazi/" + qs;
      }
  }
}

var $CMS = new cms();


$(function () {
    $("#searchTop").keypress(function (e) {
        if (e.which == 13) {
            $CMS.Search($(this).val());
        }
    });

    $("#search-btn,.search-btn").click(function (e) {
        $CMS.Search($(this).parent().find("INPUT").eq(0).val());
        return false;
    });

    function setHeight() {
        var $wh = $(window).height();
        var $ch = $("#header").height() + $("#menu").height() + $("#wrap").height();

        if ($wh > $ch) {
            $("#wrap").height($("#wrap").height() + ($wh - $ch) - 46);
        }

    }

    $(window).resize(function () {
        setHeight();
    });

    setHeight();

    //$(".jclite").jCarouselLite({
    //        btnNext: ".next",
    //        btnPrev: ".prev"
    //});

    //simple menu
    //  $(window).bind("onload", function(){
    //    var menu = new menu.dd("menu");
    //	  menu.init("menu","menuhover");
    //  });

    $("TABLE tr:nth-child(odd)").addClass("odd");

    $('ul.mainMenu').superfish();
    $(".mainMenu .sf-sub-indicator").wrapInner("<em>");

    $("#header .title").click(function () { window.location = '/'; }).css("cursor", "pointer");

    // Add pdf icons to pdf links
    $("a[href$='.pdf']").addClass("pdf-link");

    //  $(".mainMenu > LI > UL").each(function(){
    //      console.debug($(this).parent());
    //      $(this).css("width", $(this).parent().width());
    //    });

    //$(".jclite UL").liScroll();

});
