function preload() {
        this.length = preload.arguments.length;
        for (var i = 0; i < this.length; i++) {
                this[i+1] = new Image();
                this[i+1].src = preload.arguments[i];
}}
if (document.images) {
        var stuff = new preload(
   		"menu1-on.gif",
		"menu2-on.gif",
		"menu3-on.gif",
		"menu4-on.gif",
		"menu5-on.gif",
		"menu6-on.gif",
		"menu7-on.gif");
}
function SetCookie (name, value)    {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (2 < argc) ? argv[2] : null;
var path = (3 < argc) ? argv[3] : null;
var domain = (4 < argc) ? argv[4] : null;
var secure = (5 < argc) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");  }

function getCookieVal (offset) 
{var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)break;}  return null;}

var bookmarkurl="http://gialloblu.net"
var bookmarktitle="Spider on The Web"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
nome2()}


function select(i) {
        if (document.images) {
                var src = document.images[i].src;
                var off = src.lastIndexOf("off");
                if (off != -1) {
                        var newsrc = src.substring(0,off) + "on";
                        document.images[i].src = newsrc + ".gif";}}
rozzone()}

function deselect(i) {
        if (document.images) {
                var src = document.images[i].src;
                var on = src.lastIndexOf("on");
                if (on != -1) {
                        var newsrc = src.substring(0,on) + "off" +
			src.substring(on + 2, src.length);
                        document.images[i].src = newsrc; }}

}

function rozzone(){
var rozzone = GetCookie('rozzone')-(-"1");
var expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
SetCookie("rozzone", rozzone, expdate, "/", null, false);
window.status="<"+GetCookie('username')+"> Pagine sfogliate:"+GetCookie('visite')+" Punteggio Rozzone:"+GetCookie('rozzone');

}

function nome2(){username=prompt('Ciao benvenuto in Spider on The web!!! Mi dici chi sei???',username)
var expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
SetCookie("username", username, expdate, "/", null, false);
top.location.reload();}



function rozzone100(){
var rozzone = GetCookie('rozzone')-(-"100");
var expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
SetCookie("rozzone", rozzone, expdate, "/", null, false)
alert('hey '+GetCookie('username')+'\r\rhai guatagnato 100 punti di punteggio rozzone!!!');
window.status="<"+GetCookie('username')+"> Pagine sfogliate:"+GetCookie('visite')+" Punteggio Rozzone:"+GetCookie('rozzone');
}

function conta(){
var visite = GetCookie('visite')-(-"1");
if (visite == "null"){addbookmark()} 
if (visite == null){addbookmark()} 
var expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
SetCookie("visite", visite, expdate, "/", null, false);
window.status="<"+GetCookie('username')+"> Pagine sfogliate:"+GetCookie('visite')+" Punteggio Rozzone:"+GetCookie('rozzone');
}
