/* DETECTOR DE BROWSER */
var ACTUAL_FONTSIZE = 11;
var SMALLEST_FONTSIZE = 11;
var LARGEST_FONTSIZE = 20;


function EnviarAmigo(id)
{
	window.open("enviaramigo.asp?id="+id,"EnviarAmigo","width=490, height=435, scrollbars=no");
}
function Buscar() {
	if (document.frmPrincipal.buscador.value.length < 3) {
		alert("Ingrese por favor al menos 3 letras.");
		return;
	} else {
		document.frmResultado.Titulo.value = document.frmPrincipal.buscador.value;
		document.frmResultado.submit();
	}
}

function BuscarV2(ret) {
	//Controlamos que la si existe la variable bloquear para evitar problemas
	//Cuando hay dos formularios distintos
	bloquear  = ( typeof(bloquear) == "undefined" ) ? 0 : bloquear ;
	ret       = ( typeof(ret) == "undefined" )      ? 0 : ret ;
	if (!bloquear){
  	if (document.frmPrincipal.buscador.value.length < 3) {
  		alert("Ingrese por favor al menos 3 letras.");
  		if (ret){
        return false;
      }
  	} else {
  	  window.location = "../herramientas/buscador.php?accion=buscar&donde=1&ultimos=30&texto=" + document.frmPrincipal.buscador.value;
  	  return false;
  	}
  }
}
function Votar(idx,cantidad) {
	for (i=0;i<cantidad;i++) {
		if (document.frmPrincipal.rEncuesta[i].checked) {
			window.open("../herramientas/check_cookies.php?IdxEncuesta="+idx+"&IdxOpcion="+document.frmPrincipal.rEncuesta[i].value,"Votar","width=387,height=290,top=150,left=150");
		}
	}
}
function EncuestasResultados(idx) {
	document.frmEncuestasResultados.IdxEncuesta.value = idx;
	document.frmEncuestasResultados.submit();
}
function BuscarYahoo() {
	if (document.frmPrincipal.pYahoo.value!="") {
		window.open("http://ar.search.yahoo.com/search/ar?p="+document.frmPrincipal.pYahoo.value,"Yahoo");
	}
}
function ChangeProp(objName,x,theProp,theValue) { //v6.0
  var obj = FindObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function masGrande() {
  ACTUAL_FONTSIZE = ACTUAL_FONTSIZE+1;
  if (ACTUAL_FONTSIZE > LARGEST_FONTSIZE) { ACTUAL_FONTSIZE = LARGEST_FONTSIZE }
  ChangeProp('texto','','style.fontSize',ACTUAL_FONTSIZE,'SPAN');
  ChangeProp('texto2','','style.fontSize',ACTUAL_FONTSIZE,'SPAN');
   //SaveActualFontSize();
  //extenderDIV();
}

function masChica() {
  ACTUAL_FONTSIZE = ACTUAL_FONTSIZE-1
  if (ACTUAL_FONTSIZE < SMALLEST_FONTSIZE) { ACTUAL_FONTSIZE = SMALLEST_FONTSIZE }
  ChangeProp('texto','','style.fontSize',ACTUAL_FONTSIZE,'SPAN');
  ChangeProp('texto2','','style.fontSize',ACTUAL_FONTSIZE,'SPAN');
  //SaveActualFontSize();
  //extenderDIV();
}

function LoadActualFontSize() {
  return;
  //NO UTILIZO LA COOKIE
  /*
  tempArray = document.cookie.split(";");
  for (tA = 0; tA < tempArray.length; tA++){
    if (tempArray[tA].indexOf('fontSize') > -1){
      fontSizeValue = tempArray[tA].split("=")
      ACTUAL_FONTSIZE = parseInt(fontSizeValue[1]);
    }
  }
  */
}

function FindObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) x=d.getElementById(n);
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=FindObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function SaveActualFontSize() {
  var expire = new Date ();
  expire.setTime (expire.getTime() + (6000 * 24 * 3600000));
  expire = expire.toGMTString();
  document.cookie="fontSize="+ACTUAL_FONTSIZE+"; path=/; expires="+expire;
}
function VerAlbum(id)
{
	window.open("ver_album.asp?id="+id,"VerAlbum","width=500, height=500, scrollbars=no");
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=257,height=170,left = 150,top = 150');");
}
