Object.size=function(b){var a=0,c;for(c in b){if(b.hasOwnProperty(c)){a++}}return a};function URLEncode(e){var d="";var a=0;e=e.toString();var f=/(^[a-zA-Z0-9_.]*)/;while(a<e.length){var c=f.exec(e.substr(a));if(c!=null&&c.length>1&&c[1]!=""){d+=c[1];a+=c[1].length}else{if(e[a]==" "){d+="+"}else{var b=e.charCodeAt(a);var g=b.toString(16);d+="%"+(g.length<2?"0":"")+g.toUpperCase()}a++}}return d}function URLDecode(e){var c=e;var a,d;var b=/(%[^%]{2})/;while((match=b.exec(c))!=null&&match.length>1&&match[1]!=""){a=parseInt(match[1].substr(1),16);d=String.fromCharCode(a);c=c.replace(match[1],d)}return c}function set_display_mode(node,mode,target){if(node){if(typeof node=="string"){node=document.getElementById(node)}if(node){if(target){var str="node."+target;node=eval(str)}if(node&&mode){node.style.display=mode}}}return}function trim(a){return LTrim(RTrim(a))}function LTrim(a){return a.replace(/^\s+/,"")}function RTrim(a){return a.replace(/\s+$/,"")}function LZ(a){a=parseInt(a,10);return(a<0||a>9?"":"0")+a}function ctrl_taille(b,f,a,g){if(typeof b=="string"){b=document.getElementById(b)}if(typeof a=="string"){a=document.getElementById(a)}if(typeof g=="string"){g=document.getElementById(g)}if(b&&a){var c=b.value;var d=c.length;var h=f-d;if(d==0){a.innerHTML=""}else{if(h>=0){a.innerHTML=(f-h)+"/"+f}else{var e=true;if(g){if(g.value!=c){e=true}else{e=false}}if(e){b.value=c.substring(0,f);if(g){g.value=b.value}}a.innerHTML=f+"/"+f}}}return}var userId=-1;var userSocialTitle=-1;var userName="";var userPseudo="";var userRole=-1;var userFirstname="";var userCountry=-1;var userEmail="";var userPassword="";var userActivationHash="";var userInfos="";function userInfo(b,a,c){this.field=b;this.check=a;this.infos=c}function GetHashFromQS(){var c="";var f="";var e=window.document.location.href.split("?");var b=e[0];if(e.length==2){f=e[1]}if(f){var a=new RegExp(/[&]{0,1}activationhash=([\w]*)[&]{0,1}/);var d=a.exec(window.document.location.href);if(d&&d.length==2){c=d[1]}}return c}function GetHashFromCookie(){var a=readCookie("CommunityUserHash");return a}function GetHashCode(a){var b="";if(typeof userActivationHash=="string"&&userActivationHash!=""){b=userActivationHash}else{if(typeof a=="string"&&a!=""){b=a}else{b=GetHashFromQS()}}if(!b){b=GetHashFromCookie()}return b}function UpdateQueryHash(){var a="",b="";var d=window.document.location.href.split("?");var a=d[0];if(d.length==2){b=d[1]}if(b!=""){var c=GetHashFromQS();if(typeof c=="string"&&c!=""&&typeof userActivationHash=="string"&&userActivationHash!=c){a=window.document.location.href.replace(c,userActivationHash)}}else{if(typeof userActivationHash=="string"&&userActivationHash!=""){a+="?sitegroupeid="+my_ctes.sgrId+"&siteid="+my_ctes.sitId+"&activationhash="+userActivationHash+"&op=4"}}return a}function json2str(a){return JSON.stringify(a,null,"\t")}function KVPToJson(chaine,sep_1,sep_2){var ret={};if(chaine){try{if(!sep_1){sep_1="&"}else{if(sep_1=="|"){sep_1="\\"+sep_1}}if(!sep_2){sep_2="="}var s_regex="([^"+sep_2+"]+)("+sep_2+")([^"+sep_1+"?]+)"+sep_1+"?";var reg=new RegExp(s_regex,"g");ret=eval("({"+chaine.replace(reg,"'$1':'$3'").replace(/\'\'/g,"', '")+"})")}catch(e){}}return ret}function Disable_Field(b,a){if(b){if(typeof a=="undefined"){a=true}b.disabled=a}}function Enable_Field(b,a){Disable_Field(b,false)}function RAZ_node(a){if(a){while(a.firstChild){a.removeChild(a.firstChild)}}}function cree_node(b,a,d,e){var c;c=window.document.createElement(a);if(e){c.setAttribute("class",e);c.setAttribute("className",e)}if(d){c.innerHTML=d}b.appendChild(c);return c}function cree_input(b,a,d,e){var c;c=window.document.createElement("input");c.setAttribute("type",a);if(e){c.setAttribute("class",e);c.setAttribute("className",e)}if(d){c.innerHTML=d}b.appendChild(c);return c};
