/* DETECTOR DE BROWSER */
ACTUAL_FONTSIZE_COP  = 11;
ACTUAL_FONTSIZE_TXT  = 16;
ACTUAL_FONTSIZE_TXT2 = 16;
ACTUAL_FONTSIZE_TXT3 = 30;

function $(obj)
{
	return document.getElementById(obj);
}

function EnviarAmigo(idx)
{
	window.open("../enviaramigo/enviaramigo.php?idx="+idx,"EnviarAmigo","width=490, height=510, scrollbars=no");
}


function enviarSVTin()
{
	window.open("enviar/enviar.php","EnviarSanvalentin","width=490, height=430, scrollbars=no");
}


function AbrirAdjunto(idx) {
	window.open("../secciones/mostrararchivo.php?Idx="+idx,"MostrarArchivo","toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=800,height=600,top=120,left=120");
}
function MostrarNota(idx,IdxSeccion) {
	document.frmNota.Idx.value = idx;
	document.frmNota.IdxSeccion.value = IdxSeccion;
	document.frmNota.submit();
}


function MostrarNota2(idx,IdxSeccion) {
	document.frmNota2.Idx.value = idx;
	document.frmNota2.IdxSeccion.value = IdxSeccion;
	document.frmNota2.submit();
}


function MostrarNota3(idx,IdxSeccion) {
	document.frmNota3.Idx.value = idx;
	document.frmNota3.IdxSeccion.value = IdxSeccion;
	document.frmNota3.submit();
}


function MostrarNota4(idx,IdxSeccion,IfShow) {
	document.frmNota.Idx.value = idx;
	document.frmNota.IdxSeccion.value = IdxSeccion;
	document.frmNota.Show.value = IfShow;
	document.frmNota.submit();
}


function MostrarNotaFn(idx,IdxSeccion) {
	document.frmNotaFn.Idx.value = idx;
	document.frmNotaFn.IdxSeccion.value = IdxSeccion;
	document.frmNotaFn.submit();
}


function MostrarNotaDesdePopUp(idx,IdxSeccion) {
	window.opener.document.frmNota.Idx.value = idx;
	window.opener.document.frmNota.IdxSeccion.value = IdxSeccion;
	window.opener.document.frmNota.submit();
	window.close();
}


function MostrarNotaDesdePopUp2(idx,IdxSeccion) {
	window.parent.opener.document.frmNota.Idx.value = idx;
	window.parent.opener.document.frmNota.IdxSeccion.value = IdxSeccion;
	window.parent.opener.document.frmNota.submit();
	window.close();
}


function MostrarNotasColumnista(idx,IdxSeccion,tipo) {
  document.frmNota3.Idx.value = idx;
  document.frmNota3.IdxSeccion.value = IdxSeccion;
  document.frmNota3.tipo_col.value = tipo;
  document.frmNota3.action = '../notas/nota3cols.php';
  document.frmNota3.submit();
}


function MostrarNotaPrograma(idx,IdxSeccion) {
	document.frmPrograma.Idx.value = idx;
	document.frmPrograma.IdxSeccion.value = IdxSeccion;
	document.frmPrograma.submit();
}


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) {
	ret = ( typeof(ret) == "undefined" ) ? 0 : ret ;
	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 BuscarV3(ret,seccion) {
	ret = ( typeof(ret) == "undefined" ) ? 0 : ret ;
	if (document.getElementById('buscador'+seccion).value.length < 3) {
		alert("Ingrese por favor al menos 3 letras.");
		if (ret){
      return false;
    }
	} else {
		if (document.getElementById('engineGoogle'+seccion).checked) {
			document.getElementById('buscador'+seccion).name = 'q';
			document.frmPrincipal.method = "GET";
			document.frmPrincipal.action = 'http://www.infobae.com/resultados/';
			document.frmPrincipal.submit();
		} else {
	  	window.location = "../herramientas/buscador.php?accion=buscar&donde=1&ultimos=30&texto=" + document.getElementById('buscador'+seccion).value;
	  return false;
		}
	}
}


function AbrirChat() {


	if (document.frmPrincipal.chat.value.length < 1) {
		alert("Ingrese por favor al menos 1 letra.");
		return;
	//} else {
	//	document.frmChat.Nickname.value = document.frmPrincipal.chat.value;
	//	document.frmChat.submit();
	}
	//window.open("http://200.73.177.6/chat.html?@nick=" + document.frmPrincipal.chat.value ,"MostrarArchivo","toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=500,height=460,top=0,left=0");
	window.open("../chat.html?@nick=" + document.frmPrincipal.chat.value ,"Chat","toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=500,height=460,top=0,left=0");
}


function Votar(idx,cantidad) {
	var check = false;
	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");
			var check = true;
		}
	}
	if( check == false ) alert('Para votar debe seleccionar una opción');
}


