Code
<script>
function setCookie(cookieName,cookieValue,nMin) {
var today = new Date();
var expire = new Date();
if (nMin==null || nMin==0) nMin=1;
expire.setTime(today.getTime() + 60*1000*nMin);
document.cookie = cookieName+"="+escape(cookieValue)+ ";expires="+expire.toGMTString();
}
function getCookie(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 gohome() {
if(getCookie('myhomepage')) var link = unescape(getCookie('myhomepage'));
else var link = '/';
location.href = link;
}
</script>
Code
<select name="homeaddres" onchange="setCookie('myhomepage',this.value)">
<option selected value="/" >Главная</option>
<option value="/index/8" >Моя страница</option>
<option value="/load/" >Файлы</option>
<option value="/forum/" >Форум</option>
<option value="/publ/" >Статьи</option>
Комментарии: