if (window != top) top.location = location;

var slot=false;
var wi="0";
var wiv=null;
q=new Array(60);

function ReadCookies()
{
	if(GetCookie("input")!=null)
	{
		wiv=GetCookie('input');
	
		if(wiv.indexOf('¶')!=0)
			wi=wiv.substring(0,1)
	}
	
	if(GetCookie("bloque")!=null)
		r=unescape(GetCookie("bloque"));
	else
		r="";
	
	if(navigator.appName!="Microsoft Internet Explorer"||parseInt(navigator.appVersion)>=4)
	{
		q=r.split(";");
		
		if(wiv!=null&&wiv.indexOf("¶")>=0)
			slot=true;
	}
}

function GetCookie(name)
{
	arg = name + "=";
	i = 0;
	
	while( i<document.cookie.length )
	{
		j = i + arg.length;
		
		if( document.cookie.substring(i,j) == arg )
		{
			endstr = document.cookie.indexOf(";",j)
			if(endstr==-1)
				endstr = document.cookie.length
			return unescape(document.cookie.substring(j,endstr))
		}
	
		i = document.cookie.indexOf(" ", i) + 1;
		
		if(i==0)
			break;
	
	}
	
	return null;
}

function SetCookie(name,value)
{
	if(value!=null&&value!="")
	{
		var today=new Date();
		var expiry=new Date(today.getTime()+31536000000);
		document.cookie=name+"="+escape(value)+";expires="+expiry.toGMTString()+";path=/"
	}
}

var UrlLijst= new Array();
var maxAantal = 12;
var UrlGegevens= new Array();

function getPersLinks(Bloque) 
{ 
    cookieWaarde = GetCookie(Bloque);

    if (cookieWaarde=="*"||cookieWaarde==null)
    {
       return false;
    }
    else
    {
       UrlGegevens = cookieWaarde.split("¶¶");

       for (i=0; i < UrlGegevens.length; i++)
       {
            kruimel = UrlGegevens[i].split("  ");
            UrlLijst[i]= new persLink(kruimel[0], kruimel[1]);
       }

       return true;   
    }
}

function persLink(Url,Bijschrift)
{
	this.Url=Url;
	this.Bijschrift=Bijschrift;
}

function writeEmail( email, name )
{
	document.write('<a href=\"mailto:' + unescape(email) + '\">' + unescape(name) + '</a>');
}

function leftTrim(sString)
{
	while ((sString.substring(0,1) == ' ') || (sString.substring(0,6) == '&nbsp;'))
	{
		if (sString.substring(0,1) == ' ')
		{
			sString = sString.substring(1, sString.length);
		}
		else
		{
			sString = sString.substring(6, sString.length);
		}
	}
	return sString;
}

function wss( text )
{
	window.status = text;
	return true;
}

function wsc()
{
	return wss( '' );
}

function DW(Text)
{
	document.write(Text)
}

function BD(ColorNombre,Indice)
{
	DW('<div class=titulo_D1>&nbsp;' + ColorNombre.substring(1) + '</div>');
	DW('<div class=titulo_D_img>');
	DW('<a href=javascript:BAP(\"'+Indice+'\",\"\")><img src=\"/ha/i/o.gif\" width=\"18\" height=\"15\" alt=\"Restaurar este panel\"></a>');
	DW('</div>');
	DW('<div class=espacioH15></div>')
}

function BAP(Bloque,Valor)
{
	if(navigator.appName!="Microsoft Internet Explorer"||parseInt(navigator.appVersion) >= 4)
	{
		q[Bloque]=Valor;
		SetCookie('bloque',q.join(";"));
		top.location="./";
	}
	else 
		window.alert("Su Browser no permite esta función")
}

function mostrarGoogle(Q,D,P)
{
	DW('<div class=\"buscador\">');
	DW('<form method=\"GET\" action=\"http://www.homeargentina.com.ar/google/busqueda.asp\" id=\"formGoogle'+D+'\" name=\"formGoogle'+D+'\">');
	DW('<input type=\"hidden\" name=\"client\" value=\"pub-1417060769637127\">');
	DW('<input type=\"hidden\" name=\"forid\" value=\"1\">');
	DW('<input type=\"hidden\" name=\"channel\" value=\"9528442521\">');
	DW('<input type=\"hidden\" name=\"ie\" value=\"ISO-8859-1\">');
	DW('<input type=\"hidden\" name=\"oe\" value=\"ISO-8859-1\">');
	DW('<input type=\"hidden\" name=\"cof\" value=\"GALT:#808080;GL:1;DIV:#FFFFFF;VLC:1010C0;AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:1010C0;LC:1010C0;T:222222;GFNT:1010C0;GIMP:1010C0;FORID:11\">');
	DW('<input type=\"hidden\" name=\"hl\" value=\"es\">');
	DW('<table border=0 cellspacing=0 cellpadding=0 align=center><tr>');
	DW('<td><img src=\"http://homeargentina.com.ar/ha/i/google_cabezal.gif\" WIDTH=\"70\" HEIGHT=\"26\"></td>');
	DW('<td><input name=\"q\" type=\"text\" style=\"width:300px; margin-left:10px;\" value=\"' + Q + '\" onClick=\"this.select();\">');
	DW('<input type=\"submit\" value=\"Buscar en Google\" style=\"margin-left:10px;\"></td>');
	DW('</tr></table>');
	DW('</form>');
	DW('</div>');
}

function GoogleBar(Q,D,P)
{
	DW('<form method=\"GET\" action=\"http://www.homeargentina.com.ar/google/busqueda.asp\" id=\"formGoogle'+D+'\" name=\"formGoogle'+D+'\">');
	DW('<input type=\"hidden\" name=\"client\" value=\"pub-1417060769637127\">');
	DW('<input type=\"hidden\" name=\"forid\" value=\"1\">');
	DW('<input type=\"hidden\" name=\"channel\" value=\"9528442521\">');
	DW('<input type=\"hidden\" name=\"ie\" value=\"ISO-8859-1\">');
	DW('<input type=\"hidden\" name=\"oe\" value=\"ISO-8859-1\">');
	DW('<input type=\"hidden\" name=\"cof\" value=\"GALT:#808080;GL:1;DIV:#FFFFFF;VLC:1010C0;AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:1010C0;LC:1010C0;T:222222;GFNT:1010C0;GIMP:1010C0;FORID:11\">');
	DW('<input type=\"hidden\" name=\"hl\" value=\"es\">');
	DW('<input name=\"q\" type=\"text\" style=\"width:300px; margin-left:10px;\" value=\"' + Q + '\" onClick=\"this.select();\">');
	DW('<input type=\"submit\" value=\"Buscar en Google\" style=\"margin-left:10px;\">');
	DW('</form>');
}

function pu(u)
{
	var puv = window.open(u,'pu','toolbar=0,location=1,status=0,menubar=1,directories=0,scrollbars=1,resizable=1,width=950,height=550');
	window.focus();
}