function VotarInterior(idx,cantidad){
	var check = false;
	for (i=0;i<cantidad;i++){
		if (document.frmPrincipal.rEncuesta[i].checked == true ){
			var check = true;
			//if ( document.frmPrincipal.rEncuesta.value > 0 ){
				window.open("../herramientas/check_cookies.php?IdxEncuesta="+idx+"&IdxOpcion="+document.frmPrincipal.rEncuesta[i].value,"Votar","width=387,height=290,top=150,left=150");
			//}
		}
	}

	if( check == false ) alert('Para votar debe seleccionar una opción');
}


function VotarAsociada(idx,cantidad) {
	for (i=0;i<cantidad;i++) {
		if (document.frmPrincipal.rEncuestaA[i].checked) {
			window.open("../herramientas/check_cookies.php?IdxEncuesta="+idx+"&IdxOpcion="+document.frmPrincipal.rEncuestaA[i].value,"Votar","width=387,height=339,outerwidth=407,outerheight=339,top=150,left=150");
		}
	}
}


function EncuestasResultados(idx) {
	document.frmPrincipal.IdxEncuesta.value = idx;
	document.frmPrincipal.submit();
}


function BuscarServicios() {
	var Cat="";
	document.frmResultadoServicios.tipo.value = 0;
	document.frmResultadoServicios.Titulo.value = document.frmPrincipal.palabra.value;
	if (document.frmPrincipal.Cines.checked) Cat+="Cine,";
	if (document.frmPrincipal.Teatros.checked) Cat+="Teatro,";
	if (document.frmPrincipal.Musica.checked) Cat+="M&uacute;sica,";
	if (document.frmPrincipal.OtrasCategorias.value!="") Cat += document.frmPrincipal.OtrasCategorias.value;
	if (Cat.charAt(Cat.length-1)==",") Cat = Cat.substr(0,Cat.length-1);
	document.frmResultadoServicios.Categorias.value = Cat;
	document.frmResultadoServicios.submit();
}


function BuscarServicios2() {
	document.frmResultadoServicios.tipo.value = 1;
	document.frmResultadoServicios.Titulo.value = document.frmPrincipal.palabra2.value;
	document.frmResultadoServicios.Categorias.value = document.frmPrincipal.OtrasCategorias2.value;
	document.frmResultadoServicios.submit();
}


function Logueo() {
	if (document.frmPrincipal.lemail.value!="" && document.frmPrincipal.lpassword.value!="") {
		document.frmPrincipal.submit();
	}
}


function BuscarYahoo() {
	if (document.frmPrincipal.pYahoo.value!="") {
		window.open("http://ar.search.yahoo.com/search/ar?p="+document.frmPrincipal.pYahoo.value,"Yahoo");
	}
}


function mandarGalleta(nombre, valor, caducidad){
      document.cookie = nombre + "=" + escape(valor) + ((caducidad == null) ? "" : ("; expires=" + caducidad.toGMTString()))
	}
