<!--


function x () {
return;
}

function spoiler(msg)
{
  // Set up Page Colors & Table
  var s1 = 
    "<TITLE>SPOILER!</TITLE>" +
    "<LINK REL=STYLESHEET TYPE='text/css' HREF='http://dreamers.com/com/menu/estilo.css'>" +
    "<body bgcolor='#FFFFFF' class='fondo' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>" +
    "<table width='100%' border='0' cellspacing='0' cellpadding='0'>" +
    "<tr><td width='120'><img src='http://dreamers.com/imagenes/vacio.gif' width=120 height=5>" +
    "</td><td width='100%'>" +
    "<table width='100%' border='0' cellspacing='0' cellpadding='0'>" +
    "<tr><td class='text' bgcolor='#1060B1'>" +
    "<b><font color='#FFFFFF'>SPOILER</font></b>" +
    "</td></tr></table>"

  var s2 = "</td></tr><tr><td></td><td class='text2'>"
 
  var s3 =   
    "<div align='right'><FORM><INPUT TYPE='BUTTON' VALUE='Ea!'" +
                   "onClick='self.close()'>"  +
    "</FORM></td></tr></table>"

  var s4 = "</body>"
 
  popup = window.open("","spoiler","height=160,width=468,scrollbars=yes")
  popup.document.write(s1+s2+msg+s3+s4)
  popup.document.close()

}

/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var bustcachevar=0 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""
var ajaxloadingmsg = "<img src=/icons/ajax-loader.gif align=left> Cargando contenido. Por favor espera..." //HTML to show while ajax page is being feched, if applicable

function ajaxpage(url, containerid, adding, ajaxmsgID){
	var page_request = false
	if (window.XMLHttpRequest) // if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
	else if (window.ActiveXObject){ // if IE
		try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else
	return false

	page_request.onreadystatechange=function(){
		loadpage(page_request, containerid, adding, ajaxmsgID)
	}
	if (bustcachevar) //if bust caching of external page
	bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
	page_request.open('GET', url+bustcacheparameter, true)
	page_request.send(null)
}

function loadpage(page_request, containerid, adding, ajaxmsgID){
	if (page_request.readyState == 1 && ajaxmsgID){
		document.getElementById(ajaxmsgID).innerHTML=ajaxloadingmsg;
	}
	if (page_request.readyState == 2 && ajaxmsgID){
		document.getElementById(ajaxmsgID).innerHTML='';
	}
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
		if (adding){
			document.getElementById(containerid).innerHTML+=page_request.responseText
		}
		else{
			document.getElementById(containerid).innerHTML=page_request.responseText
		}
	}
}

function loadobjs(){
	if (!document.getElementById)
	return
	for (i=0; i<arguments.length; i++){
		var file=arguments[i]
		var fileref=""
		if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
			if (file.indexOf(".js")!=-1){ //If object is a js file
				fileref=document.createElement('script')
				fileref.setAttribute("type","text/javascript");
				fileref.setAttribute("src", file);
			}
			else if (file.indexOf(".css")!=-1){ //If object is a css file
				fileref=document.createElement("link")
				fileref.setAttribute("rel", "stylesheet");
				fileref.setAttribute("type", "text/css");
				fileref.setAttribute("href", file);
			}
		}
		if (fileref!=""){
			document.getElementsByTagName("head").item(0).appendChild(fileref)
			loadedobjects+=file+" " //Remember this object as being already added to page
		}
	}
}

function minientry(form,element,loadmsgID){
	var poststr = createpoststring(form)
	ajaxpage('/indices/minientry.cgi?'+poststr, element,'',loadmsgID)
}

function fastentry(form,element,loadmsgID,indice,lastnumero){
	var poststr = createpoststring(form,lastnumero);
	var cgiurl
	var apendum
	if (hasNumbers(indice)){
		cgiurl = '/indices/foros.cgi';
		apendum = '&puntuacion=NULL'
	}
	else{
		cgiurl = '/cgibin/foros.cgi';
	}
	ajaxpage(cgiurl+'?'+poststr+apendum, element,'',loadmsgID,lastnumero)
}

function hasNumbers(t){
	return /\d/.test(t);
}


