<!--
var iNoticia = 0;
var iCine = 0;
var iCineP = 0;
var iAgenda = 0;
var iAgendaP = 0;
var iFichaPeliculaLugar = 0;
var iFichaPeliculaLugarP = 0;
var sAuxNomLug = '';
var sCanal = '0';

function fImgResultadoCanal(c1, c2){
	var c = c1;
	if (c.indexOf('<')>-1){ c = c2;}
	
	var arrCanal = c.split(',')
	var canal = arrCanal[0];
	
//	alert(c1 + ' ' + c2);
	
	if(',1,2,3,'.indexOf(','+ canal + ',')>-1 || ',1,2,3,'.indexOf(','+ canal + ',')>-1){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-restaurantes.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1065");
		return true;
	}

/*
	if(',556,1550,2713,'.indexOf(','+ c1 + ',')>-1 || ',556,1550,2713,'.indexOf(','+ c2 + ',')>-1){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-Pubs.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1066");
		return true;
	}

	if(c1=='558' || c2=='558'){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-Discotecas.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1067");
		return true;
	}
*/
	if(c1=='Feria' || c2=='Feria'){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-FeriasEventos.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1077");
		return true;
	}

	if(c1=='1443' || c2=='1443'){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-CentroEventos.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1161");
		return true;
	}

	if(c1=='561' || c2=='561'){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-Moteles.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1069");
		return true;
	}
	
	if(',1285,1515,1662,1663,1664,1665,2636,6696,7037,7089,2717,7084,Hotel,'.indexOf(','+ canal + ',')>-1 || ',1285,1515,1662,1663,1664,1665,2636,6696,7037,7089,2717,7084,Hotel,'.indexOf(','+ canal + ',')>-1){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-hoteles.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1070");
		return true;
	}
  
	if(',559,560,'.indexOf(','+ canal + ',')>-1 || ',559,560,'.indexOf(','+ canal + ',')>-1){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-NightClubs.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1068");
		return true;
	}
 
	if(',1310,2797,7088,'.indexOf(','+ canal + ',')>-1 || ',1310,2797,7088,'.indexOf(','+ canal + ',')>-1){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-cine.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1072");
		return true;
	}
	
	if(c1=='Musica' || c2=='Musica'){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-MusicaFiestas.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1071");
		return true;
	}
	
	if(c1=='1313' || c2=='1313'){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-teatro.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1073");
		return true;
	}
	
	if(c1=='Libro' || c2=='Libro'){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-libros.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1076");
		return true;
	}
	
	if(',1562,1563,6801,1546,'.indexOf(','+ canal + ',')>-1 || ',1562,1563,6801,1546,'.indexOf(','+ canal + ',')>-1){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-arte.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1074");
		return true;
	}
	
	if(',556,1550,2713,558,7181,7182,7146,7147,'.indexOf(','+ canal + ',')>-1 || ',556,1550,2713,558,7181,7182,7146,7147,'.indexOf(','+ canal + ',')>-1){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-Discotecas.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1158");
		return true;
	}
	
	if(c1=='Carrete' || c2=='Carrete'){
		$('#imgResultadoCanal').attr("src", "images/v2/tit-home-Carretes.jpg");
		$('#linkResultadoCanal').attr("href", "/?id=1067");
		return true;
	}
	
	$('#imgResultadoCanal').attr("src", "images/v2/tit-home-800.jpg");
	$('#linkResultadoCanal').attr("href", "/");
}

function get_random(arr){
	return Math.round(Math.random() * (arr.length-1));
}