function consultarGalleta(nombre){
	var buscamos = nombre + "=";
	if (document.cookie.length > 0) { i = document.cookie.indexOf(buscamos);
	if (i != -1) { i += buscamos.length;

          j = document.cookie.indexOf(";", i);
	if (j == -1)
  j = document.cookie.length;
          return unescape(document.cookie.substring(i,j));
        }
      }

    }
function ShowMensaje(){
	var num;
	if (!(num=consultarGalleta("VisitasInfobae",1,null)))
      num = 0;
      num++;
      mandarGalleta("VisitasInfobae");
      if (num==1)
        window.open("../mensaje/mensaje.html","popinfobae","width=480,height=350,outerwidth=480,outerheight=350, top=150,left=150")
 	}

function Radio10enVivo() {
      if (navigator.appName.indexOf("Microsoft")!=-1) {
      	window.open("../herramientas/radio10envivo.php","radio10envivo","width=320,height=335,top=50,left=50");
      }
      else {
      	window.location = "mms://200.43.193.143/radio10";
      }
}


function Mega983enVivo() {
  //  if (navigator.appName.indexOf("Microsoft")!=-1) {
	window.open("../herramientas/mega983envivo.php","mega983envivo","width=320,height=235,top=50,left=50");
   /* } else {
	window.location = "mms://200.43.193.143/mega";
    }*/
}


function RadioPopenVivo() {
      if (navigator.appName.indexOf("Microsoft")!=-1) {
      	window.open("../herramientas/radiopopenvivo.php","radiopopenvivo","width=320,height=335,top=50,left=50");
      }
      else {
      	window.location = "http://pop.telecomdatacenter.com.ar/pop";
      }
}


function RadioVale() {
     // if (navigator.appName.indexOf("Microsoft")!=-1) {
      	window.open("../herramientas/radiovaleenvivo.php","radiovaleenvivo","width=320,height=335,top=50,left=50");
     /* }
      else {
      	window.open("../herramientas/radiovaleenvivo.php","radiovaleenvivo","width=320,height=335,top=50,left=50");
      	//window.location = "http://200.43.193.190/vale";
      }*/
}


function AmadeusenVivo() {
    if (navigator.appName.indexOf("Microsoft")!=-1) {
	window.open("../herramientas/amadeusenvivo.php","amadeusenvivo","width=320,height=235,top=50,left=50");
    } else {
	window.location = "http://amadeus.telecomdatacenter.com.ar/amadeus";
    }
}

//PopUp Tapas

function poptapas(a,b){
	window.open(a,b,"width=551,height=510,outerwidth=561,outerheight=520," + "scrollbars=yes, top=20,left=20");
}


function OpenFile(idx,idxNota,tipo){
	window.open("../interior/multimedia.php?idx="+idx+"&idxNota="+idxNota+"&tipo="+tipo,"OpenFile","status=no,width=743,height=500,outerwidth=561,outerheight=520," + "scrollbars=no, top=20,left=20");
}


function OpenFileWeblog(idx,idxWeblog,tipo){
  window.open("../interior/multimedia.php?idx="+idx+"&idxWeblog="+idxWeblog+"&tipo="+tipo,"OpenFile","status=no,width=743,height=500,outerwidth=561,outerheight=520," + "scrollbars=no, top=20,left=20");
}


function LoSabemos(IdxSeccion) {
	document.frmLoSabemos.IdxSeccion.value = IdxSeccion;
	document.frmLoSabemos.submit();
}

// Banners
function PopUpBanner(url,height,width) {
   window.open(url,"BannerPopUp","toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width="+width+",height="+height+",top=100,left=100");
}


// Canal 9
function Canal9enVivo() {
  window.open("../canal9/tv/ubicaciones.php?calidad=1","Canal9EnVivo","width=280,height=205,top=201,left=322");
}


