var IsMenuOnline=false,IsPlayerOnline=false,OnlinePodcastID=0;function showDiv(a,b){if(!IsPlayerOnline)showDivYes(a,b);else confirm("!\u067e\u062e\u0634 \u067e\u0627\u062f\u06a9\u0633\u062a \u0641\u0639\u0644\u06cc \u0645\u062a\u0648\u0642\u0641 \u062e\u0648\u0627\u0647\u062f \u0634\u062f\n\u0622\u06cc\u0627 \u0645\u0627\u06cc\u0644 \u0628\u0647 \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0647\u0633\u062a\u06cc\u062f \u061f")&&$("#SinglePlayer").fadeOut("slow",function(){$("#wimpyTarget").empty().remove().detach();$("#SinglePlayer").empty().remove().detach();try{clearInterval(to)}catch(c){}IsPlayerOnline=false;showDivYes(a,b)})}function showDivYes(a){OnlinePodcastID=a;IsPlayerOnline=true;var b="";SinglePlayeDiv=document.createElement("div");divMainMenu=document.createElement("div");var c=Math.round(($("body").innerWidth()-163)/2),d=($(window).height()-183)/2+$(window).scrollTop()-150+"px";$(SinglePlayeDiv).attr("class","PodcastViewJS_SinglePlayeDiv").attr("id","SinglePlayer").css({top:d,left:c});$("body").append(SinglePlayeDiv);$(SinglePlayeDiv).html('<img src="/Skin-Images/55199.gif" alt="" style="margin:60px 0 0 45px;"/>');$(SinglePlayeDiv).fadeTo(1200,"1.0",function(){$(SinglePlayeDiv).draggable().droppable().draggable({disabled:true});$.ajax({type:"POST",url:"/5roozServices.asmx/GetSinglePodcastXML",dataType:"xml",data:"PodcastId="+a,success:function(e){if($.isXMLDoc(e)){$(SinglePlayeDiv).html("");try{file=b+e.getElementsByTagName("File")[0].childNodes[0].nodeValue}catch(s){file=""}try{image=b+e.getElementsByTagName("Image")[0].childNodes[0].nodeValue}catch(s){image=""}try{name=e.getElementsByTagName("PodcastName")[0].childNodes[0].nodeValue}catch(s){name=""}try{DES=e.getElementsByTagName("Description")[0].childNodes[0].nodeValue}catch(s){DES=""}try{currentRate=e.getElementsByTagName("CurrentRate")[0].childNodes[0].nodeValue}catch(s){currentRate=0}try{ratedNo=e.getElementsByTagName("RatedNumber")[0].childNodes[0].nodeValue}catch(s){RatedNo=0}try{PodcastLikes=e.getElementsByTagName("Likes")[0].childNodes[0].nodeValue}catch(s){PodcastLikes=0}try{CountCommnets=e.getElementsByTagName("CommentsCount")[0].childNodes[0].nodeValue}catch(s){CountCommnets=0}try{PodcastHeared=e.getElementsByTagName("Heared")[0].childNodes[0].nodeValue}catch(s){PodcastHeared=0}divtop=document.createElement("div");$(divtop).addClass("PodcastViewJS_divtop").mouseover(function(){$(SinglePlayeDiv).draggable({disabled:false})}).mouseout(function(){$(SinglePlayeDiv).draggable({disabled:true})});$(SinglePlayeDiv).append(divtop);btnclose=document.createElement("img");$(divtop).append(btnclose);titlespan=document.createElement("span");$(titlespan).html(name).css({position:"absolute",font:"11px tahoma",color:"black",top:"-2px",left:"4px"});$(divtop).append(titlespan);$(btnclose).attr("src","/Skin-Images/close2.png").attr("alt","close").css({"float":"right",margin:"2px",cursor:"pointer"});$(btnclose).click(function(){$(SinglePlayeDiv).fadeOut("slow",function(){try{clearTimeout(o)}catch(a){}$(divPlayer).empty().remove().detach();$(divBottomContent).empty().remove().detach();$(divtop).empty().remove().detach();$(divMainMenu).empty().remove().detach();$(SinglePlayeDiv).empty().remove().detach();try{clearInterval(q)}catch(a){}IsPlayerOnline=false})});divBottomContent=document.createElement("div");$(divBottomContent).addClass("PodcastViewJS_divBottomContent");$(divBottomContent).css("background-image","url("+escape(image)+")");$(SinglePlayeDiv).append(divBottomContent);divPlayer=document.createElement("div");$(divPlayer).attr("id","wimpyTarget").addClass("PodcastViewJS_divPlayer");$(divBottomContent).append(divPlayer);var d="";d+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,47,0" width="160" height="40" id="wimpy1540">';d+='<param name="allowScriptAccess" value="always" />';d+='<param name="movie" value="/Controls/Mp3Player/wimpy.swf" />';d+='<param name="loop" value="false" />';d+='<param name="wmode" value="transparent">';d+='<param name="menu" value="false" />';d+='<param name="quality" value="high" />';d+='<param name="scale" value="noscale" />';d+='<param name="salign" value="lt" />';d+='<param name="flashvars" value="wimpyReg=Nm5nVyUyOXpGeCUyOCU3RlIlM0YlM0FrWCU4MSU0MG8lM0QlNUUlNDAwaCU4MVQlMkNKJTVC&wimpyApp=&wimpySkin=/Controls/Mp3Player/SKINS/single/skin_SinglePod3.xml&startPlayingOnload=yes&playlist='+file+'" />';d+='<embed src="/Controls/Mp3Player/wimpy.swf" flashvars="wimpyReg=Nm5nVyUyOXpGeCUyOCU3RlIlM0YlM0FrWCU4MSU0MG8lM0QlNUUlNDAwaCU4MVQlMkNKJTVC&wimpySkin=/Controls/Mp3Player/SKINS/single/skin_SinglePod3.xml&startPlayingOnload=yes&playlist='+file+'" loop="false" menu="false" quality="high" width="160" height="40" scale="noscale" salign="lt" name="wimpy1540" align="center" bgcolor="000000" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';d+="</object>";$(divPlayer).append(d);function p(){$.post("/5roozServices.asmx/AddHearedPodcast",{PodcastID:a},function(a){var b=a.getElementsByTagName("string")[0].childNodes[0].nodeValue},"xml")}var q=setTimeout(p,1.2e5),r=false;showedMore=false;var k=document.createElement("div");$(k).addClass("PodcastViewJS_divArrowMenu");$(k).click(function(){try{clearTimeout(o)}catch(a){}$(divMainMenu).slideToggle()});var o=setTimeout('$(".PodcastViewJS_divArrowMenu").click();',5e3);$(SinglePlayeDiv).append(k);$(divMainMenu).addClass("PodcastViewJS_divMainMenu");var j=[],c=$("<div></div>");$(c).addClass("PodcastViewJS_AcTitle").css("cursor","default");$(c).html("<span id='PodcastHeared'>"+PodcastHeared+"</span> \u0646\u0641\u0631 \u0627\u06cc\u0646 \u067e\u0627\u062f\u06a9\u0633\u062a \u0631\u0627 \u0634\u0646\u06cc\u062f\u0647 \u0627\u0646\u062f");$(divMainMenu).append(c);var c=$("<div></div>");$(c).addClass("PodcastViewJS_AcTitle").html("<span id='PodcastLikesNumber'>"+PodcastLikes+"</span> \u0646\u0641\u0631 \u0622\u0646 \u0631\u0627 \u062f\u0648\u0633\u062a \u062f\u0627\u0634\u062a\u0647 \u0627\u0646\u062f");$(divMainMenu).append(c);var f=$("<div></div>");$(f).addClass("PodcastViewJS_AcContent").addClass("AcContent2");var n=$("<a></a>");$(n).addClass("PodcastAC_like").hover(function(){$(this).css("background-position","62px 20px")},function(){$(this).css("background-position","62px 0px")});$(n).attr("href","javascript:;").click(function(){SubmitPodcastLike(true,a,"PodcastLikesNumber","PodcastLikeMSG")});$(f).append(n);$(divMainMenu).append(f);var m=$("<a></a>");$(m).attr("href","javascript:;").addClass("PodcastAC_dislike").hover(function(){$(this).css("background-position","0px 20px")},function(){$(this).css("background-position","0px 0px")});$(m).click(function(){SubmitPodcastLike(false,a,"PodcastLikesNumber","PodcastLikeMSG")});$(f).append(m);$(f).append('<div id="PodcastLikeMSG"></div>');$(divMainMenu).append(f);j.push(f);$(c).click(function(){l(f);$(f).slideToggle()});var c=$("<div></div>");$(c).addClass("PodcastViewJS_AcTitle").html("<span id='PodcastCommentsCount'>"+CountCommnets+"</span> \u0646\u0641\u0631 \u062f\u0631\u0628\u0627\u0631\u0647 \u0622\u0646 \u0646\u0638\u0631 \u062f\u0627\u062f\u0647 \u0627\u0646\u062f");$(divMainMenu).append(c);var g=$("<div></div>");$(g).addClass("PodcastViewJS_AcContent").addClass("AcContent3");$(g).append('<div class="label">\u0646\u0627\u0645 \u0634\u0645\u0627 : </div>').append('<input class="textbox" type="text" id="Podcastcommnet_name" dir="rtl" />').append('<div class="label">\u067e\u0633\u062a \u0627\u0644\u06a9\u062a\u0631\u0648\u0646\u06cc\u06a9 \u0634\u0645\u0627 :  </div>').append('<input class="textbox" type="text" id="Podcastcommnet_mail" dir="ltr" />').append('<div class="label">\u0646\u0638\u0631 \u0634\u0645\u0627 :  </div>').append('<textarea cols="18" rows="5" id="Podcastcommnet_body" style=" width:125px;"></textarea>').append("<div class=\"send\"><a href=\"javascript:\" onclick=\"SubmitPocastCommnet($('#Podcastcommnet_name').val(),$('#Podcastcommnet_mail').val(),$('#Podcastcommnet_body').val(),'PodcastCommnetMSG','AcContent3', '"+a+'\')" class="PodcastCommnetSendBtn"></a><a href="javascript:" onclick="ShowAllPodCommnets();" class="PodcastCommnet_otherBtn"></a></div>').append('<div id="PodcastCommnetMSG"></div>');$(divMainMenu).append(g);j.push(g);$(c).click(function(){l(g);$(g).slideToggle()});var c=$("<div></div>");$(c).html("<a href='"+file+"'>\u062f\u0627\u0646\u0644\u0648\u062f \u06a9\u0646\u06cc\u062f !</a>").addClass("PodcastViewJS_AcTitle");$(divMainMenu).append(c);var c=$("<div></div>");$(c).html("\u062f\u0631\u0628\u0627\u0631\u0647 \u0627\u06cc\u0646 \u067e\u0627\u062f\u06a9\u0633\u062a").addClass("PodcastViewJS_AcTitleRed");$(divMainMenu).append(c);var h=$("<div></div>");$(h).addClass("PodcastViewJS_AcContent").addClass("AcContent4");if(DES!="")$(h).append(DES.replace("p","span"));else $(c).hide();$(divMainMenu).append(h);j.push(h);$(c).click(function(){l(h);$(h).slideToggle()});function l(a){for(i=0;i<j.length;i++)j[i]!=a&&$(j[i]).slideUp()}$(SinglePlayeDiv).append(divMainMenu)}},error:function(c,a,b){alert(a);alert(b)}})});return false}function ShowAllPodCommnets(){var b=$("<div></div>"),c=$("<div></div>"),a=$("<div></div>");$(b).addClass("PodcastViewJS_CommentsDIV");$(a).addClass("PodcastViewJS_CommentsListDiv");$(divMainMenu).animate({left:"205px"},"normal");$(c).html('<img src="/Skin-Images/close2.png" alt="" style="display:block; border:0px solid red;" />').addClass("PodcastViewJS_divtop").css("padding","2px 4px 0 3px").click(function(){$(divMainMenu).animate({left:"0px"},"fast",function(){$(b).remove().empty().detach()})});$(b).append(c).append(a);$(a).html("\u0644\u0637\u0641\u0627 \u0635\u0628\u0631 \u06a9\u0646\u06cc\u062f . . .");$(divMainMenu).append(b);$.post("/controls/PodcastCommentSimple.aspx",{PodcastID:OnlinePodcastID},function(b){$(a).html(b)})}function SubmitPodcastLike(g,b,f,c){if(readCookie("PodcastLike")){var a=readCookie("PodcastLike");if(a.search(b)>-1)e("before");else if(a.search(b)==-1){eraseCookie("PodcastLike");a=a+","+b;createCookie("PodcastLike",a,90);d()}}else{var a=b+",";createCookie("PodcastLike",a,90);d()}function d(){e("wait");var a="PodcastId="+b+"&Likes="+g,d="/5roozServices.asmx/LikePodcast";$.ajax({type:"post",data:a,url:d,async:true,success:function(a){try{xmlDoc=a;var b=$.parseJSON(xmlDoc.getElementsByTagName("string")[0].childNodes[0].nodeValue);$("#"+f).text(b.Likes);$("#"+c).slideUp("fast",function(){$(this).html(" \u0646\u0638\u0631 \u0634\u0645\u0627 \u062b\u0628\u062a \u0634\u062f");$(this).slideDown("fast")})}catch(d){alert(d)}},error:function(c,b,a){alert(b);alert(a)},dataType:"xml"})}function e(a){$("#"+c).slideUp("fast",function(){try{clearInterval(IntMSGPodcast)}catch(b){}switch(a){case"success":$(this).html(" \u0646\u0638\u0631 \u0634\u0645\u0627 \u062b\u0628\u062a \u0634\u062f");break;case"before":$(this).html("\u0646\u0638\u0631 \u0634\u0645\u0627 \u0642\u0628\u0644\u0627 \u062b\u0628\u062a \u0634\u062f\u0647 \u0627\u0633\u062a ");break;case"wait":$(this).html("<img width='18' height='18' src='/Skin-Images/remembermilk_orange.gif' alt='wait'/>")}$(this).slideDown("fast");IntMSGPodcast=setInterval('$("#'+c+'").hide()',5e3)})}}function SubmitPocastCommnet(d,h,a,f,e,g){var c=true;if(a==""){c=false;b("BODY")}if(d==""){c=false;b("NAME")}if(c){while(a.search("\n")>-1)a=a.replace("\n","<br/>");b("wait");$.post("/5roozServices.asmx/AddPodcastCommnet",{AuthorName:d,AuthorMail:h,Comment:a,PodcastID:g},function(c){var a=c.getElementsByTagName("string")[0].childNodes[0].nodeValue;(a="OK")&&b("success")},"xml")}function b(a){$("#"+f).slideUp("fast",function(){switch(a){case"success":$(this).html(" \u0646\u0638\u0631 \u0634\u0645\u0627 \u062b\u0628\u062a \u0634\u062f");$("."+e+" input,.AcContent3 textarea").val("");break;case"wait":$(this).html("<img width='18' height='18' src='/Skin-Images/remembermilk_orange.gif' alt='wait'/>");break;case"BODY":$(this).html("\u0644\u0637\u0641\u0627 \u0646\u0638\u0631 \u062e\u0648\u062f \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f");break;case"NAME":$(this).html("\u0644\u0637\u0641\u0627 \u0646\u0627\u0645 \u062e\u0648\u062f \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f")}$(this).slideDown("fast")})}}function SetandShowInfoDiv(o,c,n,p,m){try{$("#infoDiv").empty()}catch(q){}!auto==true&&wimpy_gotoTrack(o);var i=$("<span></span>"),b=$("<ul></ul>"),k=$("<li></li>"),l=$("<li></li>"),f=$("<li></li>"),g=$("<li></li>"),a=$("<div></div>").hide();$(f).append(a);var h=$("<a></a>");$(h).addClass("PodcastAC_like").hover(function(){$(this).css("background-position","62px 20px")},function(){$(this).css("background-position","62px 0px")});$(h).attr("href","javascript:;").click(function(){SubmitPodcastLike(true,c,"HomePodcastLikesNumber","HomePodcastMSG")});$(a).append(h);var d=$("<a></a>");$(d).attr("href","javascript:;").addClass("PodcastAC_dislike").hover(function(){$(this).css("background-position","0px 20px")},function(){$(this).css("background-position","0px 0px")});$(d).click(function(){SubmitPodcastLike(false,c,"HomePodcastLikesNumber","HomePodcastMSG")});$(a).append(d);var j=$("<a href='javascript:;'></a>");$(i).css({"float":"left",margin:"5px 0 0 5px",cursor:"pointer"}).click(function(){hideinfodiv()}).html("<img src='/skin-images/close1.png'/>");$(k).html("<a class='aboutPodcast' href='/Podcastinfo.aspx?PodcastID="+c+"' onclick='return false;'>\u062f\u0631\u0628\u0627\u0631\u0647 \u0627\u06cc\u0646 \u067e\u0627\u062f\u06a9\u0633\u062a</a>");$(b).append(k);$(j).html(m+"  \u0646\u0641\u0631 \u0646\u0638\u0631 \u062f\u0627\u062f\u0647\u200c\u0627\u0646\u062f ").click(function(a){OpenHomePodcastcommnet(c,a,$(this).offset().left+$(this).innerWidth())});$(f).append(j);$(b).append(f);var e=false;$(g).html("<span id='HomePodcastLikesNumber'>"+p+"</span>  \u0646\u0641\u0631 \u062f\u0648\u0633\u062a \u062f\u0627\u0634\u062a\u0647\u200c\u0627\u0646\u062f </a>").click(function(){$(a).slideToggle();if(!e){$("#infoDiv").animate({height:"80px",top:"100px"},"fast");e=true}else{$("#infoDiv").animate({height:"63px",top:"117px"},"fast");e=false}});$(g).append(a);$(b).append(g);$(l).html("<a href='"+n+"'>\u062f\u0627\u0646\u0644\u0648\u062f</a>");$(b).append(l);$("#infoDiv").slideUp("fast",function(){$("#infoDiv").slideDown("slow",function(){beautyTipAboutPodcast()}).append(i).append(b)});timeOut=false;auto=false}function OpenHomePodcastcommnet(j,n,k){if(IsCommnetWindowOnline)return;k+=15;var c=$("<div></div>"),f=$("<div></div>"),b=$("<div></div>"),e=$("<div></div>"),a=$("<div></div>"),g=$("<a href='javascript:'></a>"),h=$("<a href='javascript:'></a>"),d=$("<a class='HPodcastBack' href='javascript:'></a>"),i=$("<a class='HPodcastClose' href='javascript:'></a>");$(b).addClass("SendHomePodcastComments");$(e).addClass("SendHomePodcastCommentsTop");$(a).addClass("ListHomePodcastComment");$(b).append('<div class="label">\u0646\u0627\u0645 \u0634\u0645\u0627 : </div>').append('<input class="textbox" type="text" id="HPodcastcommnet_name" dir="rtl" />').append('<div class="label">\u067e\u0633\u062a \u0627\u0644\u06a9\u062a\u0631\u0648\u0646\u06cc\u06a9 \u0634\u0645\u0627 :  </div>').append('<input class="textbox" type="text" id="HPodcastcommnet_mail" dir="ltr" />').append('<div class="label">\u0646\u0638\u0631 \u0634\u0645\u0627 :  </div>').append('<textarea cols="18" rows="5" id="HPodcastcommnet_body" style=""></textarea>').append('<div class="send">');$(g).click(function(){SubmitPocastCommnet($("#HPodcastcommnet_name").val(),$("#HPodcastcommnet_mail").val(),$("#HPodcastcommnet_body").val(),"HPodcastCommnetMSG","SendHomePodcastComments",j)}).addClass("PodcastCommnetSendBtn");$(h).click(function(){l()}).addClass("PodcastCommnet_otherBtn");$(b).append("<div style='height:5px;'></div>").append(g).append(h).append("</div>").append('<div id="HPodcastCommnetMSG"></div>');$(i).html("").click(function(){$(c).hide("fast",function(){$(this).empty().remove().detach()});IsCommnetWindowOnline=false});$(d).html("").click(function(){m()}).css("display","none");$(e).append(d).append(i);$(c).css({top:n.pageY+"px",left:k+"px"}).addClass("MainHomePodcastComment").append(f);$(f).css({position:"relative",width:"100%",height:"215px",border:"0px solid lime"}).append(e).append(b).append(a);$("body").append(c);$(c).show("normal");IsCommnetWindowOnline=true;function l(){$(b).hide("fast",function(){$(a).html("\u0644\u0637\u0641\u0627 \u0635\u0628\u0631 \u06a9\u0646\u06cc\u062f");$.post("/controls/PodcastCommentSimple.aspx",{PodcastID:j},function(b){$(a).html(b);$("div.PodcastcommentHeader").attr("style","color:white;");$("div.PodcastcommentBody").attr("style","color:#e9e9e9;font-weight:bold;")});$(a).show();$(d).show()})}function m(){$(a).hide("fast",function(){$(b).show();$(d).hide();$("div.PodcastcommentHeader,div.PodcastcommentBody").attr("style","")})}}
