var CANCLICK=false,WSP=' \t\n\r',DGTS='0123456789';function bwTest(){var b=navigator.appName;if(b=='Netscape'){this.b='ns'}else if(b=='Microsoft Internet Explorer'){this.b='ie'}else{this.b=b}this.v=parseInt(navigator.appVersion);this.ns=((this.b=='ns')&&(this.v>=4));this.ns4=((this.b=='ns')&&(this.v==4));this.ns5=((this.b=='ns')&&(this.v==5));this.ie=((this.b=='ie')&&(this.v>=4));this.ie4=(navigator.userAgent.indexOf('MSIE 4')>0);this.ie5=(navigator.userAgent.indexOf('MSIE 5')>0);if(this.ie5){this.v=5}this.min=(this.ns||this.ie)}var is=new bwTest();function canSubmit(F){if(CANCLICK){F.reset();return false}CANCLICK=true;return true}function isEmpty(v){if(v.length){v=v.replace(/^\s\s*.?/,'').replace(/\s\s*$/,'')}return(v==null||v.length<1)}function warn(s){return alert(unescape(s))}function hilite(f){if(/(text|textarea|password|file)/.test(f.type))f.select()}function warnfocus(f,s){if(is.ns4||is.ie){warn(s);f.focus()}else{f.focus();warn(s)}return false}function isWrong(f,s){hilite(f);return warnfocus(f,s)}function selectFld(f){if(f){hilite(f);f.focus()}return true}function selectOpt(f,v){var i,l,o=f.options;l=o.length;v=String(v).toLowerCase();for(i=0;i<l;i++){if(o[i].value.toLowerCase()==v){o[i].selected=true;o[i].defaultSelected=true}}return true}function isBlank(v){return(isEmpty(v)||/^\s+$/.test(v))}function isInteger(s){var i,c;if(isEmpty(s))return(isInteger.arguments[1]==true);for(i=0;i<s.length;i++){c=s.charAt(i);if(DGTS.indexOf(c)<0)return false}return true}function isSelected(f,s,n){var i,o=f.options;i=o.selectedIndex;if(isEmpty(n)){n=1}if(i<n){if(isEmpty(o[i].value)){return isWrong(f,s)}}return true}function tString(f,s){if(isBlank(f.value))return isWrong(f,s);return true}function tEmail(f,s1,s2){var v=f.value;if(isBlank(v))return isWrong(f,s1);v=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i.test(v);return(v||isWrong(f,s2))}function tSCBox(f,s){if(f.checked){return true}warn(s);return false}function tMCBox(f,s){for(var i=0;i<f.length;i++){if(f[i].checked==true){return true}}warn(s);return false}function sTxt(s){self.status=(isBlank(s))?'':unescape(s);return true}function pathName(){var l=location;return l.protocol+'\/\/'+l.host+l.pathname};function baseHref(){var o='',i=0,s=pathName().split('/');while(i<(s.length-1)){o+=s[i]+'/';i++}return o};function goTo(u){location.href=u}function goHash(n){location.hash=n;return false}
function ea(){var a,i=0,o='';while((a=arguments[i++])){o='.'+unescape(a)+o}o=o.replace('.*.','@').substr(1);document.write('<a href="m'+'ailto:'+o+'">'+o+'<\/a>')}function submitMute(F,v){if(canSubmit(F)&&!isEmpty(v)){F.action=v;F.submit();return true}return false}function submitWarn(F,v,s){if(confirm(unescape(s)))return submitMute(F,v);return false}function flipCase(obj,flag){if(flag){obj.value=obj.value.toUpperCase()}else{obj.value=obj.value.toLowerCase()}return true}function flipCases(f,b){var u=f.value.toUpperCase();if(b)f.value=u;else f.value=u.toLowerCase()}function getSeleIdx(obj){return obj.options.selectedIndex}function setLang(obj){var o=obj.options,i;if(o.selectedIndex>1){for(var i=2;i<obj.length;i++){if(o[i].selected)goTo(o[i].value)}}return false}function findGroup(obj,idx){var o=obj.options,i;if(isEmpty(idx))idx=1;if(o.selectedIndex>idx){for(var i=(idx+1);i<obj.length;i++){if(o[i].selected)obj.form.submit()}}return false}function sCol(obj){var _i='gif.welcome?t';for(i=1;i<obj.length;i++){if(obj.options[i].selected)_i=eval(obj.options[i].value+'.src')};document['colore'].src=_i;return true}function tQty(F,q){var _q=parseInt(F.qty.value,10);if(_q!=q){if(isNaN(_q)||(_q<1)){F.qty.value=0}return canSubmit(F)}return false}function tAuth(F){if(tString(F.usr,site.nousermsg)&&tString(F.pwd,site.nopaswmsg)){return canSubmit(F)}return false}function addLoadEvent(func){var wo=window.onload;if(typeof window.onload!='function'){window.onload=func}else{window.onload=function(){if(wo){wo()}func()}}}function roleDiscover(){var e,i=0,l=document.getElementById('privileges').getElementsByTagName('h5');while((e=l[i++])){e.style.cursor='pointer';e.onclick=function(){var p=this.parentNode;p.className=(p.className=='module plus')?'module minus':'module plus'}}};function hasFile(F,a,s){var v,i;if((v=F.upl.value)){i=1+v.lastIndexOf('.');v=v.substr(i).toLowerCase();if(isEmpty(v)||v.length>4){warn(s);F.reset()}else{F.submit()}}return false}
function awake(f,t){setTimeout('selectFld(document.edit.elements["'+f+'"])',(t||500))}function bgToggle(){var t,i=0,r=document.getElementsByTagName('tr');while((t=r[i++])){if(t.className=='rows'){t.onmouseover=function(){this.className='rows on'};t.onmouseout=function(){this.className='rows'}}}}function selectRows(t){var F,e,v,i=0,c=1;if((F=document.forms['list'])){while((e=F.elements[i++])){if(e.name.substring(0,3)==t){if(c){v=e.checked;c=0}e.checked=!v}}}return false};function auto(f,t){if(f.defaultValue!=f.value)f.form.elements[t].checked=1}
var skip={url:'',lmt:0,val:0,max:1,rng:1,key:function(e){return(self.event)?self.event.keyCode:(e)?e.which:false},set:function(f,e){if(/^3|10|13$/.test(this.key(e)))this.rec(f.form)},rec:function(F){with(this){lmt=parseInt(F.l.value);val=parseInt(F.k.value);if(lmt<2)lmt=1;if(lmt!=rng)url+='&lm='+lmt;val=(val<1)?0:(val>max)?max:val-1;if(val)url+='&ks='+val;goTo(url)}}};var floatwin=function(u,w,h,d){this.url=u||'index.php?cx=admin:editor';this.wid=w||640;this.hei=h||480;this.dbg=d||0;this.tgt=0;this.win=0;this.tmp=0;this.save=function(v){with(this.tgt){value=v;form.fmt.value=1;if(form.action.substr(-5)!=':edit')form.action+=':edit';form.submit()}};this.set=function(id){var t=this.tgt,a,x,i=0,o='';if(t.name.length>3){a=t.value.replace("\r","\n").split("\n");while(a[i]&&(x=parseInt(a[i++]))){if(x&&x!=id)o+=x+"\n"}}t.value=o+id;return false};this.open=function(){var a,u,n='fw'+new Date().getTime();with(this){a='left='+((screen.width-wid)/2-100)+',top='+((screen.height-hei)/2-100)+',width='+wid+',height='+hei+',resizable=1,scrollbars=1,location='+dbg;u=(url==null)?'':baseHref()+url+'&'+n}return open(u,n,a)};this.load=function(t){var f=arguments[1]||'edit',F;with(this){if((F=document.forms[f]))tgt=F.elements[t]||0;if(!win||(win&&win.closed)){win=open()}else{win.focus()}}return false}};function inSrc(s,d){new floatwin('file.php?ir='+s,800,600,d).open();return false};function recAdd(u,w,h,d,s){if(confirm(unescape(s)))new floatwin(u,w,h,d).open();return false};var tabs={items:[],persist:1,elm:function(i){return document.getElementById(i)||false},tags:function(o,n){return o.getElementsByTagName(n)||false},save:function(n,v){document.cookie=n+'='+v},pick:function(n){var c,r;if((c=document.cookie)){r=new RegExp(n+'=[^;]+','i');c=c.match(r)}return(c)?c[0].split('=')[1]:false},frag:function(o){return o.href.split('#')[1]||false},view:function(o,s){if(typeof o!='undefined')this.elm(o).style.display=s},activate:function(li_a){if(li_a){var l,pi,ll,i=0,ui=li_a.parentNode.parentNode.id;ll=this.tags(this.elm(ui),'li');while((l=ll[i++])){l.className='';this.view(this.frag(l.firstChild),'none')}li_a.parentNode.className='on';li_a.blur();pi=this.frag(li_a);this.view(pi,'block');if(this.persist){this.save(ui,pi)}}return false},setup:function(ul_id){var l,sl,set,ll,li_a,pnl,i=0,last_on=this.pick(ul_id);if(!this.items[ul_id])this.items[ul_id]=[];ll=this.tags(this.elm(ul_id),'li');while((l=ll[i++])){li_a=this.tags(l,'a')[0];if(i==1)sl=li_a;if((pnl=this.frag(li_a))){this.items[ul_id][this.items[ul_id].length]=pnl;li_a.onclick=function(){return tabs.activate(this)};li_a.onmouseover=function(){return self.status=''};if(!set&&(l.className=='on'||pnl==last_on)){set=li_a}}}if(!last_on||!this.persist){this.save(ul_id,'')}return this.activate(set||sl)},init:function(){var u,i=0,uu=this.tags(document,'ul');while((u=uu[i++])){if(u.className=='tabs')this.setup(u.id)}}};function centerImg(){var a,l,e,i,m;if(document.getElementsByTagName){a=document.getElementsByTagName('div');l=a.length;while(l--){e=a[l];if((' '+e.className+' ').indexOf(' image ')>-1){i=e.getElementsByTagName('img')[0];m=parseInt((e.clientHeight-i.height)/2);i.style.marginTop=m+'px'}}}return 1};var site={nousermsg:'',nopaswmsg:'',init:function(u,p){this.nousermsg=u;this.nousermsg=u;tabs.init();bgToggle()}};