function EncuestasResultadosFn(idx) {
	document.frmEncuestasResultados.IdxEncuesta.value = idx;
	document.frmEncuestasResultados.submit();
}


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_COP  = ACTUAL_FONTSIZE_COP  + 1;
	ACTUAL_FONTSIZE_TXT  = ACTUAL_FONTSIZE_TXT  + 1;
	ACTUAL_FONTSIZE_TXT2 = ACTUAL_FONTSIZE_TXT2 + 1;
	ACTUAL_FONTSIZE_TXT3 = ACTUAL_FONTSIZE_TXT3 + 1;

  if (ACTUAL_FONTSIZE_COP  > 15) { ACTUAL_FONTSIZE_COP 	= 15 }
  if (ACTUAL_FONTSIZE_TXT  > 20) { ACTUAL_FONTSIZE_TXT 	= 20 }
  if (ACTUAL_FONTSIZE_TXT2 > 20) { ACTUAL_FONTSIZE_TXT2 = 20 }
  if (ACTUAL_FONTSIZE_TXT3 > 34) { ACTUAL_FONTSIZE_TXT3	= 34 }

  ChangeProp('cop','','style.fontSize',ACTUAL_FONTSIZE_COP,'SPAN');
  ChangeProp('texto','','style.fontSize',ACTUAL_FONTSIZE_TXT,'SPAN');
  ChangeProp('texto2','','style.fontSize',ACTUAL_FONTSIZE_TXT2,'SPAN');
  ChangeProp('texto3','','style.fontSize',ACTUAL_FONTSIZE_TXT3,'SPAN');
  //SaveActualFontSize();
  //extenderDIV();) ?

}

