function mandarGalleta(nombre, valor, caducidad, path) {
  document.cookie = nombre + "=" + escape(valor) 
  + ((caducidad == null) ? "" : ("; expires=" + caducidad.toGMTString()))	
  + "; path="+ path;
}

var _uri = self.location.href;
var fec = new Date();
var anio = fec.getFullYear();
var mes = fec.getMonth()+1;
if(mes>11) {anio++; mes=1}
//var caducidad = new Date(2010,1,1,0,0,0);
var caducidad = new Date(anio,mes,1,0,0,0);

if (_uri.indexOf('/empresas')!=-1){
	mandarGalleta("portal","empresas",caducidad,"/");
}
else if (_uri.indexOf('/particulares')!=-1){
	mandarGalleta("portal","particulares",caducidad,"/");
}	