function DesactivarSolapa(solapa) {
eval("window." + solapa + ".className='solapa-off'");
}

function Clk(src,solapa) {
	//DesactivarSolapa(SolapaActiva);
	//SolapaActiva = solapa;
	//src.className='solapa-on';

	if (solapa=="solapa1") { // En la Web
		if (document.search.q.value=="") {
			window.location.href="home.asp";
		} else {
			document.search.action="resultados.asp";
			document.search.submit();
		}
	}
	if (solapa=="solapa2") { // Directorio
		if (document.search.q.value=="") {
			window.location.href="home_directorio.asp";
		} else {
			document.search.action="resultados.asp";
			document.search.cat.value="gwd/Top/World";
			document.search.ie.value="utf8";
			document.search.submit();
		}
	}
	if (solapa=="solapa3") { // Imágenes
		if (document.search.q.value=="") {
			window.location.href="home_imagenes.asp";
		} else {
			document.search.action="imagenes.asp";
			document.search.submit();
		}
	}
}

function Ovr(src) {
src.style.cursor = 'hand';
}

function Out(src) {
src.style.cursor = 'default';
}

function validavacios(form1)
{
if (form1.q.value == "")
{
alert("Para realizar una búsqueda debes ingresar una palabra clave");
form1.q.focus();
return (false);
}
return true;
}

function topicforos(topicid)
{
window.location.href="foros/topic.asp?topic_id="+topicid;
}

// CODIGO DE DETECCION DE LA RESOLUCION PARA DETERMINAR EL TAMAÑO DEL POPUP

agent = navigator.userAgent;
if (parseInt(agent.substring(8,9)) > 3) {
if (screen.width >= 800) {
winwidth = 760;
winheight = 550;
} else {
winwidth = 620;
winheight = 420;
}
}
if (parseInt(agent.substring(8,9)) <= 3) {
winwidth = 620;
winheight = 420;
}

// CODIGO DEL POPUP NORMAL CENTRADO

function popup(url,name,width,height,resize,scroll) {
var dialogWin = new Object();
dialogWin.width = width;
dialogWin.height = height;
now = new Date();
var millis=now.getTime();
var mstr=""+millis;
if (navigator.appName == "Netscape") {
dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2);
dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2);
var attr = 'screenX=' + dialogWin.left + ',screenY=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
} else if (document.all) {
dialogWin.left = (screen.width - dialogWin.width) / 2;
dialogWin.top = (screen.height - dialogWin.height) / 2;
var attr = 'left=' + dialogWin.left + ',top=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
}
// AGREGA EL CODIGO ANTI-CACHING
tienesp=false;
for (i=0; i<url.length; i++)
if (url.charAt(i)=='?')
tienesp=true;
if (tienesp)
nocach='&nocache='+mstr;
else
nocach='?nocache='+mstr;
window.open(url + nocach ,name,attr);
}

// CODIGO DEL POPUP DE CHAT

function popup_chat(canal) {
if (winwidth==760) {
url='chat/javachat.asp?res=2&chan=' + canal;
} else {
url='chat/javachat.asp?res=1&chan=' + canal;
}
popup(url,'Chat',winwidth,winheight,'no','no');
}

function chat() {
var s;
s=document.chat_login.canal[document.chat_login.canal.selectedIndex].value;
if (document.chat_login.canal.selectedIndex!=0) {
	if (s=='mas') {
		location.href='home.asp';
	} else {
		popup_chat(s);
	}
}
}
function window.onload()
{
	document.search.q.focus();
}