function masChica() {

	ACTUAL_FONTSIZE_COP  = ACTUAL_FONTSIZE_COP  - 1;
	ACTUAL_FONTSIZE_TXT  = ACTUAL_FONTSIZE_TXT  - 1;
	ACTUAL_FONTSIZE_TXT2 = ACTUAL_FONTSIZE_TXT2 - 1;
	ACTUAL_FONTSIZE_TXT3 = ACTUAL_FONTSIZE_TXT3 - 1;

  if (ACTUAL_FONTSIZE_COP  < 9) { ACTUAL_FONTSIZE_COP 		= 9  }
  if (ACTUAL_FONTSIZE_TXT  < 13) { ACTUAL_FONTSIZE_TXT 		= 13 }
  if (ACTUAL_FONTSIZE_TXT2 < 13) { ACTUAL_FONTSIZE_TXT2 	= 13 }
  if (ACTUAL_FONTSIZE_TXT3 < 27) { ACTUAL_FONTSIZE_TXT3		= 27 }

  ChangeProp('cop','','style.fontSize',ACTUAL_FONTSIZE_COP,'SPAN');
  ChangeProp('texto','','style.fontSize',ACTUAL_FONTSIZE_TXT,'SPAN');
  ChangeProp('texto2','','style.fontSize',ACTUAL_FONTSIZE_TXT2,'SPAN');
  ChangeProp('texto3','','style.fontSize',ACTUAL_FONTSIZE_TXT3,'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 MiInfobae(){
	window.location = "miinfobae.php";
}


function NombreUsuario(){
  var nombre;
  if (getCookie("InfobaeLogin[nombre]") != null ){
		nombre = getCookie("InfobaeLogin[nombre]") + " " + getCookie("InfobaeLogin[apellido]");
		document.write(nombre.substr(0,15));
	}
}


function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


function getClima(tipo){

	var codigo = "SABE" ;
	if (getCookie("InfobaeClima") != null ){
		codigo = getCookie("InfobaeClima");
	}

	for (i = 0 ; i < arrClima.length ; i++ ){
		if ( arrClima[i][0] == codigo ){
		  if (tipo == 1) {
		    document.write(arrClima[i][1].substring(0,12));
		  } else {
			  document.write(arrClima[i][tipo]);
			}
		}
	}

}


function SelectSector(idx){
	window.location = "../quienesquien/listado.php?idx="+ idx ;
}


function BuscarEmpresa(){
	if (document.frmPrincipal.pagina){
		document.frmPrincipal.pagina.value = "0";
		document.frmPrincipal.total.value = "0";
	}
	document.frmPrincipal.accion.value = "buscar";
	document.frmPrincipal.action = "../quienesquien/listado.php";
	document.frmPrincipal.submit();
}


function IrAPagina2(pagina){
	document.frmPrincipal.method = "GET" ;
	document.frmPrincipal.pagina.value = pagina - 1 ;
	document.frmPrincipal.submit();
}


function IrAPagina(pag){
  document.frmPrincipal.accion.value = "buscar";
	document.frmPrincipal.pagina.value = pag - 1;
	document.frmPrincipal.action = "../quienesquien/listado.php";
	document.frmPrincipal.submit();
}


function VideoIrAPagina(pag){
	document.form1.buscar.value = "Buscar";
	document.form1.pagina.value = pag;
	document.form1.action = "../admin/adminVideo.php";
	document.form1.submit();
}


function VideoCIrAPagina(pag){
	document.form1.pagina.value = pag;
	document.form1.action = "../admin/adminVideoCanal.php";
	document.form1.submit();
}


function FNIrAPagina(pag){
	document.frmPaginador.pagina.value = pag - 1;
	document.frmPaginador.action = "../fn/consultas.php";
	document.frmPaginador.submit();
}


function Seguimiento(idxtema,idxcat){
	window.open("../interior/popupmisseg.php?idxTema="+idxtema+"&idxCategoria="+idxcat,"PopUpMisSeguimientos","toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=470,height=270,top=100,left=100");
}


function VerEmpresa(idx) {
	window.location.href = '../notas/infoEmpresa.php?idx='+idx;
}


function alerta(algo) {
	alert(algo);
}


function infobaetv() {
	window.open("../herramientas/infobaetv.php","InfobaeTV","width=480, height=480, scrollbars=no");
}


function noticiasfotoPopUp(idxNota, idxSeccion, opcion, layout) {
  /*
  galleta = consultarGalleta('resolution');
  w = (galleta == '800x600'? 660:664);
  h = (galleta == '800x600'? 560:575);

  opcion = (typeof(opcion) == "undefined")? 0 : opcion;
  layout = (typeof(layout) == "undefined")? 1 : layout;
  window.open('../interior/noticiasfotoPopUp.php?idxNota=' + idxNota + '&idxSeccion=' + idxSeccion + '&opcion=' + opcion + '&layout=' + layout, 'noticiasfotoPopUp', 'status=no, top=0, left=0, toolbar=no, width=' + w + ', height=' + h);
  */
  window.location = '../interior/fotos.php?idxNota=' + idxNota + '&idxSeccion=' + idxSeccion + '&opcion=' + opcion + '&layout=' + layout;
}


function checkBox(fieldName, fieldValue, optionIndex, optionCount)
{
	var optionImg = document.getElementById(fieldName + '_' + optionIndex);
	optionImg.src = '../imgs/ico/box_checked.gif';

	var f = document.forms['frmPrincipal'];
	f[fieldName].value = fieldValue;

	for(var i=0; i<optionCount;++i)
	{
		if(optionIndex!=i)
		{
			optionImg = document.getElementById(fieldName + '_' + i);
			optionImg.src = '../imgs/ico/box_unchecked.gif';
		}
	}
}


function buscarMundial() {
  if (document.getElementById("strBuscar").value.length < 3) {
		alert("Ingrese por favor al menos 3 letras.");
		return;
	} else {
	  window.location = "../herramientas/buscador.php?accion=buscar&buscador=Buscar&resolution=1024x768&pagina=0&orden=0&texto="+document.getElementById("strBuscar").value+"&seccion=0&formato=0&donde=1&area1=34";
	}
}


function ciudadMundial(nCiudad)
{
	var ciudad ='';
	/* gelsenkirchen colonia dortmund kaiserslautern munich nuremberg francfort stuttgart leipzig berlin hanover hamburgo */
	switch(nCiudad)
	{
		case 1: ciudad='gelsenkirchen'; break;
		case 2: ciudad='colonia'; break;
		case 3: ciudad='dortmund'; break;
		case 4: ciudad='kaiserslautern'; break;
		case 5: ciudad='munich'; break;
		case 6: ciudad='nuremberg'; break;
		case 7: ciudad='francfort'; break;
		case 8: ciudad='stuttgart'; break;
		case 9: ciudad='leipzig'; break;
		case 10: ciudad='berlin'; break;
		case 11: ciudad='hanover'; break;
		case 12: ciudad='hamburgo'; break;
	}
	//alert(nCiudad + '=' + ciudad);
  window.open('../mundial2006/canchas.php?ciudad=' + ciudad, 'CiudadMundial', 'status=yes, menubar=no, toolbar=no, width=690, height=532');
}


function trim(valor){
	var re = /^(\s)*|(\s)*$/;
	var str = (valor ? valor : this);
	return str.replace(re,'');
}
String.prototype.trim = trim;


function ingresasPOP( url  , url_redirectto  )
{
  url_redirectto = (typeof(url_redirectto) != "undefined")  ? url_redirectto : "" ;
  window.open("../interior/login_pop.php?returnto=" + url + "&redirectto=" + url_redirectto,"Ingresar","width=380, height=400, scrollbars=no");
}


function abusoPOP( idComentario )
{
	window.open("../interior/login_pop.php?abuso="+idComentario,"Ingresar","width=380, height=400, scrollbars=no");
}


function checkCaracteres( inputElement, cantidad ) {
	if( inputElement.value.length > cantidad ) {
		inputElement.value = inputElement.value.substr(0, cantidad);
	}
	document.frmPrincipal.lcomentario.value = inputElement.value.length;
}


function ingresasPOPComentario( url )
{
	/*
	if( document.frmPrincipal.lcomentario.value > 500 ) {
		alert('Se ha excedido en el número de caracteres, por favor ingrese un comentario de menos de 500 caracteres.');
		return false;
	}
	*/
	window.open("../interior/login_pop.php?submitTo=" + url,"Ingresar","width=380, height=400, scrollbars=no");
}


function runSWF(archivo, ancho, alto, version, bgcolor, id,idm, menu, FlashVars, quality, allowScriptAccess , wmode) { // tutorial by IVI CONCEPT - www.ivi-concept.com
if(version!=""){
	var version_data=version;
}else{
	var version_data="6,0,0,0";
}
if(menu!=""){
	menu_data=menu;
}else{
	menu_data=false;
}
if(bgcolor!=""){
	var bgcolor_data=bgcolor;
}else{
	var bgcolor_data="#FFFFFF";
}
if(id!=""){
	id_data=id;
}else{
	id_data="flashMovie";
}
if(quality!=""){
	quality_data=quality;
}else{
	quality_data="high";
}
if(allowScriptAccess!=""){
	allowScriptAccess_data=allowScriptAccess;
}else{
	allowScriptAccess_data="always";
}
var quality="high"; // calidad de visualización de la peli

if(typeof(wmode)!="undefined"){
	wmode_data=wmode;
}else{
	wmode_data="transparent";
}


var agt=navigator.userAgent.toLowerCase();
  if((navigator.appName == "Microsoft Internet Explorer") ||
  ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1)))
  {
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version_data+'" width='+ancho+' height='+alto+' id='+id_data+'>\n');
    document.write('<param name="movie" value='+archivo+'>\n');
    document.write('<param name="allowScriptAccess" value='+allowScriptAccess_data+'>\n');
    document.write('<param name="quality" value='+quality_data+'>\n');
    document.write('<param name="wmode" value='+wmode_data+'>\n');
    //document.write('<param name="FlashVars" value='+FlashVars+'>\n');
    document.write('<param name="bgcolor" value='+bgcolor_data+'>\n');
    //document.write('<param name="menu" value='+menu_data+' >\n');
    document.write('<param name="allowFullScreen" value=true >\n');
    //FlashVars='+FlashVars+' menu='+menu_data+' swLiveConnect=true
    document.write('</object>\n');
  }
  else
  {
    document.write('<embed src='+archivo+' bgcolor='+bgcolor_data+' allowScriptAccess='+allowScriptAccess_data+' quality='+quality_data+' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width='+ancho+' height='+alto+' id='+idm+' wmode='+wmode_data+' allowFullScreen=true></embed>');
  }
}


