var word = new Array(); word[0] = GetCookie("word0"); word[1] = GetCookie("word1"); word[2] = GetCookie("word2"); word[3] = GetCookie("word3"); word[4] = GetCookie("word4"); word[5] = GetCookie("word5"); word[6] = GetCookie("word6"); word[7] = GetCookie("word7"); word[8] = GetCookie("word8"); word[9] = GetCookie("word9"); function ReList(){ qu.innerHTML=""; for (nLoop = 0; nLoop < 10; nLoop++) { qu.innerHTML+="
"+word[nLoop]+""; } } function BeforeK(){ var query = document.field.query.value; var flg = 0; for (nLoop = 0; nLoop < 10; nLoop++){ if(query == word[nLoop]){ flg = 1; } } if(query == ""){ flg = 1; } if (flg == 0){ for (nLoop = 0; nLoop < 9; nLoop++){ word[9-nLoop] = word[8-nLoop]; } word[0] = query; SetCookie("word0", word[0]); SetCookie("word1", word[1]); SetCookie("word2", word[2]); SetCookie("word3", word[3]); SetCookie("word4", word[4]); SetCookie("word5", word[5]); SetCookie("word6", word[6]); SetCookie("word7", word[7]); SetCookie("word8", word[8]); SetCookie("word9", word[9]); } } function GetCookie(key){ var tmp = document.cookie + ";"; var index1 = tmp.indexOf(key, 0); if(index1 != -1){ tmp = tmp.substring(index1,tmp.length); var index2 = tmp.indexOf("=",0) + 1; var index3 = tmp.indexOf(";",index2); return(unescape(tmp.substring(index2,index3))); } return(""); } function SetCookie(key, val){ document.cookie = key + "=" + escape(val) + ";expires=Fri, 31-Dec-2030 23:59:59;"; }