//Variables Globales
var visitas;

function agregar() 
{
	document.AddFavorite('http://www.portallaplata.com.ar','Portal La Plata');
}

function iniciar(cantVisitas) {
writeCookie('yb',-1,0); //Quitar en internet

	if(!readCookie('yb')) 
		{var vv=window.open('http://www.portallaplata.com.ar/pop_under.html?'+cantVisitas,'plp','resizable=no,toolbar=no,status=no,scrollbars=auto,location=no,menubar=no,directories=no,width=770,height=86,top=50,left=0');}
		{writeCookie('yb','yaBasta',1);} //1
	window.focus;document.focus;
}


function hhpp() {
visitas=location.href.substring(location.href.lastIndexOf("?")+1);
var gue='http://portallaplata.com.ar/guia/guia_comercios.asp?v='+visitas;

var ini=document.all.ini; //writeCookie('hp',visitas,0);	//temporal
//Guardamos una cookie para no molestar al preguntar.
var c=readCookie('hp');
c=0; // sacar
if(!c){
	writeCookie('hp',visitas,240);	
	var cc=readCookie('hp');
	if(cc){
		ini.style.behavior='url(#default#homepage)';
		if (! ini.isHomePage(gue))
			{ ini.setHomePage(gue);
			if (! ini.isHomePage(gue)) { //imprimo la imagen JPG
				//alert(" aaa "+cc);
				window.close();
				};
			}
		}
	}
}

//Funciones generales del sitio (-:

function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
};


function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
};//end function



/* en desuso */
function linkear_2(lin, tit) {
htm="<table width=450 border=1 cellpadding=2 cellspacing=0 bordercolor=#000066>"+
	"<tr><td bgcolor=#000066>"+
		"<font color=#FFFFFF>&nbsp;<b>Agreg&aacute; un link a esta p&aacute;gina:</b></font>"+
	"</td></tr>"+
	"<tr><td>Copi&aacute; el c&oacute;digo del cuadro de texto y pegalo en tu p&aacute;gina."+
	"<center><textarea onFocus=\"select();\" name=textarea cols=80 rows=2>"+
"&lt;a href=&quot;"+lin+"&quot; target=&quot;_blank&quot;&gt;"+tit+"&lt;/a&gt;"+
	"</textarea></center>"+
	"</td></tr>"+
	"</table>";
document.all.linkeanos.innerHTML=htm;
//document.write(htm);
}//end function


//document.onLoad=linkear(document.URL, "Clasificados");

function linkear(lin, tit) {
htm="<table width=450 border=1 cellpadding=2 cellspacing=0 bordercolor=#FF0000>"+
	"<tr><td bgcolor=#FF0000>"+
		"<font color=#FFFFFF>&nbsp;<b>Compart&iacute; esta p&aacute;gina:</b></font>"+
	"</td></tr>"+
	"<tr><td>Si ten&eacute;s un Blog o p&aacute;gina web, pod&eacute;s agregarle un link a esta secci&oacute;n.<br>"+
	"Copi&aacute; el c&oacute;digo del cuadro de texto y pegalo en tu web."+
	"<center><textarea onFocus=\"select();\" name=textarea cols=80 rows=2 wrap=off style=\"overflow:hidden;\">"+
"&lt;a href=&quot;"+lin+"&quot; target=&quot;_blank&quot;&gt;"+tit+"&lt;/a&gt;"+
	"</textarea></center>"+
	"</td></tr>"+
	"</table>";
//document.all.linkeanos.innerHTML=htm;
document.write(htm);
}//end function



var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}//end function



function validar_form_agregar(formulario) {
	f=formulario;sid=document.getElementById('sid');empty=document.getElementById('empty');empty.value=sid.value;
	return true
}//end function



function strToEmail(element) {
	patron = new RegExp(/([a-zA-Z0-9-._]+) \(arroba\) ([a-zA-Z0-9-]+) \(punto\) ([a-zA-Z0-9-.]+)/);
	//reemplazo = ' <span style="color:#0000FF; font-weight:bold" title="reemplazar los parentesis por la Arroba">$1(<img src="/imagenes/icono_arroba.gif" width="12" height="12" align="absmiddle"/>)$2.$3</span>';
	reemplazo = ' <span style="color:#0000FF; font-weight:bold" title="reemplazar los parentesis por la Arroba">$1<img src="/imagenes/icono_arroba.gif" width="12" height="12" align="absmiddle"/><span style=\"display:none\"> ARROBA </span>$2.$3</span>';
	str=element.innerHTML; //
	newstr = str.replace(patron,  reemplazo); 
	element.innerHTML=newstr;
	element.onclick= new function() {;};
	return true
}//end function

function l(url, txt, tooltip, target) {
	document.write('<a rel="nofollow" href="'+url+'" title="'+tooltip+'" target="'+target+'" >'+txt+'</a>');
}
//if(Math.round(Math.random()*500)!=1) {mws_o = new Object(); this.mws_o=mws_o; }