function popupGaleria(idGaleria, opcion, seccion , mostrarCombo) {
	/*
  galleta = consultarGalleta('resolution');
  w = (galleta == '800x600'? 660:664);
  h = (galleta == '800x600'? 560:555);

  opcion        = (typeof(opcion)       == "undefined") ? 0 : opcion;
  layout        = (typeof(layout)       == "undefined") ? 1 : layout;
  mostrarCombo  = (typeof(mostrarCombo) == "undefined") ? 0 : mostrarCombo;
  window.open('../interior/galeriaPopUp.php?idSeccion='+seccion+'&idGaleria='+idGaleria+"&opcion="+opcion+"&mostrarCombo="+mostrarCombo, 'noticiasfotoPopUp', 'status=no, top=0, left=0, toolbar=no, width=' + w + ', height=' + h);*/
  window.location = '../interior/fotos.php?idSeccion='+seccion+'&idGaleria='+idGaleria+"&opcion="+opcion+"&mostrarCombo="+mostrarCombo;
}

function popupGaleria2007(idGaleria, opcion, seccion , mostrarCombo) {
  galleta = consultarGalleta('resolution');
  w = (galleta == '800x600'? 660:780);
  h = (galleta == '800x600'? 600:630);

  opcion        = (typeof(opcion)       == "undefined") ? 0 : opcion;
  layout        = (typeof(layout)       == "undefined") ? 1 : layout;
  mostrarCombo  = (typeof(mostrarCombo) == "undefined") ? 0 : mostrarCombo;
  window.open('../interior/galeriaPopUpElecciones.php?idSeccion='+seccion+'&idGaleria='+idGaleria+"&opcion="+opcion+"&mostrarCombo="+mostrarCombo, 'noticiasfotoPopUp', 'status=no, top=0, left=0, toolbar=no, width=' + w + ', height=' + h);
}


