var var_cookieid="";var var_cookie_domain="";var var_cookie_path="/";var selectedbutton="/net/app/i/ac/sel.gif";var unselectedbutton="/net/app/i/ac/unsel.gif";function net(){this.init=function(){};this.trim=function(A){if(typeof (A)=="undefined"){return""}A=A.replace(/^\s+/,"");return A.replace(/\s+$/,"")};this.confirm_action=function(A,B){if(!B){B="Для подтверждения нажмите ОК"}if(A){A=A.replace("&amp;","&")}else{A=""}if(confirm(B)){window.location.href=A}else{return false}};this.confirm=function(A,B){if(!B){B="Для подтверждения нажмите ОК"}if(confirm(B)){return true}else{return false}};this.pop_up_window=function(C,E,A,B){if(!B){var F=new Date();B=F.getTime()}var D=window.open(C.replace("&amp;","&"),B,"width="+E+",height="+A+",resizable=1,scrollbars=1,location=no,directories=no,status=no,menubar=no,toolbar=no");D.focus();return false};this.my_getcookie=function(A){return this.cookies[A]};this.my_setcookie=function(A,B,C){expire="";domain="";path="/";if(C){expire="; expires=Wed, 1 Jan 2020 00:00:00 GMT"}if(var_cookie_domain!=""){domain="; domain="+var_cookie_domain}if(var_cookie_path!=""){path=var_cookie_path}document.cookie=var_cookieid+A+"="+B+"; path="+path+expire+domain+";";this.cookies[A]=B};this.catalog_hide=function(A,B){new Json.Remote("/net/catalog/hide/"+A,{onComplete:function(C){if(C.ret=="hide"){B.setHTML("сделать папку публичной")}else{if(C.ret=="show"){B.setHTML("скрыть папку")}}}}).send()};this.catalog_film_rem=function(B,A){new Json.Remote("/net/catalog/film/remove/"+B,{onComplete:function(C){}}).send()}}function stacksize(A){for(i=0;i<A.length;i++){if((A[i]=="")||(A[i]==null)||(A=="undefined")){return i}}return A.length}var _this_select_all=0;function film_select_all(){clean=new Array();saved=new Array();var E=new Array();tmp=document.modform.selectedtids.value;if(tmp!=""){saved=tmp.split(",")}if(_this_select_all==0){var G=document.getElementsByTagName("input");for(var D=0;D<=G.length;D++){var F=G[D];if(F&&(F.type=="checkbox")&&(!F.disabled)){var I=F.id;var H=I.replace(/^fid_(.+?)$/,"$1");if(H){try{clean[clean.length]=H;E[H]=1}catch(C){}}}}_this_select_all=1}else{var G=document.getElementsByTagName("input");for(var D=0;D<=G.length;D++){var F=G[D];if(F&&(F.type=="checkbox")&&(!F.disabled)){var I=F.id;var H=I.replace(/^fid_(.+?)$/,"$1");if(H){try{E[H]=1}catch(C){}}}}_this_select_all=0}for(D=0;D<saved.length;D++){if(saved[D]!=""&&E[saved[D]]!=1){clean[clean.length]=saved[D]}}newvalue=clean.join(",");var A=0;for(var B=0;B<clean.length;B++){if(E[clean[B]]!=1){A++}}document.modform.selectedtids.value=newvalue;newcount=stacksize(clean);alert(newvalue);return false}function film_toggle_fid(C){var K=new Array();var G=new Array();var L=1;var H=document.getElementById("film-cat-"+C);tmp=document.modform.selectedtids.value;if(tmp!=""){K=tmp.split(",")}for(D=0;D<K.length;D++){if(K[D]!=""){if(K[D]==C){L=0}else{G[G.length]=K[D]}}}if(L){G[G.length]=C;H.src=selectedbutton}else{H.src=unselectedbutton}newvalue=G.join(",");var E=new Array();var A=0;var I=document.getElementsByTagName("input");for(var D=0;D<=I.length;D++){var F=I[D];if(F&&(F.type=="hidden")&&(!F.disabled)){var M=F.id;var J=M.replace(/^fid_(.+?)$/,"$1");if(J){E[J]=1}}}for(var B=0;B<G.length;B++){if(E[G[B]]!=1){A++}}document.modform.selectedtids.value=newvalue;newcount=stacksize(G);document.getElementById("fselected").setHTML(newcount);return false}function checkdelete(){if(isDelete=="delete"){formCheck=confirm(lang_suredelete);if(formCheck==true){return true}else{return false}}}function goURL(A){document.location=A}function Catalog(){this.createCatShow=function(){$("crtdir").setStyle("display","block");return this},this.createCat=function(){if($("catalogname").value){new Ajax("/net/catalog/add/",{method:"post",postBody:"catalogname="+encodeURIComponent($("catalogname").value),onComplete:function(A){if(A){if(A=="limit"){alert_box("<center>Лимит исчерпан.<br/> Максимальное количество папок, которое можно создать 20</center>")}else{$("newcat0").setHTML('<p class="dt ci"><a href="/net/user/catalog/'+A+'">'+$("catalogname").value+'</a></p><div class="af2_ln" style="margin:2px 0"></div>');$("newcat0").clone().removeProperty("id").injectInside("newcat").setStyle("display","block");$("catalogname").value=""}}}}).request();return this}},this.edWin=function(A){$("catedit").setStyle("display","block");$("catedit").setStyle("margin-left","240px");$("catedit").setStyle("margin-top",A.offsetTop-340+"px")}};