+}
+
+/*
+ * GESTIONE DEI COOKIES
+ */
+function createCookie(name,value,hours,path) {
+ if (hours) {
+ var date = new Date();
+ date.setTime(date.getTime()+(hours*60*60*1000));
+ var expires = "; expires="+date.toGMTString();
+ }
+ else var expires = "";
+ document.cookie = name+"="+value+expires+"; path="+path;
+}
+
+function readCookie(name) {
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+ for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+ }
+ return null;
+}
+
+function eraseCookie(name) {
+ createCookie(name,"",-1);
+}
+
+function url_append_arg(url, name, value)
+{
+ var pos, sep, pref, rest;
+
+ if ((pos = url.indexOf('?'+name+'=')) == -1) {
+ pos = url.indexOf('&'+name+'=');
+ }
+ if (pos == -1) {
+ if ((pos = url.indexOf('?')) != -1)
+ sep = '&';
+ else
+ sep = '?';
+
+ return (url+sep+name+"="+encodeURIComponent(value));
+ }
+ else {
+ pref = url.substring(0, pos+1);
+ rest = url.substring(pos+1);
+ // alert("rest: "+rest+" pos: "+pos);
+ if ((pos = rest.indexOf('&')) != -1) {
+ rest = rest.substring(pos);
+ }
+ else {
+ rest = "";
+ }
+ return (pref+name+"="+encodeURIComponent(value)+rest);
+ }
+}
+
+function url_append_args(url)
+{
+ var i, ret;
+
+ ret = url;
+ for (i = 1 ; i < arguments.length-1 ; i+= 2) {
+ ret = url_append_arg(ret, arguments[i], arguments[i+1]);
+ }
+
+ return (ret);