/*
_____________
::    botikode    ::
¯¯¯¯¯¯¯¯¯¯¯¯¯
*/

function refresh() {
	location.reload();
}
function lehioa() {
	window.defaultStatus="Ricardo Óptico. En la calle Loyola nº 9 de San Sebastián.";
}

/*
____________________
::      edukiarentzat       ::
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
*/

function but_on(ni) {
	ni.className="buton";
	}
function but_of(ni) {
	ni.className="but";
	}
function servi(zein, zenbat){
	for (i = 1; i <= zenbat; i++) {
		document.getElementById("serv"+i).style.display="none";
	}
	if(zein!=0) {
		document.getElementById("serv"+zein).style.display="block";
	}
}

/*
_____________
::   lehio*pop   ::
¯¯¯¯¯¯¯¯¯¯¯¯¯
*/

function pop(url,name,features, myWidth, myHeight, isCenter) {
	if(window.screen)if(isCenter)if(isCenter=="1") {
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	flop=window.open(url,name,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
	flop.focus();
}
function popper(zein) {
		zabalera="619";
		altuera="387";
		if(zein==1) {
			pop('popup.htm?1','popi','status=yes',zabalera,altuera,'1');
		}else if(zein==2) {
			pop('popup.htm?2','popi','status=yes',zabalera,altuera,'1');
    		}
}
/*
_____________
::     cookie      ::
¯¯¯¯¯¯¯¯¯¯¯¯¯
*/

function saveCookie(name,value,days) {
        if (days) {
                var date = new Date();
                date.setTime(date.getTime()+(days*24*60*60*1000))
                var expires = "; expires="+date.toGMTString()
        }
        else expires = ""
        document.cookie = name+"="+value+expires+"; path=/"
}
function readCookie(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 deleteCookie(name) {
        saveCookie(name,"",-1)
}