﻿/// <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 = "/search/" + qs;
      }
  }
}

var $CMS = new cms();


$(function(){
//  $("#inputSearchTop,#inputSearchBottom").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;
//  });
  
  $(".clanovi-udruge TR").each(function(){
    $(this).find("TD:eq(2)").wrapInner("<div class='address'>");
    $(this).find("TD:eq(1)").css("text-align","center").css("vertical-align","middle");
    $(this).find("TD:eq(1) IMG").css("float","none").css("margin","0");
  });
  
  //$("#menu LI:last").wrapInner("<span>").addClass("last");
  
  function setHeight(){
    var $wh = $(window).height();
    var $ch = $("#header").height() + $("#menu").height() + $("#wrap").height();
    
    if ($wh>$ch){
      $("#wrap").height($("#wrap").height()+($wh-$ch)-46);
    }

    /*$("#wrap").height()*/
  }
  
  $(window).resize(function() {
    setHeight();
  });
  
  setHeight();
  
});