var nowplaying=readCookie("nowplaying");if(nowplaying&&window.location.search==""){window.location=location.protocol+"//"+location.host+(location.pathname.search(/hangportal/i)==1?"/hangportal":"")+"/mrplayer.php?hangtar="+nowplaying+"&autoplay=1"}else{if(nowplaying&&window.location.search!="?hangtar="+nowplaying+"&autoplay=1"){eraseCookie("nowplaying")}}var cuepoints=undefined;var autoHideLayers=true;var seekerPos=0;var jumpToSeekerPos=false;$(document).ready(function(){$(".player").after("<a id='show' style='margin-left:364px;color:#B8E5FC;'>show layers</a>");$("a#show").click(function(){$("#layers").toggle();$(".player #screen").unbind()});$(".player #layers").hide();if($(".player #screen").is("[rel='ajanlo']")){q($(".player #controls #ajanlo"),"#lAjanlo")}$(".player #screen").mouseenter(function(){if(jQuery.browser.msie){$(".player #layers").show()}else{$(".player #layers").fadeIn("slow")}}).mouseleave(function(){if(autoHideLayers){if(jQuery.browser.msie){$(".player #layers").hide()}else{$(".player #layers").fadeOut("slow")}}});$(".player #layers #tabs").tabs({collapsible:true,selected:-1,select:function(y,z){$(".player #layers #lPreli").show()},show:function(y,z){$(".player #layers .controllayer").hide();$(".player #controls .button").removeClass("active");autoHideLayers=true}});$(".player #layers #tabs #tabs2").tabs({collapsible:false,selected:0});$(".player #layers #lAjanlo .tabs").tabs({collapsible:false,selected:0,select:function(y,z){var A=0;$(z.panel).find(".item img").each(function(){if(A++<4&&$(this).is("[rel]")){$(this).attr("src",$(this).attr("rel")).removeAttr("rel")}})}});$(".scrollable").show().scrollable({size:3,onBeforeSeek:function(){var y=0;$(this.getItems()).find("img[rel]").each(function(){if(y++<1){$(this).attr("src",$(this).attr("rel")).removeAttr("rel")}})}});$(".player #layers #tabs #tabs2 .content .info a").click(function(){var y=$(this).closest(".item");if($(y).hasClass("dwidth")){$(y).removeClass("dwidth");$(this).removeClass("hover")}else{$(y).parent().find(".item").removeClass("dwidth");$(y).addClass("dwidth");$(y).parent().find(".info a").removeClass("hover");$(this).addClass("hover")}return false});$(".player #controls #embed").not(".disabled").click(function(){q(this,"#lEmbed")});$(".player #controls #download").not(".disabled").click(function(){q(this,"#lDownload")});$(".player #controls #email").not(".disabled").click(function(){q(this,"#lEmail")});var c=true;$(".player #controls #ajanlo").not(".disabled").click(function(){q(this,"#lAjanlo")});$("#lEmbed input[type='submit']").click(function(){$.get("/");return false});var t=$("#isMP3").is(".true");var r=$("#isMP3").is("[rel='hangtar']");var e=$("#isMP3").is("[rel='mtar']");var b="";if(location.host=="www.mr1-kossuth.hu"){key="#@6d80e23899423a82277";b=".commercial"}else{if(location.host=="www.hangtar.radio.hu"){key="#@f3f4b22554770428a87";b=".commercial"}}var d=0;var l=0;var x;var j=$(".loading");$("#player").flowplayer({wmode:"opaque",src:location.protocol+"//"+location.host+(location.pathname.search(/hangportal/i)==1?"/hangportal":"")+"/js/flowplayer/flowplayer"+b+"-3.1.2.swf"},{key:key,clip:{autoPlay:true,autoBuffering:false,onBegin:function(z){if(t){l=$("#seeker #line").parent().width();d=$f("player").getClip().fullDuration;if(d==undefined&&$("#duration").is("[rel!='']")){d=parseInt($("#duration").attr("rel"))}$f("player").setVolume(50);if(d!=undefined){$("#duration").html(n(d,true,":"))}if(seekerPos==0){$("#seeker").slider({max:d,value:seekerPos,start:function(B,C){$("#seeker .ui-slider-handle").stopTime()},slide:function(B,C){$("#seeker .ui-slider-handle").html(n(C.value,false,":"))},change:function(D,E){g("player");var B=$f("player").getStatus().bufferEnd;if(t){$(j).show();var C="";if(r){C=$("a#player").attr("href").replace(".mp3","-"+E.value+".mp3");seekerPos=E.value}else{if(e){C=s(E.value);seekerPos=E.value}}h($("#controls #play"),"player",false,C,false)}else{if(D.originalEvent!="programmatically"){$f("player").seek(E.value)}}},stop:function(B,C){g("player")}})}$("#seeker #line #buffer").everyTime(100,function(D){var B=$f("player").getStatus().bufferEnd;var C=Math.round((l*B)/d);$(this).css("width",C+"px");if(C>=l){$(this).stopTime()}});if(cuepoints!=undefined){for(i in cuepoints){var A=cuepoints[i].time/1000/d*l;$("#seeker").append('<div class="marker" style="margin-left:'+A+'px" title="'+k(cuepoints[i].time)+" - "+cuepoints[i].text+'"></div>')}}var y=$("#helper");$("#seeker").mouseover(function(){if(d!=undefined){$(y).show()}}).mousemove(function(C){var B=C.pageX-this.offsetLeft;if(B<l&&B>0&&d!=undefined){$(y).html(n(B*d/l,true,":")).css("margin-left",(B+10)+"px")}}).mouseout(function(){$(y).hide()});w($("#controls #play"),"player",true)}},onStart:function(z){if(!t){l=$("#seeker #line").parent().width();d=$f("player").getClip().fullDuration;if(d==undefined&&$("#duration").is("[rel!='']")){d=parseInt($("#duration").attr("rel"))}$f("player").setVolume(50);if(d!=undefined){$("#duration").html(n(d,true,":"))}$("#seeker").slider({max:d,start:function(B,C){$("#seeker .ui-slider-handle").stopTime()},slide:function(B,C){$("#seeker .ui-slider-handle").html(n(C.value,false,":"))},change:function(B,C){g("player");if(B.originalEvent!="programmatically"){$f("player").seek(C.value-2)}},stop:function(B,C){g("player")}});$("#seeker #line #buffer").everyTime(100,function(D){var B=$f("player").getStatus().bufferEnd;var C=Math.round((l*B)/d);$(this).css("width",C+"px");if(C>=l){$(this).stopTime()}});if(cuepoints!=undefined){for(i in cuepoints){var A=cuepoints[i].time/1000/d*l;$("#seeker").append('<div class="marker" style="margin-left:'+A+'px" title="'+k(cuepoints[i].time)+" - "+cuepoints[i].text+'"></div>')}}var y=$("#helper");$("#seeker").mouseover(function(){if(d!=undefined){$(y).show()}}).mousemove(function(C){var B=C.pageX-this.offsetLeft;if(B<l&&B>0&&d!=undefined){$(y).html(n(B*d/l,true,":")).css("margin-left",(B+10)+"px")}}).mouseout(function(){$(y).hide()});w($("#controls #play"),"player",true)}},onPause:function(){m($("#controls #play"),"player",true)},onStop:function(){m($("#controls #play"),"player",true)},onFinish:function(){m($("#controls #play"),"player",true)},onResume:function(){w($("#controls #play"),"player",true)},onCuepoint:[cuepoints,function(y,A){var z=3000;if(A.time2!=undefined&&A.time2>A.time){z=A.time2-A.time}$("#lCaption").show().find("span").html(A.text).parent().animate({opacity:0.75},z,function(){$(this).hide()})}]},plugins:{controls:null},logo:{url:location.protocol+"//"+location.host+(location.pathname.search(/hangportal/i)==1?"/hangportal":"")+"/images/mr1/mr_watermark.png",fullscreenOnly:false,zIndex:0,top:"10",left:"260",displayTime:10}});$("#controls #play").not(".disabled").click(function(){if($(this).hasClass("paused")){$(j).show();if(jumpToSeekerPos){clip=s(seekerPos);h(this,"player",false,clip,false)}else{w(this,"player",false)}}else{if($(this).hasClass("playing")){m(this,"player",false)}}return false});$(".splash .start div").click(function(){$("#controls #play").trigger("click")});$(".jumpto").click(function(){$("#lCaption").hide();if($f("player").getState()==-1){$f("player").load(function(){$f("player").seek($(this).attr("rel")/1000)})}if($f("player").getState()==4){w($("#controls #play"),"player",false)}$f("player").seek($(this).attr("rel")/1000-1);return false});$("#controls #volume #indi").slider({range:"min",max:100,value:50,slide:function(y,z){$f("player").setVolume(z.value);$(this).attr("title","hangerÅ‘ "+Math.round(z.value)+"%")}});$(".player #channels a").click(function(){eraseCookie("nowplaying")});var f=0;var u=$(".player .splashgal");var p=new Array();if(u.length>0){$(".player").everyTime(10000,function(z){var y=u[f++];if(f>u.length){y=u[0];f=0}$(".player .splash").css("background-image","url("+$(y).attr("href")+")");p[f+1]=new Image();p[f+1].src=$(u[f+1]).attr("href")})}var v=$("#lEmail .send form");$("#lEmail #back a").click(function(){$(v).find("#email").val("");$(v).find("input,textarea").removeAttr("disabled");$("#lEmail #back").hide();$("#lEmail .send").show()}).css("cursor","pointer");$(v).submit(function(){return false});$("#lEmail .send #ok").click(function(){var z="";var y=$(v).find("#email").val();var A=$(v).find("#myemail").val();var B=$(v).find("#msg").val();if(B==""){z="KÃ©rem adja meg az Ã¼zenetet."}if(A==""){z="KÃ©rem adja meg sajÃ¡t e-mail cÃmÃ©t."}if(y==""){z="KÃ©rem adja meg a cÃmzett e-mail cÃmÃ©t."}if(z!=""){alert(z)}if(z==""){$(v).find("input,textarea").attr("disabled","disabled");$.post("sendHTML.php",{email:y,myemail:A,"msg[]":[B]},function(C){var D="Az Ã¼zenet elkÃ¼ldÃ©se sikertelen";if(C=="1"){D="AjÃ¡nlÃ¡sÃ¡t elkÃ¼ldtÃ¼k ismerÅ‘sÃ©nek."}$("#lEmail .send").hide();$("#lEmail #back").show().prepend(D+"<br /><br />")})}return false});$("#test a").click(function(){clip=$(this).attr("href");$("#test").append($f("player").getState()+"<br>");$f("player").addClip(clip);a=$f("player").getPlaylist().length;alert(a);$f("player").play(a-1);return false});function h(A,z,D,C,B){if(!D){if(C==""){$f(z).play()}else{try{$f(z).stopBuffering()}catch(y){}$f(z).unload();$f(z).play(C,B)}}$(A).removeClass("paused").addClass("playing");g(z);$(".player .splash .start").hide();if($("#isLive").is(".true")){createCookie("nowplaying",$("#isLive").html(),0);$(j).hide()}}function w(z,y,A){h(z,y,A,"",false)}function m(z,y,A){$("#seeker .ui-slider-handle").stopTime();if(!A){if($f(y).getState()<=2){seekerPos=$("#seeker").slider("option","value");jumpToSeekerPos=true;$f(y).stopBuffering()}$f(y).pause();$(".player .splash .start").show()}$(z).removeClass("playing").addClass("paused");if($("#isLive").is(".true")){eraseCookie("nowplaying")}}function g(z){var y=0;$("#seeker .ui-slider-handle").everyTime(100,function(B){var A=$f(z).getTime();if(A>y){$(j).hide()}y=A;$(this).html(n(seekerPos+A,false,":"));$("#seeker").slider("option","value",seekerPos+A);if(seekerPos+A>=$("#seeker").slider("option","max")){m($("#controls #play"),"player",false)}})}function n(A,D,z){var y=o(Math.floor(A/3600));var B=o(Math.floor(A/60)-y*60);var C=o(Math.round(A%60));return(D?y+z:"")+B+z+C}function k(z){z=z/1000;var y=o(Math.floor(z/3600));var A=o(Math.floor(z/60)-y*60);var B=o(Math.round(z%60));return y+":"+A+":"+B}function o(y){var z=""+y;while(z.length<2){z="0"+z}return z}function q(y,z){$(document).stop(true,true);$(y).toggleClass("active");if($(y).hasClass("active")){$(".player #controls .button").not(y).removeClass("active");$(".player #layers #tabs").tabs("select",-1);$(".player #layers .controllayer").hide();$(".player #layers").show().find(z).show();autoHideLayers=false}else{$(".player #layers").hide().find(z).hide();$(".player #layers #lPreli").show();autoHideLayers=true}}function s(A){var z=/(\d\d\d\d)(\d\d)(\d\d)_(\d\d)(\d\d)(\d\d)_(\d{1,2})/;var y=$("a#player").attr("href").match(z);var B=new Date(y[1],y[2]-1,y[3],y[4],y[5],y[6]);B.setSeconds(B.getSeconds()+Math.round(A));return $("a#player").attr("href").replace(z,B.getFullYear()+""+o(B.getMonth()+1)+""+o(B.getDate())+"_"+o(B.getHours())+""+o(B.getMinutes())+""+o(B.getSeconds())+"_"+y[7])}});var cookieEnabled=true;function createCookie(d,e,f){if(f){var c=new Date();c.setTime(c.getTime()+(f*24*60*60*1000));var b="; expires="+c.toGMTString()}else{var b=""}document.cookie=d+"="+e+b+"; path=/";if(!readCookie("nowplaying")&&cookieEnabled&&f!=-1){cookieEnabled=false;alert("Amennyiben szeretnÃ©, hogy az Ã©lÅ‘ adÃ¡s lejÃ¡tszÃ¡sa folytatÃ³djon az oldalon valÃ³ navigÃ¡lÃ¡st kÃ¶vetÅ‘en is, engedÃ©lyezze bÃ¶ngÃ©szÅ‘jÃ©ben a sÃ¼tik (cookies) kezelÃ©sÃ©t.")}}function readCookie(d){var f=d+"=";var b=document.cookie.split(";");for(var e=0;e<b.length;e++){var g=b[e];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return g.substring(f.length,g.length)}}return null}function eraseCookie(b){createCookie(b,"",-1)};
