var pw=500,ph=400,curPlayerType=0,pphWidth=510;
$(document).ready(function(){$("#wide").click(function(){if(pphWidth==510){pphWidth=995;pw=985;ph=788;$("#pph").animate({width:995,height:868},0)}else{pphWidth=510;pw=500;ph=400;$("#pph").animate({width:510,height:490},0)}play(1,true)});$("#inv").click(function(){$("#invitemsg").hide();$("#invitebox").is(":visible")?$("#invitebox").hide():$("#invitebox").show()});$("#fs").click(function(){window.open("/apps/widgets/player/?slug="+channel_slug+"&width="+screen.width+"&height="+screen.height+"&autostart=true&fullscreen=true",
"fs","fullscreen=yes, leftX=0, leftY=0");$("#player").html("Fullscreen mode is enabled!<br>To return to standard mode please refresh this page.")});$("#wnd").click(function(){window.open("/apps/widgets/player/?slug="+channel_slug+"&autostart=true&autoresize=true","wnd","fullscreen=yes, leftX=0, leftY=0, width=506, height=465");$("#player").html("Fullscreen mode is enabled!<br>To return to standard mode please refresh this page.")})});
function play(a,c){var b="Bitrate: ";if(chans.recordType[1]!=201){for(var f in chans.recordType){var d=chans.recordType[f];if(f!=1&&f!=4)b+=" | ";else if(f==4)b+="<br>";var e="http://wefire.tv/help/";if(cur_interface!=0&&cur_interface!=20)e="?action=help&slug=";if(d==1)e+="winmedia";else if(d==2)e+="realplayer";else if(d==3)e+="quicktime";else if(d==4)e+="flash";else if(d==6)e+="silverlight";else if(d==7)e+="vlc";else if(d==101)e+="wma";else if(d==102)e+="aac";else if(d==103)e+="flash";else if(d==
104)e+="ogg";else if(d==105)e+="realaudio";else if(d==106)e+="mp3";if(cur_interface==0||cur_interface==20)e+="/";b+='<a target=_blank href="'+e+'" target=_blank>';b+='<img width=20 height=20 src="http://s2.vefire.ru/img/';if(d==1)b+="wm_player.png";else if(d==2)b+="real_player.png";else if(d==3)b+="quicktime_player.png";else if(d==4)b+="flash_player.png";else if(d==6)b+="sl_player.png";else if(d==7)b+="vlc_player.png";else if(d==101)b+="wm_player.png";else if(d==102)b+="aac.png";else if(d==103)b+=
"flash_player.png";else if(d==104)b+="ogg.png";else if(d==105)b+="real_player.png";else if(d==106)b+="mp3.png";b+='" align=absMiddle></a> ';if(a==f){b+='<span class="cur_bitrate">';b+='<a href="javascript:;" onclick="return play('+f+',true);">';b+=chans.bitrate[f]!=""?chans.bitrate[f]+" Kbit/sec ":"auto";b+="</a>";b+='</span> [<a target=_blank href="'+e+'">plugin</a>]'}else{b+='<a href="javascript:;" onclick="return play('+f+',true);">';b+=chans.bitrate[f]!=""?chans.bitrate[f]+" Kbit/sec ":"auto";
b+="</a>"}}$("#bitrate").html(b)}d=chans.recordType[a];b=d==1?winMedia(a,c):d==2?realPlayer(a,c):d==3?quickTime(chans.source[a],c):d==4||d==6||d==103?chans.source[a].replace(/500/gi,pw).replace(/400/gi,ph).replace(/autostart=true/gi,"autostart="+(c?"true":"false")):d==7?vlc(chans.source[a],c):d==101?winMedia(a,c):d==102?aac(chans.source[a],c):d==104?ogg(chans.source[a],c):d==105?realaudio(chans.source[a],c):d==106?mp3(chans.source[a],c):d==201?chans.source[a]:"";curPlayerType=d;$("#player").html(b);
if(d==201||d==202)$("#wide").hide();return false}
function winMedia(a,c){var b="<object id=video name=video width="+pw+" height="+ph+' classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">';b+='<param name=url value="http://wefire.tv/channel/'+slug+"/asx/"+a+'/">';b+="<param name=autoStart value="+(c?"true":"false")+">";b+='<param name=bgColor value="#000000">';
b+="<param name=showControls value=true>";b+="<param name=showStatusBar value=true>";b+="<param name=TransparentatStart value=true>";b+="<param name=AnimationatStart value=true>";b+="<param name=StretchToFit value=true>";b+='<embed src="http://wefire.tv/channel/'+slug+"/asx/"+a+'/" StretchToFit=1 type="application/x-mplayer2" name=video2 id=video2 ';b+="autostart="+(c?"1":"0")+" fullScreen=true showcontrols=1 showstatusbar=1 autorewind=1 scale=aspect ";b+="width="+pw+" height="+ph+' style="display:block;position:relative;"></embed></object>';
return b}
function realPlayer(a,c){var b='<object id=video classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+pw+'" height="'+ph+'">';b+='<param name=src value="http://wefire.tv/channel/'+slug+"/ram/"+a+'/">';b+="<param name=autostart value="+(c?"true":"false")+">";b+="<param name=controls value=imagewindow>";b+="<param name=console value=video>";b+="<param name=loop value=true>";b+='<embed src="http://wefire.tv/channel/'+slug+"/ram/"+a+'/" width="'+pw+'" height="'+ph+'" loop=true type="audio/x-pn-realaudio-plugin" controls=imagewindow console=video autostart='+(c?
"true":"false")+" id=video></embed>";b+="</object><br>";b+='<object id=controls classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+pw+'" height=30>';b+='<param name=src value="http://wefire.tv/channel/'+slug+"/ram/"+a+'/">';b+="<param name=autostart value="+(c?"true":"false")+">";b+="<param name=controls value=ControlPanel>";b+="<param name=console value=video>";b+='<embed src="http://wefire.tv/channel/'+slug+"/ram/"+a+'/" width="'+pw+'" height=30 controls=ControlPanel type="audio/x-pn-realaudio-plugin" console=video autostart='+
(c?"true":"false")+"></embed>";b+="</object>";return b}
function vlc(a,c){var b='<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://www.videolan.org/" ';b+='width="'+pw+'" height="'+(ph-30)+'" id=video events=True>';b+='<embed pluginspage="http://wefire.tv/help/vlc/" type="application/x-vlc-plugin" progid="VideoLAN.VLCPlugin.2" id=video2 name=video ';b+='target="'+a+'" autoplay="'+(c?"true":"false")+'" loop="yes" volume="20" height="'+(ph-30)+'" width="'+pw+'">';b+="</object><div style=\"background:#0857a6 url('http://s2.vefire.ru/img/player_background.png')repeat-x;width:"+pw+
'px;height:31px;" class="vlc_buttons">';b+='<span class="vlc_logo"></span>';b+='<a class="vlc_full" href="javascript:;" onClick="video.video.toggleFullscreen();" title="Fullscreen"></a>';b+='<a class="vlc_plus" href="javascript:;" onClick="with(document.video.audio)if(volume<100)volume+=10;" title="Volume +"></a>';b+='<a class="vlc_minus" href="javascript:;" onClick="with(document.video.audio)if(volume>0)volume-=10;" title="Volume -"></a>';b+='<a class="vlc_mute" href="javascript:;" onClick="video.audio.toggleMute();" title="Mute"></a>';
b+='<a class="vlc_169" href="javascript:;" onClick="video.video.aspectRatio=\'16:9\';" title="Dimensin: 16:9"></a>';b+='<a class="vlc_43" href="javascript:;" onClick="video.video.aspectRatio=\'4:3\';" title="Dimension 4:3"></a>';b+='<a class="vlc_replay" href="javascript:;" onClick="video.playlist.stop();video.playlist.play();$(\'#vlc_play\').hide();$(\'#vlc_stop\').show();" title="Restart"></a>';b+='<a class="vlc_play" id="vlc_play" href="javascript:;" onClick="video.playlist.play();$(\'#vlc_play\').hide();$(\'#vlc_stop\').show();" title="Play"></a>';
b+='<a class="vlc_stop" id="vlc_stop" href="javascript:;" onClick="video.playlist.stop();$(\'#vlc_stop\').hide();$(\'#vlc_play\').show();" title="Stop"></a>';b+="</div>";b+="<script>if($.hotkeys){";b+='$(document).bind("keydown","up",function(e){with(document.video.audio)if(volume<100)volume+=10;return false;});';b+='$(document).bind("keydown","down",function(e){with(document.video.audio)if(volume>0)volume-=10;return false;});';b+='$(document).bind("keydown","space",function(e){document.video.playlist.togglePause();return false;});';
b+="}<\/script>";return b}
function quickTime(a,c){var b='<object id=video name=video width="'+pw+'" height="'+ph+'" autoplay=true classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">';b+='<param name=src value="'+a+'">';b+='<param name=autoplay value="'+(c?"true":"false")+'">';b+='<param name=bgcolor value="000000">';b+="<param name=controller value=true>";b+="<param name=scale value=tofit>";b+='<embed id=video name=video src="'+a+'" bgcolor="000000" width="'+pw+'" height="'+
ph+'" scale="tofit" autoplay="'+(c?"true":"false")+'" controller=true pluginspage="http://www.apple.com/quicktime/download/"></embed>';b+="</object>";return b}function aac(a,c){return a='<embed id=video src="'+a+'" autostart="'+(c?"true":"false")+'" console="Console" controls="All" width="'+pw+'" height="'+ph+'" type="audio/x-pn-realaudio-plugin">'}function ogg(a,c){return a="<audio "+(c?'autoplay="autoplay" ':"")+'controls="controls"><source src="'+a+'" width="'+pw+'" height="'+ph+'"></audio>'}
function realaudio(a,c){return a='<embed src="'+a+'" autostart="'+(c?"true":"false")+'" console="Console" controls="All" width="'+pw+'" height="'+ph+'" type="audio/x-pn-realaudio-plugin">'}
function mp3(a,c){return a=$.browser.opera||$.browser.mozilla||$.browser.msie?'<embed src="'+a+'" autostart="'+(c?"true":"false")+'" console="Console" controls="All" width="'+pw+'" height="'+ph+'" type="application/x-mplayer2">':"<audio "+(c?'autoplay="autoplay" ':"")+'controls="controls"><source src="'+a+'" width="'+pw+'" height="'+ph+'"></audio>'}
function updatePromoted(){var a="",c=pr.source_url1.substring(0,3);a+='<div class="prPlayer fl">';if(c=="1||"||c=="101"){a+='<object id=mediaPlayer width=340 height=272 classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" type="application/x-oleobject">';a+='<param name=url value="/channel/'+pr.slug+'/asx/1/s/">';a+="<param name=autoStart value=true>";a+="<param name=showControls value=true>";a+="<param name=showAudioControls value=true>";
a+="<param name=showPositionControls value=false>";a+="<param name=showTracker value=false>";a+="<param name=showDisplay value=false>";a+="<param name=showStatusBar value=false>";a+='<embed src="/channel/'+pr.slug+'/asx/1/s/" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/mediaplayer/download/default.asp" name=MediaPlayer autostart=1 showpositioncontrols=0 showcontrols=1 showstatusbar=0 showdisplay=0 autorewind=0 width=340 height=272></embed></object>'}else{c=pr.source_url1.split("||");
c.shift();c.shift();c=c.join();c=c.replace(/500/gi,"340").replace(/400/gi,"272");a+=c}a+="</div>";a+='<div class="prRight fl">';a+='<h1 style="padding-bottom:5px;"><a href="/channel/'+pr.slug+'/">Recommended channel: '+pr.name+"</a></h1>";a+='<a href="/channel/'+pr.slug+'/"><img src="/l/'+pr.lang+"/"+pr.slug+'.gif" width=100 height=70 align=left style="margin:0 5 5 0px;"></a>';c=pr.description;a+=c.length>165?c.substr(0,165)+"...<br><br>":pr.description+"<br>";a+="<div class=cb><b>What's your opinion about this channel?</b></div>";
a+="<div class=prLabel>Please, rate this channel::</div>";a+='<div style="margin:5 55px" id="votes'+pr.id+'"></div>';a+="</div>";a+='<div class="fl prLabel" style="padding-top:10px;width:50%;">';a+='<div class=fl style="padding:0 5px;width:140px;">... love this channel?</div><div class=fl style="width:160px;">';a+=cur_edit_mode>0?'<a class="add_button" href="javascript:;" onclick="return remote.addToRemote('+pr.id+');" title="Add to my Remote Control">Add to my Remote Control</a>':'<a class="add_button" href="/login?addtopult" title="Add to my Remote Control" height=18>Add to my Remote Control</a>';
a+="</div></div>";a+='<div class="cb line"></div>';cur_thread_id=pr.tid;$("#pr").html(a);multiplexer.subscribe("k"+pr.channel_attr_id,function(b){});vote(pr.id,0);return false}function changePromoted(){$.ajax({method:"GET",data:{n:n},url:"/ajax/channel/getRandomPromoted/",success:function(a,c){if(a.Status>0){pr=a.Message;n=a.n;updatePromoted()}},err:function(a,c,b){}})}
function vote(a,c){$("#votes"+a).html('<img src="http://s2.vefire.ru/img/progress.gif">');$.getJSON("/ajax/channel/vote/",{id:a,vote:c},onVote)}
function onVote(a){a.status==1&&$("#votes"+a.id).html('<div><span class=ratingblock><ul class="unit-rating" style="width:100px;"><li class="current-rating" style="width:'+a.width+'px;" name=rating></li><li><a href="javascript:;" onclick="vote(\''+a.id+'\', 1);return false;" title="'+a.p1+'" class="r1-unit rater" rel=nofollow>1</a></li><li><a href="javascript:;" onclick="vote(\''+a.id+'\', 2);return false;" title="'+a.p2+'" class="r2-unit rater" rel=nofollow>2</a></li><li><a href="javascript:;" onclick="vote(\''+
a.id+'\', 3);return false;" title="'+a.p3+'" class="r3-unit rater" rel=nofollow>3</a></li><li><a href="javascript:;" onclick="vote(\''+a.id+'\', 4);return false;" title="'+a.p4+'" class="r4-unit rater" rel=nofollow>4</a></li><li><a href="javascript:;" onclick="vote(\''+a.id+'\', 5);return false;" title="'+a.p5+'" class="r5-unit rater" rel=nofollow>5</a></li></ul></span></div><div style="color:#7a7a7a;font-size:10px;text-align:left;white-space: nowrap;">'+a.vcnt+" | "+a.vavg+"</div>")}
function vote2(a,c){$("#votes"+a).html('<div class=wcloud><img src="http://s2.vefire.ru/img/progress.gif"></div>');$.getJSON("/ajax/channel/vote/",{slug:a,vote:c},onVote2)}
function onVote2(a){a.status==1&&$("#votes"+a.id).html('<div><span class=ratingblock><ul class="unit-rating" style="width:100px;"><li class="current-rating" style="width:'+a.width+'px;" name=rating></li><li><a href="javascript:;" onclick="vote2(\''+a.id+'\', 1);return false;" title="'+a.p1+'" class="r1-unit rater" rel=nofollow>1</a></li><li><a href="javascript:;" onclick="vote2(\''+a.id+'\', 2);return false;" title="'+a.p2+'" class="r2-unit rater" rel=nofollow>2</a></li><li><a href="javascript:;" onclick="vote2(\''+
a.id+'\', 3);return false;" title="'+a.p3+'" class="r3-unit rater" rel=nofollow>3</a></li><li><a href="javascript:;" onclick="vote2(\''+a.id+'\', 4);return false;" title="'+a.p4+'" class="r4-unit rater" rel=nofollow>4</a></li><li><a href="javascript:;" onclick="vote2(\''+a.id+'\', 5);return false;" title="'+a.p5+'" class="r5-unit rater" rel=nofollow>5</a></li></ul></span></div><div style="color:#7a7a7a;font-size:10px;text-align:left;">'+a.vcnt+"<br>"+a.vavg+"</div>")}
function updateEmbedPlayer(){$("#pCode").val('<iframe id=player src="http://'+document.domain+"/apps/widgets/player/?slug="+slug+"&width="+$("#pWidth").val()+"&height="+$("#pHeight").val()+"&autostart="+$("#auto").val()+"&bgcolor="+$("#bgcolor").val()+"&textcolor="+$("#textcolor").val()+'" scrolling="no" frameborder="0" style="border:none; overflow:hidden;width:'+$("#pWidth").val()+"px;height:"+$("#pHeight").val()+'px;" allowtransparency="true">Your browser does not support iframes. Here you can watch/listen online channel '+
channel_name+': <a href="http://'+document.domain+"/channel/"+slug+'/">http://'+document.domain+"/channel/"+slug+"/</a></iframe>")}
function embedPlayer(a){var c='<div class=wcloud style="text-align:left">';c+="<div id=pMsg></div>";c+="<div class=inf>Embed this player on your site or blog!</div><br>";c+='<div class=fSubtitle style="padding:0 0 5 55;">Width: <input type=text style="width:50px" id=pWidth value="'+(pw+6)+'" onkeyup="return updateEmbedPlayer();" onpaste="return updateEmbedPlayer();"> px ';c+='&nbsp;&nbsp;Height: <input type=text style="width:50px" id=pHeight value="'+(ph+65)+'" onkeyup="return updateEmbedPlayer();" onpaste="return updateEmbedPlayer();"> px</div>';
c+="<div class=cb></div>";c+='<div class=fSubtitle style="padding:0 0 5 55;">Background: <input type=text style="width:50px" size=6 maxlength=6 id=bgcolor value="000000" onkeyup="return updateEmbedPlayer();" onpaste="return updateEmbedPlayer();">';c+="<div class=cb></div>";c+='Foreground: <input type=text style="width:50px" size=6 maxlength=6 id=textcolor value="ffffff" onkeyup="return updateEmbedPlayer();" onpaste="return updateEmbedPlayer();"></div>';c+="<div class=cb></div>";c+='<link rel="stylesheet" media="screen" type="text/css" href="/utils/colorpicker/css/colorpicker.css" />';
c+='<script type="text/javascript" src="/utils/colorpicker/js/colorpicker.js"><\/script>';c+='<div class=fSubtitle style="padding:0 0 5 55;">Autostart: <select id=auto onChange="return updateEmbedPlayer();"><option value=true>Yes<option value=false>No</select></div>';c+="<div class=cb></div>";c+='<div class=fSubtitle style="padding:0 0 5 55;">HTML-code of the player:</div>';c+='<div style="padding:0 0 5 55;" class="fTextarea fl"><textarea rows=9 style="width:400px;" class=fMessage id=pCode></textarea></div>';
c+="<div class=cb></div>";c+='<input style="margin:0 0 5 55;" onclick="';c+=a=="player"?"play(1,true);":"$('#'+el).hide();";c+='return false;" type=button id=pOK value="Close"/></div>';c+="</div>";c+="<script>";c+='$("#bgcolor, #textcolor").ColorPicker({onSubmit: function(hsb, hex, rgb, el) {$(el).val(hex);$(el).ColorPickerHide();updateEmbedPlayer();},';c+='onBeforeShow: function () {$(this).ColorPickerSetColor(this.value);}}).bind("keyup", function(){$(this).ColorPickerSetColor(this.value);});';
c+="<\/script>";$("#"+a).html(c);updateEmbedPlayer();$("#pWidth").focus();return false}function showMap(a,c,b){if(GBrowserIsCompatible()){var f=new GMap2(document.getElementById("map"),{mapTypes:[G_HYBRID_MAP]});f.setCenter(new GLatLng(a,c),13);f.enableScrollWheelZoom();point=new GLatLng(a,c);marker=new GMarker(point);f.addControl(new GSmallMapControl);f.addControl(new GMapTypeControl);f.addOverlay(marker);marker.openInfoWindowHtml(b)}}
function setChannelStatus(a,c){$("#ch_status").html('<img src="http://s2.vefire.ru/img/progress.gif">');$.ajax({type:"GET",url:"/ajax/channel/setStatus/?id="+a+"&s="+c,dataType:"json",success:function(b,f){if(b.Status==0){$("#ch_status_link").html('<img src="http://s2.vefire.ru/img/icons/49.gif" align=absmiddle width=16 height=16 border=0> <font color=green>\u041a\u0430\u043d\u0430\u043b \u0430\u043a\u0442\u0438\u0432\u0435\u043d</font> <a href="" onclick="if (confirm (\'\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043d\u0430\u043b?\') ) return setChannelStatus('+
a+', 1); else return false;">[\u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c]</a></div>');$("#ch_status").html("<div class=ok>\u041a\u0430\u043d\u0430\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d!</div>")}else if(b.Status==1){$("#ch_status_link").html('<img src="http://s2.vefire.ru/img/icons/50.gif" align=absmiddle width=16 height=16 border=0> <font color=red>\u041a\u0430\u043d\u0430\u043b \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u0435\u043d</font> <a href="" onclick="return setChannelStatus('+
a+', 0);">[\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c]</a>');$("#ch_status").html("<div class=ok>\u041a\u0430\u043d\u0430\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d! \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d \u0438\u0437 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u0441\u0443\u0442\u043e\u043a!</div>")}else $("#status").html("<div class=err>1\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430! \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0434\u043d\u0435\u0435...</div>");
$("#ch_status").show("pulsate",{times:3},300)},error:function(b,f,d){$("#ch_status").html("<div class=err>\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430! \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0434\u043d\u0435\u0435...</div>").effect("pulsate",{times:3},300)}});return false}
function reloadChannelOwners(a){$("#status").html('<img src="http://s2.vefire.ru/img/progress.gif"> \u0418\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f...');$.ajax({type:"GET",url:"/ajax/channel/reloadChannelOwners/?channel="+a,dataType:"json",success:function(c,b){c.Status==0?$("#status").html('<div class=ok>\u0421\u0430\u0439\u0442 \u043f\u0435\u0440\u0435\u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d! <a href="#" onclick="window.location.reload();return false;">\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443!</a></div>'):
$("#status").html("<div class=err>\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430! \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0434\u043d\u0435\u0435... (Err "+c.Status+":"+c.Message+")</div>");$("#status").show("pulsate",{times:3},300);$("#checkform :input").removeAttr("disabled")},error:function(c,b,f){$("#status").html("<div class=err>\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430! \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0434\u043d\u0435\u0435...</div>").effect("pulsate",
{times:3},300);$("#checkform :input").removeAttr("disabled")}});$("#checkform :input").attr("disabled",true);return false}
function addChannelOwners(){$("#status").html('<img src="http://s2.vefire.ru/img/progress.gif"> \u0418\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f...');$.ajax({type:"GET",url:"/ajax/channel/reloadChannelOwners/",data:{role:$("#co_role").val(),user:$("#co_user").val(),channel:$("#co_slug").val()},dataType:"json",success:function(a,c){a.Status==0?$("#status").html('<div class=ok>\u0420\u043e\u043b\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430! <a href="#" onclick="window.location.reload();return false;">\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443!</a></div>'):
$("#status").html("<div class=err>\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430! \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0434\u043d\u0435\u0435... (Err "+a.Status+":"+a.Message+")</div>");$("#status").show("pulsate",{times:3},300)},error:function(a,c,b){$("#status").html("<div class=err>\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430! \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0434\u043d\u0435\u0435...</div>").effect("pulsate",
{times:3},300)}});return false}
function updateProgram(){$.ajax({type:"GET",url:"/ajax/rsvp/getUpdates/",data:{channel_attr_id:channel_attr_id},dataType:"json",success:function(a,c){if(a.Status==1){c="";for(var b=0;b<a.Message.length;b++)with(a.Message[b]){c+='<div class=event id="event_'+id+'">';c+='<div class="calendar fl"><span class="calendar_month">'+date_from_month+'</span><span class="calendar_day">'+date_from_day+"</span></div>";c+='<div style="margin-left:57px;"><span class="fr" style="text-align:right;">';c+=date_from_text+
" -"+date_to_text+'</span><a href="http://wefire.tv/event/'+id+'"><b>'+htmlspecialchars(title)+"</b></a><br>";c+=is_live?"<span class=live>\u0432 \u044d\u0444\u0438\u0440\u0435</span>":'<a href="http://wefire.tv/event/'+id+'#rsvp" onclick="return rsvpForm('+id+');" class="l_button" style="width:110px;margin-top:3px;"><img src="http://s2.vefire.ru/img/icons/pin-blue.png"> \u041d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043c\u043d\u0435</a>';c+="</div><div class=cb></div></div>"}$("#events").html(c)}},
error:function(a,c,b){}});return false}
function rsvpForm(a,c){c=c||0;$("#video").css("visibility","hidden");$("body").find("#bg_opacity").is("div")||($.browser.msie?$("body").append('<div id="bg_opacity"><iframe scrolling="no" frameborder="0" style="position:absolute;top:0;left:0;width:100%;height:100%;filter:alpha(opacity=0)"></iframe></div>'):$("body").append('<div id="bg_opacity"></div>'));o='<div class="b_w" id="rsvp_modal" style="margin-left:-270px;width:540px;margin-top:-300px;display:block;position:fixed;z-index:10;top:50%;left:50%;padding:20px;">';o+=
'<a href="javascript:;" onclick="return rsvpClose();" class="l_button" style="width:12px;height:14px;padding-top:4px;margin-bottom:5px;position:absolute;top:3;right:3;"><img src="http://s2.vefire.ru/img/icons/close-blue.png"/></a>';o+='<div id="rsvp_modal_cont"></div></div>';$("body").append(o);$.hotkeys&&$(document).bind("keydown","esc",function(b){rsvpClose();return false});$("#bg_opacity").click(function(){rsvpClose()});$("#rsvp_modal_cont").html('<img src="http://s2.vefire.ru/img/progress.gif"> \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430...');
$.ajax({type:"GET",url:"/ajax/rsvp/loadEventInfo/",data:{id:a},dataType:"json",success:function(b,f){if(b.Status==1)with(b.Message){o='<div class="calendar fl"><span class="calendar_month">'+date_m+'</span><span class="calendar_day">'+date_d+"</span></div>";o+='<div style="margin-left:57px;"><b style="font-size:16px;" id="rsvp_modal_title">'+title+'</b><br><span style="color:#7a7a7a;" id="rsvp_modal_desc">'+date_full+' \u043d\u0430 \u043a\u0430\u043d\u0430\u043b\u0435 <a href="/channel/'+channel_slug+
'/">'+channel_name+"</a></span></div>";o+='<div id="rsvp_modal_form"  class="cb" style="margin-top:20px;padding:10px 0;border-top:1px #ccc dotted;">';o+=c==0?'\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 E-mail \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 "\u041f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f", \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u043b\u0438 \u0412\u0430\u0441 \u0437\u0430 \u043f\u043e\u043b\u0447\u0430\u0441\u0430 \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438.':
'\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 E-mail \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 "\u041e\u0442\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f".';o+='<div class="b_lg" style="margin:10px 0;padding:10px;">';o+=c==0?'<form method="POST" onsubmit="return rsvpSend('+
a+')">':'<form method="POST" onsubmit="return rsvpUnsubscr(\''+c+"')\">";o+='<input type="text" placeholder="\u0412\u0432\u0435\u0434\u0438\u0442\u0435 E-mail" value="'+user_email+'" class="bform_input" name="rsvp_email" id="rsvp_email" style="width:400px;margin-right:10px"/><input style="width:100px;" type="submit" class="bform_button" value="';o+=c==0?"\u041f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f":"\u041e\u0442\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f";o+='"/></form></div>';
o+='<div id="rsvp_modal_status"></div>';o+="</div>";$("#rsvp_modal_cont").html(o)}else $("#rsvp_modal_cont").html('<div class="err">Error: '+b.Message+"</div>")},error:function(b,f,d){$("#rsvp_modal_cont").html("<div class=err>\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430! \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0434\u043d\u0435\u0435...</div>").effect("pulsate",
{times:3},300)}});return false}
function rsvpSend(a){$("#rsvp_modal_status").html('<img src="http://s2.vefire.ru/img/progress.gif"> \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430...');$.ajax({type:"POST",url:"/ajax/rsvp/send/",data:{id:a,email:$("#rsvp_email").val()},dataType:"json",success:function(c,b){if(c.Status==1){o='<div style="width:250px;" class="fl">';o+='<div id="vk_groups"></div>';o+='<script type="text/javascript">';o+='VK.Widgets.Group("vk_groups", {mode: 0, width: "250", height: "250"}, 8024927);';o+="<\/script>";
o+="</div>";o+='<div style="margin-left:260px;"><b>\u0413\u043e\u0442\u043e\u0432\u043e!</b><br><br>\u0412\u0430\u0448\u0430 \u0437\u0430\u044f\u0432\u043a\u0430 \u043f\u0440\u0438\u043d\u044f\u0442\u0430. \u0417\u0430 30 \u043c\u0438\u043d\u0443\u0442 \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043d\u0430 \u0412\u0430\u0448 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0441\u043b\u0430\u043d\u043e \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435.<div style="background:url(\'http://s.vefire.ru/img/pointer_gray.gif\') left top no-repeat;height:80px;padding:30px 0 0 55px;margin-top:10px;">\u0415\u0441\u043b\u0438 \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u044b\u0442\u044c \u0432 \u043a\u0443\u0440\u0441\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0435\u0439 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0447 \u043d\u0430 \u0432\u042d\u0444\u0438\u0440\u0435.ru, \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a \u043d\u0430\u043c ';
o+='<a href="http://vkontakte.ru/vefire">\u0432\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u0435</a>';o+='.</div><div class="cb"></div></div>';o+='<div style="margin-top:10px;padding-top:10px;border-top:1px #ccc dotted;"><a href="javascript:;" onclick="return rsvpClose();" class="action fr">\u0417\u0430\u043a\u0440\u044b\u0442\u044c</a><a href="/event/'+a+'/">\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0440\u0443\u0437\u044c\u044f\u043c \u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 &raquo;</a></div>';
o+="<div class=cb></div>";$("#rsvp_modal_form").html(o)}else $("#rsvp_modal_status").html('<div class="err">'+c.Message+"</div>")},error:function(c,b,f){$("#rsvp_modal_status").html("<div class=err>\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430! \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0434\u043d\u0435\u0435...</div>").effect("pulsate",
{times:3},300)}});return false}
function rsvpUnsubscr(a){$("#rsvp_modal_status").html('<img src="http://s2.vefire.ru/img/progress.gif"> \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430...');$.ajax({type:"POST",url:"/ajax/rsvp/unsubscribe/",data:{code:a,email:$("#rsvp_email").val()},dataType:"json",success:function(c,b){if(c.Status==1){o='<div style="width:250px;" class="fl">';o+='<div id="vk_groups"></div>';o+='<script type="text/javascript">';o+='VK.Widgets.Group("vk_groups", {mode: 0, width: "250", height: "250"}, 8024927);';o+=
"<\/script>";o+="</div>";o+='<div style="margin-left:260px;"><b>\u0413\u043e\u0442\u043e\u0432\u043e!</b><br><br>\u0412\u0430\u0448\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u043d\u0430 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043e \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430.<div style="background:url(\'http://s.vefire.ru/img/pointer_gray.gif\') left top no-repeat;height:80px;padding:30px 0 0 55px;margin-top:10px;">\u0415\u0441\u043b\u0438 \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u044b\u0442\u044c \u0432 \u043a\u0443\u0440\u0441\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0435\u0439 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0447 \u043d\u0430 \u0432\u042d\u0444\u0438\u0440\u0435.ru, \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a \u043d\u0430\u043c \u0432 ';
o+='<a href="http://vkontakte.ru/vefire">\u0432\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u0435</a>';o+='.</div><div class="cb"></div></div>';o+='<div style="margin-top:10px;padding-top:10px;border-top:1px #ccc dotted;"><a href="javascript:;" onclick="return rsvpClose();" class="action fr">\u0417\u0430\u043a\u0440\u044b\u0442\u044c</a></div>';o+="<div class=cb></div>";$("#rsvp_modal_form").html(o)}else $("#rsvp_modal_status").html('<div class="err">'+c.Message+"</div>")},error:function(c,b,f){$("#rsvp_modal_status").html("<div class=err>\u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430! \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0434\u043d\u0435\u0435...</div>").effect("pulsate",
{times:3},300)}});return false}function rsvpClose(){$("#rsvp_modal").remove();$("#bg_opacity").remove();$("#video").css("visibility","visible");return false}function zeroFill(a,c){c-=a.toString().length;if(c>0)return(new Array(c+(/\./.test(a)?2:1))).join("0")+a;return a}
var dCurDate,dStartDate,dEndDate,nTimelineTimer,aWeekdays=["\u041f\u041d","\u0412\u0422","\u0421\u0420","\u0427\u0422","\u041f\u0422","\u0421\u0411","\u0412\u0421"],aMonths=new Array("\u042f\u041d\u0412","\u0424\u0415\u0412","\u041c\u0410\u0420","\u0410\u041f\u0420","\u041c\u0410\u0419","\u0418\u042e\u041d","\u0418\u042e\u041b","\u0410\u0412\u0413","\u0421\u0415\u041d","\u041e\u041a\u0422","\u041d\u041e\u042f","\u0414\u0415\u041a");function getDay(a){return aWeekdays[(a+7)%7]}
function getMonth(a){return aMonths[a]}
function setCurTime(){dCurDate.setSeconds(dCurDate.getSeconds()+1);var a=zeroFill(dCurDate.getHours(),2)+":"+zeroFill(dCurDate.getMinutes(),2);$("#timeline").attr("title",a);$("#time").html(a);if(dCurDate<dStartDate||dCurDate>dEndDate){$("#timeline").hide();$("#time").hide()}else{$("#timeline").css("left",170+(dCurDate-dStartDate)*825/(dEndDate-dStartDate)+"px").show();$("#time").css("left",131+(dCurDate-dStartDate)*825/(dEndDate-dStartDate)+"px").show()}for(var c='<div style="text-align:right;background:#0958a7;color:white;position:absolute;padding:3px;color:#fff;width:164px;border-top:2px #fff solid">\u0414\u0415\u041d\u042c</div>',
b=170,f=dStartDate.getDate(),d=-2;d<8;d++){a=new Date(dCurDate);a.setDate(a.getDate()+d);c+='<div class=timelineday style="left:'+b+"px;";if(f==a.getDate()){c+="background:red;color:#fff;border:2px #cbdef1 solid;";c+="width:70px;";b+=84}else{if(d==0)c+="background:#e9eff5;color:#000;";c+="width:30px;border:1px #fff solid;border-top:2px #fff solid;";b+=42}var e=a.getFullYear()+"-"+zeroFill(a.getMonth()+1,2)+"-"+zeroFill(a.getDate(),2);c+='" onclick=\'updateGuide({"d":"'+e+'","h":"'+dStartDate.getHours()+
'"});\'">';c+=f==a.getDate()?getDay(dCurDate.getDay()+d-1)+" "+a.getDate()+" "+aMonths[a.getMonth()]:getDay(dCurDate.getDay()+d-1);c+="</div>"}a=aWeekdays[(dCurDate.getDay()-1+7)%7]+", "+dCurDate.getDate()+" "+aMonths[dCurDate.getMonth()];a+=" "+zeroFill(dCurDate.getHours(),2)+":"+zeroFill(dCurDate.getMinutes(),2)+":"+zeroFill(dCurDate.getSeconds(),2);c+='<div style="position:absolute;text-align:center;height:30px;padding:3 5px;left:'+b+'px;width:200px;"><b>'+a+"</b></div>";$("#days").html(c);c="";
b=170;c+='<div style="text-align:right;background:#0958a7;color:white;position:absolute;padding:3px;color:#fff;width:164px;border-top:2px #fff solid">\u0427\u0410\u0421</div>';for(f=0;f<24;f++){a=new Date(dStartDate.getFullYear(),dStartDate.getMonth(),dStartDate.getDate());c+='<div class=timelinehour style="left:'+b+"px;";if(dStartDate.getHours()==f){b+=38;c+="width:26px;background:red;color:#fff;border: 2px #cbdef1 solid;"}else if(dCurDate.getHours()==f){b+=33;c+="width:23px;background:#e9eff5;color:#fff;color:#000;border:1px #fff solid;border-top:2px #fff solid;"}else{b+=
33;c+="width:23px;border:1px #fff solid;border-top:2px #fff solid;"}e=a.getFullYear()+"-"+zeroFill(a.getMonth()+1,2)+"-"+zeroFill(a.getDate(),2);c+='" onclick=\'updateGuide({"d":"'+e+'","h":"'+f+"\"});'>"+f+"</div>"}$("#hours").html(c)}
function updateGuide(a){if(a.d)window.location.hash="#d="+a.d+"&h="+a.h;$("#program_status").html("\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445...");$.ajax({type:"GET",url:"/ajax/rsvp/getProgram/",data:a,dataType:"json",success:function(c,b){b="";var f=0;if(c.Status>0){with(c.Message){dStartDate=new Date(date.start_date*1000);dEndDate=new Date(dStartDate.getTime()+7200000);dCurDate=new Date(date.cur_date*1000);b+="<script>clearTimeout(nTimelineTimer);setCurTime();nTimelineTimer = setInterval(function() {setCurTime();}, 1000);<\/script>";
b+='<div id=days style="position:relative;height:26px">';b+="</div><div class=line></div>";b+='<div id=hours style="position:relative;height:26px"></div><div style="height:20px;" class=line></div>';b+='<div id=timetable style="position:relative">';c=31*channels.length+21*(channels.length/10)+20*(channels.length%10>0?1:0);b+='<div id=time style="text-align:center;color:white;line-height:normal;position:absolute;z-index:30;top:-15px;width:40px;height:15px;background:red;"></div>';b+='<div id="timeline" style="top:0px;height:'+
c+'px;display:none;"></div>';for(c=0;c<channels.length;c++){f++;if(c%10==0){b+='<div style="position:relative;border-bottom:1px #ccc solid;height:20px;background:#e9eff5">';var d=new Date(dStartDate.getTime()-7200000),e=d.getHours();d=d.getFullYear()+"-"+zeroFill(d.getMonth()+1,2)+"-"+zeroFill(d.getDate(),2);b+='<div style="position:absolute;left:160px;"><a href="#d='+d+"&h="+e+'" onclick=\'updateGuide({"d":"'+d+'","h":"'+e+"\"});'><</a></div>";e=date.start_hour;b+='<div style="padding:0 2px;border-left:1px #ccc solid;position:absolute;left:170px;"><b>'+
e+":00</b></div>";b+='<div style="padding:0 2px;border-left:1px #ccc solid;position:absolute;left:376px;">'+e+":30</div>";e++;if(e>23)e=0;b+='<div style="padding:0 2px;border-left:1px #ccc solid;position:absolute;left:582px;"><b>'+e+":00</b></div>";b+='<div style="padding:0 2px;border-left:1px #ccc solid;position:absolute;left:788px;">'+e+":30</div>";e=dEndDate.getHours();d=dEndDate.getFullYear()+"-"+zeroFill(dEndDate.getMonth()+1,2)+"-"+zeroFill(dEndDate.getDate(),2);b+='<div style="position:absolute;left:985px;"><a href="#d='+
d+"&h="+e+'" onclick=\'updateGuide({"d":"'+d+'","h":"'+e+"\"});'>></a></div>";b+="</div>"}b+='<div style="position:relative;border-bottom:1px #ccc solid;height:30px;">';b+='<div style="position:absolute;width:170px;height:30px;padding:0px;border-right:1px #ccc solid;border-right:1px #ccc solid;border-bottom:1px #ccc solid;">';b+='<div class=gradient style="position:absolute;right:0;width:15px;height:30px"></div>';b+='<div class=fl style="width:25px;text-align:center"><small><b>'+f+"</b></small></div>";
b+='<div class=fl style="width:145px;overflow:hidden;white-space:nowrap;">';b+='<a href="'+getDomain("ru",channels[c].type)+"/channel/"+channels[c].slug+'" title="'+htmlspecialchars(channels[c].name)+'">';b+='<img align=absmiddle width=25 height=18 src="/l/mini/'+channels[c].slug+'.gif" border=0> '+htmlspecialchars(channels[c].name)+"</a>";b+="</div>";b+="</div>";with(channels[c])for(e=0;e<programs.length;e++){d=new Date(Math.max(programs[e].f*1000,dStartDate.getTime()));var g=new Date(Math.min(programs[e].t*
1000,dEndDate.getTime())),h=Math.floor((g-d)*825/(dEndDate-dStartDate)),i=Math.floor(170+(d-dStartDate)*825/(dEndDate-dStartDate));b+='<div style="height:29px;padding:1px;border-left:1px #ccc solid;position:absolute;left:'+i+"px;width:"+h+'px;overflow:hidden;white-space:nowrap">';if(g-d>130000)b+='<div class=gradient style="position:absolute;right:0;width:15px;height:28px"></div>';b+='<a href="/event/'+programs[e].id+'" title="'+htmlspecialchars(programs[e].title)+" - "+zeroFill(d.getHours(),2)+":"+
zeroFill(d.getMinutes(),2)+"-"+zeroFill(g.getHours(),2)+":"+zeroFill(g.getMinutes(),2)+'">'+htmlspecialchars(programs[e].title)+"</a>";b+="</div>"}b+="</div>"}b+="</div>"}$("#programs").html(b);$("#program_status").html("")}},error:function(c,b,f){$("#program_status").html("<div class=err>"+b+" (Err "+f+")</div>").effect("pulsate",{times:3},300)}})};

