function fetchAds(B){var C="category="+B;var A="./view/online/jsp/ads.jsp";createRequest();if(ajaxRequest==null){return }ajaxRequest.onreadystatechange=function(){if(ajaxRequest.readyState==4){if(ajaxRequest.status==200){try{document.getElementById("leftBar").innerHTML=ajaxRequest.responseText;forceAd(B)}catch(D){failureInfoMsg("Network Failure!")}}else{if(ajaxRequest.status==500){failureInfoMsg("Network Failure!")}}}};ajaxRequest.open("POST",A,true);ajaxRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajaxRequest.send(C);return false}var titleAds=new Array();var urlAds=new Array();var desc1Ads=new Array();var desc2Ads=new Array();var useGraphicAds=new Array();var adsCampaignId=new Array();var countAds=-1;var addOverlayTimer=null;var graphicFlag=0;function fetchOverlayAds(){countAds=0;var B="method=fetchOverlayAds";var A={success:function(F){try{var D=YAHOO.lang.JSON.parse(F.responseText);if(D.length>0){for(var E=0;E<D.length;E++){titleAds[E]=D[E].title;urlAds[E]=D[E].url;desc1Ads[E]=D[E].desc1;desc2Ads[E]=D[E].desc2;useGraphicAds[E]=D[E].useGraphic;adsCampaignId[E]=D[E].campaignId}paintOverlayDiv(countAds,0);graphicFlag=0}}catch(C){return }},failure:function(C){failureInfoMsg("Network Failure!")}};YAHOO.util.Connect.asyncRequest("POST","/OnlineAdmin",A,B);return false}function adsUrlClick(A){window.open(A);return false}function paintAdsDivs(D,F,B,E,C){if(document.getElementById("ad")){document.getElementById("ad").style.visibility="visible";document.getElementById("ad").innerHTML=" Ads by Akeebo "}if(document.getElementById("ad"+D)){document.getElementById("ad"+D).style.visibility="visible"}var A=(B.length>17)?(B.substring(0,15)+"..."):B;if(document.getElementById("ad"+D)){document.getElementById("ad"+D).innerHTML='<table style="margin-left:5px;"><tr><td style="padding-top:5px;"><a href='+B+' target="blank" title="'+F+'" style="cursor:pointer;color:#2200CC;text-decoration:underline;"><b>'+F+"</b></a></td></tr><tr><td>"+E+"</td></tr><tr><td>"+C+'</td></tr><tr><td style="color:Green;">'+A+"</td></tr></table>"}}function paintOverlayDiv(A,C){if(document.getElementById("adOverlayHide")){document.getElementById("adOverlayHide").style.visibility="hidden"}if(document.getElementById("adOverlayCancel")){document.getElementById("adOverlayCancel").style.visibility="visible";document.getElementById("adOverlayCancel").innerHTML='Ads by Akeebo&nbsp; <img onclick="closeAds();" src="/view/online/images/cancel.jpg" style="cursor:pointer;" title="close Ads" alt="Loading..." />'}if(document.getElementById("adOverlayPrevious")){document.getElementById("adOverlayPrevious").style.visibility="visible";document.getElementById("adOverlayPrevious").innerHTML='<img onclick="previousAd('+A+');" src="/view/online/images/leftAd.png" style="cursor:pointer;" title="previous Ads" alt="Loading..." />'}if(document.getElementById("adOverlayNext")){document.getElementById("adOverlayNext").style.visibility="visible";document.getElementById("adOverlayNext").innerHTML='<img onclick="nextAd('+A+');" src="/view/online/images/rightAd.png" title="next Ads" style="cursor:pointer;" alt="Loading..." />'}if(document.getElementById("adOverlay")){if(addOverlayTimer==null){addOverlayTimer=window.setInterval("nextAd(countAds);",5000)}document.getElementById("adOverlay").style.visibility="visible";if((useGraphicAds[A]=="1")&&(C==0)){document.getElementById("adOverlay").style.background='url("/ImageHandler?value='+adsCampaignId[A]+'&icon=-1&imageType=6") no-repeat';var B='<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="624" height="80" name="adsImage" id="adsImage" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/ImageHandler?value='+adsCampaignId[A]+'&icon=-1&imageType=6" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="opaque"><embed src="/ImageHandler?value='+adsCampaignId[A]+'&icon=-1&imageType=6" wmode="opaque" quality="high" bgcolor="#000000" width="624" height="80" name="adsImage" id="adsImage" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';document.getElementById("adOverlay").innerHTML="<a onclick='return adsUrlClick(\""+urlAds[A]+'");\' title="'+titleAds[A]+'" style="cursor:pointer;">'+B+"</a>";graphicFlag=1}else{document.getElementById("adOverlay").style.background="black";document.getElementById("adOverlay").innerHTML='<table style="margin-left:5px;"><tr><td style="padding-top:2px;text-align:left;width:495px;"><a href='+urlAds[A]+" target='blank' style='cursor:pointer;color:#ffffff;font-size:25px;text-decoration:underline;font-weight:bold;'>"+titleAds[A]+'</a></td></tr><tr><td colspan="3" style="color:#ffffff;font-size:16px;">'+desc1Ads[A]+" "+desc2Ads[A]+'</td></tr><tr><td style="color:Yellow;font-size:17px;"><b>'+urlAds[A]+"</b></td></tr></table>";graphicFlag=0}}}function closeAds(A){if(document.getElementById("adOverlay")){document.getElementById("adOverlay").style.visibility="hidden"}if(document.getElementById("adOverlayCancel")){document.getElementById("adOverlayCancel").style.visibility="hidden"}if(document.getElementById("adOverlayPrevious")){document.getElementById("adOverlayPrevious").style.visibility="hidden"}if(document.getElementById("adOverlayNext")){document.getElementById("adOverlayNext").style.visibility="hidden"}if(document.getElementById("adOverlayHide")){document.getElementById("adOverlayHide").style.visibility="visible";document.getElementById("adOverlayHide").innerHTML='<img onclick="paintOverlayDiv('+0+');" src="/view/online/images/ad.png" title="next Ads" style="cursor:pointer;" alt="Loading..." />'}if(addOverlayTimer!=null){window.clearInterval(addOverlayTimer);addOverlayTimer=null}}function nextAd(A){var B=urlAds.length;if(graphicFlag==1){paintOverlayDiv(A,1)}else{A++;if(A>=B){A=0;paintOverlayDiv(A,0)}else{paintOverlayDiv(A,0)}}countAds=A}function previousAd(A){var B=urlAds.length;if(graphicFlag==1){paintOverlayDiv(A,1)}else{A--;if(A<0){A=(B-1);paintOverlayDiv(A,0)}else{paintOverlayDiv(A,0)}}countAds=A}function forceAd(B){var C="method=forceAdsInfo&category="+B;var A={success:function(E){try{var H=YAHOO.lang.JSON.parse(E.responseText);if(H.length>0){var K=H[0].title;var D=H[0].url;var I=H[0].desc1;var G=H[0].desc2;var F=H[0].useGraphic;var L=H[0].campaignId;forceAdsPanel(K,D,I,G,F,L)}}catch(J){return }},failure:function(D){failureInfoMsg("Network Failure!")}};YAHOO.util.Connect.asyncRequest("POST","/OnlineAdmin",A,C);return false}function forceAdsPanel(F,B,D,C,E,A){searchContent1();document.getElementById("adsPanel_background").style.display="block";document.getElementById("adsPanel").style.display="block";document.getElementById("adsPanel").innerHTML='<table><tr><td style="padding-left:5px;padding-right:0px;padding-top:0px;font-size:16px;width:280px;text-align:left;"><a href='+B+' target="blank" style="cursor:pointer;color:#2200CC;font-size:25px;text-decoration:underline;font-weight:bold">'+F+'</a></td><td style="cursor:pointer;"><a onclick="fadeAdsPanel();"><img title="click to close" alt="cross" src="/view/tv/images/widgets/cancel.png" valign="middle" border=0></a></td></tr><tr><td colspan="2" style="padding-left:7px;padding-right:7px;padding-top:15px;font-size:16px;width:469px;text-align:justify;"><b>'+D+'</b></td></tr><tr><td colspan="2" style="padding-left:7px;padding-right:7px;padding-top:10px;font-size:16px;width:469px;text-align:justify;"><b>'+C+'</b></td></tr><tr><td colspan="2" style="padding-left:7px;padding-right:7px;padding-top:10px;font-size:16px;width:469px;text-align:justify;color:Green;"><b>'+B+"</b></td></tr></table>"}function fadeAdsPanel(){document.getElementById("adsPanel_background").style.display="none";document.getElementById("adsPanel").style.display="none"}function hideAdsDivs(){if(addOverlayTimer!=null){window.clearInterval(addOverlayTimer);addOverlayTimer=null}if(document.getElementById("adOverlay")){document.getElementById("adOverlay").style.visibility="hidden"}if(document.getElementById("ad")){document.getElementById("ad").style.visibility="hidden"}if(document.getElementById("ad0")){document.getElementById("ad0").style.visibility="hidden"}if(document.getElementById("ad1")){document.getElementById("ad1").style.visibility="hidden"}if(document.getElementById("ad2")){document.getElementById("ad2").style.visibility="hidden"}if(document.getElementById("ad3")){document.getElementById("ad3").style.visibility="hidden"}if(document.getElementById("ad4")){document.getElementById("ad4").style.visibility="hidden"}if(document.getElementById("ad5")){document.getElementById("ad5").style.visibility="hidden"}if(document.getElementById("more")){document.getElementById("more").style.visibility="hidden"}if(document.getElementById("adOverlayCancel")){document.getElementById("adOverlayCancel").style.visibility="hidden"}if(document.getElementById("adOverlayPrevious")){document.getElementById("adOverlayPrevious").style.visibility="hidden"}if(document.getElementById("adOverlayNext")){document.getElementById("adOverlayNext").style.visibility="hidden"}if(document.getElementById("ad10")){document.getElementById("ad10").style.visibility="hidden"}if(document.getElementById("ad11")){document.getElementById("ad11").style.visibility="hidden"}if(document.getElementById("ad12")){document.getElementById("ad12").style.visibility="hidden"}if(document.getElementById("ad13")){document.getElementById("ad13").style.visibility="hidden"}if(document.getElementById("ad14")){document.getElementById("ad14").style.visibility="hidden"}if(document.getElementById("ad15")){document.getElementById("ad15").style.visibility="hidden"}}function moveAds(G,B,C,E,D){if(parseInt(G)<0){if(parseInt(C)-7>=0){G=0}else{return false}}if(parseInt(G)>=parseInt(B)){if(parseInt(C)+7<parseInt(B)){G=parseInt(E)}else{return false}}var A="./view/online/jsp/ads.jsp";createRequest();var F="category="+D+"&pageView="+G+"&totalQue="+B;var H={success:function(I){document.getElementById("leftBar").innerHTML=I.responseText},failure:function(I){failureInfoMsg("Network Failure!")},argument:[]};YAHOO.util.Connect.asyncRequest("POST",A,H,F);return false}function savePhoto(C){if(C.title.value==""){Alert.fnAlert("Please enter title.",null,C.title);return false}if(C.fileText.value==""){Alert.fnAlert("Please select image file.",null,C.fileText);return false}else{var B=C.fileText.value.substring(C.fileText.value.indexOf(".")+1,C.fileText.value.length).toLowerCase();if((B!="jpg")&&(B!="png")&&(B!="jpeg")&&(B!="gif")&&(B!="bmp")&&(B!="tiff")){Alert.fnAlert("File format not supported.",null,null);return false}}if(document.getElementById("loaderUpload_background")){document.getElementById("loaderUpload_background").style.display="block"}loaderUpload();YAHOO.util.Connect.setForm(C,true);var A="/UploadPhoto";var D={success:function(F){var E=F.responseText},failure:function(E){alert("failure")},upload:function(G){if(document.getElementById("loaderUpload_background")){document.getElementById("loaderUpload_background").style.display="none"}loaderUploadVar.hide();var E=G.responseText;var F="customerId="+C.customerId.value+"&tag="+C.tag.value;loadJspContent("photos",F)},argument:[]};YAHOO.util.Connect.asyncRequest("POST",A,D,null);return false}function insidefile(){if(document.getElementById("fileSystem")){document.getElementById("fileText").value=document.getElementById("fileSystem").value}}function videofile(){if(document.getElementById("videoFile")){document.getElementById("videoText").value=document.getElementById("videoFile").value}}function photos(B,A){var C="customerId="+parseInt(YAHOO.util.Cookie.get("customerId"))+"&tag="+A;loadJspContent("photos",C)}function moveUpDown(H,C,D,F,E,A){if(parseInt(H)<0){if(parseInt(D)-1>=0){H=0}else{return false}}if(parseInt(H)>=parseInt(C)){if(parseInt(D)+1<=parseInt(C)){H=parseInt(F)}else{return false}}if(parseInt(H)+4==parseInt(C)){if((parseInt(C)%4)>=0){H=C-4}else{}}H=parseInt(H);var B=(H+1);if((B+3)>C){return }var G="customerId="+E+"&tag="+A+"&pageView="+H+"&totalPage="+C;loadJspContent("photos",G)}var photoParam;function deletePhoto(E,C,A,D){photoParam="method=deletePhoto&id="+parseInt(E)+"&customerId="+parseInt(C)+"&tag="+parseInt(A);var B=photoDeleteConfirm("Are you sure to delete picture "+D+"?");return false}function deletePhoto_cancelHandler(){YAHOO.util.Dom.setStyle("onlinePanel_background","display","none");YAHOO.util.Dom.setStyle("onlinePanel","display","none");return false}function deletePhoto_okHandler(){var A={success:function(C){var B=C.responseText;YAHOO.util.Dom.setStyle("onlinePanel_background","display","none");YAHOO.util.Dom.setStyle("onlinePanel","display","none");loadJspContent("photos",photoParam)},failure:function(B){},argument:[]};YAHOO.util.Connect.asyncRequest("POST","OnlineAdmin",A,photoParam)}function showPicture(E,B,A,D){var C="id="+E+"&customerId="+B+"&title="+D;loadJspContent("showImage",C)}function closePhoto(){document.getElementById("whySign").style.visibility="hidden";document.getElementById("showImage").innerHTML=""}function showPublic(A){var B="customerId="+A;loadJspContent("publicImages",B);return false}function showPublicVideo(A){var B="customerId="+A;loadJspContent("publicVideos",B);return false}function showPublicAudio(A){var B="customerId="+A;loadJspContent("publicAudio",B);return false}function customerUpDown(F,G,H,B,I,C,E){if(parseInt(F)<0){if(parseInt(H)-1>=0){F=0}else{return false}}if(parseInt(F)>=parseInt(G)){if(parseInt(H)+1<=parseInt(G)){F=parseInt(B)}else{return false}}if(parseInt(F)+12==parseInt(G)){if((parseInt(G)%12)>=0){F=G-12}else{}}F=parseInt(F);var A=(F+1);if((A+12)>G){return }if(E==1){var D="customerId="+I+"&pageView="+F+"&pages="+C;loadJspContent("publicVideos",D)}else{if(E==2){var D="customerId="+I+"&pageView="+F+"&pages="+C;loadJspContent("publicAudio",D)}else{var D="customerId="+I+"&pageView="+F+"&pages="+C;loadJspContent("publicImages",D)}}}function imageUpDown(F,G,H,B,I,C,E){if(parseInt(F)<0){if(parseInt(H)-1>=0){F=0}else{return false}}if(parseInt(F)>=parseInt(G)){if(parseInt(H)+1<=parseInt(G)){F=parseInt(B)}else{return false}}if(C){if(parseInt(F)+3==parseInt(G)){if((parseInt(G)%3)>=0){F=G-3}else{}}F=parseInt(F);var A=(F+1);if((A+6)>G){return }var D="customerId="+I+"&pages="+F+"&pageView="+C;if(E){loadJspContent("publicVideos",D)}else{loadJspContent("publicImages",D)}}else{if(parseInt(F)+4==parseInt(G)){if((parseInt(G)%4)>=0){F=G-4}else{}}F=parseInt(F);var A=(F+1);if((A+8)>G){return }var D="customerId="+I+"&pageView="+F;loadJspContent("videoPanel",D)}}function saveVideos(D){if(D.title.value==""){Alert.fnAlert("Please enter title.",null,D.title);return false}if(D.fileText.value==""){Alert.fnAlert("Please select image for thumbnail.",null,D.fileText);return false}else{var B=D.fileText.value.substring(D.fileText.value.indexOf(".")+1,D.fileText.value.length).toLowerCase();if((B!="jpg")&&(B!="png")&&(B!="jpeg")&&(B!="gif")&&(B!="bmp")&&(B!="tiff")){Alert.fnAlert("Image file format not supported.",null,null);return false}}if(D.status.value==1){if(D.videoText.value==""){Alert.fnAlert("Please select video.",null,D.videoText);return false}else{var C=D.videoText.value.substring(D.videoText.value.indexOf(".")+1,D.videoText.value.length).toLowerCase();if((C!="mp4")&&(C!="wmv")&&(C!="avi")&&(C!="mpeg-2")&&(C!="ogg")&&(C!="ts")&&(C!="3gp")&&(C!="wav")&&(C!="flv")){Alert.fnAlert("Video file format not supported.",null,null);return false}}}else{if(D.videoText.value==""){Alert.fnAlert("Please select audio.",null,D.videoText);return false}else{var C=D.videoText.value.substring(D.videoText.value.indexOf(".")+1,D.videoText.value.length).toLowerCase();if((C!="mp3")&&(C!="wav")&&(C!="ogg")&&(C!="aiff")&&(C!="au")&&(C!="midi")&&(C!="m4p")&&(C!="mp2")){Alert.fnAlert("Audio file format not supported.",null,null);return false}}}if(document.getElementById("loaderUpload_background")){document.getElementById("loaderUpload_background").style.display="block"}loaderUpload();YAHOO.util.Connect.setForm(D,true);var A="/UploadVideos";var E={success:function(G){var F=G.responseText},failure:function(F){if(document.getElementById("loaderUpload_background")){document.getElementById("loaderUpload_background").style.display="none"}loaderUploadVar.hide();alert("failure")},upload:function(H){if(document.getElementById("loaderUpload_background")){document.getElementById("loaderUpload_background").style.display="none"}loaderUploadVar.hide();var F=H.responseText;var G="customerId="+D.customerId.value;if(F==1){loadJspContent("videoPanel",G)}else{loadJspContent("audioPanel",G)}},argument:[]};YAHOO.util.Connect.asyncRequest("POST",A,E,null);return false}var videoParam="";var cusID=-1;function deleteVideo(D,B,C){videoParam="method=deleteVideo&customerId="+parseInt(B)+"&id="+parseInt(D);cusID="customerId="+parseInt(B);var A=videoDeleteConfirm("Are you sure to delete video "+C+"?");return false}function deleteVideo_cancelHandler(){YAHOO.util.Dom.setStyle("onlinePanel_background","display","none");YAHOO.util.Dom.setStyle("onlinePanel","display","none");return false}function deleteVideo_okHandler(){var A={success:function(C){var B=C.responseText;YAHOO.util.Dom.setStyle("onlinePanel_background","display","none");YAHOO.util.Dom.setStyle("onlinePanel","display","none");loadJspContent("videoPanel",cusID)},failure:function(B){},argument:[]};YAHOO.util.Connect.asyncRequest("POST","OnlineAdmin",A,videoParam)}function videos(A){var B="customerId="+parseInt(YAHOO.util.Cookie.get("customerId"));loadJspContent("videoPanel",B)}function Audios(A){var B="customerId="+parseInt(YAHOO.util.Cookie.get("customerId"));loadJspContent("audioPanel",B)}var audioParam="";function deleteAudio(D,B,C){audioParam="method=deleteAudio&customerId="+parseInt(B)+"&id="+parseInt(D);cusID="customerId="+parseInt(B);var A=audioDeleteConfirm("Are you sure to delete audio "+C+"?");return false}function deleteAudio_cancelHandler(){YAHOO.util.Dom.setStyle("onlinePanel_background","display","none");YAHOO.util.Dom.setStyle("onlinePanel","display","none");return false}function deleteAudio_okHandler(){var A={success:function(C){var B=C.responseText;YAHOO.util.Dom.setStyle("onlinePanel_background","display","none");YAHOO.util.Dom.setStyle("onlinePanel","display","none");loadJspContent("audioPanel",cusID)},failure:function(B){},argument:[]};YAHOO.util.Connect.asyncRequest("POST","OnlineAdmin",A,audioParam)}function audioUpDown(F,G,H,B,I,C,E){if(parseInt(F)<0){if(parseInt(H)-1>=0){F=0}else{return false}}if(parseInt(F)>=parseInt(G)){if(parseInt(H)+1<=parseInt(G)){F=parseInt(B)}else{return false}}if(parseInt(F)+1==parseInt(G)){if((parseInt(G)%1)>=0){F=G-1}else{}}if(E){F=parseInt(F);var A=(F+1);if((A+3)>G){return }var D="customerId="+I+"&pages="+F+"&pageView="+C;loadJspContent("publicAudio",D)}else{F=parseInt(F);var A=(F+1);if((A+4)>G){return }var D="customerId="+I+"&pageView="+F;loadJspContent("audioPanel",D)}}