var bookmarkurl="http://www.terra.es/personal6/alanceta";
var bookmarktitle="Antonio Lanceta Aragonés";

function addbookmark(){
 if (document.all) 
  window.external.AddFavorite(bookmarkurl,bookmarktitle);
}

function getCookie(name){
	var cname = name + "=";               
	var dc = document.cookie;             
    if (dc.length > 0) {              
    	begin = dc.indexOf(cname);       
        if (begin != -1) {           
        	begin += cname.length;       
	        end = dc.indexOf(";", begin);
            if (end == -1) 
				end = dc.length;
            return unescape(dc.substring(begin, end));
        } 
    }
return null;
}

function setCookie(name, value, expires) {
//	alert(name);
//	alert(value);
//	alert(expires);
	document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

function txt_visitas_local(){

	var exp = new Date();                                   // make new date object
	var numerovisitas;
	exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 71)); // set it 31 days ahead

	numerovisitas=getCookie("visitas");
	if (numerovisitas == null){
		document.write("Tu primera visita");
		setCookie("visitas",1,exp);
		}
	else{
		document.write("Tus visitas: "+ eval(numerovisitas));
		setCookie("visitas", (eval(getCookie("visitas"))+1), exp);
		}
}
