/* (C) 2008 PRIME Computer Kft. www.prime.hu */
var PSIntra=PSIntra||{};PSIntra.prt_pfe={e_req1:"<li>A(z) %1 értéke nem lehet üres.",e_req2:"<li>Kérem jelölje be a(z) %1 jelölőnégyzetet.",e_req3:"<li>Kérem válassza ki a(z) %1 értékét.",e_minl:"<li>A(z) %1 hossza legalább %2 karakter kell hogy legyen.",e_mail:"<li>A(z) %1 nem érvényes e-mail cím.",e_date:"<li>A(z) %1 nem érvényes dátum formátumú. <br>(a várt formátum: éééé.hh.nn - például: <b>2008.06.01</b>)",e_dati:"<li>A(z) %1 nem érvényes dátum+idő formátumú. <br>(a várt formátum: éééé.hh.nn óó:pp - például: <b>2008.06.01 11:23</b>)",e_minv:"<li>A(z) %1 értéke nem lehet kisebb mint %2.",e_maxv:"<li>A(z) %1 értéke nem lehet nagyobb mint %2.",e_real:"<li>A(z) %1 értéke nem szám.",e_int:"<li>A(z) %1 értéke nem egész szám.",e_phon:"<li>A(z) %1 nem megfelelő telefonszám (%2. karakter rossz).",e_maxl:"<li>A(z) %1 hossza nem lehet több mint %2 karakter.",e_maxe:"<li>Az ellenőrzés megszakítva, vannak még fel nem sorolt hibák az oldalon...",errorcap:"Hibás Adatmegadás",ajaxprog:'Adatok Továbbítása Folyamatban&nbsp;&nbsp;<img src="java/images/wait.gif">',ajaxerr:"<b>Ajax Hiba</b>",plswait:"Türelmét kérem...<br>",ajaxcanabort:'Az adattovábbítást megszakíthatja a <b>"Megszakít"</b> gomb megnyomásával.<br>',postaborted:"Az adattovábbítás megszakítva",ajaxunknown:"<b>Ismeretlen AJAX eljárás</b>",ajaxnotarget:"<b>Nincs AJAX célobjektum megadva</b>"};PSIntra.prt_pfcn=["beviteli mező","szövegdoboz","szövegdoboz","lenyíló lista","jelölő négyzet","gomb","-","gombsor","panel","paneldoboz","felirat","link","-","-","fájlválasztó","adattábla"];PSIntra.prt_pajax=null;PSIntra.prt_plasterr="";PSIntra.prt_last_get="";jQuery.extend({formid:function(d){if(d!==""&&d.substr(0,1)!="#"){return"#"+d}else{return d}},divnam:function(d){if(d!==""&&d.substr(0,1)=="#"){return d.substr(1)}else{return d}},checkfileexists:function(f){var res=true;try{var fso=new ActiveXObject("Scripting.FileSystemObject");res=fso.FileExists(f)}catch(e){res=true}return res},date_daydiff:function(d1,d2){var one_day=1000*60*60*24,d1u=Date.UTC(d1.getFullYear(),d1.getMonth(),d1.getDate(),0,0,0,0),d2u=Date.UTC(d2.getFullYear(),d2.getMonth(),d2.getDate(),0,0,0,0);return Math.abs(Math.ceil((d1u-d2u)/(one_day)))+1},number_format:function(s,d,ds,ts,er){var fl=parseFloat(s);if(er===undefined){er="*"}if(isNaN(fl)){return er}if(d===undefined){d=0}if(ds===undefined){ds="."}if(ts===undefined){ts=" "}var fs=fl.toString(),dp=fs.indexOf("."),ret="",dcs=0;if(d>0){ret=ds;if(dp>=0){var i=dp+1;while(i<fs.length&&dcs<d){ret+=fs.substr(i,1);dcs++;i++}}if(dcs!=d){ret+="00000000000000000000000".substr(0,d-dcs)}}if(dp==0){ret="0"+ret}else{if(dp<0){dp=fs.length}for(var i=dp-1;i>=0;i--){if(ts!=""&&i<(dp-1)&&((i-dp+1)%3)==0){ret=ts+ret}ret=fs.substr(i,1)+ret}}return ret},abort_ajax:function(b){jQuery.dlgbtnclick(b);if(PSIntra.prt_pajax!==null){PSIntra.prt_pajax.abort();PSIntra.prt_pajax=null;alert($.striptags(PSIntra.prt_pfe.postaborted))}},UTF8encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c)}else{if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128)}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128)}}}return utftext},UTF8decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++}else{if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3}}}return string},drop_error:function(d,er){if(d!==""&&d!=="-"){$($.formid(d)).html('<div class="skn_messE">'+er+"</div>")}else{alert($.striptags(er))}return er},centerpos:function(a){if(!(a.length)){return{left:"0px",top:"0px"}}var w=a.width(),h=a.height();if(w==0){w=parseInt(a.css("width"),10);if(isNaN(w)||w===undefined){w=0}}if(h==0){h=parseInt(a.css("height"),10);if(isNaN(h)||h===undefined){h=0}}return{left:Math.max(Math.round(($(window).width()-w)/2),0)+"px",top:Math.max(Math.round(($(window).height()-h)/2),0)+"px"}},checkfilename:function(s){if(s===""||s===null||s===undefined||s.length<4){return false}var fp=s.indexOf(":"),lp=s.lastIndexOf(":");if(fp<0||fp!=lp){return false}return $.checkfileexists(s)},chdatesep:function(ev){if(ev.which==44){ev.which=46}return true},show_indoc:function(opt,event){var opts=$.extend({idpre:"infowin",durl:"",caption:"Információk",waittxt:"Az információk töltődnek...",width:600,height:450,pdta:{}},opt||{});if(opts.durl==""){if(event!==undefined){event.returnValue=false}return false}var cdiv=opts.idpre+"_cont",hdiv=opts.idpre+"_head",tdiv=opts.idpre+"_txtarget",bcls=opts.idpre+"_bclosewin",bgcol=PSIntra.prt_blindmode?"black":"#FFFFD0",bgcolin=PSIntra.prt_blindmode?"navy":"#F3F8FE";if(!($("#"+cdiv).length)){var ih='<div id="'+cdiv+'" class="p_groupbox hidden" style="position:relative;width:'+opts.width+"px;height:"+opts.height+"px;background-color: "+bgcol+';"><div id="'+hdiv+'" class="p_gbcaption" style="height:21px"><b>'+opts.caption+'</b></div><div class="p_cbwrapper" style="position:absolute;width:165px;height:28px;left:'+(opts.width-173)+"px;top:"+(opts.height-35)+'px;overflow:hidden;"><a href="" class="xbtn" style="width:157px;" target="_self" id="'+bcls+'" onclick="$.unblockUI(); event.returnValue=false; return false;"><span class="xbtn_pre"></span><span class="xbtn_post"></span><span id="xicon_cancel" class="xbtn_icon">Bezárás</span></a></div><div id="'+tdiv+'" class="p_panel" style="padding:2px;background-color:'+bgcolin+";position:absolute;width:"+(opts.width-18)+"px;height:"+(opts.height-74)+'px;left:8px;top:32px;border: 1px solid navy; overflow: auto;"></div></div>';$("body").append(ih)}$("#"+tdiv).html("<br><br><center><b>"+opts.waittxt+"</b></center>");$.blockUI({message:$("#"+cdiv),css:$.centerpos($("#"+cdiv))});$("#"+tdiv).myload(opts.durl,opts.pdta);if(event!==undefined){event.returnValue=false}return false},cancel_event:function(e){if(!e){e=window.event}if(e===undefined||e===null){return false}if(e.stopPropagation){e.stopPropagation()}if(e.preventDefault){e.preventDefault()}e.cancelBubble=true;e.cancel=true;e.returnValue=false;return false},striptags:function(txt){var ot=0,ct=0;while(ot>=0&&ct>=0){ot=txt.indexOf("<");ct=txt.indexOf(">",ot);if(ct>=0&&ot>=0){txt=txt.substr(0,ot)+txt.substr(ct+1)}}return txt},addbookmark:function(ur,cap){if(window.sidebar){window.sidebar.addPanel(cap,ur,"")}else{if(window.external){window.external.AddFavorite(ur,cap)}else{if(window.opera&&window.print){return true}}}},endisbutton:function(sel,con,sta){var itm;sel+="[class^='xbtn']";if(con===undefined||con===""){itm=$(sel)}else{itm=$(sel,con)}for(var i=0;i<itm.length;i++){var ao=$(itm[i]),acls=ao.attr("class"),isdis=acls.indexOf("Dis")<0,newcls=isdis?acls.substr(4):acls.substr(7),xdis=ao.attr("xdisabled")=="1";if(sta===undefined){newcls="xbtn"+(isdis?"Dis":"")+newcls}else{if(sta){newcls="xbtn"+newcls}else{newcls="xbtnDis"+newcls}}if(acls!=newcls&&!xdis){ao.attr("class",newcls);if(isdis){var ahr=ao.attr("href");ao.attr("xhref",ahr===undefined?"***":ahr).attr("href","#");ao[0].xonclick=(ao[0].onclick)?ao[0].onclick:null;ao[0].onclick=function(event){event.returnValue=false;return false}}else{var ahr=ao.attr("xhref");if(ahr=="***"){ao.removeAttr("href")}else{ao.attr("href",ahr)}ao.removeAttr("xhref");ao[0].onclick=(ao[0].xonclick)?ao[0].xonclick:null;ao[0].xonclick=null}}}},formatmess:function(m,p1,p2,sm){var fh=function(am,i,p){if(am.indexOf("(z) %"+i)>=0){if("euioaöüóőúéáű15".indexOf(p.substr(0,1).toLowerCase())>=0){am=am.replace("(z) %"+i,"z %"+i)}else{am=am.replace("(z) %"+i," %"+i)}}return am.replace("%"+i,"<b>"+p+"</b>")};if(sm===undefined){sm=PSIntra.prt_pfe[m]}if(p1===""){return sm+"<br>"}var r=fh(sm,"1",p1);if(p2===""){return r+"<br>"}return fh(r,"2",p2)+"<br>"},setprogress:function(s,n,c,cap){s=$.formid(s);if(cap!==undefined){$(s+"stepcap").html(cap)}var tds=$("td",s+"stepprog"),stc=tds.length/2,done,arr;for(var i=0;i<tds.length;i++){var idx=Math.floor(i/2),tdj=jQuery(tds[i]);if(i-idx*2==0){if(n<0||idx>n){done=0}else{if(n==idx){done=2}else{done=1}}jQuery(tds[i]).attr("class","cell_txt done"+done)}else{var j=idx+1,ht=c===undefined||c==""?j:n==idx?c:j;if(j==stc){arr=-1}else{if(n<0||j>n){arr=0}else{if(n==j){arr=2}else{arr=1}}}jQuery(tds[i]).attr("class","cell_arr done"+done+(arr<0?"":" arr"+done+arr)).html(ht)}}$(s+"stepcap").myvisible(true);$(s+"stepprog").myvisible(true)},mlc:function(p,c,d){var a3="mail",a6=p+String.fromCharCode(64)+d+"."+c,a5="to",a7=a3+a5+":"+a6;document.location.href=a7},adsidlink:function(l){if(PSIntra.prt_phpsess!==undefined){var sidn=PSIntra.prt_phpsess.split("=");l+=(l.indexOf("?")<0?"?":"&")+sidn[0]+"="+sidn[1]}return l},addsid:function(o){if(PSIntra.prt_phpsess!==undefined&&PSIntra.prt_phpsess!==null){var sidn=PSIntra.prt_phpsess.split("=");o[sidn[0]]=sidn[1]}},getdateYMD:function(v){var ok=false,ad=null;if(v!==""){ok=/^\d{4}[\.]\d{2}[\.]\d{2}$/.test(v);if(ok){var er,ymd=v.split(".");for(var j=0;j<3;j++){ymd[j]=ymd[j]*1}ad=new Date();try{ad.setFullYear(ymd[0],ymd[1]-1,ymd[2]);ad.setHours(0,0,0,0)}catch(er){ok=false}if(ok){ok=ad.getFullYear()==ymd[0]&&(ad.getMonth()+1)==ymd[1]&&ad.getDate()==ymd[2]}}if(!ok){ad=null}}return ad},settimepart:function(d,t){if(t.length!=5||t.substr(2,1)!=":"){return null}var ah=parseInt(t.substr(0,2),10),am=parseInt(t.substr(3,2),10);if(ah>=0&&ah<=23&&am>=0&&am<=59){d.setHours(ah,am,0,0);return d}return null},getdatetimeYMDhm:function(v,deft){if(v===""||v===undefined||v===null||(v.length!=10&&v.length!=16)){return null}deft=deft===undefined?"00:00":deft;var ad=$.getdateYMD(v.substr(0,10));if(ad===null){return null}if(v.length==10){return deft=="00:00"?ad:$.settimepart(ad,deft)}if(v.substr(10,1)!=" "){return null}return $.settimepart(ad,v.substr(11,5))},getdatecheckval:function(s,ut,deft){if(s=="t"){return new Date()}if(s.indexOf("t")<0){if(ut){return $.getdatetimeYMDhm(s,deft)}else{return $.getdateYMD(s)}}var ad=new Date();if(s.indexOf(".")<0){var md=s.substr(s.indexOf("t")+1),one_day=1000*60*60*24,at=Date.UTC(ad.getFullYear(),ad.getMonth(),ad.getDate(),12,0,0,0),ev=at+md+"*"+one_day;try{var nt=eval(ev);ad.setTime(nt);ad.setHours(0,0,0,0)}catch(er){return null}}else{var ad=new Date(),ymd=s.split("."),aymd=[ad.getFullYear(),ad.getMonth()+1,ad.getDate()],rd=[],t,er;for(var i=0;i<3;i++){if(ymd[i].indexOf("t")<0){rd[i]=parseInt(ymd[i],10)}else{t=aymd[i];try{rd[i]=eval(ymd[i])}catch(er){return null}}}try{ad.setFullYear(rd[0],rd[1]-1,rd[2]);ad.setHours(0,0,0,0)}catch(er){return null}if(!(ad.getFullYear()==rd[0]&&(ad.getMonth()+1)==rd[1]&&ad.getDate()==rd[2])){return null}}if(!ut||deft===undefined||deft=="00:00"){return ad}return $.settimepart(ad,deft)},mycapital:function(v){if(v===""){return""}var d=" .,;:-+!/?\"'",rs="",mx=v.length,i=0;while(i<mx){var j=i;while(i<mx&&d.indexOf(v.charAt(i))>=0){i++}rs+=v.substr(j,i-j);if(i<mx){rs+=v.charAt(i++).toUpperCase()}j=i;while(i<mx&&d.indexOf(v.charAt(i))<0){i++}rs+=v.substr(j,i-j).toLowerCase()}return rs},gettabcheck:function(s){var c=$("input[@type='checkbox']:checked",$.formid(s)),r=[],l=s.length;for(var i=0;i<c.length;i++){var o=$(c[i]),n=o.attr("id").substr(l),v=o.attr("value");r.push({idx:n,key:v})}return r},gettabcheck_str:function(s,mx){var c=$("input[@type='checkbox']:checked",$.formid(s)),r=[],res="",mxid=0;if(mx===undefined){mx=0}for(var i=0;i<c.length;i++){var cid=$(c[i]).attr("id"),idl=cid.lastIndexOf("_"),idx=parseInt((idl>0)?cid.substr(idl+1):"NAN",10);if(!isNaN(idx)){r[idx]=1;if(idx>mxid){mxid=idx}}}if(mx==0){mx=mxid+1}for(var i=0;i<mx;i++){if(r[i]===1){res+="1"}else{res+="0"}}return res},chgtabcheck:function(s,x){var st="input[@type='checkbox']";s=$.formid(s);switch(x){case 0:return $(st,s).attr("checked","");case 1:return $(st,s).attr("checked","checked");default:return $(st,s).each(function(i){this.checked=!this.checked})}},reformatdate:function(dv,a){if(dv.length!=8){return dv}var y=parseInt(dv.substr(0,4),10),m=parseInt(dv.substr(4,2),10),d=parseInt(dv.substr(6,2),10);if(y>1900&&y<2100&&m>=1&&m<=12&&d>=1&&d<=31){dv=y+"."+(m<10?"0":"")+m+"."+(d<10?"0":"")+d;a.myval(dv)}return dv},fillnull:function(v,l){var r=v.toString();if(r.length<l){r="00000000000000000000000".substr(0,l-r.length)+r}return r},autoheight:function(mdiv,bdiv){var ab=null,mh=0,mw=0,ad=$($.formid(mdiv));if(ad===null||ad===undefined){return null}if(bdiv!==undefined&&bdiv!==""){ab=$($.formid(bdiv))}jQuery.each($($.formid(mdiv)+" > *"),function(eidx,o){var ao=jQuery(o);if(ao.attr("id")!=$.divnam(bdiv)&&ao.myvisible()){var ah=ao.height()+parseInt(ao.css("top"),10),ar=ao.width()+parseInt(ao.css("left"),10);if(ah>mh){mh=ah}if(ar>mw){mw=ar}}});if(ab!==null&&ab!==undefined){mh+=2;ab.css("top",mh+"px");mh+=ab.height()}ad.css("height",mh+"px");return ad},ajxreload:function(s,pars){var pdta={};pdta[PSIntra.prt_ajaxfunc]="reload";$.addsid(pdta);var sdta=$.extend(pdta,pars||{});if(!$($.formid(s)).length){return null}return $($.formid(s)).myload("ajaxgate.php",sdta)},getdateSTR:function(d,t,ds,ts){if(d===undefined||d===null||typeof d!="object"||d.constructor!=Date){d=new Date()}if(ds===undefined||ds===null){ds="."}var dr=d.getFullYear().toString()+ds+$.fillnull(d.getMonth()+1,2)+ds+$.fillnull(d.getDate(),2);if(t!==undefined&&t!==null&&t){if(ts===undefined||ts===null){ts=":"}dr+=" "+$.fillnull(d.getHours(),2)+ts+$.fillnull(d.getMinutes(),2)+ts+$.fillnull(d.getSeconds(),2)}return dr},update_access:function(){PSIntra.prt_lastaccess=new Date().getTime()},milis_since_lastacc:function(){return new Date().getTime()-PSIntra.prt_lastaccess},do_heartbeat:function(){var nxhb=PSIntra.heartbeat_milis;if(PSIntra.prt_pajax===null){var no_acc=$.milis_since_lastacc();if((no_acc+3000)>PSIntra.heartbeat_milis){var pdta={};pdta[PSIntra.prt_ajaxfunc]=PSIntra.heartbeat_func;$.addsid(pdta);$.mypost("ajaxgate.php",pdta,null,false,"text/html")}else{nxhb=PSIntra.heartbeat_milis-no_acc}}setTimeout($.do_heartbeat,nxhb)},mygetbypost:function(url,data,type,erret){var jsonret={},ret="",iserr=false;$.update_access();var areq=jQuery.ajax({type:"POST",url:url,data:data,dataType:type,async:false,success:function(retdta){if(type=="json"){jsonret=retdta}},complete:function(req,stat){if(stat!="success"){iserr=true;var errmsg=$.striptags(PSIntra.prt_pfe.ajaxerr+": "+stat+" "+req.status+" "+req.statusText);alert(errmsg);if(erret!==undefined){var ep=erret.indexOf("*error*");if(ep>=0){erret=erret.substr(0,ep)+errmsg+erret.substr(ep+7)}}}else{ret=req.responseText}}});if(iserr){if(erret===undefined){return""}return erret}if(type=="json"){return jsonret}var cpos=0;while(cpos<ret.length&&ret.charCodeAt(cpos)<=32){cpos++}if(cpos==0){return ret}return ret.substr(cpos)},mypost:function(url,data,callback,issync,type){if(jQuery.isFunction(data)){callback=data;data={}}if(issync===undefined||issync===null){issync=false}$.update_access();return jQuery.ajax({type:"POST",url:url,data:data,complete:callback,async:!issync,dataType:type})},myajax:function(opt,padd){var opts=$.extend({ajaxmethod:"load",showajaxdlg:false,ajaxabort:false,addsessid:true,ajaxfunc:"",ajaxurl:"ajaxgate.php",baseelem:"",targetelem:"",errdiv:"port_warning",onnohtml:null,onokcallback:null,jumpelem:""},opt||{});var pdta=$.extend({},padd||{}),has_error="";if(opts.showajaxdlg){$.showdialog(PSIntra.prt_pfe.ajaxprog,opts.ajaxabort?PSIntra.prt_pfe.ajaxcanabort:PSIntra.prt_pfe.plswait,opts.ajaxabort?32:0,null,opts.ajaxabort?"$.abort_ajax":"")}if(opts.addsessid&&PSIntra.prt_phpsess!==undefined){var sidn=PSIntra.prt_phpsess.split("=");pdta[sidn[0]]=sidn[1]}if(PSIntra.prt_ajaxfunc!==undefined&&PSIntra.prt_ajaxfunc!==""&&opts.ajaxfunc!==""){pdta[PSIntra.prt_ajaxfunc]=opts.ajaxfunc}if(opts.ajaxmethod=="load"){if(opts.targetelem===""){if(opts.baseelem!==""){opts.targetelem=$($.formid(opts.baseelem)).parent().eq(0).attr("id")}if(opts.targetelem===""){return $.drop_error(opts.errdiv,PSIntra.prt_pfe.ajaxnotarget)}}jQuery($.formid(opts.targetelem)).myload(opts.ajaxurl,pdta,function(rt,stat,req){if(opts.showajaxdlg){jQuery.dlgbtnclick(0)}if(stat!="success"&&stat!="notmodified"){has_error=$.drop_error(opts.errdiv,PSIntra.prt_pfe.ajaxerr+": "+stat+" "+req.status+" "+req.statusText)}else{if(opts.jumpelem!==""){document.location.hash=$.formid(opts.jumpelem)}if(opts.onokcallback!==null){opts.onokcallback()}}},{onnohtml:opts.onnohtml})}else{if(opts.ajaxmethod=="post"){PSIntra.prt_pajax=jQuery.mypost(opts.ajaxurl,pdta,function(req,stat){PSIntra.prt_pajax=null;if(opts.showajaxdlg){jQuery.dlgbtnclick(0)}if(stat!="success"&&stat!="notmodified"){has_error=$.drop_error(opts.errdiv,PSIntra.prt_pfe.ajaxerr+": "+stat+" "+req.status+" "+req.statusText)}},false)}else{if(opts.ajaxmethod=="posts"||opts.ajaxmethod=="postsget"){jQuery.mypost(opts.ajaxurl,pdta,function(req,stat){if(opts.showajaxdlg){jQuery.dlgbtnclick(0)}if(stat!="success"&&stat!="notmodified"){has_error=$.drop_error(opts.errdiv,PSIntra.prt_pfe.ajaxerr+": "+stat+" "+req.status+" "+req.statusText)}else{PSIntra.prt_last_get=req.responseText}},true)}else{has_error=$.drop_error(PSIntra.prt_pfe.ajaxunknown+": "+opts.ajaxmethod)}}}return has_error}});jQuery.fn.extend({myreplaceWith:function(value){return this.each(function(){var e=$(this);var p=e.parent();var s=e.prev();e.remove();if(s[0]){s.after(value)}else{p.prepend(value)}})},myvisible:function(value){if(value===undefined){if(!this.length){return undefined}return !jQuery(this[0]).hasClass("hidden")}return this.each(function(){if(value=="t"){jQuery(this).toggleClass("hidden")}else{if(value===true){jQuery(this).removeClass("hidden")}else{jQuery(this).addClass("hidden")}}})},myenable:function(value){if(value===undefined){if(!this.length){return undefined}return !jQuery(this[0]).hasClass("disabled")}return this.each(function(){if(value=="t"){if(jQuery(this).hasClass("disabled")){jQuery(this).removeAttr("disabled").removeClass("disabled")}else{jQuery(this).attr("disabled","disabled").addClass("disabled").removeClass("p_error")}}else{if(value===true){jQuery(this).removeAttr("disabled").removeClass("disabled")}else{jQuery(this).attr("disabled","disabled").addClass("disabled").removeClass("p_error")}}return })},mylab:function(value){if(value===undefined||(typeof value=="object"&&value.constructor!=Array)){if(!this.length){return undefined}var a=jQuery(this[0]);var pl=a.attr("plabel"),l=pl;if(pl===undefined||pl===null||pl.indexOf("%1")>=0){var t=(value!==undefined&&value.ctyp!==undefined)?value.ctyp:"";if(t===""){var apt=a.attr("ptype");t=(apt===undefined||apt==="")?0:parseInt(apt.split(";")[0])}var id=a.attr("id");l=(t==7)?$($.formid(id)+" legend").text():$("label[@for='"+id+"']").text();if(l===undefined||l===""){l=PSIntra.prt_pfcn[t]}if(l!==""&&l.charAt(l.length-1)==":"){l=l.substr(0,l.length-1)}if(l!==""&&l.charAt(0)=="-"){l=l.substr(1)}}if(pl!==undefined&&pl!==null&&pl.indexOf("%1")>=0){l=pl.replace("%1",l)}return l}if(!this.length){return }return this.each(function(){var a=jQuery(this);var t=(typeof value=="object"&&value.constructor==Array)?value[0]:undefined;var l=(typeof value=="object"&&value.constructor==Array)?value[1]:value;if(a.attr("plabel")!==undefined){return a.attr("plabel",l)}if(t===undefined){var apt=a.attr("ptype");t=(apt===undefined||apt==="")?0:parseInt(apt.split(";")[0])}var id=a.attr("id");var lo=(t==7)?$($.formid(id)+" legend"):$("label[@for='"+id+"']");if(lo!==undefined){lo.text(l)}return })},setseltext:function(txt,idx,val){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){if(idx===undefined||idx<0){idx=elem.selectedIndex}if(idx<0||idx>=elem.options.length){return }if(txt!==""){elem.options[idx].text=txt}if(val!==undefined){elem.options[idx].value=val}}}},clearselitems:function(){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){while(elem.length>0){elem.remove(0)}}}},selnextmatch:function(txt){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var idx=elem.selectedIndex+1,src=txt.toLowerCase(),nidx=-1;while(nidx<0&&idx<elem.options.length){if(elem.options[idx].text.toLowerCase().indexOf(src)>=0){nidx=idx}idx++}if(nidx>=0){elem.selectedIndex=nidx}else{if(elem.options.length>0){elem.selectedIndex=0}}}}},indexofseltext:function(txt){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")&&txt!==""){for(var i=0;i<elem.options.length;i++){if(elem.options[i].text==txt){return i}}return -1}}return undefined},indexofselval:function(txt){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")&&txt!==""){for(var i=0;i<elem.options.length;i++){if(elem.options[i].value==txt){return i}}return -1}}return undefined},dropselitem:function(idx){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){if(idx===undefined||idx<0){idx=elem.selectedIndex}if(idx<0||idx>=elem.options.length){return }elem.remove(idx);if(elem.options.length>0){if(idx>=elem.options.length){idx--}elem.selectedIndex=idx}}}},addselitem:function(txt,val){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){elem.options[elem.length]=new Option(txt,val);elem.selectedIndex=elem.options.length-1}}},insertmemo:function(iv){return this.each(function(){if(document.selection){this.focus();sel=document.selection.createRange();sel.text=iv;this.focus()}else{if(this.selectionStart||this.selectionStart=="0"){var startPos=this.selectionStart;var endPos=this.selectionEnd;var scrollTop=this.scrollTop;this.value=this.value.substring(0,startPos)+iv+this.value.substring(endPos,this.value.length);this.focus();this.selectionStart=startPos+iv.length;this.selectionEnd=startPos+iv.length;this.scrollTop=scrollTop}else{this.value+=iv;this.focus()}}})},getseltxt:function(index){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){if(index===undefined){index=elem.selectedIndex}var values=[],options=elem.options,one=elem.type=="select-one";if(index<0||index>=options.length){return null}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected||index==i){value=option.text;if(one){return value}values.push(value)}}return values}}return undefined},getselval:function(index){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){if(index===undefined){index=elem.selectedIndex}var values=[],options=elem.options,one=elem.type=="select-one";if(index<0||index>=options.length){return null}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected||index==i){value=option.value;if(one){return value}values.push(value)}}return values}}return undefined},myval:function(value){if(value===undefined||(typeof value=="object"&&value.constructor!=Array)){if(!this.length){return undefined}var a=jQuery(this[0]);var t=(value!==undefined&&value.ctyp!==undefined)?value.ctyp:"";if(t===""){var apt=a.attr("ptype");if(apt===undefined||apt===null||apt===""){return a.val()}t=parseInt(apt.split(";")[0])}var v="";switch(t){case 4:if(a.is(":checked")){v=a.val()}else{v=a.attr("uvalue")}break;case 7:v=$("input[@name='"+a.attr("pname")+"']:checked").val();break;case 3:v=a.val();if(v=="-"){v=""}break;default:v=a.val();break}return(v===undefined||v===null)?"":v}if(!this.length){return }return this.each(function(){var apt=jQuery(this).attr("ptype"),t=0;if(apt!==undefined&&apt!==null&&apt!==""){t=parseInt(apt.split(";")[0])}switch(t){case 7:return $("input[@name='"+jQuery(this).attr("pname")+"']").val([value]);break;case 4:if(jQuery(this).attr("uvalue")==value){this.checked=false}default:return jQuery(this).val(value);break}})},myload:function(url,params,callback,opt){var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}var opts=$.extend({onnohtml:null},opt||{});callback=callback||function(){};var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null}else{if(params[PSIntra.prt_ajaxfunc]=="reload"&&params._cpa===undefined){params._cpa=this.attr("psrc");if(params._cpa===null||params._cpa===undefined){params._cpa=""}}params=jQuery.param(params);type="POST"}}var self=this;$.update_access();PSIntra.prt_pajax=jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){PSIntra.prt_pajax=null;if(status=="success"||status=="notmodified"){var inject=true,cpos=0;if(opts.onnohtml!==null){while(cpos<res.responseText.length&&res.responseText.charCodeAt(cpos)<=32){cpos++}inject=cpos<res.responseText.length&&res.responseText.charCodeAt(cpos)==60}if(inject){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText)}else{opts.onnohtml(cpos==0?res.responseText:res.responseText.substr(cpos))}}self.each(callback,[res.responseText,status,res])}});return this}});jQuery.formvalidate=function(f,opt,padd){var opts=$.extend({skip_sel:"",nocheck:false,limiter:"",showerrdlg:true,cutformname:true,doajaxonok:"load",showajaxdlg:false,ajaxabort:false,addsessid:true,ajaxfunc:"",ajaxurl:"ajaxgate.php",targetelem:"",errdiv:"port_warning",showerrdiv:false,okcallback:null,maxerrors:10,jumpelem:"",showstat:false},opt||{});var msgs=[],foce=null,focet=0,stat={elcnt:0,elchk:0,elsbm:0,eltyp:{},startt:0,selt:0,endt:0};var pdta=$.extend({},padd||{});function fm(m,p1,p2,sm){if(sm===undefined){sm=PSIntra.prt_pfe[m]}if(p1===""){return sm+"<br>"}var r=fh(sm,"1",p1);if(p2===""){return r+"<br>"}return fh(r,"2",p2)+"<br>"}function st(at){return at>=1&&at<=7&&at!=5}function fh(m,i,p){if(m.indexOf("(z) %"+i)>=0){if("euioaöüóőúéáű15".indexOf(p.substr(0,1).toLowerCase())>=0){m=m.replace("(z) %"+i,"z %"+i)}else{m=m.replace("(z) %"+i," %"+i)}}return m.replace("%"+i,"<b>"+p+"</b>")}var asel=":input:visible:not(.disabled,:button)"+opts.skip_sel+",input[@type='hidden'],fieldset";if(opts.showstat){stat.startt=new Date().getTime();stat.selt=stat.startt}var lmc=(opts.limiter!="")?opts.limiter:f+"_"+f;jQuery.each($(asel,$.formid(lmc)),function(eidx,o){if(opts.showstat){if(eidx==0){stat.selt=new Date().getTime()}stat.elcnt++;var atn=o.tagName.toLowerCase();if(atn==="input"){atn=atn+"-"+o.type}stat.eltyp[atn]=(stat.eltyp[atn]||0)+1}var a=jQuery(o),pt=a.attr("ptype"),n_c=false,n_s=false;if(pt!==undefined&&pt!==null){var pr=pt.split(";"),prl=pr.length,i=prl-1;while(i>=0&&pr[i]===""){i--}prl=i+1;var t=parseInt(pr[0],10);n_s=!isNaN(t)&&a.is(":enabled");n_c=n_s&&t!=6;if(n_c){var p=a.parents(),j=0;while(j<p.length&&jQuery(p[j]).is(":visible")){if(jQuery(p[j]).attr("id")==f+"_"+f||jQuery(p[j]).attr("pvisistop")=="1"){j=p.length}else{j++}}n_c=(j==p.length);n_s=n_c}if(n_c||n_s){var tabor=parseInt(a.attr("tabindex"),10),tabo="00000";if(isNaN(tabor)){tabor=0}else{tabo=tabor.toString()+":";while(tabo.length<5){tabo="0"+tabo}}var v=a.myval({ctyp:t});var cc=prl>1?parseInt(pr[1],10):0;var is_ro=a.attr("readonly");if(is_ro!==false&&is_ro!==undefined&&is_ro!==""&&is_ro!==null){n_c=false}if(!opts.nocheck&&n_c&&(cc>0||prl>2)){stat.elchk++;var id=a.attr("id"),l=a.mylab(),ee=t!=4?a:$($.formid("wrap_"+id));var ok=true;if(cc&128){alert('"'+l+'" value: :'+v+":")}if(ok&&(cc&1)&&(v==="")){msgs.push(tabo+fm(t==4?"e_req2":(t==3||t==7?"e_req3":"e_req1"),l,""));ok=false}if(ok&&(cc&8)&&(v!=="")){ok=(parseInt(v,10).toString()==v);if(!ok){msgs.push(tabo+fm("e_int",l,""))}}if(ok&&(cc&16)&&(v!=="")){ok=!isNaN(parseFloat(v));if(!ok){msgs.push(tabo+fm("e_real",l,""))}}if(ok&&prl>2&&pr[2]!==""&&v!==""){var ml=parseInt(pr[2],10);ok=(isNaN(ml)||ml===0||v.length>=ml);if(!ok){msgs.push(tabo+fm("e_minl",l,ml.toString()))}}if(ok&&(cc&32)&&v!==""){i=0;while(ok&&i<v.length){ok=(" 0123456789/-".indexOf(v.charAt(i++))>=0)}if(!ok){msgs.push(tabo+fm("e_phon",l,i))}}if(ok&&(cc&2)&&(v!=="")){ok=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(v);if(!ok){msgs.push(tabo+fm("e_mail",l,""))}}var ad,ymd;if(ok&&(cc&4)&&(v!=="")){if(v.length==8){v=$.reformatdate(v,a)}ad=$.getdateYMD(v);ok=(ad!==null);if(!ok){msgs.push(tabo+fm("e_date",l,""))}}if(ok&&(cc&64)&&(v!=="")){if(v.length==8){v=$.reformatdate(v,a)}ad=$.getdatetimeYMDhm(v);ok=(ad!==null);if(!ok){msgs.push(tabo+fm("e_dati",l,""))}}if(ok&&(v!=="")&&prl>3&&pr[3]!==""){if(cc&4){var cd=$.getdatecheckval(pr[3],false);if(cd!==null){cd.setHours(0,0,0,0);ok=ad>=cd;if(!ok){msgs.push(tabo+fm("e_minv",l,$.getdateSTR(cd,false)))}}}else{if(cc&64){var cd=$.getdatecheckval(pr[3],true);if(cd!==null){ok=ad>=cd;if(!ok){msgs.push(tabo+fm("e_minv",l,$.getdateSTR(cd,false)))}}}else{if(cc&8){var cv=pr[3]=="y"?(new Date().getFullYear()):parseInt(pr[3],10);ok=isNaN(cv)||(parseInt(v,10)>=cv);if(!ok){msgs.push(tabo+fm("e_minv",l,cv.toString()))}}else{if(cc&16){var cv=parseFloat(pr[3]);ok=isNaN(cv)||(parseFloat(v)>=cv);if(!ok){msgs.push(tabo+fm("e_minv",l,pr[3]))}}}}}}if(ok&&(v!=="")&&prl>4&&pr[4]!==""){if(cc&4){var cd=$.getdatecheckval(pr[4],false);if(cd!==null){cd.setHours(0,0,0,0);ok=ad<=cd;if(!ok){msgs.push(tabo+fm("e_maxv",l,$.getdateSTR(cd,false)))}}}else{if(cc&64){var cd=$.getdatecheckval(pr[4],true,"23:59");if(cd!==null){ok=ad<=cd;if(!ok){msgs.push(tabo+fm("e_maxv",l,$.getdateSTR(cd,false)))}}}else{if(cc&8){var cv=pr[4]=="y"?(new Date().getFullYear()):parseInt(pr[4],10);ok=isNaN(cv)||(parseInt(v,10)<=cv);if(!ok){msgs.push(tabo+fm("e_maxv",l,cv.toString()))}}else{if(cc&16){var cv=parseFloat(pr[4]);ok=isNaN(cv)||(parseFloat(v)<=cv);if(!ok){msgs.push(tabo+fm("e_maxv",l,pr[4]))}}else{if(t==2){var cv=parseInt(pr[4],10);ok=isNaN(cv)||(v.length<=cv);if(!ok){msgs.push(tabo+fm("e_maxl",l,pr[4]))}}}}}}}if(ok&&prl>5&&pr[5]!==""&&(v!==""||(cc&256))){var am=eval(pr[5]+"("+t+",'"+l+"','"+v+"',a);");ok=am===undefined||am==="";if(!ok){msgs.push(tabo+fm("",l,"",am))}}if(ee!==undefined&&ee!==null){if(ok){if(ee.hasClass("p_error")){ee.removeClass("p_error");if(t==7){$($.formid(id)+" legend").removeClass("p_error")}}}else{if(!ee.hasClass("p_error")){ee.addClass("p_error");if(t==7){$($.formid(id)+" legend").addClass("p_error")}}if(foce===null||tabor<focet){foce=t!=7?a:$($.formid("i0_")+id);focet=tabor}}}}if(n_s){var n=t!=7?a.attr("name"):a.attr("pname");if(n!==undefined&&n!==null&&n!==""){if(opts.cutformname&&n.indexOf(f+"_")===0){n=n.substr(f.length+1)}if(t==1){var ttr=a.css("text-transform");if(ttr=="uppercase"){v=v.toUpperCase()}else{if(ttr=="lowercase"){v=v.toLowerCase()}else{if(ttr=="capitalize"){v=$.mycapital(v)}}}}pdta[n]=v;stat.elsbm++}}}}});if(opts.showstat){stat.endt=new Date().getTime();var tstat="",tims="\n- Select time: "+(stat.selt-stat.startt)+" msec\n- Parsing time: "+(stat.endt-stat.selt)+" msec\n- Total time: "+(stat.endt-stat.startt)+" msec";for(var j in stat.eltyp){tstat+="\n    - "+j+": "+stat.eltyp[j]}alert("Statistics:\n- Selector: "+asel+"\n- Total elems: "+stat.elcnt+tstat+"\n- Checked: "+stat.elchk+"\n- Errors: "+msgs.length+"\n- Sumbitted: "+stat.elsbm+tims)}PSIntra.prt_plasterr="";var errcnt=msgs.length;if(errcnt>0){msgs.sort();for(var i=0;i<errcnt;i++){if(i<opts.maxerrors){PSIntra.prt_plasterr+=msgs[i].substr(5)}}if(errcnt>opts.maxerrors&&opts.maxerrors>1){PSIntra.prt_plasterr+=PSIntra.prt_pfe.e_maxe}}if(PSIntra.prt_plasterr!==""){if(opts.showerrdlg){$.showdialog(PSIntra.prt_pfe.errorcap,'<ul class="err_ul">'+PSIntra.prt_plasterr+"</ul>",1+512,foce)}else{if(opts.showerrdiv){if(opts.errdiv!=="-"){$(opts.errdiv).html('<div class="skn_messE"><ul class="err_ul">'+PSIntra.prt_plasterr+"</ul></div>")}else{alert($.striptags(PSIntra.prt_plasterr))}if(foce!==null){foce.focus()}}}return false}if(opts.okcallback!==null){var ret=opts.okcallback(pdta);if(ret===false){return false}else{if(typeof ret=="object"){pdta=$.extend(pdta,ret||{})}}}if(opts.doajaxonok!==""){PSIntra.prt_plasterr=$.myajax({ajaxmethod:opts.doajaxonok,showajaxdlg:opts.showajaxdlg,ajaxabort:opts.ajaxabort,addsessid:opts.addsessid,ajaxfunc:opts.ajaxfunc,ajaxurl:opts.ajaxurl,baseelem:f+"_"+f,targetelem:opts.targetelem,errdiv:opts.errdiv,jumpelem:opts.jumpelem},pdta)}return(PSIntra.prt_plasterr==="")};