function gotoEditor(){
    $('html, body').animate({ 
      scrollTop: $('#live_chat').offset().top 
  }, 1000, '', (function (){showSupportButton()}));
}

function showSupportButton(){
    if(document.getElementById('live_chat_container').style.display == 'none'){
        $('#live_chat_container').fadeIn("1000");
        resizePage();
    }
}
$().ready(function () {
    //gotoEditor();
    resizePage();
});

function showTutorial (){
    var video_width = 740;
    var video_height = 530;
    
    var src = $('#live_demo_container').html();

    var msg = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"720\" height=\"510\" id=\"slideshow\" align=\"middle\"> <param name=\"allowScriptAccess\" value=\"sameDomain\" /> <param name=\"allowFullScreen\" value=\"false\" /> <param name=\"wmode\" value=\"transparent\">         <param name=\"FlashVars\" value=\"&video_src=" + src + "\"> <param name=\"movie\" value=\"http://www.sumopix.com/flash/sumoplayer.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#333333\" />	<embed wmode=\"transparent\" src=\"http://www.sumopix.com/flash/sumoplayer.swf\" FlashVars=\"&video_src=" + src + "\" quality=\"high\" bgcolor=\"#FFFFFF\" width=\"720\" height=\"510\" name=\"slideshow\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"/> </object>;";
    $.blockUI({
            message:msg, 
            css: { 
                top:  ($(window).height() - video_height) /2 + 'px', 
                left: ($(window).width() - video_width) /2 + 'px', 
                width: video_width + 'px',
                border: '0px',
                padding:'10px',
            }
    });
    $('.blockOverlay').attr('title','Click to unblock').click($.unblockUI);
    $('.blockOverlay').attr('cursor','default'); 
    //alert($('.blockOverlay').getAttribute('style').html());
}

function showHelp(){
    var help_width = 740;
    var help_height = 530;
    
    var msg = $('#help_container').html();
    $.fancybox({
            'transitionIn'	:'elastic',
            'transitionOut'	:'elastic',
            'width'     : help_width,
            'height'    : help_height,
            'speedIn'   :600,
            'speedOut'  :200,
            //'href'      : path,
            'hideOnContentClick': false,
            'showCloseButton': true,
            'overlayShow' : true,
            'title': "",
            'titlePosition': 'over',
            'centerOnScroll': false,
            'enableEscapeButton': true,
            'scrolling': 'no',
            'modal':false,
            'padding': 10,
            'content': msg
        });
    
}

function closePlayer(){
    $.fancybox.close();
}
