/* jQuery for timinn.is */
$(function() {       
  $(".banner").each(function() {
      var div_id = this.id;
      $("#"+div_id).html();
      var banner_id = div_id.split("ad_")[1];
      $.get('/banners/' + banner_id + '.aspx', function(data) {
        try {
          var d = $(data);        
          var src = d.attr("src");
          var ow = d.attr("width");
          var oh = d.attr("height");
          if (typeof src != 'undefined') {
            var args = src.split(".");
            if (args[args.length-1] == "swf") {          
              var flashvars = {};
              var params = {};
              params.menu = "false";
              params.wmode = "transparent";
              var attributes = {};
              swfobject.embedSWF(src, div_id, ow, oh, "10.0.0", false, flashvars, params);               
              $('#'+div_id).css("padding-bottom", "15px");
            }
          } else {
            $('#'+div_id).html(data);
          }    
        } catch(err) {}
      });
  });
  $(".weather-wrapper").hover(function () {
      $(".weather-forc").animate({
          height: 290
      }, 1000);
  }, function () {
      $(".weather-forc").animate({
          height: 0
      }, 1000);
  });
  
  $(".outline-expander").toggle(function() {
    $(this).parent("div").animate({height: $(this).attr("rel")});
    $(this).text("Lesa minna");  
  }, function() {
    $(this).parent("div").animate({height: 120});
    $(this).text("Lesa meira");      
  });
    
  $(".outline-box a.outline-expander").each(function() {
    var t = $(this);
    var p = t.parent("div");    
    var imgheight = p.find("img").height();
    $(this).attr("rel", p.height());
    p.height( (imgheight>0)? imgheight+80 : 120 );
  });
});

function setRel(obj) {

}

function fbs_click() {
    u = location.href;
    t = document.title;
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
    return false;
}

function fbs_click2(t) {
    u = location.href;  
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
    return false;
}

