var incs = 'inc/';
var loadContent = function(to, path){
//  snowStorm.freeze();
 $(to)
     .html('<img src="../images/loading.gif" alt="Laadimas...">')
     .load(path, {} , function(){     
       setTimeout(function() {
          $(to).find('a.lightBox').lightBox()
  //    snowStorm.resume();          
        }, 100);
 });         
} 
   
$(document).ready(function(){  
   $('a.lightBox').lightBox()
      
   $("div.pais p a, p.menu a.ajax").click(function(e){
       e.preventDefault();    
       aload(this);   
   });
   
   $("p.bands span a.media").click(function(e){    
       e.preventDefault();
       loadContent("div.mediabox", incs + 'pleier.php?dir=' + $(this).attr("href"));             
   });
   
//    var resizeTimer = null;
//    $(window).bind('resize', function() {
//        if (resizeTimer) clearTimeout(resizeTimer);
//        resizeTimer = setTimeout(resizecontent, 100);
//    });
    
//    resizecontent()
    $("p.bands span").hover(function(){
        $(this).addClass('showadds');
    
    },
    function(){
        $(this).removeClass('showadds');
    
    })
    $("p.bands span a.desc").click(function(e){ 
        e.preventDefault();
        loadContent("div#content", 'band/' + $(this).attr("href") + '.html');        
    })
    
     
    jQuery.each(jQuery.browser, function(i, val) {
      if(i=="msie" && val != false) {        
        $('a.snow').css("font-size","xx-small");
        $('div.mediabox').css("top","235px");                
        
        browserIE = true
      }                             
                
    });
    
});

  function resizecontent() {
     h = $(window).height()
     $('div.center div#content').height(h -300)
  }
  function allmeida() {
     var html = '<img src="../images/loading.gif" alt="Laadimas...">'
     $("div.mediabox").html(html);  
     $("div.mediabox").load(incs + 'pleier.php', {}, function(){               
         $('.mediabox').jqDrag('span.drag').jqResize('span.resize');                   
     });         
  }
  
  function setEmbedobj(width, height) {
  //called from jqDnR.js line 20
     $('.embedobject').attr('width',  width);
     $('.embedobject').attr('height',height);        
  }
   
  function aload(obj) {
      href = $(obj).attr("href").replace(new RegExp('http://veebruari.lellealternatiiv.ee/', "i"), '')
      loadContent("div#content", incs + href);    
      return false;
  }


 
