/** * Object PHP_Serializer * JavaScript to PHP serialize / unserialize class. * This class is designed to convert php variables to javascript * and javascript variables to php with a php serialize unserialize * compatible way. * * PARSABLE PHP TO JAVASCRIPT VARIABLES: * [ PHP TYPE ] [ JAVASCRIPT TYPE ] * array Array * class Object (*) * string String * boolean Boolean * undefined or null null * integer / double Number * * PARSABLE JAVASCRIPT TO PHP VARIABLES: * [ JAVASCRIPT TYPE ] [ PHP TYPE ] * Array array * Object class (*) * String string * Boolean boolean * null null * Number int or double * Date class * Error class * Function anything (*) * __class anything (*) * * (*) NOTE: * Any PHP serialized class requires the native PHP class to be used, then it's not a * PHP => JavaScript converter, it's just a usefull serilizer class for each * compatible JS and PHP variable types. * However is possible to change public parameters. * Lambda, Resources or other dedicated PHP variables are not usefull for JavaScript. * (i.e. * $v = create_function('', 'return 1;'); serialize($v); * $conn = mydb_connect(); serialize($conn); * ) * There are same restrictions for javascript functions too then these will not be sent * (but will be filtered / ignored automatically). * _____________________________________________ * * EXAMPLE: * var php = new PHP_Serializer(); * alert(php.unserialize(php.serialize(somevar))); * // should alert the original value of somevar * --------------------------------------------- * @author Andrea Giammarchi * @site www.devpro.it * @date 2005/11/26 * @lastmod 2005/12/07 14:30 [fixed deer Park serialize problem] * @credits Special thanks to Fabio Sutto for some ideas and some debug * Special thanks to kentaromiura for a faster loop idea while unserialize * @version 1.5d, tested on FireFox 1.0.7, FireFox 1.5, IE 6 SP2 and Opera 8 */ function PHP_Serializer(){16!=String(Object).indexOf("(")?this.__cut=9:this.__cut=10}function PHP_Serializer__String(t){return"s:"+t.length+':"'+t+'";'}function PHP_UnSerializer__String(){var t=this.__s.substr(2,this.__s.indexOf(":",2)-2),e=parseInt(t) t=t.length+4 var i=this.__s.substr(t,e) return this.reduce(e+t+2),i}function PHP_Serializer__Boolean(t){return"b:"+(0==t?"0":"1")+";"}function PHP_UnSerializer__Boolean(){var t="1"==this.__s.substr(2,1) return this.reduce(4),t}function PHP_Serializer__Number(t){return t=String(t),t.indexOf(".")==-1?"i:"+t+";":"d:"+t+";"}function PHP_UnSerializer__Number(){var t=this.__s.indexOf(";",1)-2,e=Number(this.__s.substr(2,t)) return this.reduce(t+3),e}function PHP_Serializer__Function(){return""}function PHP_Serializer__Undefined(){return"N;"}function PHP_UnSerializer__Undefined(){return this.reduce(2),null}function PHP_Serializer__Common_ArrayObject(t){var e,i=0,n="" for(var s in t)e=null==t[s],(e||t[s].constructor!=Function&&"__class"!=s)&&(n+=isNaN(s)?this.__string(s):this.__number(s),n+=e?this.__undefined():this[t[s].constructor](t[s]),++i) return[i,n]}function PHP_UnSerializer__Common_ArrayObject(t){var e,i,n=this.__s.indexOf(":",2),s=parseInt(this.__s.substr(2,n-2)) if(this.reduce(n+2),0!=s)do i=this[this.__s.substr(0,1)](),e=this.__s.substr(0,1),t[i]=this[e]() while(--s) return t}function PHP_Serializer__Object(t){var e=String(t.constructor),i=e.substr(this.__cut,e.indexOf("(")-this.__cut),n=this.__common_array_object(t) return"O:"+i.length+':"'+i+'":'+n[0]+":{"+n[1]+"}"}function PHP_UnSerializer__Object(){var tmp="s"+this.__s.substr(1,this.__s.indexOf(":",4)-1)+";",a=tmp.substr(2,tmp.indexOf(":",2)-2) this.reduce(tmp.length-2) var o=tmp.substr(a.length+4,parseInt(a)) return eval("typeof("+o+") == 'undefined'")&&eval("function "+o+"(){}"),tmp="tmp = this.__common(new "+o+"());",eval(tmp),this.reduce(1),tmp}function PHP_Serializer__Array(t){var e=this.__common_array_object(t) return"a:"+e[0]+":{"+e[1]+"}"}function PHP_UnSerializer__Array(){var t=this.__common(new Array) return this.reduce(1),t}function PHP_Serializer__serialize(t){if(null==t)var e=this.__undefined() else if(this[t.constructor])var e=this[t.constructor](t) else var e=this[Object](t) return e}function PHP_UnSerializer__Reducer(t){this.__s=this.__s.substr(t,this.__s.length-t)}function PHP_UnSerializer__unserialize(t){return this.__s=t,delete t,this[this.__s.substr(0,1)]()}function ajax_debug(t){ajax_debug_mode&&get_element("debug_inner")&&ADDRinnerHTML("debug_inner",(new Date).toTimeString()+": "+t+"
")}function kd(url,ld,ob,md,nd){var found=!1,_i_=0 for(var i in ods)if("object"==typeof ods[i]&&ods[i].finished){_i_=i,ods[_i_].finished=!1,found=!0 break}if(found||(_i_=ods.length,ods[_i_]=new Object,ajax_debug("Adding objects to ods current_i (_i_):"+_i_+" "+navigator.userAgent)),!found||navigator.userAgent.indexOf("MSIE 7")>=0||navigator.userAgent.indexOf("MSIE 6")>=0||navigator.userAgent.indexOf("MSIE 5")>=0){if(window.XMLHttpRequest)ods[_i_].od=new XMLHttpRequest else{if(!window.ActiveXObject)throw"Can not create XMLHTTP-instance" try{ods[_i_].od=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{ods[_i_].od=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}try{ods[_i_].od.i=_i_}catch(t){}ods[_i_].od.onreadystatechange=function(){if(4==this.readyState){if(200!=this.status&&206!=this.status)throw ajax_debug("od "+this.i+"; An error has occurred during request; status return: "+this.status),"An error has occurred during request" var pd=this.getResponseHeader("Content-Type") pd=pd.substr(0,pd.indexOf(";")) try{switch(pd){case"application/json":ajax_debug("od "+this.i+"; recieved "+this.responseText),ods[this.i].ld(""==this.responseText?null:eval("("+this.responseText+")"),ods[this.i].ob) break case"text/plain":case"text/html":ajax_debug("od "+this.i+"; recieved "+this.responseText),ods[this.i].ld(this.responseText,ods[this.i].ob) break default:throw ajax_debug("od "+this.i+"; Illegal content type "+pd),"Illegal content type"}}catch(t){ajax_debug("od "+this.i+"; Caught error "+t+": Could not eval "+this.responseText)}ods[this.i].finished=!0,ajax_debug("od "+this.i+"; finished: "+ods[this.i].finished)}else ajax_debug("od "+this.i+"; still waiting... readyState="+this.readyState)}}if(url=prefix_root+"/"+url,void 0===md&&(md="GET"),ods[_i_].ld=ld,ods[_i_].ob=ob,ajax_debug("od "+_i_+"; uri = "+url+" / ld = "+ld),ods[_i_].od.open(md,url,!0),"POST"==md){ods[_i_].od.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8") var qd=rd(nd) ajax_debug("od "+_i_+"; to send using POST qd = "+qd)}else var qd=null ods[_i_].od.send(qd),ajax_debug("od "+_i_+"; waiting... ")}function rd(t){var e="",i=!0 for(var n in t)e+=(i?"":"&")+n+"="+window.encodeURI(t[n]),i&&(i=!1) return e}function get_element(t){return document.getElementById?document.getElementById(t):document.all?document.all[t]:!!document.layers&&document.layers[t]}function innerHTML(t,e,i){return get_element(t)?(get_element(t).innerHTML=e,!0):(i||alert("Can't find element id "+t+" to write content: "+e),!1)}function trim(t){if("string"!=typeof t)return t for(var e=t,i=e.substring(0,1);" "==i||10==i.charCodeAt(0);)e=e.substring(1,e.length),i=e.substring(0,1) for(i=e.substring(e.length-1,e.length);" "==i||10==i.charCodeAt(0);)e=e.substring(0,e.length-1),i=e.substring(e.length-1,e.length) for(;e.indexOf(" ")!=-1;)e=e.substring(0,e.indexOf(" "))+e.substring(e.indexOf(" ")+1,e.length) return e}function getElementPosition_new(t){var e=new Object if(e.x=0,e.y=0,e.width=0,e.height=0,t){if(t.offsetParent){e.x=t.offsetLeft,e.y=t.offsetTop for(var i=t.offsetParent;i;){e.x+=i.offsetLeft,e.y+=i.offsetTop var n=i.tagName.toLowerCase() "table"!=n&&"body"!=n&&"html"!=n&&"div"!=n&&i.clientTop&&i.clientLeft&&(e.x+=i.clientLeft,e.y+=i.clientTop),i=i.offsetParent}}else t.left&&t.top?(e.x=t.left,e.y=t.top):(t.x&&(e.x=t.x),t.y&&(e.y=t.y)) t.offsetWidth&&t.offsetHeight?(e.width=t.offsetWidth,e.height=t.offsetHeight):t.style&&t.style.pixelWidth&&t.style.pixelHeight&&(e.width=t.style.pixelWidth,e.height=t.style.pixelHeight)}return e}function hide(t){var e;(e=get_element(t))&&(e.style.display="none")}function show(t,e,i){var n=get_element(t) n&&(e!==!1&&(n.style.left=e+"px"),i!==!1&&(n.style.top=i+"px"),n.style.display="")}function make_name(t){var e=/[\'.\[\]]+/g return t.replace(e,"_")}function handle_status(t,e){""!=trim(e)&&0!=t&&alert(t+": "+e)}function createCookie(t,e,i){if(i){var n=new Date n.setTime(n.getTime()+24*i*60*60*1e3) var s="; expires="+n.toGMTString()}else var s="" document.cookie=t+"="+e+s+"; path=/"}function readCookie(t){for(var e=t+"=",i=document.cookie.split(";"),n=0;n0?"+":t<0&&t>-1?"‑":"",(o=a.length)>3?o%=3:o=0,r+(o?a.substr(0,o)+n:"")+a.substr(o).replace(/(\d{3})(?=\d)/g,"$1"+n)+(e?i+Math.abs(t-a).toFixed(e).slice(2):"")}function o2a(t){var e=new Array if("object"==typeof t)for(var i in t)"object"==typeof t[i]&&"parent"!=i?e[i]=o2a(t[i]):"function"!=typeof t[i]&&(e[i]=t[i]) else e=t return e}function MD5(t){function e(t,e){return t<>>32-e}function i(t,e){var i,n,s,a,o return s=2147483648&t,a=2147483648&e,i=1073741824&t,n=1073741824&e,o=(1073741823&t)+(1073741823&e),i&n?2147483648^o^s^a:i|n?1073741824&o?3221225472^o^s^a:1073741824^o^s^a:o^s^a}function n(t,e,i){return t&e|~t&i}function s(t,e,i){return t&i|e&~i}function a(t,e,i){return t^e^i}function o(t,e,i){return e^(t|~i)}function r(t,s,a,o,r,l,h){return t=i(t,i(i(n(s,a,o),r),h)),i(e(t,l),s)}function l(t,n,a,o,r,l,h){return t=i(t,i(i(s(n,a,o),r),h)),i(e(t,l),n)}function h(t,n,s,o,r,l,h){return t=i(t,i(i(a(n,s,o),r),h)),i(e(t,l),n)}function c(t,n,s,a,r,l,h){return t=i(t,i(i(o(n,s,a),r),h)),i(e(t,l),n)}function u(t){for(var e,i=t.length,n=i+8,s=(n-n%64)/64,a=16*(s+1),o=Array(a-1),r=0,l=0;l>>29,o}function d(t){var e,i,n="",s="" for(i=0;i<=3;i++)e=t>>>8*i&255,s="0"+e.toString(16),n+=s.substr(s.length-2,2) return n}function p(t){t=t.replace(/\r\n/g,"\n") for(var e="",i=0;i127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e}var f,g,m,v,_,y,b,w,x,k=Array(),C=7,T=12,D=17,S=22,P=5,A=9,M=14,I=20,N=4,E=11,H=16,z=23,$=6,O=10,j=15,W=21 for(t=p(t),k=u(t),y=1732584193,b=4023233417,w=2562383102,x=271733878,f=0;ft.length&&n("Error","Invalid"),s.push(a),a=t.slice(e+(o-1),e+o),o+=1 return[s.length,s.join("")]},a=function(t,e,n){var s s=[] for(var a=0;a]*?>.*?<\/script>/gi,""),t=t.replace(/]*?>.*?<\/style>/gi,""),t=t.replace(/<[\/\!]*?[^<>]*?>/gi,""),t=t.replace(/([\r\n])[\s]+/gi," "),t=t.replace(/&(quot|#34);/gi,'"'),t=t.replace(/&(amp|#38);/gi,"&"),t=t.replace(/&(lt|#60);/gi,"<"),t=t.replace(/&(gt|#62);/gi,">"),t=t.replace(/&(nbsp|#160);/gi," "),t=t.replace(/&#(\d+);/gi,"")}function mouseCoords(t){return t.pageX||t.pageY?{x:t.pageX,y:t.pageY}:{x:t.clientX+document.body.scrollLeft-document.body.clientLeft,y:t.clientY+document.body.scrollTop-document.body.clientTop}}function static_hide(t){try{t=t||window.event for(var e=0;eανάκτηση στοιχείων'):this.hide_inactive()),"undefined"!=typeof t&&null!=t?this.sg("_getting",!1,t):this.sg("_getting",!1)},this.checking=function(t){return"undefined"!=typeof t&&null!=t?this.sg("_checking",!1,t):this.sg("_checking",!1)},this.saving=function(t){return"undefined"!=typeof t&&null!=t&&(1==t?this.show_inactive('
Γίνεται αποθήκευση
'):this.hide_inactive()),"undefined"!=typeof t&&null!=t?this.sg("_saving",!1,t):this.sg("_saving",!1)},this.change=function(t){return"undefined"!=typeof t&&null!=t?this.sg("_change","",t):this.sg("_change","")},this.prepare_data=function(t){},this.can_save=function(t){return!0},this.get=function(){this.getting(!0),kd(this.f()+"?f="+this.prefix()+"_get&p="+e(a.serialize(this.to_send()))+"&xi="+this.xr_id()+"&xs="+this.session(),function(g,aaa){if(eval("var what="+g+";"),aaa.getting(!1),what){if(what.status&&parseInt(what.status)<=-1e3)return alert(what.mesg),void aaa.logout() aaa.after_get(what),handle_status(what.status,what.mesg)}},this)},this.after_get=function(t){1==t.status&&(this.load(t.data),this.show())},this.check_for_uniqueness=function(field,value){value=trim(value),""!=value&&(this.checking(!0),kd(this.f()+"?f="+this.prefix()+"_check&p="+e(a.serialize(o2a({field:e(field),value:e(value),id:this.data.sg("id")})))+"&xi="+this.xr_id()+"&xs="+this.session(),function(g,aaa){eval("var what="+g+";"),what&&(aaa.after_check_for_uniqueness(field,what.status),handle_status(what.status,what.mesg)),aaa.checking(!1)},this))},this.after_check_for_uniqueness=function(field,status){try{if(status=1){innerHTML(this.inner_status,''),this.checked.sg(field,!1,!0) for(var i in this.to_do_after_check)try{eval(this.to_do_after_check[i])}catch(t){alert("myindexbase.check_for_uniqueness.kd.return() to_do_after_check["+i+"] "+t)}}else innerHTML(this.inner_status,'χρησιμοποιείται'),this.checked.sg(field,!1,!1)}catch(t){alert("myindexbase.after_check_for_uniqueness.kd.return() "+t)}},this.save=function(forma){if(this.prepare_data(forma),this.can_save(forma)){this.saving(!0) var tosend=new Array tosend.f=this.prefix()+"_save",tosend.p=a.serialize(this.to_send()),tosend.xi=this.xr_id(),tosend.xs=this.session(),kd(this.f(),function(g,aaa){eval("var what="+g+";"),aaa.saving(!1),what&&(aaa.after_save(what),handle_status(what.status,what.mesg))},this,"POST",tosend)}else this.saving(!1)},this.after_save=function(t){this.load(t.data),this.show()},doinit&&this.init()}function Menu(name,parent){myindexbase.call(this,name,parent),this.init=function(){this.states=[],this.current_state_id=""},this.prev_state_id=function(t){return"undefined"!=typeof t&&null!=t?this.sg("_prev_state_id","",t):this.sg("_prev_state_id","")},this.state_id=function(t){return"undefined"!=typeof t&&null!=t?this.sg("_state_id","",t):this.sg("_state_id","")},this.add_state=function(id,desc,action,active,classname){try{classname||(classname="myindexbase") var length=this.get_state_i(id) return eval("var tmp = new "+classname+'(this.name+".states[\'"+length+"\']", this);'),tmp.init(),tmp.data.sg("id","",id),tmp.sg("state_desc","",desc),tmp.sg("action","",null==action?'alert("Dummy action");':action),tmp.sg("active",!0,"boolean"!=typeof active||active),this.states[length]=tmp,length}catch(t){alert("Menu.add_state() "+t)}return-1},this.get_state_i=function(t){for(var e in this.states)if(this.states[e].data.sg("id")==t)return e return this.states.length},this.draw=function(){var t="" try{t+="
" var e="",i="",n=0 for(var s in this.states)n++>=this.limit1()&&(e='onclick="'+this.name+".change_state("+s+')"',this.states[s].sg("active",!0)||(e=""),i="",this.states[s].data.sg("id")==this.state_id()&&(i="selected"),t+="
'+d(this.states[s].sg("state_desc"))+"
") t+="
"}catch(t){alert("Menu.draw() "+t)}return t},this.change_state=function(i){try{if(this.prev_state_id(this.state_id()),this.states[i]){this.state_id(this.states[i].data.sg("id")) try{eval(this.states[i].sg("action"))}catch(t){alert("menu.change_state("+i+") eval("+this.states[i].sg("action")+") "+t)}this.show()}}catch(t){alert("Menu.change_state("+i+") "+t)}},this.init()}function myAuth(name,parent){myindexbase.call(this,name,parent),this.inners=function(){var t=new myindexbase(this.name).inners.call(this) try{this.popup_inner=t+"_popup_inner",this.inner_status2=t+"_inner_status2",this.myforma=t+"_myforma"}catch(t){alert("myAuth.inners() "+t)}return t},this.inners(),this.f("if.php"),this.user=new User(this.name+".user",this,(!0)),this.aggelia=new Aggelia(this.name+".aggelia",this,(!0)),this.aggelia.after_save=function(t){try{new Aggelia(this.name).init.call(this,t),this.init(),this.show()}catch(t){alert("myAuth.aggelia.after_save() "+t)}},this.init(),this.show(),this.aggelies=new Aggelies(this.name+".aggelies",this,(!0)),this.menu=new Menu(this.name+".menu",this,(!0)),this.menu.add_state("user","Λογαριασμός μού",this.name+".hide_all_show("+this.user.name+".inner);"),this.menu.add_state("aggelia","Καταχώριση αγγελίας",this.name+".hide_all_show("+this.aggelia.name+".inner);"+this.name+".aggelia.show()"),this.menu.add_state("aggelies","Οι αγγελίες μου",this.name+".hide_all_show("+this.aggelies.name+".inner);"+this.name+".aggelies.show()"),this.menu.state_id("user"),this.init=function(){new myindexbase(this.name).init.call(this),this.prefix("auth"),this.username(readCookie("username")?readCookie("username"):""),this.password(readCookie("password")?readCookie("password"):""),this.session(readCookie("session")?readCookie("session"):""),this.user.init(),this.aggelia.init(),this.aggelies.init()},this.username=function(t){return"undefined"!=typeof t&&null!=t?this.sg("_username","",t):this.sg("_username","")},this.password=function(t){return"undefined"!=typeof t&&null!=t?this.sg("_password","",t):this.sg("_password","")},this.xr_id=function(){if(this.user&&this.user.loaded())return this.user.data.sg("id")},this.session=function(t){return"undefined"!=typeof t&&null!=t?this.sg("_session","",t):this.sg("_session","")},this.is_logged_in=function(t){return"boolean"==typeof t?this.sg("_is_logged_in",!1,t):this.sg("_is_logged_in",!1)},this.is_set_cookie=function(t){return"boolean"==typeof t?this.sg("_is_set_cookie",!1,t):this.sg("_is_set_cookie",!1)},this.gl=function(t){return gl?gl:""},this.to_send=function(){var t=new Array try{t.username=this.username(),t.time=parseInt((new Date).getTime()/1e3),t.password=MD5(this.password()+t.time),t.session=this.session(),t.gl=this.gl()}catch(t){alert("myAuth.to_send() "+t)}return t},this.login=function(t){try{"undefined"!=typeof t&&(this.username(e(t.username.value)),""!=t.password.value&&this.password(e(MD5(t.password.value))),this.is_set_cookie("Y"==t.set_cookie.value),t.password.value=""),""!=this.username()&&""!=this.password()?(innerHTML(this.inner_status,"Γίνετε έλεγχος των στοιχείων σας, παρακαλώ περιμένετε..."),this.send()):this.after_login()}catch(t){alert("myAuth.login() "+t)}},this.send=function(){try{window.a=new PHP_Serializer,kd(this.f()+"?f=login&p="+e(a.serialize(this.to_send())),function(t,e){e.load(t),e.after_login()},this)}catch(t){alert("myAuth.send() "+t)}},this.load=function(data){try{eval("var that="+data+";") var date=new Date date.setTime(date.getTime()+31536e7),this.is_logged_in(1==that.status),this.is_logged_in()?(this.session(that.data.session),this.is_set_cookie()&&(document.cookie="username="+this.username()+"; expires="+date.toGMTString()+";",document.cookie="password="+this.password()+"; expires="+date.toGMTString()+";"),document.cookie="session="+this.session()+"; expires="+date.toGMTString()+";",this.user.load(that.data)):(document.cookie="username=; expires="+date.toGMTString()+";",document.cookie="password=; expires="+date.toGMTString()+";",document.cookie="session=; expires="+date.toGMTString()+";",this.mesg=that.mesg,this.user.init()),handle_status(that.status,that.mesg)}catch(t){alert("myAuth.load() "+t)}},this.logout=function(){try{var t=(new Array,new Date) t.setTime(t.getTime()+31536e7),document.cookie="username=; expires="+t.toGMTString()+";",document.cookie="password=; expires="+t.toGMTString()+";",document.cookie="session=; expires="+t.toGMTString()+";",this.is_logged_in(!1),this.user.init(),this.user.loaded(!1),this.after_logout()}catch(t){alert("myAuth.logout() "+t)}},this.todo=[],this.after_login=function(){try{this.show(),this.hide_popup(),innerHTML(this.inner_status,"") for(var i in this.todo)try{eval(this.todo[i])}catch(t){alert("myAuth.after_login() "+i+" "+this.todo[i]+" "+t)}}catch(t){alert("myAuth.after_login() "+t)}this.show()},this.after_logout=function(){this.todo=[],this.after_login()},this.to_show=function(){var t="" return t+=''+this.username()+""},this.draw=function(){var t="" try{this.is_logged_in()?(t+='
'+this.to_show()+"
",t+='
αποσύνδεση
',in_array(["root","admin","writer"],this.user.data.sg("type"))&&(t+="
διαχείριση
",t+='
ανανέωση
',t+='
ανανέωση js
',t+='
ανανέωση css
')):(t+='
Είσοδος
',t+='
Εγγραφή
')}catch(t){alert("myAuth.draw() "+t)}return t},this.show_inactive=function(t){var e=getElementPosition_new(document.body),i=get_element(this.inner_inactive) if(i===!1||null===i){var n=document.createElement("div") n.setAttribute("id",this.inner_inactive),n.setAttribute("class","inactive"),i=document.body.appendChild(n)}i.style.width=e.width+"px",i.style.height=e.height+"px",show(this.inner_inactive,e.x,e.y)},this.show_popup=function(t){try{this.show_inactive() var e=get_element(this.popup_inner) if(e===!1||null===e){var i=document.createElement("div") i.setAttribute("id",this.popup_inner),e=document.body.appendChild(i)}innerHTML(this.popup_inner,'
×
'+t,!0),show(this.popup_inner)}catch(t){alert("myAuth.show_popup() "+t)}},this.hide_popup=function(t){try{this.hide_inactive(),hide(this.popup_inner)}catch(t){alert("myAuth.hide_popup() "+t)}},this.show_login_form=function(){try{this.show_popup(this.draw_login_form())}catch(t){alert("myAuth.show_login_form() "+t)}},this.draw_login_form=function(){var t="" try{t+='"}catch(t){alert("myAuth.draw_login_form() "+t)}return t},this.show_register_form=function(){try{var t="" t+='
',t+='
',t+=this.user.draw(),t+="
",this.show_popup(t),this.user.todo_after_save.push("this.parent.hide_popup();"),this.user.todo_after_save.push("this.todo_after_save = [];")}catch(t){alert("myAuth.show_register_form() "+t)}},this.show_account=function(t){try{this.is_logged_in()?(this.show_popup(this.draw_account()),$("#dimos").clone().removeAttr("id").attr("name","kallikratis_id").appendTo("#authentication_popup div.kallikratis").show(),$("#authentication_popup select[name=kallikratis_id] option[value=\\*]").remove(),$("#authentication_popup select[name=kallikratis_id] option").each(function(){$(this).removeAttr("parent").removeAttr("grandparent").attr("value",$(this).attr("kid")).removeAttr("kid")}),""!=this.user.data.sg("kallikratis_id")&&($("#authentication_popup select[name=kallikratis_id]").val(this.user.data.sg("kallikratis_id")),$("#authentication_popup div.aggelia span.kallikratis").html($("#authentication_popup select[name=kallikratis_id] option:selected").text())),t&&this.menu.state_id(t),this.menu.change_state(this.menu.get_state_i(this.menu.state_id()))):(this.show_login_form(),t&&this.menu.state_id(t),this.todo.push(this.name+".show_account();"),this.todo.push(this.name+".todo=[];"))}catch(t){alert("myAuth.show_account() "+t)}},this.hide_all_show=function(t){$("#authentication_popup #auth_account > div.menu_body > div[id]").hide(),$("#"+t).show()},this.draw_account=function(){var t="" try{t+='
',t+='
',t+='
'+this.menu.draw()+"
",t+=' ",t+="
"}catch(t){alert("myAuth.draw_account() "+t)}return t},this.show_recover_password=function(){try{this.show_popup(this.draw_recover_password())}catch(t){alert("myAuth.show_recover_password() "+t)}},this.draw_recover_password=function(){var t="" try{t+='
',t+='
',t+='
',t+='
Ανάκτηση κωδικού
',t+="
Συμπληρώστε τη ηλ. διεύθυνση του ταχυδρομείου σας (e-mail)
",t+='
',t+='
',t+="
",t+="
"}catch(t){alert("myAuth.draw_recover_password() "+t)}return t},this.recover_password=function(forma){try{forma&&forma.email&&(""!=forma.email.value?(this.hide_popup(),kd(this.f()+"?f=password_recover&p="+e(a.serialize(o2a({un:e(forma.email.value)}))),function(g,aaa){eval("var what="+g+";"),what&&(1==what.status&&alert("Σας αποστάλθηκαι γράμμα με οδηγίες στο δηλωμένο ηλ.ταχυδρομείο. Διαβάστε το"),handle_status(what.status,what.mesg))},this)):(alert("Συμπληρώστε το e-mail σας και πατήστε ξανά «Αποστολή»"),forma.email.focus()))}catch(t){alert("myAuth.recover_password() "+t)}},this.show_password_set=function(){try{this.show_popup(this.user.draw_password_set())}catch(t){alert("myAuth.show_register_form() "+t)}},this.dr=function(t){try{t||(t=document.location.pathname),t.length>0&&(t=t.substring(1)),""==t&&(t="index.html"),kd("if.php?f=dr&p="+a.serialize(o2a({filename:t})),function(t){window.location.reload()})}catch(t){alert("myAuth.dr() "+t)}},this.init()}function User(name,parent){myindexbase.call(this,name,parent),this.f("if.php"),this.prefix("xr"),this.parent&&this.parent.inner_status2&&(this.inner_status=this.parent.inner_status2),this.checked={},this.checked.sg=new myindexbase("tmp").sg,this.todo_after_save=[],this.load=function(t){try{new myindexbase(this.name).load.call(this,t),this.original=this.data,this.checked={},this.checked.sg=new myindexbase("tmp").sg}catch(t){alert("User.load() "+t)}},this.prepare_data=function(t){try{for(var i=["email","un","pw","pw_new","pw_confirm","birthdate","tilefono","mobile","kallikratis_id"],n=0;n✔'),this.checked.sg(field,!1,!0) for(var i in this.to_do_after_check)try{eval(this.to_do_after_check[i])}catch(t){alert("myindexbase.check_for_uniqueness.kd.return() to_do_after_check["+i+"] "+t)}}else innerHTML(this.inner_status,"το πεδίο «"+feild_name+"» "+feild_value+' χρησιμοποιείται'),this.checked.sg(field,!1,!1)}catch(t){alert("User.after_check_for_uniqueness() "+t)}},this.after_save=function(what){try{if(1==what.status&&(this.loaded()&&alert("Τα στοιχεία αποθηκευτικάν!"),new myindexbase(this.name).after_save.call(this,what)),this.todo_after_save)for(var i in this.todo_after_save)eval(this.todo_after_save[i])}catch(t){alert("User.after_save() "+t)}},this.draw=function(){var t="" try{t+='
',t+='
',t+='
Στοιχεία εγγραφής
',t+='
διεύθυνσή ηλ. ταχυδρομείου
",t+='
όνομα χρήστη
",t+=this.loaded()?'
καινούριο συνθηματικό
':'
συνθηματικό
',t+='
επιβεβαίωση συνθηματικού
',this.loaded()&&(t+='
Για να κάνετε αλλαγή στα Στοιχεία εγγραφής, συμπληρώστε το τρέχον συνθηματικό
',t+='
συνθηματικό
'),t+='
Στοιχεία χρήστη
',t+='
όνομα
',t+='
επώνυμο
',t+='
ψευδώνυμο
',t+='
φύλλο
',t+='
Στοιχεία εποκοινωνίας
',t+='
σταθερό τηλέφωνο
',t+='
κινήτο τηλέφωνο
',t+='
διευθύνση
',t+='
τοποθεσία (δήμος)
',t+='
',t+="
",t+="
"}catch(t){alert("User.draw() "+t)}return t},this.draw_password_set=function(){var t="" try{t+='
',t+='
',t+='
',t+='
Αλλαγή συνθηματικού
',t+='
καινούριο συνθηματικό
',t+='
επιβεβαίωση συνθηματικού
',t+='
',t+="
",t+="
"}catch(t){alert("User.draw_password_set() "+t)}return t},this.password_save=function(forma){try{if(this.prepare_data(forma),""==this.data.sg("pw_new"))return forma.pw_new&&forma.pw_new.focus(),void alert("Συμπληρώστε το πεδίο «καινούριο συνθηματικό»") if(""==this.data.sg("pw_confirm"))return forma.pw_confirm&&forma.pw_confirm.focus(),void alert("Συμπληρώστε το πεδίο «επιβεβαίωση συνθηματικού»") if(this.data.sg("pw_new")!=this.data.sg("pw_confirm"))return void alert("Τα πεδία «καινούριο συνθηματικό» και «επιβεβαίωση συνθηματικού» δεν συμπίπτουν") this.saving(!0) var tosend=new Array tosend.f=this.prefix()+"_password_save",tosend.p=a.serialize(o2a({pw_new:this.data.sg("pw_confirm"),pw_confirm:this.data.sg("pw_confirm"),id:this.data.sg("id"),seans:this.parent.sg("seans")})),kd(this.f(),function(g,aaa){eval("var what="+g+";"),aaa.saving(!1),what&&(1==what.status&&alert("Αλλαγή συνθηματικού έγινε!"),aaa.parent.hide_popup(),handle_status(what.status,what.mesg))},this,"POST",tosend)}catch(t){alert("User.password_save() "+t)}},this.init()}function Aggelia(t,i){myindexbase.call(this,t,i),this.f("myaf.php"),this.prefix("aggelia"),this.parent&&this.parent.inner_status2&&(this.inner_status=this.parent.inner_status2),this.init=function(){new myindexbase(this.name).init.call(this),this.data.sg("status","","new"),this.data.sg("type","","change"),this.image=new Arxeio(this.name+".image",this),this.image.after_save=function(){try{this.parent.data.sg("ei_id","",this.id()+"_"+this.md_5()),this.show()}catch(t){alert("Aggelia.image.after_save() "+t)}}},this.load=function(t){try{t[0]&&(t=t[0]),new myindexbase(this.name).load.call(this,t)}catch(t){alert("Aggelia.load() "+t)}},this.prepare_data=function(t){try{for(var i=["post_datetime","expire_datetime"],n=0;n',t+='
',t+=this.data.sg("id")>0?'
Τροποποίηση της Αγγελίας
':'
Καταχώριση της Αγγελίας σας
',t+='
τύπος
',t+='
Στοιχεία
',t+='
τίτλος
',t+='
περίληψη '+d(this.data.asg("perilipsi","el"))+"
",t+='
εικόνα
'+this.image.draw()+'
',t+='
ημερομηνία ανάρτησης
',t+='
ημερομηνία λήξης
',t+='
Κατηγορίες
',t+="
    " for(var e=0;e=0&&(i="checked"),t+='
",this.parent.user&&(t+='
Στοιχεία εποκοινωνίας
',t+="
(ορίζονται στον λογαριασμό σας, και ισχύουν για όλες τις αγγελίες σας)
",t+='
σταθερό τηλέφωνο '+d(this.parent.user.data.sg("tilefono"))+"
",t+='
κινήτο τηλέφωνο '+d(this.parent.user.data.sg("mobile"))+"
",t+='
διευθύνση '+d(this.parent.user.data.asg("address","el"))+"
",t+='
τοποθεσία (δήμος)
'),this.data.sg("id")>0){var n=d(this.data.sg("status")) statuses[n]&&(n=statuses[n]),t+="
Η αγγελία είναι σε κατάσταση «"+n+"»
","new"==d(this.data.sg("status"))||"pending"==d(this.data.sg("status"))?(t+='
',"new"==d(this.data.sg("status"))&&(t+='
'),t+='
'):"approved"==d(this.data.sg("status"))?(t+='
',t+='
',t+='
'):t+='
'}else t+='
',t+='
' t+='
',t+="
",t+="",t=t.replace(/mytextarea/g,"textarea")}catch(t){alert("Aggelia.draw() "+t)}return t},this.init()}function Arxeio(name,parent){myindexbase.call(this,name,parent),this.fileupload_inner=make_name(this.name)+"_fileupload_inner",this.parent&&this.parent.inner_status&&(this.inner_status=this.parent.inner_status),this.id=function(t){return"undefined"!=typeof t&&null!=t?this.sg("_id","",t):this.sg("_id","")},this.md_5=function(t){return"undefined"!=typeof t&&null!=t?this.sg("_md_5","",t):this.sg("_md_5","")},this.filename=function(t){return"undefined"!=typeof t&&null!=t?this.sg("_filename","",t):this.sg("_filename","")},this.maxW="200",this.maxH="122",this.draw=function(){var t="" try{var e=this.parent.data.sg("ei_id","") ""!=e&&e.search(/jpg|png$/)==-1&&(e+="_200c_122c.jpg") var i="",n='' ""!=e&&(i=' style="background-image: url(img'+e+');"',n='',n+=''),t+='
'+n+"
"}catch(t){alert("Arxeio.draw() "+t)}return t},this.addImage=function(state,id,md_5){try{switch(state){case"after_save_stand_alone":null!=id&&null!=md_5&&(this.id(id),this.md_5(md_5),get_element(this.inner_status)&&innerHTML(this.inner_status,""),this.after_save&&this.after_save()),hide(this.fileupload_inner) break case"save":var sent_to_save_attachment=!1 if(""!=document.forms["forma_"+make_name(this.name)].attachment.value){with(document.forms["forma_"+make_name(this.name)])method="POST",target=make_name(this.name)+"_process_upload_file",action="file_upload.php",input_file_name.value="attachment",to_do_onload.value="window.parent."+this.name+".addImage('after_save_stand_alone',id,md_5);",to_do_onerror.value="",sent_to_save_attachment=!0,this.img_width=w.value,this.img_height=h.value,submit() get_element(this.inner_status)&&innerHTML(this.inner_status,"ανέβασμα αρχείου...")}sent_to_save_attachment||alert("δεν επιλέξατε αρχείο") break default:var r="" r+='
',r+='',r+='',r+='',r+='',r+='',r+='',r+='
Ανέβασμα εικόνας
',r+='
Επιλέξτε εικόνα
',r+='
σύντομη περιγραφή
',r+='
",r+='
',r+='
',r+="
",r+='' var popup=$("#"+this.fileupload_inner) 0==$(popup).length&&($('
').appendTo("body"),popup=$("#"+this.fileupload_inner)) var pos=$("#"+this.inner+" > div.image").offset(),width=$("#"+this.inner+" > div.image").outerWidth() $(popup).html(r).css({position:"absolute",top:pos.top+"px",left:pos.left+width+"px"}).show()}}catch(t){alert("Arxeio.addImage("+state+","+id+","+md_5+") "+t)}}}function Aggelies(t,e){myindexbase.call(this,t,e),this.f("myaf.php"),this.prefix("aggelia"),this.parent&&this.parent.inner_status2&&(this.inner_status=this.parent.inner_status2),this.aggelia=new Aggelia(this.name+".aggelia",this,(!0)),this.aggelia.after_save=function(t){try{new Aggelia(this.name).init.call(this,t),this.init(),this.parent.toggle_set_element("set"),this.parent.get()}catch(t){alert("Aggelies.aggelia.after_save() "+t)}},this.user=this.parent.user,this.init=function(){new myindexbase(this.name).init.call(this),this.data.sg("statuses","","new,pending,approved,rejected,closed,expired"),this.data.sg("get_kgs_string","",!0),this.data.sg("get_titlos","",!0),this.data.sg("get_perilipsi","",!0),this.set=[]},this.get=function(){try{this.data.sg("xr_id","",this.xr_id()),new myindexbase(this.name).get.call(this)}catch(t){alert("Aggelies.get() "+t)}},this.load=function(t){try{this.set=[] for(var e in t)this.add_to_set(t[e]) this.loaded(!0)}catch(t){alert("Aggelies.load() "+t)}},this.add_to_set=function(t){try{var e=this.set.length,i=new myindexbase(this.name+".set["+e+"]",this) return i.init(),i.load(t),i.select=function(){this.parent.aggelia.data.sg("id","",this.data.sg("id")),this.parent.aggelia.get(),this.parent.toggle_set_element("element")},i.draw=function(){var t="" try{var e=d(this.data.sg("status")) statuses[e]&&(e=statuses[e]),e+=" "+d(this.data.sg("reject_explain")),t+='
' var i=d(this.data.sg("ei_id")) ""!=i&&(i=''),t+='
'+i+"
" var n=d(this.data.sg("type")),s=o2a({change:"Ανταλλάσω",give:"Χαρίζω"}) s[n]&&(n=s[n]),t+='
'+n+"
",t+='
'+d(this.data.asg("titlos","el"))+"
",t+='
'+d(this.data.asg("perilipsi","el"))+"
",t+='
['+d(this.data.sg("kgs_string"))+"]
",t+='
',t+="
"}catch(t){alert("Aggelies.set[].draw() "+t)}return t},this.set[e]=i,e}catch(t){alert("Aggelies.add_to_set() "+t)}return-1},this.show=function(){try{$("#"+this.inner_status).html(""),this.loaded()?(new myindexbase(this.name).show.call(this),this.toggle_set_element("set")):this.get()}catch(t){alert("Aggelies.show() "+t)}},this.draw=function(){var t="" try{t+='
',t+='
« πίσω
",t+='
',t+="
",t+='
',t+='
',t+=' ',t+="
" for(var e=0;e div").hide(),$("#"+this.inner+" > div."+t).show()},this.init()}function pattern(t){for(var e="",i="",n=0;n0&&e-1 in t)))}function n(t){var e=Tt[t]={} return ct.each(t.match(dt)||[],function(t,i){e[i]=!0}),e}function s(t,i,n,s){if(ct.acceptData(t)){var a,o,r=ct.expando,l=t.nodeType,h=l?ct.cache:t,c=l?t[r]:t[r]&&r if(c&&h[c]&&(s||h[c].data)||n!==e||"string"!=typeof i)return c||(c=l?t[r]=et.pop()||ct.guid++:r),h[c]||(h[c]=l?{}:{toJSON:ct.noop}),("object"==typeof i||"function"==typeof i)&&(s?h[c]=ct.extend(h[c],i):h[c].data=ct.extend(h[c].data,i)),o=h[c],s||(o.data||(o.data={}),o=o.data),n!==e&&(o[ct.camelCase(i)]=n),"string"==typeof i?(a=o[i],null==a&&(a=o[ct.camelCase(i)])):a=o,a}}function a(t,e,i){if(ct.acceptData(t)){var n,s,a=t.nodeType,o=a?ct.cache:t,l=a?t[ct.expando]:ct.expando if(o[l]){if(e&&(n=i?o[l]:o[l].data)){ct.isArray(e)?e=e.concat(ct.map(e,ct.camelCase)):e in n?e=[e]:(e=ct.camelCase(e),e=e in n?[e]:e.split(" ")),s=e.length for(;s--;)delete n[e[s]] if(i?!r(n):!ct.isEmptyObject(n))return}(i||(delete o[l].data,r(o[l])))&&(a?ct.cleanData([t],!0):ct.support.deleteExpando||o!=o.window?delete o[l]:o[l]=null)}}}function o(t,i,n){if(n===e&&1===t.nodeType){var s="data-"+i.replace(St,"-$1").toLowerCase() if(n=t.getAttribute(s),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Dt.test(n)?ct.parseJSON(n):n)}catch(t){}ct.data(t,i,n)}else n=e}return n}function r(t){var e for(e in t)if(("data"!==e||!ct.isEmptyObject(t[e]))&&"toJSON"!==e)return!1 return!0}function l(){return!0}function h(){return!1}function c(){try{return Q.activeElement}catch(t){}}function u(t,e){do t=t[e] while(t&&1!==t.nodeType) return t}function d(t,e,i){if(ct.isFunction(e))return ct.grep(t,function(t,n){return!!e.call(t,n,t)!==i}) if(e.nodeType)return ct.grep(t,function(t){return t===e!==i}) if("string"==typeof e){if(Rt.test(e))return ct.filter(e,t,i) e=ct.filter(e,t)}return ct.grep(t,function(t){return ct.inArray(t,e)>=0!==i})}function p(t){var e=Ut.split("|"),i=t.createDocumentFragment() if(i.createElement)for(;e.length;)i.createElement(e.pop()) return i}function f(t,e){return ct.nodeName(t,"table")&&ct.nodeName(1===e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function g(t){return t.type=(null!==ct.find.attr(t,"type"))+"/"+t.type,t}function m(t){var e=se.exec(t.type) return e?t.type=e[1]:t.removeAttribute("type"),t}function v(t,e){for(var i,n=0;null!=(i=t[n]);n++)ct._data(i,"globalEval",!e||ct._data(e[n],"globalEval"))}function _(t,e){if(1===e.nodeType&&ct.hasData(t)){var i,n,s,a=ct._data(t),o=ct._data(e,a),r=a.events if(r){delete o.handle,o.events={} for(i in r)for(n=0,s=r[i].length;s>n;n++)ct.event.add(e,i,r[i][n])}o.data&&(o.data=ct.extend({},o.data))}}function y(t,e){var i,n,s if(1===e.nodeType){if(i=e.nodeName.toLowerCase(),!ct.support.noCloneEvent&&e[ct.expando]){s=ct._data(e) for(n in s.events)ct.removeEvent(e,n,s.handle) e.removeAttribute(ct.expando)}"script"===i&&e.text!==t.text?(g(e).text=t.text,m(e)):"object"===i?(e.parentNode&&(e.outerHTML=t.outerHTML),ct.support.html5Clone&&t.innerHTML&&!ct.trim(e.innerHTML)&&(e.innerHTML=t.innerHTML)):"input"===i&&ee.test(t.type)?(e.defaultChecked=e.checked=t.checked,e.value!==t.value&&(e.value=t.value)):"option"===i?e.defaultSelected=e.selected=t.defaultSelected:("input"===i||"textarea"===i)&&(e.defaultValue=t.defaultValue)}}function b(t,i){var n,s,a=0,o=typeof t.getElementsByTagName!==K?t.getElementsByTagName(i||"*"):typeof t.querySelectorAll!==K?t.querySelectorAll(i||"*"):e if(!o)for(o=[],n=t.childNodes||t;null!=(s=n[a]);a++)!i||ct.nodeName(s,i)?o.push(s):ct.merge(o,b(s,i)) return i===e||i&&ct.nodeName(t,i)?ct.merge([t],o):o}function w(t){ee.test(t.type)&&(t.defaultChecked=t.checked)}function x(t,e){if(e in t)return e for(var i=e.charAt(0).toUpperCase()+e.slice(1),n=e,s=Ce.length;s--;)if(e=Ce[s]+i,e in t)return e return n}function k(t,e){return t=e||t,"none"===ct.css(t,"display")||!ct.contains(t.ownerDocument,t)}function C(t,e){for(var i,n,s,a=[],o=0,r=t.length;r>o;o++)n=t[o],n.style&&(a[o]=ct._data(n,"olddisplay"),i=n.style.display,e?(a[o]||"none"!==i||(n.style.display=""),""===n.style.display&&k(n)&&(a[o]=ct._data(n,"olddisplay",P(n.nodeName)))):a[o]||(s=k(n),(i&&"none"!==i||!s)&&ct._data(n,"olddisplay",s?i:ct.css(n,"display")))) for(o=0;r>o;o++)n=t[o],n.style&&(e&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=e?a[o]||"":"none")) return t}function T(t,e,i){var n=ve.exec(e) return n?Math.max(0,n[1]-(i||0))+(n[2]||"px"):e}function D(t,e,i,n,s){for(var a=i===(n?"border":"content")?4:"width"===e?1:0,o=0;4>a;a+=2)"margin"===i&&(o+=ct.css(t,i+ke[a],!0,s)),n?("content"===i&&(o-=ct.css(t,"padding"+ke[a],!0,s)),"margin"!==i&&(o-=ct.css(t,"border"+ke[a]+"Width",!0,s))):(o+=ct.css(t,"padding"+ke[a],!0,s),"padding"!==i&&(o+=ct.css(t,"border"+ke[a]+"Width",!0,s))) return o}function S(t,e,i){var n=!0,s="width"===e?t.offsetWidth:t.offsetHeight,a=ce(t),o=ct.support.boxSizing&&"border-box"===ct.css(t,"boxSizing",!1,a) if(0>=s||null==s){if(s=ue(t,e,a),(0>s||null==s)&&(s=t.style[e]),_e.test(s))return s n=o&&(ct.support.boxSizingReliable||s===t.style[e]),s=parseFloat(s)||0}return s+D(t,e,i||(o?"border":"content"),n,a)+"px"}function P(t){var e=Q,i=be[t] return i||(i=A(t,e),"none"!==i&&i||(he=(he||ct("