function ChangeItemVideo(idSeccion,maximo,accion){
	if(accion == "siguiente"){
		if( parseInt(posVideo[idSeccion]) + Number(1) <= parseInt(maximo) ){
			posVideo[idSeccion] = posVideo[idSeccion] + 1;
		}else{
			posVideo[idSeccion] = 0 ;
		}
	}else{
		//num = parseInt(posVideo[idSeccion]) - Number(1);
		//alert(num);
		if( parseInt(posVideo[idSeccion]) - Number(1) >= parseInt(0) ){
			posVideo[idSeccion] = posVideo[idSeccion] - 1;
		}else{
			posVideo[idSeccion] = maximo ;
		}
	}
	//alert(posVideo[idSeccion]);

	for( var i = 0 ; i <= maximo ; i++  ){
		if( i == posVideo[idSeccion] ){
			document.getElementById("Item_"+idSeccion+"_"+i).style.display = "block";
			document.getElementById("Count_Item_"+idSeccion).innerHTML = Number(i) + Number(1);
		}else{
			document.getElementById("Item_"+idSeccion+"_"+i).style.display = "none";
		}
	}
}

function popupJuegos(url, width, height) {
	 var windowJuego = window.open(url,"JuegosAzar","toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width="+width+",height="+height+",top=100,left=100");
	 windowJuego.title = 'Juegos de Azar';
}
