// 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 VIDEO

function popup_video(id_media, id_grupo) {
if (typeof(id_grupo)=="undefined") id_grupo='';
if (typeof(id_media)=="undefined") id_media='';
popup('http://www.ciudad.com.ar/ar/portales/ciudadtv/popup.asp?ID_Media='+id_media+'&IDGrupo='+id_grupo,'Video','750','520','no','no');
}

function Ovr(src) {
	src.style.cursor = 'hand';
}

function Out(src) {
	src.style.cursor = 'default';
}

function Click(src) {
if(event.srcElement.tagName=='TD'){
src.children.tags('A')[0].click();
}
}

// CODIGO DEL POPUP DE CHAT

function popup_chat(canal) {
if (winwidth==760) {
url='http://www.ubbi.cl/chat/javachat.asp?res=2&chan=' + canal;
} else {
url='http://www.ubbi.cl/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);
	}
}
}