var mylogin = ''; function change_category(cat,reload) { if (reload != 2) { mycategory = cat; setCategories(); } else { self.document.dbs.category.value = cat; self.document.dbs.submit(); } if (reload == 1) self.location.href = self.location.href; } function getCategories() { // var str = GetCookie("login"); // if (str != null) { // mylogin = str; // } // str = GetCookie("category" + mylogin); str = GetCookie("category"); if (str != null) { mycategory = str; } // str = GetCookie("personal" + mylogin); // var j=0; str = ''; if (str != null) { for (var i=str; i; i=i.substring (i.indexOf('&') + 1)) { mydb[j] = i.substring(0, i.indexOf('&', 0)); j++; } } } function setCategories() { var str =""; var expdate = new Date(); expdate.setTime (expdate.getTime() + (24*60*60*1000*365)); SetCookie("category", mycategory, expdate); // non si gestice la login // SetCookie("login", mylogin, expdate, '/'); // SetCookie("category" + mylogin, mycategory, expdate, '/'); // personal not handled when handled // for (var i=0; i < mydb.length; i++) { // str = str + mydb[i] + "&"; // } // SetCookie("personal" + mylogin, str, expdate, '/'); } function nick2cat (nick) { if(!nick) nick = mycategory; for (var i=0; i< categories.length; i++) { if (categories[i].nickname == nick) return categories[i] } return ; } function getcatprofile () { obj = nick2cat(); return obj.profile; } function category(cat) { obj = nick2cat(cat); self.document.write(obj.title); }