CW_Action_Site.SITE_USER_ID=18617;CW_Action_Site.MEDIA_OF_THE_DAY_GROUP_ID=945;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(){try{CW_comwebAjax.loadHtml("html/login/register.html","registerContainer");CW_Action_User.loginCheckAutoConnect("loginCheck","registerHome")}catch(A){}CategoryListManager.initialize();CW_comwebAjax.loadHtml("html/search/search1.html","menuSearch");initializeMenuMainSub();this._displayNewsLink()},_displayMostViewedVideo:function(){var A="MainElementsLoader._displayMostViewedVideoCallback";CW_Action_Media.displayMediaList(A,6,CW_Action_Media.Media_TYPE_VIDEO,CW_Filter.SINCE_ALL,7,false)},_displayMostViewedVideoCallback:function(G,F){var E=0;var B="";var D=F.queryString;if(G!=null){document.getElementById("mostViewedListHomeContent").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="goToMediaPlay('action=alone&listing.page=1',"+E+");";loadBrick_media_mediaElement3(H,"mostViewedListHomeContent",B,true)}}}},_displayNewsLink:function(){var B="MainElementsLoader._displayNewsLinkCallback";var A=new Array();A.push("action=load.html");A.push("url=http://www.cavadeos.com/rss/Actu-Cavadeos-laune.xml");CW_comwebAjax.sendRequest("rss.jsp",B,null,"_displayNewsLink",A,null)},_displayNewsLinkCallback:function(D,J){try{var F=new ComwebBeanXmlDom();F.setXmlDom(D.getStorageValues()._getImmediateChildDom("channel")[0]);comwebBeanItemArray=F._getImmediateChildDom("item");var K;var B=null;var I="";var A="class='stripeNone'";for(var G=0;G<comwebBeanItemArray.length;G++){K=new ComwebBeanXmlDom();K.setXmlDom(comwebBeanItemArray[G]);B=new Date(K.getValues("pubDate"));var C=B.getHours();if(C<10){C="0"+new String(C)}var E=B.getMinutes();if(E<10){E="0"+new String(E)}if(G%2==0){A="class='stripe'"}else{A="class='stripeNone'"}I+="<li "+A+" >"+B.getDate()+" "+(ComwebI18N_Manager.getMonth(B.getMonth()).substring(0,3))+". &agrave; "+C+":"+E+" <a href='"+K.getValues("link")+"' >"+K.getValues("title")+"</a></li>"}document.getElementById("newsboxContainer-list").innerHTML=I}catch(H){}}};function loadMainElements(){MainElementsLoader.loadMainElement()}function loadMainPage(){Pub_Cavadeos.reload();dhtmlHistory.add("Home")}var Pub_Cavadeos={iframeAd1:null,iframeAd1Src:"http://www.cavadeos.com/BanMan/abmw.aspx?z=50&isframe=true",iframeAd2:null,iframeAd2Src:"./pub/ad2.html",iframeAd3:null,iframeAd3Src:"./pub/ad4.html",reload:function(){try{var A=(new Date()).getTime();var D=new HashTable();D.put("valueNum1",A);CW_comwebAjax.loadHtml("pub/ad1.html?cache="+A,"bannerIframe",D);if(this.iframeAd2==null){for(var B=0;B<parent.frames.length;B++){try{if(parent.frames[B].name=="adC1"){this.iframeAd2=parent.frames[B]}}catch(C){}}}if(this.iframeAd2!=null){this.iframeAd2.location.replace(this.iframeAd2Src+"?cache="+(new Date()).getTime())}if(this.iframeAd3==null){for(var B=0;B<parent.frames.length;B++){try{if(parent.frames[B].name=="adD"){this.iframeAd3=parent.frames[B]}}catch(C){}}}if(this.iframeAd3!=null){this.iframeAd3.location.replace(this.iframeAd3Src+"?cache="+(new Date()).getTime())}}catch(C){}}};var StatObject={addStat:function(A){if(A!="player"){Pub_Cavadeos.reload()}try{urchinTracker("/"+A)}catch(B){}}};CW_AjaxPage_Manager.displayUserNotConnected=function(){showDialog_connected_error()};CW_AjaxPage_Manager.currentPageIsSearch=false;CW_AjaxPage_Manager.currentMenuId=null;CW_AjaxPage_Manager.refreshMenu=function(G,B){this.currentMenuId=G;try{var A=G.indexOf("_");var F=G.substring(0,A);var D=G.substring(A+1);var C=document.getElementById("masterPage");menuSubMyScroon.style.display="none";menuSubMember.style.display="none";menuSubVideo.style.display="none";menuSubPhoto.style.display="none";if(G!="X_X"){switch(F){case"0":C.className="videos";menuSubMyScroon.style.display="none";menuSubMember.style.display="none";menuSubVideo.style.display="block";menuSubPhoto.style.display="none";tabOngletMenuGen.selectTab(0,false);if(D!="X"){tabOngletMenuVideo.selectTab(parseInt(D),false)}else{tabOngletMenuVideo.deselectTab()}break;case"1":C.className="pictures";menuSubMyScroon.style.display="none";menuSubMember.style.display="none";menuSubVideo.style.display="none";menuSubPhoto.style.display="block";tabOngletMenuGen.selectTab(1,false);if(D!="X"){tabOngletMenuPhoto.selectTab(parseInt(D),false)}else{tabOngletMenuPhoto.deselectTab()}break;case"4":C.className="myScroon";menuSubMyScroon.style.display="block";menuSubMember.style.display="none";menuSubVideo.style.display="none";menuSubPhoto.style.display="none";tabOngletMenuGen.selectTab(4,false);if(D!="X"){if(D=="0"){C.className+=" videos"}else{if(D=="1"){C.className+=" pictures"}else{if(D=="3"){B=new String(B).toLowerCase();if(B.indexOf("video")>-1){C.className+=" videos"}else{if(B.indexOf("photo")>-1){C.className+=" pictures"}}}}}tabOngletMenuSubMyScroon.selectTab(parseInt(D),false)}else{tabOngletMenuSubMyScroon.deselectTab()}break;case"2":C.className="";menuSubMyScroon.style.display="none";menuSubMember.style.display="block";menuSubVideo.style.display="none";menuSubPhoto.style.display="none";tabOngletMenuGen.selectTab(2,false);if(D!="X"){tabOngletMenuSubMember.selectTab(parseInt(D),false)}else{tabOngletMenuSubMember.deselectTab()}break;default:C.className="";menuSubMyScroon.style.display="none";menuSubMember.style.display="none";menuSubVideo.style.display="none";menuSubPhoto.style.display="none";if(F!="X"){tabOngletMenuGen.selectTab(parseInt(F),false)}break}}else{tabOngletMenuGen.deselectTab();C.className=""}}catch(E){}};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 D=window.location.hash;if(D!=null&&D!=""){if(D.indexOf("#")==0){D=D.substr(1)}}if(D.indexOf("Search")==0){document.getElementById("searchBackLink").innerHTML="<a href='javascript:goToLastSearch(\""+D+"\" )' >"+CW_internationalization.getValue("search.last")+"</a>";this.currentPageIsSearch=false}}}if(A=="player"){return }var C=B.getStatId();var F=B.getMenuId();StatObject.addStat(C);this.refreshMenu(F,A);A=(new String(A)).toLowerCase();var E="video";if(A.indexOf("playlist")>=0){E="playlist"}else{if(A.indexOf("member")>=0){E="member"}else{if(A.indexOf("photo")>=0){E="photo"}}}loadBrick_tags_tagsHome(E)};PlayerFlash.flashPlayMediaDisplayEvent=function(E,B){var A="";switch(E.getMediaType()){case CW_Action_Media.Media_TYPE_IMAGE:A=CW_internationalization.getValue("upload.uploadMedia.photo").toLowerCase();CW_AjaxPage_Manager.refreshMenu("1_X");break;default:A=CW_internationalization.getValue("upload.uploadMedia.video").toLowerCase();CW_AjaxPage_Manager.refreshMenu("0_X");break}var C=E.getCategoryId();StatObject.addStat("player:"+C);var D=new HashTable();D.put("mediatype",A);document.getElementById("mediaPlayInfosTagsContainer").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.validLogin=function(D,C){if(CW_FormValidator.check(C)){var B=CW_util.getFormElement(C,"action");if(B==null){C.appendChild(CW_util.createElementInputHidden("action",this.ACTION_USER_LOGIN))}else{B.value=this.ACTION_USER_LOGIN}C.appendChild(CW_util.createElementInputHidden("user.fullview",1));var A=new HashTable();A.put("originalCallback",D);A.put("formName",C.name);CW_comwebAjax.sendRequestForm("/comweb/ssoCava","CW_Action_User._loginCheck",null,"login",C,A)}};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,initialize:function(){this.hashTableCatVideo=null;this.hashTableCatPhoto=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;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)}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;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,J){var A=document.getElementById("item_Listing_content");var L=new String(J.queryString);var I="myScroon";if(L.indexOf("media.type="+CW_Action_Media.Media_TYPE_VIDEO)>0){I="myScroon videos"}else{if(L.indexOf("media.type="+CW_Action_Media.Media_TYPE_IMAGE)>0){I="myScroon pictures"}}try{document.getElementById("masterPage").className=I;document.getElementById("mySubscription").className="masterBloc1 listing "+I}catch(H){}if(A){var C="";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 B=D[F];var G=B.getUid();C="goToMediaPlay('"+L+"',"+B.getUid()+" );";loadBrick_media_mediaElement(B,"item_Listing_content",C,true)}var K=J.hashTableStore.get("pagerFormName");CW_logger.log(CW_logger.LEVEL_INFORMATION," comebPage item listning : "+K+" .mananageHistoryAndPager");CW_Page_Manager.changePageCheck(E,J)}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",9);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;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="<p>Vous devez saisir une souscription</p>";return }if(this._hasAlreadySubscribed(E,D)){document.getElementById("errorFeedback").innerHTML="<p>Vous disposez d&eacute;j&agrave; de cette souscription</p>";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="<p>L'&eacute;l&eacute;ment demand&eacute; n'existe pas</p>"}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:12,listingNb_public_membre:12,listingNb_public_playlist:12,listingNb_myscroon_media:9,listingNb_myscroon_membre:9,listingNb_myscroon_playlist:9,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};