function cookie_exists(Name) { // Slightly modified from Netscape's JavaScript guide. // We just want to know whether the cookie exists; // we don't care what its value is. var search = Name + "=" if (document.cookie.length > 0) { // if there are any cookies offset = document.cookie.indexOf(search) return (offset != -1); // offset != -1 means the cookie exists } // if document.cookie.length > 0 } // function cookie_exists function rate_page(rating) { var page, re, path; path=escape(document.location.pathname); re=/pictures\/.*\/.*\.html/; if (re.test(document.location.pathname)) { // Hack! page="../rating.html"; } else { page="rating.html"; } page= page + "?" + "page=" + path + "&title=" + escape(document.title) + "&rating=" + escape(rating) + (cookie_exists(path) ? "&ar=1" : "&ar=0"); rate_window=window.open(page, "rate_window_name", "hotkeys=yes,innerHeight=150,innerWidth=250,resizable=yes,scrollbars=yes"); //"directories,location,menubar,status,toolbar=no"); rate_window.focus(); }