function createpoststring(form,fastentry){
	var uid1=document.getElementById(form).uid.value //get value to post from a form field
	var comments=document.getElementById(form).comments.value //get value to post from a form field
	var indice=document.getElementById(form).indice.value //get value to post from a form field
	var entrada=document.getElementById(form).entrada.value //get value to post from a form field
	var poststr = "comments=" + escape(comments) + "&uid=" + encodeURI(uid1) + "&indice=" + encodeURI(indice);
	if (fastentry){
		poststr += "&fastentry=" + fastentry;
	}
	else{
		poststr += "&entrada=" + encodeURI(entrada);
	}
	return poststr;
}




function textoflota(indice,numero,uid,abierto){
	var Formi = "<form id=form"+indice+"/"+numero+"><input type=hidden name='uid' value="+uid+"><input type=hidden name='indice' value="+indice+"><input type=hidden name='entrada' value="+numero+">";
	Formi += "<textarea NAME=comments ROWS=1 COLS=50 WRAP=VIRTUAL class='a' style=\"width:365px\;\"></textarea> <a href=# onclick=\"cerrar('elemento"+indice+"/"+numero+"')\; mostrardiv('elementoup"+indice+"/"+numero+"')\; return false\;\" style=\"padding:2px; float:right; color:white; border:1px outset black; width:10px; display:block; background-color:midnightblue; margin:2px; font-family:Verdana,Geneva,Helvetica,Arial; font-size:8px; text-align:center;\">X</a>";
	Formi += "<a href=\"#\" style=\"padding:2px; float:right; color:white; border:1px outset black; width:50px; display:block; background-color:midnightblue; margin:2px; font-family:Verdana,Geneva,Helvetica,Arial; font-size:10px; text-align:center;\" onclick=\"minientry('form"+indice+"/"+numero+"','conts"+indice+"/"+numero+"','loadmsg"+indice+"/"+numero+"')\; return false;\">enviar</a></form>";
	var textoflota = "<div align=right ";
	if (abierto){
	textoflota += "style=display:none\; ";
	}
	textoflota += "id=elementoup"+indice+"/"+numero+"><a href=# onclick=\"mostrardiv('elemento"+indice+"/"+numero+"')\; cerrar('elementoup"+indice+"/"+numero+"')\; return false\;\">comentar</a></div>";
	textoflota += "<div id=loadmsg"+indice+"/"+numero+"></div>";
	textoflota += "<div id=elemento"+indice+"/"+numero+" ";
	if (!abierto){
	textoflota += "style=display:none\;>"
	}
	textoflota += Formi+"</div>";
	return textoflota;
}

function textoflotaBIG(indice,lastnumero,uid){
	var Formi = "<form id=form"+indice+"><input type=hidden name='uid' value="+uid+"><input type=hidden name='indice' value="+indice+"><input type=hidden name='fastentry' value="+lastnumero+"><input type=hidden name='entrada' value=''>";
	Formi += "<textarea NAME=comments ROWS=3 COLS=70 WRAP=VIRTUAL class='a' style=\"width:80%\; \"></textarea> <a href=# onclick=\"cerrar('elemento"+indice+"')\; mostrardiv('elementoup"+indice+"')\; return false\;\" style='float:right; padding:2px; color:white; border:1px outset black; width:12px; display:inline; background-color:midnightblue; margin:2px; font-family:Verdana,arial; font-weight:bold; font-size:9px; text-align:center;'>X</a>";
	Formi += "<a href=\"#\" style=\"padding:2px; float:right; color:white; border:1px outset black; width:50px; display:block; background-color:midnightblue; margin:2px; font-family:Verdana,arial; font-weight:bold; font-size:11px; text-align:center;\" onclick=\"fastentry('form"+indice+"','conts"+indice+"','loadmsg"+indice+"','"+indice+"','"+lastnumero+"')\; return false;\">enviar</a></form><div style='clear:both\;'></div>";
	var textoflota = "<div style=\"display:block\; cursor:text\; width:100\%\; margin-bottom:20px; background:none repeat scroll 0 0 #F4FBFF\; border:1px solid #38459E\; font-family:verdana,arial\; font-size:10px\;\" id=elementoup"+indice+" onclick=\"mostrardiv('elemento"+indice+"')\; cerrar('elementoup"+indice+"')\; return false\;\"><font color=#38459E>enviar un grito rapido</font></div>";
	textoflota += "<div id=elemento"+indice+" style='display:none\; clear:both\; '>"+Formi+"</div>";
	textoflota += "<div id=loadmsg"+indice+" style='padding-left:100px'></div>";
	return textoflota;
}

