function set()
{
var then=new Date()
var str=document.all.txt1.value
then.setTime(then.getTime()+60*60*1000)
document.cookie="cookie1="+ str +";expires="+then.toGMTString()
}
function get()
{
var str=new String(document.cookie)
var cookiehead="cookie1="
var beginposition=str.indexOf(cookiehead)
if(beginposition!=-1)
{
document.all.txt1.value=str.substring(beginposition+cookiehead.length)
}
}
</script>
<body onload="get()">
<input type="text" name=txt1 onkeypress="set">
</body>