CW_Action_Site.SITE_USER_ID=45476;CW_Action_Site.MEDIA_OF_THE_DAY_GROUP_ID=3359;CW_Action_Site.ArrayAbusId_Media=new Array();CW_Action_Site.ArrayAbusId_Media.push(1);CW_Action_Site.ArrayAbusId_Media.push(2);CW_Action_Site.ArrayAbusId_Media.push(3);CW_Action_Site.ArrayAbusId_Media.push(4);CW_Action_Site.ArrayAbusId_Comment=new Array();CW_Action_Site.ArrayAbusId_Comment.push(2);CW_Action_Site.ArrayAbusId_Comment.push(3);CW_Action_Site.ArrayAbusId_Comment.push(4);CW_Filter.Filter_ORDER_RANDOM_active=false;CW_Filter.ORDER_MOSTNOTATION=8;var MainElementsLoader={loadMainElement:function(){initializeMenuMainSub();try{CW_comwebAjax.loadHtml("html/login/register.html","registerContainer");CW_Action_User.loginCheckAutoConnect("loginCheck","registerHome")}catch(A){}CategoryListManager.initialize();this._displayHtmlZone_1();this._displayMostViewedVideo();CW_comwebAjax.loadHtml("html/search/search1.html","menuSearch")},_displayHtmlZone_1:function(){var A=Ajax.getTransport();A.open("GET","/comweb/load?action=load.html&url="+escape(htmlZone1),false);A.send(null);document.getElementById("html_zone_1").innerHTML=A.responseText},_displayMostViewedVideo:function(){CW_comwebAjax.loadHtml("html/home/homeMostViewVideoBrick.html","homeMostViewVideoBrick");var A="MainElementsLoader._displayMostViewedVideoCallback";CW_Action_Media.displayMediaList(A,4,CW_Action_Media.Media_TYPE_IMAGE,CW_Filter.SINCE_THISWEEK,CW_Filter.ORDER_MOSTVIEWED,false)},_displayMostViewedVideoCallback:function(G,F){var E=0;var B="";var D=F.queryString;if(G!=null){document.getElementById("homeMostViewVideoContent").innerHTML="";var A=G.getSpecificChildren("list")[0].getSpecificChildren("media");if(A.length>0){for(var C=0;C<A.length;C++){var H=A[C];E=H.getUid();B="goToMediaPlayMost('action=alone&listing.page=1',"+E+");";loadBrick_media_mediaElement2(H,"homeMostViewVideoContent",B,true)}}}}};function loadMainElements(){MainElementsLoader.loadMainElement()}function loadMainPage(){CW_AjaxPage_Manager.displayPage("home")}var Pub_else={iframeAd1:null,iframeAd1Src:"./pub/ad1_else.html",reload:function(A){try{if(this.iframeAd1==null){for(var B=0;B<parent.frames.length;B++){try{if(parent.frames[B].name=="adA_else"){this.iframeAd1=parent.frames[B]}}catch(C){}}}if(this.iframeAd1!=null){this.iframeAd1.location.replace(this.iframeAd1Src+"?tagPub="+A+"&cache="+(new Date()).getTime())}}catch(C){}}};CW_AjaxPage_Manager.displayUserNotConnected=function(){showDialog_connected_error()};CW_AjaxPage_Manager.currentPageIsSearch=false;CW_AjaxPage_Manager.currentMenuId=null;CW_AjaxPage_Manager.refreshMenu=function(F,B){this.currentMenuId=F;try{var A=F.indexOf("_");var E=F.substring(0,A);var C=F.substring(A+1);menuSubMyScroon.style.display="none";menuSubMember.style.display="none";menuSubVideo.style.display="none";menuSubPhoto.style.display="none";menuSubMusic.style.display="none";if(F!="X_X"){switch(E){case"0":menuSubMyScroon.style.display="block";menuSubMember.style.display="none";menuSubVideo.style.display="none";menuSubPhoto.style.display="none";menuSubMusic.style.display="none";tabOngletMenuGen.selectTab(0,false);if(C!="X"){tabOngletMenuSubMyScroon.selectTab(parseInt(C),false)}else{tabOngletMenuSubMyScroon.deselectTab()}break;case"3":menuSubMyScroon.style.display="none";menuSubMember.style.display="block";menuSubVideo.style.display="none";menuSubPhoto.style.display="none";menuSubMusic.style.display="none";tabOngletMenuGen.selectTab(3,false);if(C!="X"){tabOngletMenuSubMember.selectTab(parseInt(C),false)}else{tabOngletMenuSubMember.deselectTab()}break;default:menuSubMyScroon.style.display="none";menuSubMember.style.display="none";menuSubVideo.style.display="none";menuSubPhoto.style.display="none";if(E!="X"){tabOngletMenuGen.selectTab(parseInt(E),false)}break}}else{tabOngletMenuGen.deselectTab()}}catch(D){}};CW_AjaxPage_Manager.refreshClassStyle=function(B){var A=document.getElementById("masterPage");if(B!=null&&B!=""){A.className=B}else{A.className="default"}};CW_AjaxPage_Manager.returnURL=function(A){if(document.getElementById("returnLogOut")){if(A!=null){document.getElementById("returnLogOut").innerHTML='&gt;&nbsp;<a onclick="CW_Action_User.logout(\'registerLoad\')" href="https://secure.ccrtvi.com/su/Register?hiAction=0&hiTarget='+CW_config.webappUri+A+'">Surt</a>'}else{document.getElementById("returnLogOut").innerHTML='&gt;&nbsp;<a onclick="CW_Action_User.logout(\'registerLoad\')" href="https://secure.ccrtvi.com/su/Register?hiAction=0&hiTarget='+CW_config.webappUri+'#Home">Surt</a>'}}};CW_AjaxPage_Manager.refreshElement=function(B){var A=B.getPageName();window.scrollTo(0,0);if(A.indexOf("search")==0){this.currentPageIsSearch=true}else{if(this.currentPageIsSearch){var E=window.location.hash;if(E!=null&&E!=""){if(E.indexOf("#")==0){E=E.substr(1)}}if(E.indexOf("Search")==0){document.getElementById("searchBackLink").innerHTML="<a href='javascript:goToLastSearch(\""+E+"\" )' >"+CW_internationalization.getValue("search.last")+"</a>";this.currentPageIsSearch=false}}}if(A!="video_listing_category"&&A!="photo_listing_category"&&A!="music_listing_category"){loadDefaultZone1();Pub_else.reload(escape(tagPub))}else{}ajaxSite_DoHit();if(A=="player"){return }var D=B.getStatId();var G=B.getMenuId();this.refreshMenu(G,A);this.refreshClassStyle(B.classStyle);A=(new String(A)).toLowerCase();var F="video";if(A.indexOf("playlist")>=0){F="playlist"}else{if(A.indexOf("music")>=0){F="music"}else{if(A.indexOf("member")>=0){F="member"}else{if(A.indexOf("photo")>=0){F="photo"}}}}var C="video";if(A.indexOf("member")>=0){C="member"}else{if(A.indexOf("music")>=0){C="music"}else{if(A.indexOf("photo")>=0){C="photo"}}}loadBrick_tags_tagsHome(F);loadBrick_home_newHomeBrick(C)};PlayerFlash.flashPlayMediaDisplayEvent=function(E,C){var B="";switch(E.getMediaType()){case CW_Action_Media.Media_TYPE_IMAGE:B=CW_internationalization.getValue("upload.uploadMedia.photo").toLowerCase();loadBrick_tags_tagsHome("photo");loadBrick_home_newHomeBrick("photo");CW_AjaxPage_Manager.refreshMenu("2_X");CW_AjaxPage_Manager.refreshClassStyle("pictures");break;case CW_Action_Media.Media_TYPE_MUSIC:B=CW_internationalization.getValue("upload.uploadMedia.audio").toLowerCase();loadBrick_tags_tagsHome("music");loadBrick_home_newHomeBrick("music");CW_AjaxPage_Manager.refreshMenu("3_X");CW_AjaxPage_Manager.refreshClassStyle("audio");break;default:loadBrick_tags_tagsHome("video");loadBrick_home_newHomeBrick("video");B=CW_internationalization.getValue("upload.uploadMedia.video").toLowerCase();CW_AjaxPage_Manager.refreshMenu("X_X");CW_AjaxPage_Manager.refreshClassStyle("videos");break}var F="X_X";var A="player";categoryId=E.getCategoryId();var D=new HashTable();D.put("mediatype",B);document.getElementById("mediaPlayInfosContainer").getElementsByTagName("h2").item(0).innerHTML=CW_internationalization.getValueParams("media.settings",D)};CW_Page_Manager.changePageCheck=function(C,A){var N=A.hashTableStore.get("pagerFormName");var J=document.forms[N];CW_logger.log(CW_logger.LEVEL_INFORMATION,"CW_Page_Manager.changePageCheck() :"+N+", "+J);var R=document.getElementById(J.pagerDivId.value);var B=(new String(A.queryString)).replace("listing.page=","listing_page=").replace("listing.nbre.elements=","listing_nbre_elements=");var K=parseInt(B.toQueryParams().listing_page);var D=parseInt(B.toQueryParams().listing_nbre_elements);try{CW_util.getFormElement(J,"listing.page").value=K}catch(P){CW_logger.log(CW_logger.LEVEL_ERROR,"CW_Page_Manager.changePageCheck() :"+N+", can t change the listing.page input value")}var F=null;var O=R.getElementsByTagName("div");for(var L=0;L<O.length;L++){if(O.item(L).id=="pagercontent_dyn"){F=O.item(L)}}if(F==null){F=document.getElementById("pagercontent_dyn")}var I=C.getSpecificChildren("list")[0].getTotalNbItem();if(I>D){if((I%D)==0){maxpage=parseInt(I/D)}else{maxpage=parseInt(I/D)+1}}else{maxpage=1}writtedPage=K;if(((K)%ComwebPageGlobal.NB_PAGE)==0){writtedPage=(K-ComwebPageGlobal.NB_PAGE)+1}else{writtedPage=parseInt((K-((K)%ComwebPageGlobal.NB_PAGE))+1)}var E="";if((K-2)>1){if((K+2)>=maxpage){writtedPage=maxpage-4}else{writtedPage=(K-2)}}else{writtedPage=1}if(writtedPage<=1){writtedPage=1}else{E+="<li><a href='javascript:CW_Page_Manager.changePage("+1+',"'+N+"\")'>1</a></li><li>...</li>"}for(var H=1;writtedPage<=maxpage&&H<=ComwebPageGlobal.NB_PAGE;writtedPage++,H++){if(writtedPage==K){E+="<li class='currentElementPager'>"+writtedPage+"</li>"}else{E+="<li><a href='javascript:CW_Page_Manager.changePage("+writtedPage+',"'+N+"\")'>"+writtedPage+"</a></li>"}}if((K+2)<maxpage&&(writtedPage-1)!=maxpage){E+="<li>...</li><li><a href='javascript:CW_Page_Manager.changePage("+maxpage+',"'+N+"\")'>"+maxpage+"</a></li>"}if(E!=""){E="<ul id='pager_id' class='pager'><li class='titlePager'>"+ComwebI18N_Manager.getPagerTitle()+"</li>"+E+"</ul>"}F.innerHTML=E;CW_logger.log(CW_logger.LEVEL_INFORMATION,"CW_Page_Manager.changePageCheck() (END):"+N+", "+J);try{var Q=document.getElementById(J.pageDivId.value);var M=null;var G=Q.getElementsByTagName("div");for(var L=0;L<G.length;L++){if(G.item(L).id=="pagerContainer2"){M=G.item(L)}}if(M!=null){M.innerHTML="<div id='pagercontent_dyn'>"+E+"</div>"}}catch(P){}};ComwebFormValidatorElement.prototype._setErrorClassic=ComwebFormValidatorElement.prototype._setError;ComwebFormValidatorElement.prototype._setError=function(A){this._setErrorClassic(A)};CW_util.setUserPlaylistContent=function(C,B,A){var D=new HashTable();D.put("selectPlaylistListId",B);D.put("formName",C);D.put("selectedIndex",A);CW_Action_User.getUserPlaylist("CW_util._setUserPlaylistContentCallback",D)};CW_util._setUserPlaylistContentCallback=function(C,I){var H=null;var A=null;var E=null;try{H=C.getSpecificChildren("list");A=C.getSpecificChildren("list");E=A[0].getSpecificChildren("group")}catch(D){}if(H==null||A==null||E==null||E.length==0){var G=I.hashTableStore;var J=G.get("formName");var B=G.get("selectPlaylistListId");var F=CW_util.getFormElement(document.forms[J],B);F.innerHTML="";F.appendChild(this.createElementOption("null",CW_internationalization.getValue("playlist.empty")));F.disabled="disabled"}else{CW_util._displayUserPLaylistContent(C,I)}};CW_util.setCategoryListContent=function(B,D,C,A){CategoryListManager.setCategoryListContent(B,D,C,A)};CW_Action_User._loginCheck=function(comwebBean,requestResume){var errorChilds=comwebBean.getSpecificChildren("error");if(errorChilds.length>0){var comwebBeanError="";var form=document.forms[requestResume.hashTableStore.get("formName")];while(errorChilds.length>0){comwebBeanError=errorChilds.shift();switch(comwebBeanError.getUid()){case 18:break;case 32:break;case this.Error_LOGIN_USER_NOT_FOUND:CW_FormValidator.setErrorMessage(form,"user.username",ComwebI18N_Manager.getErrorLogin());break;case this.Error_LOGIN_WRONG_PASSWORD:CW_FormValidator.setErrorMessage(form,"user.username",ComwebI18N_Manager.getErrorLoginPassword());break;case this.Error_LOGIN_ACCOUNT_LOCKED_OUT:CW_FormValidator.setErrorMessage(form,"user.username",ComwebI18N_Manager.getErrorLoginLockedAccount());break;case this.Error_LOGIN_ACCOUNT_BARRED:CW_FormValidator.setErrorMessage(form,"user.username",ComwebI18N_Manager.getErrorLoginBarredAccount());break;case this.Error_LOGIN_NO_CONFIRMATION:showDialog_confirmationRegMail();break;case this.ERROR_REGISTRATION_UNIFICATION:var content="";var parentDiv=document.getElementById("registerContainer");parentDiv.innerHTML="";content='<div id="loginBoxOffline" class="rightBloc1"><div class="rightBloc1_Body">'+comwebBeanError.getDetail()+'</div><a href="javascript:goTo()" onclick=\'CW_comwebAjax.loadHtml("html/login/register.html","registerContainer")\'>&gt;&nbsp;Torna</a></div>';parentDiv.innerHTML = content;break;default:CW_FormValidator.setErrorMessage(form,"user.username",ComwebI18N_Manager.getErrorUid(comwebBeanError.getUid()));break}document.getElementById("validRegister").style.display="block"}}else{try{var comwebBean_session=comwebBean.getSpecificChildren("session")[0];var comwebBean_user=comwebBean.getSpecificChildren("user")[0];CW_config.setConnectedUser(comwebBean_user)}catch(e){CW_logger.log("Error","CW_Action_User._loginCheck: Error while getting comwebBean_session, comwebBean_user:"+e);var form=document.forms[requestResume.hashTableStore.get("formName")];CW_FormValidator.setErrorMessage(form,"user.username",ComwebI18N_Manager.getErrorLogin());return }eval(requestResume.hashTableStore.get("originalCallback")+"(comwebBean ,requestResume);")}};CW_Action_User.loginCheckAutoConnect=function(H,G){var E=new HashTable();E.put("originalCallback",H);E.put("formName",G);var I=new Array();I.push("action=chk.sess");I.push("user.fullview=1");I.push("site.uid="+CW_config.serviceId);I.push("lng="+CW_config.langId);var A=new String(I.join("&"));var B=CW_Action_User.SERVLET_URI;var C=MD5(A);if(CW_config.isProd&&B.indexOf("/comweb/")==0){B=B.replace("/comweb/","/comweb/MD5_"+C+"/")}var D=CW_comwebAjax.ajaxTransactionManager.getTransaction(C);D.registerMD5(C);var F=new RequestResume(B,"CW_Action_User._loginCheck",A,"nohistoryName",D.identifier,C,E);var J={asynchronous:false,method:"post",encoding:"UTF-8",requestHeaders:["X-Prototype-Version",Prototype.Version],postBody:CW_util.encodeUTF8(A),onComplete:CW_comwebAjax._onRequestComplete.bind(J,F,(new Date()).getTime())};new Ajax.Request(B,J)};function CountryLangManager(){this.initialize()}CountryLangManager.prototype={ComwebBean_lng_Array:null,ComwebBean_cty_Array:null,sorted_lng_Array_lang:null,sorted_cty_Array_lang:null,initialize:function(){this.ComwebBean_lng_Array=null;this.ComwebBean_cty_Array=null},_setLang:function(){if(this.ComwebBean_lng_Array==null){var B=Ajax.getTransport();B.open("GET","xml/list_lng.xml",false);B.send(null);var A=new ComwebBean();A.parseXml(this._getXmlDocument(B));this.ComwebBean_lng_Array=A.getSpecificChildren("lng")}},_setCountry:function(){if(this.ComwebBean_cty_Array==null){var B=Ajax.getTransport();B.open("GET","xml/list_cty.xml",false);B.send(null);var A=new ComwebBean();A.parseXml(this._getXmlDocument(B));this.ComwebBean_cty_Array=A.getSpecificChildren("cty")}},_setLangListContent:function(F,C,B,G){this._setLang();var E=CW_util.getFormElement(document.forms[F],C);var A;try{if(ComwebBean_lng_Array.length>0&&this.sorted_lng_Array_lang!=CW_config.langId){this.ComwebBean_lng_Array.sort();this.sorted_lng_Array_lang=CW_config.langId;if(ComwebBean_lng_Array[0]>ComwebBean_lng_Array[1]){ComwebBean_lng_Array.reverse()}}}catch(H){}if(G==true){for(var D=0;D<this.ComwebBean_lng_Array.length;D++){A=this.ComwebBean_lng_Array[D];if(A.isMediaEdit()){E.appendChild(CW_util.createElementOption(A.getUid(),A.getLangName()))}}}else{for(var D=0;D<this.ComwebBean_lng_Array.length;D++){A=this.ComwebBean_lng_Array[D];E.appendChild(CW_util.createElementOption(A.getUid(),A.getLangName()))}}if(B!=null&&B!=""&&B!=NaN){CW_util.setSelectedIndex(E,B)}if(G==true&&E.selectedIndex==0){CW_util.setSelectedIndex(E,1)}},getLangFlag:function(D){this._setLang();try{var A;for(var B=0;B<this.ComwebBean_lng_Array.length;B++){A=this.ComwebBean_lng_Array[B];if(A.getUid()==D){return A.getValues("flag")}}}catch(C){return null}},getLangLngBean:function(D){this._setLang();try{var A;for(var B=0;B<this.ComwebBean_lng_Array.length;B++){A=this.ComwebBean_lng_Array[B];if(A.getUid()==D){return A}}}catch(C){return null}},getCountryCtyBean:function(C){this._setCountry();try{var A;for(var B=0;B<this.ComwebBean_cty_Array.length;B++){A=this.ComwebBean_cty_Array[B];if(A.getUid()==C){return A}}}catch(D){return null}},getCountryFlag:function(C){this._setCountry();try{var A;for(var B=0;B<this.ComwebBean_cty_Array.length;B++){A=this.ComwebBean_cty_Array[B];if(A.getUid()==C){return A.getValues("flag")}}}catch(D){return null}},_setCountryListContent:function(E,B,A){this._setCountry();var D=CW_util.getFormElement(document.forms[E],B);var G;try{if(ComwebBean_cty_Array.length>0&&this.sorted_cty_Array_lang!=CW_config.langId){this.ComwebBean_cty_Array.sort();this.sorted_cty_Array_lang=CW_config.langId;if(ComwebBean_cty_Array[0]>ComwebBean_cty_Array[1]){ComwebBean_cty_Array.reverse()}}}catch(F){}for(var C=0;C<this.ComwebBean_cty_Array.length;C++){G=this.ComwebBean_cty_Array[C];D.appendChild(CW_util.createElementOption(G.getUid(),G.getCountryName()))}if(A!=null&&A!=""&&A!=NaN){CW_util.setSelectedIndex(D,A)}},_getXmlDocument:function(C){try{if(window.ActiveXObject){var B=new ActiveXObject("Microsoft.XMLDOM");B.async="false";B.loadXML(C.responseText)}else{var D=new DOMParser();var B=D.parseFromString(C.responseText,"text/xml")}return B.documentElement}catch(A){return null}}};var CountryLangManager=new CountryLangManager();function ComwebBean_lng(){this.initialize()}ComwebBean_lng.prototype={initialize:function(){this.name="ComwebBean_lng";this.storageValues=new HashTable();this.childList=null},getUid:function(){return parseInt(this.getValues("uid"))},getLangName:function(){return(CW_util.decodeUTF8(this.getValues(CW_config.langId)))},isMediaEdit:function(){return(this.getValues("edtMedia")=="true")},toString:function(){return this.getLangName()}};ComwebBean_lng.prototype=Object.extend(new ComwebBean(),ComwebBean_lng.prototype);function ComwebBean_cty(){this.initialize()}ComwebBean_cty.prototype={initialize:function(){this.name="ComwebBean_cty";this.storageValues=new HashTable();this.childList=null},getUid:function(){return parseInt(this.getValues("uid"))},getCountryName:function(){return(CW_util.decodeUTF8(this.getValues(CW_config.langId)))},toString:function(){return this.getCountryName()}};ComwebBean_cty.prototype=Object.extend(new ComwebBean(),ComwebBean_cty.prototype);function CategoryListManager(){}CategoryListManager.prototype={hashTableCatVideo:null,hashTableCatPhoto:null,hashTableCatAudio:null,initialize:function(){this.hashTableCatVideo=null;this.hashTableCatPhoto=null;this.hashTableCatAudio=null;this._setCategoryList(CW_Action_Media.Media_TYPE_VIDEO)},_setCategoryList:function(H){var G=new Array();G.push("action="+CW_Action_Site.ACTION_Categories);G.push("lang.uid="+CW_internationalization.getUid());G.push("media.type="+H);G.push("site.uid="+CW_config.serviceId);G.push("lng="+CW_config.langId);var A=new String(G.join("&"));var B=CW_Action_Site.SERVLET_URI_CATEGORY;var C=MD5(A);if(CW_config.isProd&&B.indexOf("/comweb/")==0){B=B.replace("/comweb/","/comweb/MD5_"+C+"/")}var D=CW_comwebAjax.ajaxTransactionManager.getTransaction(C);D.registerMD5(C);var E=new HashTable();E.put("mediaType",H);var F=new RequestResume(B,"CategoryListManager._setCategoryListCallback",A,"nohistoryName",D.identifier,C,E);var I={asynchronous:false,method:"post",encoding:"UTF-8",requestHeaders:["X-Prototype-Version",Prototype.Version],postBody:CW_util.encodeUTF8(A),onComplete:CW_comwebAjax._onRequestComplete.bind(I,F,(new Date()).getTime())};new Ajax.Request(B,I)},_setCategoryListCallback:function(F,D){var A=new HashTable();var E=F.getSpecificChildren("category");if(E.length>0){for(var C=0;C<E.length;C++){var B=E[C];A.put(B.getUid(),B.getTitle())}}switch(parseInt(D.hashTableStore.get("mediaType"))){case CW_Action_Media.Media_TYPE_VIDEO:this.hashTableCatVideo=A;break;case CW_Action_Media.Media_TYPE_IMAGE:this.hashTableCatPhoto=A;break;case CW_Action_Media.Media_TYPE_MUSIC:this.hashTableCatAudio=A;break;default:break}},getCategoryTitle:function(B){var A=null;A=this.hashTableCatVideo.get(B);if(A==null){if(this.hashTableCatPhoto==null){this._setCategoryList(CW_Action_Media.Media_TYPE_IMAGE)}A=this.hashTableCatPhoto.get(B);if(A==null){if(this.hashTableCatAudio==null){this._setCategoryList(CW_Action_Media.Media_TYPE_MUSIC)}A=this.hashTableCatAudio.get(B)}}return A},setCategoryListContent:function(K,D,A,C){A=parseInt(A);var B;switch(A){case CW_Action_Media.Media_TYPE_VIDEO:if(this.hashTableCatVideo==null){this._setCategoryList(CW_Action_Media.Media_TYPE_VIDEO)}B=this.hashTableCatVideo;break;case CW_Action_Media.Media_TYPE_IMAGE:if(this.hashTableCatPhoto==null){this._setCategoryList(CW_Action_Media.Media_TYPE_IMAGE)}B=this.hashTableCatPhoto;break;case CW_Action_Media.Media_TYPE_MUSIC:if(this.hashTableCatAudio==null){this._setCategoryList(CW_Action_Media.Media_TYPE_MUSIC)}B=this.hashTableCatAudio;break;default:return }var I=CW_util.getFormElement(document.forms[K],D);var H=B.getKeyArray();for(var E=0;E<H.length;E++){var F=H[E];var J=B.get(F);if(J=="null"||J==null||J==""){I.appendChild(CW_util.createElementOption(F,F))}else{I.appendChild(CW_util.createElementOption(F,J))}}try{CW_util.setSelectedIndex(I,C)}catch(G){}}};var SubscriptionManager={currentLink:null,pagerName:null,itemType:null,itemUid:null,subscriptionId:null,isRemoving:false,currentMemberSubscriptionArray:null,currentTagSubscriptionArray:null,currentPlaylistSubscriptionArray:null,reinitialize:function(){this.currentLink=null;this.pagerName=null;this.itemType=null;this.subscriptionId=null;this.isRemoving=false},displaySelectedItem:function(C,F,G,D,A){if(this.isRemoving){return }if(this.currentLink!=null){this.currentLink.className=""}C.className="filterActive";this.currentLink=C;this.itemType=F;this.itemUid=G;this.subscriptionId=D;CW_comwebAjax.loadHtml("html/myScroon/mySubscription/mySubscriptionListing.html","myScroon_Content_video");var E="SubscriptionManager.changeMediaType";createOngletSubscriptionVP(E).selectTab(0,false);var B=this._getPager(F,G,A);loadBrick_filter_common(B.pagerName,"filter_common",CW_Filter.Filter_MEDIA,CW_Filter.ORDER_LASTADD,CW_Filter.SINCE_ALL);B.display()},displaySelectedItemCallback:function(E,H){var A=document.getElementById("item_Listing_content");var J=new String(H.queryString);if(A){var B="";A.innerHTML="";var D=E.getSpecificChildren("list")[0].getSpecificChildren("media");if(D!=null&&D.length>0){for(var F=0;F<D.length;F++){var C=D[F];var G=C.getUid();B="goToMediaPlay('"+J+"',"+C.getUid()+" );";loadBrick_media_mediaElement(C,"item_Listing_content",B,true)}var I=H.hashTableStore.get("pagerFormName");CW_logger.log(CW_logger.LEVEL_INFORMATION," comebPage item listning : "+I+" .mananageHistoryAndPager");CW_Page_Manager.changePageCheck(E,H)}else{A.innerHTML=CW_internationalization.getValue("general.noContent")}}},_getPager:function(D,F,A){var E="SubscriptionManager.displaySelectedItemCallback";var B=new HashTable();var C="";if(D==CW_GlobalVar.ITEM_TYPE_USER){B.put("user.uid",F);B.put("media.type",CW_Action_Media.Media_TYPE_VIDEO);B.put("action",CW_Action_Media.ACTION_MEDIA_USER);C=CW_Action_Media.SERVLET_URI}else{if(D==CW_GlobalVar.ITEM_TYPE_GROUP){B.put("group.type",0);B.put("group.uid",F);B.put("media.type",CW_Action_Media.Media_TYPE_VIDEO);B.put("user.uid",A);B.put("action","media.group");C=CW_Action_Media.SERVLET_URI}else{if(D==CW_GlobalVar.ITEM_TYPE_TAG){B.put("media.type",CW_Action_Media.Media_TYPE_VIDEO);B.put("tag.uid",F);B.put("action","media.tag");C=CW_Action_Media.SERVLET_URI}}}B.put("listing.nbre.elements",16);B.put("listing.page",1);return new ComwebPager("media_Listing","subscriptionPager",E,C,B)},changeMediaType:function(A){var B=document.getElementById("subscriptionPager").getElementsByTagName("form").item(0);switch(A){case 0:CW_util.getFormElement(B,"media.type").value=CW_Action_Media.Media_TYPE_VIDEO;break;case 1:CW_util.getFormElement(B,"media.type").value=CW_Action_Media.Media_TYPE_IMAGE;break;case 2:CW_util.getFormElement(B,"media.type").value=CW_Action_Media.Media_TYPE_MUSIC;break;default:break}CW_Page_Manager.changePage(1,B.name)},removeSelectedSubscription:function(){if(this.subscriptionId==null){}else{this.isRemoving=true;var A=new HashTable();A.put("subscriptionid",this.subscriptionId);A.put("itemtype",this.itemType);CW_Action_Site.removeSubscription("SubscriptionManager.removeSelectedSubscriptionCallback",this.itemUid,this.itemType,A)}},removeSelectedSubscriptionCallback:function(A,E){CW_comwebAjax.loadHtml("html/myScroon/mySubscription/mySubscriptionListing.html","myScroon_Content_video");this.currentLink.style.display="none";try{this.currentLink.parentNode.parentNode.removeChild(this.currentLink.parentNode);var H=E.hashTableStore;var G=parseInt(H.get("subscriptionid"));var D=parseInt(H.get("itemtype"));var F=new Array();var I=new Array();switch(D){case CW_GlobalVar.ITEM_TYPE_USER:F=this.currentMemberSubscriptionArray;break;case CW_GlobalVar.ITEM_TYPE_GROUP:F=this.currentPlaylistSubscriptionArray;break;case CW_GlobalVar.ITEM_TYPE_TAG:F=this.currentTagSubscriptionArray;break}for(var B=0;B<F.length;B++){if(F[B].getUid()!=G){I.push(F[B])}}switch(D){case CW_GlobalVar.ITEM_TYPE_USER:this.currentMemberSubscriptionArray=I;break;case CW_GlobalVar.ITEM_TYPE_GROUP:this.currentPlaylistSubscriptionArray=I;break;case CW_GlobalVar.ITEM_TYPE_TAG:this.currentTagSubscriptionArray=I;break}}catch(C){}this.reinitialize()},_hasAlreadySubscribed:function(C,B){switch(C){case CW_GlobalVar.ITEM_TYPE_USER:if(this.currentMemberSubscriptionArray==null){return false}for(var A=0;A<this.currentMemberSubscriptionArray.length;A++){if(B==this.currentMemberSubscriptionArray[A].getSpecificChildren("user")[0].getUsername()){return true}}break;case CW_GlobalVar.ITEM_TYPE_GROUP:if(this.currentPlaylistSubscriptionArray==null){return false}for(var A=0;A<this.currentPlaylistSubscriptionArray.length;A++){if(B==this.currentPlaylistSubscriptionArray[A].getSpecificChildren("group")[0].getGroupName()){return true}}break;case CW_GlobalVar.ITEM_TYPE_TAG:if(this.currentTagSubscriptionArray==null){return false}for(var A=0;A<this.currentTagSubscriptionArray.length;A++){if(B==this.currentTagSubscriptionArray[A].getSpecificChildren("tag")[0].getText()){return true}}break}return false},createSubscription:function(B){var C=document.forms[B];document.getElementById("errorFeedback").innerHTML="";var E=parseInt(CW_util.getFormElement(C,"item.type").value);var D=CW_util.getFormElement(C,"itm.name").value;if(C==null){return }if(D==""){document.getElementById("errorFeedback").innerHTML="Vous devez saisir une souscription";return }if(this._hasAlreadySubscribed(E,D)){document.getElementById("errorFeedback").innerHTML="Vous disposer d&eacute;j&agrave; de cette souscription";return }var A=new HashTable();A.put("formname",B);A.put("itemtype",E);CW_Action_Site.createSubscriptionByName("SubscriptionManager.createSubscriptionCallback",D,E,A)},createSubscriptionCallback:function(F,L){var M=F.getSpecificChildren("error");var K=F.getSpecificChildren("subscription");var A="";if(M.length>0||K.length==0||K==null){document.getElementById("errorFeedback").innerHTML="L'&eacute;l&eacute;ment demand&eacute; n'existe pas"}else{var C=K[0];var G=null;var J="";var I=L.hashTableStore.get("itemtype");if(I!=null){I=parseInt(I);switch(I){case CW_GlobalVar.ITEM_TYPE_USER:G="memberSubscription";J=loadbrick_Filter_MySubscriptionFilterMember(C);this.currentMemberSubscriptionArray.push(C);break;case CW_GlobalVar.ITEM_TYPE_GROUP:G="playlistSubscription";J=loadbrick_Filter_MySubscriptionFilterGroup(C);this.currentPlaylistSubscriptionArray.push(C);break;case CW_GlobalVar.ITEM_TYPE_TAG:G="tagSubscription";J=loadbrick_Filter_MySubscriptionFilterTag(C);this.currentTagSubscriptionArray.push(C);break}if(G!=null&&J!=""){var D=document.getElementById(G);new Insertion.Bottom(D,J);var D=document.getElementById(G);var E=D.getElementsByTagName("li");var B=E.item(E.length-1).getElementsByTagName("a").item(0);B.onclick()}}try{(CW_util.getFormElement(document.forms[L.hashTableStore.get("formname")],"itm.name")).value=""}catch(H){}}}};function loadbrick_Filter_MySubscriptionFilterMember(E){var A="";try{var D=E.getSpecificChildren("user")[0];var F="SubscriptionManager.displaySelectedItem(this,"+CW_GlobalVar.ITEM_TYPE_USER+","+D.getUid()+","+E.getUid()+")";var B="";if(E.isChanged()=="true"){B="filterChanged"}A="<li><a href='javascript:goTo();' onclick=\""+F+"\" class='"+B+"'>"+D.getNickname()+"</a></li>"}catch(C){}return A}function loadbrick_Filter_MySubscriptionFilterTag(B){var A="";try{var E=B.getSpecificChildren("tag")[0];var F="SubscriptionManager.displaySelectedItem(this,"+CW_GlobalVar.ITEM_TYPE_TAG+","+E.getUid()+","+B.getUid()+")";var C="";if(B.isChanged()=="true"){C="filterChanged"}A="<li><a href='javascript:goTo();' onclick=\""+F+"\"  class='"+C+"'>"+E.getText()+"</a></li>"}catch(D){}return A}function loadbrick_Filter_MySubscriptionFilterGroup(B){var A="";try{var F=B.getSpecificChildren("group")[0];var E=F.getSpecificChildren("user")[0];var G="SubscriptionManager.displaySelectedItem(this,"+CW_GlobalVar.ITEM_TYPE_GROUP+","+F.getUid()+","+B.getUid()+","+E.getUid()+" )";var C="";if(B.isChanged()=="true"){C="filterChanged"}A="<li><a href='javascript:goTo();' onclick=\""+G+"\" class='"+C+"'>"+F.getGroupName()+"</a></li>"}catch(D){}return A}var CategoryListManager=new CategoryListManager();function CacheManager(){this.initialize()}CacheManager.prototype={contentFirstShowcaseVideo:null,flashPlayerVersion:null,listingNb_public_media:15,listingNb_public_membre:16,listingNb_public_playlist:5,listingNb_myscroon_media:9,listingNb_myscroon_membre:8,listingNb_myscroon_playlist:5,listingNb_comment:3,initialize:function(){ComwebPager_media_comments.nbElement=this.listingNb_comment;ComwebPager_user_comments.nbElement=this.listingNb_comment},getFlashPlayerVersion:function(){if(this.flashPlayerVersion==null){this.flashPlayerVersion=parseInt((deconcept.SWFObjectUtil).getPlayerVersion().major)}return this.flashPlayerVersion}};var CacheManager=new CacheManager();var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function encode64(C){var A="";var J,H,F;var I,G,E,D;var B=0;do{J=C.charCodeAt(B++);H=C.charCodeAt(B++);F=C.charCodeAt(B++);I=J>>2;G=((J&3)<<4)|(H>>4);E=((H&15)<<2)|(F>>6);D=F&63;if(isNaN(H)){E=D=64}else{if(isNaN(F)){D=64}}A=A+keyStr.charAt(I)+keyStr.charAt(G)+keyStr.charAt(E)+keyStr.charAt(D)}while(B<C.length);return A}function decode64(C){var A="";var J,H,F;var I,G,E,D;var B=0;C=C.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{I=keyStr.indexOf(C.charAt(B++));G=keyStr.indexOf(C.charAt(B++));E=keyStr.indexOf(C.charAt(B++));D=keyStr.indexOf(C.charAt(B++));J=(I<<2)|(G>>4);H=((G&15)<<4)|(E>>2);F=((E&3)<<6)|D;A=A+String.fromCharCode(J);if(E!=64){A=A+String.fromCharCode(H)}if(D!=64){A=A+String.fromCharCode(F)}}while(B<C.length);return A}try{document.writeSave=document.write;document.write=function(A){document.writeSave(CW_util.decodeUTF8(A))}}catch(e){}Event.observe(window,"load",function(){document.getElementById("containerGen").style.display="block";document.getElementById("loaderBox").style.display="none"});