function CojerValorCookie(indice) {
	//indice indica el comienzo del valor
	var galleta = document.cookie
	//busca el final del valor, dado por ;, a partir de indice
	var finDeCadena = galleta.indexOf(";", indice)
	//si no existe el ;, el final del valor lo marca la longitud total de la cookie
	if (finDeCadena == -1)
		finDeCadena = galleta.length

	return unescape(galleta.substring(indice, finDeCadena))
	}

function CojerCookie(nombre) {
	var galleta = document.cookie
	//construye la cadena con el nombre del valor
	var arg = nombre + "="
	var alen = arg.length			//longitud del nombre del valor
	var glen = galleta.length		//longitud de la cookie

	var i = 0
	while (i < glen) {
		var j = i + alen			//posiciona j al final del nombre del valor
		if (galleta.substring(i, j) == arg)	//si en la cookie estamo ya en nombre del valor		
			return CojerValorCookie(j)	//devuleve el valor, que esta a partir de j

		i = galleta.indexOf(" ", i) + 1		//pasa al siguiente
		if (i == 0)
			break				//fin de la cookie
	}
	return null					//no se encuentra el nombre del valor
}
function checkuid(indice,lastnumero,abierto) {
	var valor = CojerCookie('city')
	var valorvar = new Array() 
	valorvar = valor.split("::")
	if (valorvar[0] == 'uid'){	var uid = valorvar[1];}
	if (uid){
		return textoflota(indice,lastnumero,uid,abierto);
	}
	else{
		if (abierto) {	
		return "necesitas estar logeado";
		}
		else{		
			return;	
		}
	}
}

function checkuidBIG(indice,lastnumero) {
	var valor = CojerCookie('city')
	var valorvar = new Array() 
	if (!lastnumero){lastnumero = 1;}
	valorvar = valor.split("::")
	if (valorvar[0] == 'uid'){	var uid = valorvar[1];}
	if (uid){
		return textoflotaBIG(indice,lastnumero,uid);
	}
	else{
		return;
	}
}

function mostrardiv(elem) {
	div = document.getElementById(elem);
	div.style.display = '';
}

function cerrar(elem) {
	div = document.getElementById(elem);
	div.style.display='none';
}

// zona de despliegue mediante ajax
	function getposOffset(what, offsettype){
		return (what.offsetParent)? what[offsettype]+this.getposOffset(what.offsetParent, offsettype) : what[offsettype]
	}

function desplegar(objid,anchorid,url) {
	var subobj=document.getElementById(objid)
	var horizontaloffset=15
	var verticaloffset =  - 3

	if (subobj.style.visibility == "visible"){
		subobj.style.visibility="hidden"
		return
	}
	var anchorobj=document.getElementById(anchorid)
	subobj.style.left=this.getposOffset(anchorobj, "offsetLeft") + horizontaloffset + "px"
	subobj.style.top=this.getposOffset(anchorobj, "offsetTop")+verticaloffset+"px"
	subobj.style.clip= "rect(0 auto auto 0)" //hide drop down box initially via clipping
	subobj.style.visibility="visible"
	subobj.onmouseout=function(e){hide(this, subobj, e)}
	if (subobj.style.backgroundColor == "LemonChiffon"){
		return
	}
	else{
		subobj.style.backgroundColor="LemonChiffon"; 
		ajaxpage(url, objid, '', objid);
	}
//	loadobjs('/icons/codigogritos.js');

}
function desplegarbasico(url,objid) {
	var subobj=document.getElementById(objid)

	if (subobj.style.display == "block"){
		subobj.style.display="none"
		return
	}
	subobj.style.display="block"
	if (subobj.style.backgroundColor == "Khaki"){
		return
	}
	else{
		subobj.style.backgroundColor="Khaki"; 
		ajaxpage(url, objid, '', objid);
	}
}

	function hide(activeobj, subobj, e){
		if (!isContained(activeobj, e)){
			window["hidetimer_"+subobj.id]=setTimeout(function(){
				subobj.style.visibility="hidden"
				subobj.style.left=subobj.style.top=0
				clearTimeout(window["glidetimer_"+subobj.id])
			}, '1000')
		}
	}

	function hidediv(subobjid){
		document.getElementById(subobjid).style.visibility="hidden"
	}

function isContained(m, e){
		var e=window.event || e
		var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
		while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
		if (c==m)
			return true
		else
			return false
	}

// -->