function fVerAyuda(v){
	var t = 'Ayuda';
	if(v=='VenDin_AyudaPrecios')
		t = 'Detalle sobre rango de valores';
	if(!document.getElementById('divboxhelp' + v)){
		divwin_itemhelp=dhtmlwindow.open('divboxhelp' + v, 'div', v, t, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else if(document.getElementById('divboxhelp' + v).style.display=='none'){
		divwin_itemhelp=dhtmlwindow.open('divboxhelp' + v, 'div', v, 'Ayuda', 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divboxhelp' + v))
	}
}

function fVentanas(v, t){
	if(!document.getElementById('divbox' + v)){
		divwin_Ventana = dhtmlwindow.open('divbox' + v, 'div', v, t, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_itemhelp = dhtmlwindow.open('divbox' + v, 'div', v, t, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}
}

function fVerListaBusRapida(sw){
	if(sw==1){
		document.getElementsByName('tBusRapida')[0].style.color='#000000';
		sAuxNomLug = document.getElementsByName('tBusRapida')[0].value;
		document.getElementsByName('tBusRapida')[0].value='';
		divwin_itemlist=dhtmlwindow.open('divboxBusRapida', 'div', 'VenDin_BusRapida', 'Lugares', 'width=330px,height=255px,' + fWinPosition('VenDin_BusRapida_Link') + 'resize=0,scrolling=1');
  	return false;
	}
	else{
		document.getElementsByName('tBusRapida')[0].style.color='#999999';
		document.getElementsByName('tBusRapida')[0].value=sAuxNomLug;
//		divwin_itemlist.close();
		return false;
	}
}

function fBusRapida(s){
	var o = document.getElementsByName('SelLista')
	for(i=0;i<o.length;i++){
		if(o[i].id.toLowerCase().indexOf(s.toLowerCase())>-1){
			o[i].style.display='';
		}
		else{
			o[i].style.display='none';
		}
	}
}

function fNoticias(sw){
	if(sw==0){
		if(iNoticia > 0){
			$('#tblNoticias tr td:eq(' + String(iNoticia + 4) + ')').hide();
			$('#tblNoticias tr td:eq(' + String(iNoticia) + ')').fadeIn('normal');
			iNoticia = iNoticia - 1;
		}
		else
			iNoticia = 0;
	}

	else{
		if(iNoticia + 4 < $('#tblNoticias tr td').length-2){
			iNoticia = iNoticia + 1;
			$('#tblNoticias tr td:eq(' + String(iNoticia) + ')').hide();
			$('#tblNoticias tr td:eq(' + String(iNoticia + 4) + ')').fadeIn('normal');
		}
	}
}

function fWinPosition(gb){
	var ns6 = (!document.all && document.getElementById);
	var ie4 = (document.all);
	var ns4 = (document.layers);
	
	if (ie4) {
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;
	}
	
	if (ns6) {
		x = window.scrollX;
		y = window.scrollY;
	}
	i=0;
	t=15;
	if(gb.indexOf('Guia')>-1)
		i=10;

	if(gb.indexOf('LoginUsuario')>-1)
		i=-100;
		
	if(gb.indexOf('BusRapida')>-1){
		t=25;
		i=15;
	}

	return 'left=' + String($('#' + gb).offset().left + i - x) + 'px,top=' + String($('#' + gb).offset().top + t - y) + 'px,';
}

function fAmpliarVentanas(s, i, o){
	if(o.src.indexOf('Ampliar.gif')>0){
		o.src='images/Ampliar2.gif';
		o.alt='Contraer'; o.title='Contraer';
		$("#" + s + " td").fadeIn();
		$("#" + s + "Mas").fadeIn();
		$("#" + s + "Link").fadeIn();
	}
	else{
		o.src='images/Ampliar.gif';
		o.alt='Ampliar'; o.title='Ampliar';
		$("#" + s + " td:gt(" + i + ")").fadeOut();
		$("#" + s + "Mas").fadeOut();
		$("#" + s + "Link").fadeOut();
	}
}

function fContraerVentanas(s, i){
		$("#" + s + " td:gt(" + i + ")").hide();
		$("#" + s + "Mas").hide();
		$("#" + s + "Link").hide();
}

function fCineApagar(){
	$('#tblCartelera').hide(); 
	$('#tblEstrenosCine').hide(); 
	$('#tblEstrenosDVD').hide(); 
}

function fCine(s, t, o){
	iCine = 0;
	fCineApagar();
	$('#' + s).fadeIn();
	
	document.getElementById('idTit_1').className = 'Cine'; 
	document.getElementById('idTit_2').className = 'Cine'; 
	document.getElementById('idTit_3').className = 'Cine'; 
	document.getElementById(t).className = 'CineSel';
	
	document.getElementById('itLink_1').className = 'CineLink'; 
	document.getElementById('itLink_2').className = 'CineLink'; 
	document.getElementById('itLink_3').className = 'CineLink'; 
	document.getElementById(o).className = 'CineLinkSel';
}

function fCines(s, sw){
	if(sw==0){
		if(iCine > 0){
			$('#' + s + ' tr td:eq(' + String(iCine + 4) + ')').hide();
			$('#' + s + ' tr td:eq(' + String(iCine) + ')').fadeIn('normal');
			iCine = iCine - 1;
		}
		else
			iCine = 0;
	}

	else{
		if(iCine + 4 < $('#' + s + ' tr td').length-2){
			iCine = iCine + 1;
			$('#' + s + ' tr td:eq(' + String(iCine) + ')').hide();
			$('#' + s + ' tr td:eq(' + String(iCine + 4) + ')').fadeIn('normal');
		}
	}
}

function fOcultarPeliculas(s, i){
		$("#tbl" + s + " td").hide('fast', function(){
			$("#tbl" + s + " td:lt(" + String(i+1) + ")").show();
			$("#tbl" + s + " td:last").show();
		});
}

var iFotoSocial = 0;
function fFotoSocial(){
	$('#tblFotoSocial tr td:eq(' + String(iFotoSocial) + ')').hide(); $('#tblFotoSocial tr td:eq(' + String(iFotoSocial + 1) + ')').hide();
	iFotoSocial = iFotoSocial + 2;
	if(iFotoSocial>=6)
		iFotoSocial = 0;
	$('#tblFotoSocial tr td:eq(' + String(iFotoSocial) + ')').fadeIn(); $('#tblFotoSocial tr td:eq(' + String(iFotoSocial + 1) + ')').fadeIn();
}

var iMasGuiasB = 0;
function fMasGuiasB(s){
	$('#' + s + '_TD UL:eq(' + String(iMasGuiasB) + ')').fadeOut("fast", 
				 function(){
					 iMasGuiasB = iMasGuiasB + 1;
					 if(iMasGuiasB>=$('#' + s + '_TD UL').length)
						iMasGuiasB = 0;
					 $('#' + s + '_TD UL:eq(' + String(iMasGuiasB) + ')').fadeIn("fast");
					 $('#' + s + '_TD A').css('color','blue');
					 $('#' + s + '_pag_' + String(iMasGuiasB+1)).css('color','red');
				}
		);
}

function fMasGuiasBDirecto(s, i){
	$('#' + s + '_TD UL:eq(' + String(iMasGuiasB) + ')').fadeOut("fast", 
				 function(){
					 	iMasGuiasB = i-1;
					 $('#' + s + '_TD UL:eq(' + String(iMasGuiasB) + ')').fadeIn("fast");
					 $('#' + s + '_TD A').css('color','blue');
					 $('#' + s + '_pag_' + String(iMasGuiasB+1)).css('color','red');
					});
}

function fPublicidad(s){
	var arrImg = document.getElementsByName(s);
	arrImg[get_random(arrImg)].style.display='';
}

function fHomeCine(s, i){
	iCineP = 0;
	if($('#div' + s).html()==''){
		fCineApagar();
		$("#div" + s).html('<img src="images/HomeLoad.gif" style="margin-bottom:110px;">');
		$("#div" + s).load("HomeCine.asp?op=" + i,{},function(){
			fCine(s, 'idTit_' + i, 'itLink_' + i);
		});
	}
	else{
		fCine(s, 'idTit_' + i, 'itLink_' + i);
	}
}

function fHomeAgenda(s, i){
	iAgendaP = 0;
	if($('#div' + s).html()==''){
		fAgendaApagar();
		$("#div" + s).show();
		$("#div" + s).html('<img src="images/HomeLoad.gif" style="margin-bottom:110px;">');
		$("#div" + s).load("HomeAgenda.asp?op=" + i,{},function(){
			fAgenda(s, 'idAgendaTit_' + i, 'itAgendaLink_' + i);
		});
	}
	else{
		fAgenda(s, 'idAgendaTit_' + i, 'itAgendaLink_' + i);
	}
}

function fCanalAgenda(s, i){
	iAgendaP = 0;
	if($('#div' + s).html()==''){
		fAgendaApagar();
		$("#div" + s).show();
		$("#div" + s).html('<img src="images/HomeLoad.gif" style="margin-bottom:110px;">');
		$("#div" + s).load("CanalAgenda.asp?op=" + i,{},function(){
			fAgenda(s, 'idAgendaTit_' + i, 'itAgendaLink_' + i);
		});
	}
	else{
		fAgenda(s, 'idAgendaTit_' + i, 'itAgendaLink_' + i);
	}
}

function fCanalAgendaHot(s, i){
	iAgendaP = 0;
	if($('#div' + s).html()==''){
		fAgendaApagar();
		$("#div" + s).show();
		$("#div" + s).html('<img src="images/HomeLoad.gif" style="margin-bottom:110px;">');
		$("#div" + s).load("CanalAgendaHot.asp?op=" + i,{},function(){
			fAgenda(s, 'idAgendaTit_' + i, 'itAgendaLink_' + i);
		});
	}
	else{
		fAgenda(s, 'idAgendaTit_' + i, 'itAgendaLink_' + i);
	}
}

function fFichaPeliculaLugar(s, i, o){
	iFichaPeliculaLugarP = 0;
	if($('#div' + s).html()==''){
		fFichaPeliculaLugarApagar();
		$("#div" + s).show();
		$("#div" + s).html('<img src="images/HomeLoad.gif" style="margin-bottom:110px;">');
		$("#div" + s).load("FichaPeliculaLugares.asp?i=" + i + "&op=" + o,{},function(){
			fFichaPeliculaLugares(s, 'idCarteleraTit_' + o, 'itCarteleraLink_' + o);
		});
	}
	else{
		fFichaPeliculaLugares(s, 'idCarteleraTit_' + o, 'itCarteleraLink_' + o);
	}
}

function fFichaPeliculaLugares(s, t, o){
	iFichaPeliculaLugar = 0;
	fFichaPeliculaLugarApagar();
	$('#divtblCarteleraSantiago').hide(); 
	$('#divtblCarteleraRegion').hide(); 
	$("#div" + s).show();
	$('#' + s).fadeIn();
	
	$('#CarteleraAmpVent_1').hide();
	$('#CarteleraAmpVent_2').hide();
	
	$('#' + t.replace('idCarteleraTit_', 'CarteleraAmpVent_')).show();
	
	document.getElementById('idCarteleraTit_1').className = 'Agenda'; 
	document.getElementById('idCarteleraTit_2').className = 'Agenda'; 
	document.getElementById(t).className = 'AgendaSel';
	
	document.getElementById('itCarteleraLink_1').className = 'AgendaLink'; 
	document.getElementById('itCarteleraLink_2').className = 'AgendaLink'; 
	document.getElementById(o).className = 'AgendaLinkSel';
}


function fFichaPeliculaLugarApagar(){
	$('#divtblCarteleraSantiago').hide(); 
	$('#divtblCarteleraRegion').hide(); 
}

function fAgendaApagar(){
	$('#tblAgendaSantiago').hide(); 
	$('#tblAgendaRegion').hide(); 
}

function fAgenda(s, t, o){
	iAgenda = 0;
	fAgendaApagar();
	$('#divtblAgendaSantiago').hide(); 
	$('#divtblAgendaRegion').hide(); 
	$("#div" + s).show();
	$('#' + s).fadeIn();
	
	$('#AgendaAmpVent_1').hide();
	$('#AgendaAmpVent_2').hide();
	
	$('#' + t.replace('idAgendaTit_', 'AgendaAmpVent_')).show();
	
	document.getElementById('idAgendaTit_1').className = 'Agenda'; 
	document.getElementById('idAgendaTit_2').className = 'Agenda'; 
	document.getElementById(t).className = 'AgendaSel';
	
	document.getElementById('itAgendaLink_1').className = 'AgendaLink'; 
	document.getElementById('itAgendaLink_2').className = 'AgendaLink'; 
	document.getElementById(o).className = 'AgendaLinkSel';
}

function fHomeVidaSocial(i, c){
	$("#FotoSocialMini").html('<img src="images/HomeLoad.gif">');
	$("#FotoSocialMini").load("HomeVidaSocial.asp?id=" + i + "&c=" + c);

/*
	$("#FotoSocialMini").load("HomeVidaSocial.asp?id=" + i, function(){
		$("#FotoSocialItems").append($("#DIVFotoSocial").html());
		
		if($("#FotoSocialItems > label").length>1){
			$("#FotoSocialItems > label:first").slideUp("normal", function(){
				$("#FotoSocialItems > label:first").remove();
			});
		}
	});
*/
}

function fCanalImperdibles(c){
	$("#DIVImperdibles").html('<img src="images/HomeLoad.gif" style="margin-bottom:76px;">');
	$("#DIVImperdibles").load("CanalImperdibles.asp?c=" + c);
}

function fHomeGuiaBLibros(v){
	iMasGuiasB = 0;
	
	if(!document.getElementById('divbox' + v)){
		$("#" + v + "_TD").load("HomeGuiasBLibros.asp", function(){
			divwin_VenDin_Restorantes = dhtmlwindow.open('divbox' + v, 'div', v, 'Para regalar a...', 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
		})
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_VenDin_Restorantes = dhtmlwindow.open('divbox' + v, 'div', v, 'Para regalar a...', 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}	
}

function fHomeGuiaB(c, v, s, x, k){
	iMasGuiasB = 0;
	
	if(!document.getElementById('divbox' + v)){
		$("#" + v + "_TD").load("HomeGuiasB.asp?c=" + c + "&v=" + v + "&x=" + x + "&k=" + k, function(){
			divwin_VenDin_Restorantes = dhtmlwindow.open('divbox' + v, 'div', v, 'GuíasB de ' + s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
		})
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_VenDin_Restorantes = dhtmlwindow.open('divbox' + v, 'div', v, 'GuíasB de ' + s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}
}

function fCanalGuiaB(o, c, v, s, x, k){
	if(!document.getElementById('divbox' + v)){
		$("#" + v).load("CanalGuiaB.asp?op=" + o + "&c=" + c + "&x=" + x + "&k=" + k + "&v=" + v, function(){
			divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
		})
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}
}

function fCanalRegionImperdibles(o, v, s){
	if(!document.getElementById('divbox' + v)){
		$("#" + v).load("HomeImperdiblesTodos.asp?c=" + o, function(){
			divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
		})
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}
}

function fHomeImperdibles(o, v, s){
	if(!document.getElementById('divbox' + v)){
		$("#" + v).load("HomeImperdiblesTodos.asp?c=" + o, function(){
			divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
		})
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}
}

function fHomeAtraccionesServicios(o, v, s, x, k){
	if(!document.getElementById('divbox' + v)){
		$("#" + v).load("HomeAtraccionesServicios.asp?c=" + o + "&x=" + x + "&k=" + k, function(){
			divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
		})
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}
}

function fHomeArriendaUn(v, s, x, k){
	if(!document.getElementById('divbox' + v)){
		$("#" + v).load("HomeArriendaUn.asp?x=" + x + "&k=" + k, function(){
			divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
		})
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}
}

function fHomeDestacamos(v, s){
	if(!document.getElementById('divbox' + v)){
		$("#" + v).load("HomeDestacamos.asp", function(){
			divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
		})
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}
}

function fHomeSectores(o, v, s, c, x, k){
	if(!document.getElementById('divbox' + v)){
		$("#" + v + "_TD").load("HomeSectores.asp?op=" + o + "&c=" + c + "&x=" + x + "&k=" + k, function(){
			divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
		})
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}
}

var iNoticiaP = 0;
function fNoticiasPaginacion(sw){
	if(sw==0){
		$('#tblNoticias tr td:visible').hide();
		$('#tblNoticias tr td:first').show();
		$('#tblNoticias tr td:last').show();
		iNoticiaP = iNoticiaP - 1;
		if(iNoticiaP < 0){
			iNoticiaP = parseInt(($('#tblNoticias tr td').length-2)/4);
		}
		$('#tblNoticias tr td:eq(' + String(iNoticiaP * 4 + 1) + '), #tblNoticias tr td:eq(' + String(iNoticiaP * 4 + 2) + '), #tblNoticias tr td:eq(' + String(iNoticiaP * 4 + 3) + '), #tblNoticias tr td:eq(' + String(iNoticiaP * 4 + 4) + ')').fadeIn('normal');
	}

	else{
		$('#tblNoticias tr td:visible').hide();
		$('#tblNoticias tr td:first').show();
		$('#tblNoticias tr td:last').show();
		iNoticiaP = iNoticiaP + 1;
		if(iNoticiaP * 4 >= $('#tblNoticias tr td').length-2){
			iNoticiaP = 0;
		}
		$('#tblNoticias tr td:eq(' + String(iNoticiaP * 4 + 1) + '), #tblNoticias tr td:eq(' + String(iNoticiaP * 4 + 2) + '), #tblNoticias tr td:eq(' + String(iNoticiaP * 4 + 3) + '), #tblNoticias tr td:eq(' + String(iNoticiaP * 4 + 4) + ')').fadeIn('normal');
	}
}

var iImperdibleP = 0;
function fImperdiblesPaginacion(s, sw){
	if(sw==0){
		$('#' + s + ' tr td:visible').hide();
		$('#' + s + ' tr td:first').show();
		$('#' + s + ' tr td:last').show();
		iImperdibleP = iImperdibleP - 1;
		if(iImperdibleP < 0){
			iImperdibleP = parseInt(($('#' + s + ' tr td').length-2)/3);
		}
		$('#' + s + ' tr td:eq(' + String(iImperdibleP * 3 + 1) + '), #' + s + ' tr td:eq(' + String(iImperdibleP * 3 + 2) + '), #' + s + ' tr td:eq(' + String(iImperdibleP * 3 + 3) + ')').fadeIn('normal');
	}

	else{
		$('#' + s + ' tr td:visible').hide();
		$('#' + s + ' tr td:first').show();
		$('#' + s + ' tr td:last').show();
		iImperdibleP = iImperdibleP + 1;
		if(iImperdibleP * 3 >= $('#' + s + ' tr td').length-2){
			iImperdibleP = 0;
		}
		$('#' + s + ' tr td:eq(' + String(iImperdibleP * 3 + 1) + '), #' + s + ' tr td:eq(' + String(iImperdibleP * 3 + 2) + '), #' + s + ' tr td:eq(' + String(iImperdibleP * 3 + 3) + ')').fadeIn('normal');
	}
}

function fCinesPaginacion(s, sw){
	if(sw==0){
		$('#' + s + ' tr td:visible').hide();
		$('#' + s + ' tr td:first').show();
		$('#' + s + ' tr td:last').show();
		iCineP = iCineP - 1;
		if(iCineP < 0){
			iCineP = parseInt(($('#' + s + ' tr td').length-2)/4);
		}
		$('#' + s + ' tr td:eq(' + String(iCineP * 4 + 1) + '), #' + s + ' tr td:eq(' + String(iCineP * 4 + 2) + '), #' + s + ' tr td:eq(' + String(iCineP * 4 + 3) + '), #' + s + ' tr td:eq(' + String(iCineP * 4 + 4) + ')').fadeIn('normal');
	}

	else{
		$('#' + s + ' tr td:visible').hide();
		$('#' + s + ' tr td:first').show();
		$('#' + s + ' tr td:last').show();
		iCineP = iCineP + 1;
		if(iCineP * 4 >= $('#' + s + ' tr td').length-2){
			iCineP = 0;
		}
		$('#' + s + ' tr td:eq(' + String(iCineP * 4 + 1) + '), #' + s + ' tr td:eq(' + String(iCineP * 4 + 2) + '), #' + s + ' tr td:eq(' + String(iCineP * 4 + 3) + '), #' + s + ' tr td:eq(' + String(iCineP * 4 + 4) + ')').fadeIn('normal');
	}
}

function fCanalRegionImperdiblesPanel(o, v, s){
 if(!document.getElementById('divbox' + v)){
  $("#" + v).load("HomeRegionImperdibles.asp?o=0&c=" + o, function(){
   divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
  })
 }
 else if(document.getElementById('divbox' + v).style.display=='none'){
  divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
 }
 else{
  dhtmlwindow.close(document.getElementById('divbox' + v))
 }
}

function fCanalRegionRecomendadosPanel(o, v, s){
 if(!document.getElementById('divbox' + v)){
  $("#" + v).load("HomeRegionRecomendados.asp?o=0&c=" + o, function(){
   divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
  })
 }
 else if(document.getElementById('divbox' + v).style.display=='none'){
  divwin_VenDin_Canal = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
 }
 else{
  dhtmlwindow.close(document.getElementById('divbox' + v))
 }
}

function fScrollNext(s){
	var el = $("#" + s); 
	el.scrollable("next");
}

function fScrollPrev(s){
	var el = $("#" + s); 
	el.scrollable("prev");
}

function fScrollNextPage(s){
	var el = $("#" + s); 
	el.scrollable("nextPage");
}

function fScrollPrevPage(s){
	var el = $("#" + s); 
	el.scrollable("prevPage");
}

var interPlay;
var iPlayerActual = 1;
var iPlayerTotal = 1;

function fNotasPlay(){
	fNotasPlaySiguiente();
	interPlay = setInterval("fNotasPlaySiguiente()", 10000);
	$('#PlayerPlay').hide(); $('#PlayerPausa').show();
}

function fNotasPause(){
	clearInterval(interPlay);
	$('#PlayerPlay').show(); $('#PlayerPausa').hide();
}

function fNotasPlaySiguiente(){
	iPlayerActual = iPlayerActual + 1;
	var el = $("#HomeNoticiasScroll"); 
	
	if(iPlayerActual<=iPlayerTotal){
		el.scrollable("nextPage");
	}
	else{
		iPlayerActual=1;
		el.scrollable("begin");
	}
	
	if(iPlayerActual<10){
		$('#PlayerActual').html(' ' + String(iPlayerActual));
	}
	else{
		$('#PlayerActual').html(iPlayerActual);
	}
}

function fNotasPlayAnterior(){
	iPlayerActual = iPlayerActual - 1;
	var el = $("#HomeNoticiasScroll");
	
	if(iPlayerActual>=1){		
		el.scrollable("prevPage");
	}
	else{
		iPlayerActual=iPlayerTotal;
		el.scrollable("end");
	}
	
	if(iPlayerActual<10){
		$('#PlayerActual').html(' ' + String(iPlayerActual));
	}
	else{
		$('#PlayerActual').html(iPlayerActual);
	}
}


var interComentariosPlay;
var iPlayerComentariosActual = 1;
var iPlayerComentariosTotal = 1;

function fComentariosPlay(){
	fComentariosPlaySiguiente();
	interComentariosPlay = setInterval("fComentariosPlaySiguiente()", 10000);
	$('#PlayerComentariosPlay').hide(); $('#PlayerComentariosPausa').show();
}

function fComentariosPause(){
	clearInterval(interComentariosPlay);
	$('#PlayerComentariosPlay').show(); $('#PlayerComentariosPausa').hide();
}

function fComentariosPlaySiguiente(){
	iPlayerComentariosActual = iPlayerComentariosActual + 1;
	var el = $("#ComentariosScroll"); 
	
	if(iPlayerComentariosActual<=iPlayerComentariosTotal){
		el.scrollable("nextPage");
	}
	else{
		iPlayerComentariosActual=1;
		el.scrollable("begin");
	}
	
	if(iPlayerComentariosActual<10){
		$('#PlayerComentariosActual').html(' ' + String(iPlayerComentariosActual));
	}
	else{
		$('#PlayerComentariosActual').html(iPlayerComentariosActual);
	}
}

function fComentariosPlayAnterior(){
	iPlayerComentariosActual = iPlayerComentariosActual - 1;
	var el = $("#ComentariosScroll");
	
	if(iPlayerComentariosActual>=1){		
		el.scrollable("prevPage");
	}
	else{
		iPlayerComentariosActual=iPlayerComentariosTotal;
		el.scrollable("end");
	}
	
	if(iPlayerComentariosActual<10){
		$('#PlayerComentariosActual').html(' ' + String(iPlayerComentariosActual));
	}
	else{
		$('#PlayerComentariosActual').html(iPlayerComentariosActual);
	}
}

var interNotasPlatosPlay;
var iPlayerNotasPlatosActual = 1;
var iPlayerNotasPlatosTotal = 1;

function fNotasPlatosPlay(){
	fNotasPlatosPlaySiguiente();
	interNotasPlatosPlay = setInterval("fNotasPlatosPlaySiguiente()", 10000);
	$('#PlayerNotasPlatosPlay').hide(); $('#PlayerNotasPlatosPausa').show();
}

function fNotasPlatosPause(){
	clearInterval(interNotasPlatosPlay);
	$('#PlayerNotasPlatosPlay').show(); $('#PlayerNotasPlatosPausa').hide();
}

function fNotasPlatosPlaySiguiente(){
	iPlayerNotasPlatosActual = iPlayerNotasPlatosActual + 1;
	var el = $("#NotasPlatosScroll"); 
	
	if(iPlayerNotasPlatosActual<=iPlayerNotasPlatosTotal){
		el.scrollable("nextPage");
	}
	else{
		iPlayerNotasPlatosActual=1;
		el.scrollable("begin");
	}
	
	if(iPlayerNotasPlatosActual<10){
		$('#PlayerNotasPlatosActual').html(' ' + String(iPlayerNotasPlatosActual));
	}
	else{
		$('#PlayerNotasPlatosActual').html(iPlayerNotasPlatosActual);
	}
}

function fNotasPlatosPlayAnterior(){
	iPlayerNotasPlatosActual = iPlayerNotasPlatosActual - 1;
	var el = $("#NotasPlatosScroll");
	
	if(iPlayerNotasPlatosActual>=1){		
		el.scrollable("prevPage");
	}
	else{
		iPlayerNotasPlatosActual=iPlayerNotasPlatosTotal;
		el.scrollable("end");
	}
	
	if(iPlayerNotasPlatosActual<10){
		$('#PlayerNotasPlatosActual').html(' ' + String(iPlayerNotasPlatosActual));
	}
	else{
		$('#PlayerNotasPlatosActual').html(iPlayerNotasPlatosActual);
	}
}

var interImperdiblesPlay;
var iPlayerImperdiblesActual = 1;
var iPlayerImperdiblesTotal = 1;

function fImperdiblesPlay(){
	fImperdiblesPlaySiguiente();
	interImperdiblesPlay = setInterval("fImperdiblesPlaySiguiente()", 10000);
	$('#PlayerImperdiblesPlay').hide(); $('#PlayerImperdiblesPausa').show();
}

function fImperdiblesPause(){
	clearInterval(interImperdiblesPlay);
	$('#PlayerImperdiblesPlay').show(); $('#PlayerImperdiblesPausa').hide();
}

function fImperdiblesPlaySiguiente(){
	iPlayerImperdiblesActual = iPlayerImperdiblesActual + 1;
	var el = $("#ImperdiblesScroll"); 
	
	if(iPlayerImperdiblesActual<=iPlayerImperdiblesTotal){
		el.scrollable("nextPage");
	}
	else{
		iPlayerImperdiblesActual=1;
		el.scrollable("begin");
	}
	
	if(iPlayerImperdiblesActual<10){
		$('#PlayerImperdiblesActual').html(' ' + String(iPlayerImperdiblesActual));
	}
	else{
		$('#PlayerImperdiblesActual').html(iPlayerImperdiblesActual);
	}
}

function fImperdiblesPlayAnterior(){
	iPlayerImperdiblesActual = iPlayerImperdiblesActual - 1;
	var el = $("#ImperdiblesScroll");
	
	if(iPlayerImperdiblesActual>=1){		
		el.scrollable("prevPage");
	}
	else{
		iPlayerImperdiblesActual=iPlayerImperdiblesTotal;
		el.scrollable("end");
	}
	
	if(iPlayerImperdiblesActual<10){
		$('#PlayerImperdiblesActual').html(' ' + String(iPlayerImperdiblesActual));
	}
	else{
		$('#PlayerImperdiblesActual').html(iPlayerImperdiblesActual);
	}
}

function fCanalTopCiudad(o, c, d, v, s){
	if(!document.getElementById('divbox' + v)){
		$("#" + v).load("CanalTopCiudad.asp?op=" + o + "&c=" + c + "&d=" + d, function(){
			divwin_VenDin_CanalTopCiudad = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
		})
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_VenDin_CanalTopCiudad = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}
}

function fCanalCiudad(c, r, v, s, k){
	if(!document.getElementById('divbox' + v)){
		$("#" + v).load("CanalCiudadesTop.asp?c=" + c + "&r=" + r + "&k=" + k, function(){
			divwin_VenDin_CanalCiudad = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
		})
	}
	else if(document.getElementById('divbox' + v).style.display=='none'){
		divwin_VenDin_CanalCiudad = dhtmlwindow.open('divbox' + v, 'div', v, s, 'width=330px,height=255px,' + fWinPosition(v + '_Link') + 'resize=0,scrolling=1');
	}
	else{
		dhtmlwindow.close(document.getElementById('divbox' + v))
	}
}

function fValFotoSocialCompartir(f) {
 if(
   checkField(f.tNombre, isBlanco, false, 'Nombre' ) &&
   checkField(f.tEmail, isEmail, false, 'E-mail' ) &&
   checkField(f.tEmailAmigo, isBlanco, false, 'E-mails de Amigos' ) &&
   checkField(f.Mensaje, isBlanco, false, 'Mensaje' ) &&
   checkField(f.strCAPTCHA, isBlanco, false, 'Código de Validación' )
  ){
  return true;
 }
 else{
  return false;
 }
}

function loadMapa(divMapa, lugar, lat, lng) {
	var textolugar='800.cl';
  
	if (GBrowserIsCompatible()) {
/*
		var baseIcon = new GIcon(G_DEFAULT_ICON);
		baseIcon.image ="images/v2/pinchogooglemaps800.png";
		baseIcon.shadow= "images/v2/pinchogooglemaps800-sombra.png";
		baseIcon.iconSize = new GSize(38, 34);
		baseIcon.shadowSize = new GSize(60, 34);
		baseIcon.iconAnchor = new GPoint(22, 34);
		baseIcon.infoWindowAnchor = new GPoint(22, 36);
*/   
		var map = new GMap2(document.getElementById(divMapa));
		map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
		
		var geocoder = new GClientGeocoder();
	
		if(Number(lat)!=0 && Number(lng)!=0){
			map.setCenter(new google.maps.LatLng(lat, lng), 15);
//			var center = new GMarker(map.getCenter(), baseIcon);
			var center = new GMarker(map.getCenter());
		
			center.title = textolugar;
			map.addOverlay(center);
		}
		else{
			geocoder.getLatLng(lugar, function(point) {
				if (!point) {
					$('#map').hide();
					$('#LinkVerMapa').hide();
					$('#MensajeMapa').hide();
				}
				else {
					map.setCenter(point, 15);
//					var center = new GMarker(map.getCenter(), baseIcon);
					var center = new GMarker(map.getCenter());
		
					center.title = textolugar;
					map.addOverlay(center);
				}
			});
		}
	}
}

function fVerMapa(id, titulo, calle, numero, comuna, modal, lat, lng) {
	new Boxy("<div id='VenDin_Mapa" + id + "' style='width:640px; height:480px;'></div>", {
		modal: modal,
		title: "Mapa de <b>&quot;" + titulo + "&quot;</b> en <b>800.cl</b>",
		closeText: "[cerrar]",
		unloadOnHide: true,
		afterShow: function() {
			loadMapa('VenDin_Mapa' + id, calle + ' ' + numero + ', ' + comuna + ', Chile', lat, lng);
		}
	});
};

function fFichaVidaSocial(ur, n, t){
	var re = /_/gi;
	var tit = t.replace(re, " ");
	new Boxy("<div id='VenDin_FotoSocialVer" + n + "' style='width:540px; height:525px;'></div>", {
		modal: false,
		title: "Foto Social de <b>&quot;" + tit + "&quot;</b> en <b>800.cl</b>",
		closeText: "[cerrar]",
		unloadOnHide: true,
		afterShow: function() {
			$("#VenDin_FotoSocialVer" + n).load("fotosocial.asp?g=" + ur + "&sNota=" + t + "&iNota=" + n);
		}
	});
};

function fFotoSocialDetalle(i, t){
	var re = /_/gi;
	var tit = t.replace(re, " ");
	new Boxy("<div id='VenDin_FotoSocial" + i + "' style='width:600px; height:260px;'></div>", {
		modal: false,
		title: "Información Foto Social de <b>&quot;" + tit + "&quot;</b> en <b>800.cl</b>",
		closeText: "[cerrar]",
		unloadOnHide: true,
		afterShow: function() {
			$("#VenDin_FotoSocial" + i).load("FotoSocialDetalle.asp?id=" + i);
		}
	});
};

function fCompartirVidaSocial(i, t){
	var re = /_/gi;
	var tit = t.replace(re, " ");
	new Boxy("<div id='VenDin_FotoSocialCompartir" + i + "' style='width:420px; height:265px;'></div>", {
		modal: false,
		title: "Enviar Foto Social de <b>&quot;" + tit + "&quot;</b> en <b>800.cl</b>",
		closeText: "[cerrar]",
		unloadOnHide: true,
		afterShow: function() {
			$("#VenDin_FotoSocialCompartir" + i).load("VidaSocialRecomendar.asp?i=" + i + "&t=" + t);
		}
	});
};
//-->