var slideSpeed = 200;

$(document).ready (function () {                    
  $("#id_datesince, #id_datetill").dynDateTime({        
               button: ".next()",
               showsTime: false,
               daFormat:"%Y-%m-%d",
               ifFormat:"%Y-%m-%d",
               firstDay:1
              });
  $("a#resetForm").bind ("click",function () {
    $(this).parent()[0].reset(); 
    return false;
  });
});

function openNewWindow (w,h,url) {
   eval("window.open('"+url+"','"+""+"','height="+h+",width="+w+",left="+(screen.width - w)/2+",top="+(screen.height - h)/2+",status=no,location=no,toolbar=no,directories=no,menubar=no,scrollbars=yes');");
}

function showHelp (obj,e,width) { 
  var need_to_show = true;
  if ($("#divHelp")) {
    need_to_show = false;
    if ($("#divHelp").attr("init")!=obj.id)
      need_to_show = true;
    $("#divHelp").remove ();
  }
  if (need_to_show) {
    var hlpd = $(document.createElement("div")).attr("id","divHelp").addClass("divHelp");
    if (width=="auto")
      hlpd.css("max-width","none");
    $("body").append(hlpd);
    hlpd.css("top",$(obj).offset().top+$(obj).height()).css("left",$(obj).offset().left/*+$(obj).width()*/).html($($(obj).attr("href")).html()).show();
    hlpd.attr("init",obj.id);
  }
}

function showFullInfo (obj) { 
  var need_to_show = true;
  if ($("#divFullInfo")) {
    need_to_show = false;
    if ($("#divFullInfo").attr("init")!=obj.id)
      need_to_show = true;
    $("#divFullInfo").remove ();
  }
  if (need_to_show) {
    var fid = $(document.createElement("div")).attr("id","divFullInfo").addClass("divFullInfo");
    $("body").append(fid);
    fid.css("top",$(obj).offset().top+$(obj).height()).css("left",$(obj).offset().left/*+$(obj).width()*/).load(obj.href).show();
    fid.attr("init",obj.id);
  }
}