$(function() {
    
    $.fn.wait = function(time, type) { time = time || 1000; type = type || "fx"; return this.queue(type, function() {var self = this; setTimeout(function() {$(self).dequeue();}, time);});};
    
    $(".livechannel1").click(function(){ window.location='live.php?channel=1'; });
    $(".livechannel2").click(function(){ window.location='live.php?channel=2'; }); 
    $(".livechannel3").click(function(){ window.location='live.php?channel=3'; });
    $(".livechannel4").click(function(){ window.location='live.php?channel=4'; });    
  
    $(".infozlive").mouseover(function(){ $(this).addClass("infoz-mouseover"); });
    $(".infozlive").mouseout(function(){ $(this).removeClass("infoz-mouseover"); });
    
    $("#tz-pst").hover( function(){$(this).addClass("hover");}, function(){$(this).removeClass("hover");} ).click(function(){ $.post("timezone.php", { tz: "PST" }, function(){ location.reload(); });   });
    $("#tz-est").hover( function(){$(this).addClass("hover");}, function(){$(this).removeClass("hover");} ).click(function(){ $.post("timezone.php", { tz: "EST" }, function(){ location.reload(); });   });
    $("#tz-cet").hover( function(){$(this).addClass("hover");}, function(){$(this).removeClass("hover");} ).click(function(){ $.post("timezone.php", { tz: "CET" }, function(){ location.reload(); });   });
    
    // $(".comment textarea").resizable({ handles: 'se', maxWidth: 441, minWidth: 441, minHeight: 100, maxHeight:400 });
    
    
    
    function commentload(){
        $("#post-comment").click(function(){
            var itemid = $("input[name=item]").val();
            var commenttxt = $("textarea[name=comment-body]").val();
            $(".foot").load("inc/loadcomments.php", {
                    item: itemid,
                    commentbody: commenttxt }, function(){ commentload(); }
                    );
            return false;
        });
    }                            
    
    commentload();    
});
