<!--
function RedirectToIndex()
{
	try
	{
		parent.frames('pages').location = 'index.aspx';
	}
	catch (ex)
	{
		//NOP
	}
}

function AvisoLegal(Idioma)
{
	try
	{
		var Pagina='';
		switch(Idioma)
		{
			case 1:
				Pagina='LeyProteccionDatos_cas.htm';
				break;
			case 2:
				Pagina='LeyProteccionDatos_cat.htm';
				break;
			case 3:
				Pagina='LeyProteccionDatos_en.htm';
				break;
		}
		if (Pagina=='') return -1;
		var wnd=window.open(Pagina,'theLaw','width=400,height=260,left=0,top=0');
		wnd.document.title='Meeting & Congress';
	}
	catch (ex)
	{
		//do something
	}
}

function LoadSrc()
{
//Seccion, Grupo, Apartado se seteaza in pagina in care se apeleaza functia;
try
	{
	document.frames('iframe_left').location='noticias_login.aspx?IdSeccion=' + Seccion + '&IdGrupo=' + Grupo + '&IdApartado=' + Apartado;
	document.frames('iframe_right').location='InteresLogin.aspx';
	}
catch (ex)
	{
	//do something;
	}
}

function ConfirmRedirectContenidos(NrContenido,NrDias,IdSeccion,IdApartado,IdGrupo,Idioma)
{
try
	{
	var theQuestion;
	switch (Idioma)
		{
		case 1:
			theQuestion = "Hay " + NrContenido + " contenido que expira en luego " + NrDias + " d\355as. \277Usted quiere verlos?";
			break;
		case 2:
			theQuestion = "Hi ha " + NrContenido + " contingut que expira en despr\351s " + NrDias + " dies. Vost\350 vol veure'ls?";
			break;
		case 3:
			theQuestion = "There is " + NrContenido + " contents that expire in next " + NrDias + " days. You want to see them?";
			break;
		case 4:
			theQuestion = "Il y a " + NrContenido + " contenus qu'expire dans apr\350s " + NrDias + " jours. Vous voulez les voir?";
			break;
		}
	if (confirm(theQuestion)) 
		{
		top.frames('pages').location='AdminContenidosCaducidad.aspx?IdSeccion=' + IdSeccion + '&IdGrupo=' + IdGrupo + '&IdApartado=' + IdApartado;
		}
	else
		{
		top.frames('pages').location='home.aspx';
		}
	}
catch (ex)
	{
	//do something;
	}
}
//---------------------------
CurrentPos = 0;

function TextFinder(theSearch)
{
try
	{
	if (theSearch == "")
		{
		return false;
		}

	var theSearchL = theSearch.toLowerCase();
	var theText = document.body.innerHTML;
	var theTextL = theText.toLowerCase();
	var theArray = theTextL.split(theSearchL);
	var theNewText = "";

	for (var i = 0; i < theArray.length; i++)
		{
		var tempStr = new String('');
		
		for (var j = 0; j <= i; j++) 
			{
			tempStr += theArray[j];
			}
		
		var posLT = tempStr.lastIndexOf('<');
		var posGT = tempStr.lastIndexOf('>');
		var posAmp = tempStr.lastIndexOf('&');
		var posComa = tempStr.lastIndexOf(';');
		
		if ((posGT < posLT) || (posComa < posAmp))
			{
			theNewText += theText.substr(CurrentPos, theArray[i].length) + theText.substr(CurrentPos + theArray[i].length, theSearch.length);
			}
		else
			{
			theNewText += theText.substr(CurrentPos, theArray[i].length) + "<span style='background-color: red; color: white;'>" + theText.substr(CurrentPos + theArray[i].length, theSearch.length) + "</span>";
			}
		
		CurrentPos += theArray[i].length + theSearch.length;
		}

		document.body.innerHTML = theNewText;
	}
catch (ex)
	{
	//do something;
	}
}
function Enlarge()
{
	var tmp_img = new Image();
	tmp_img.src = event.srcElement.src;
	var w = tmp_img.width + 8;
	var h = tmp_img.height + 48;
	window.showModelessDialog(event.srcElement.src,'','dialogHeight:' + h + 'px;dialogWidth:' + w + 'px;resizable:1;');
}

function ImageViewEventos(Evento, Idioma, Img, Width, Height)
{
try
	{
	var rnd = Math.floor(Math.random() * 201)
	window.showModelessDialog('image_view.aspx?Evento='+ Evento +'&Idioma=' + Idioma + '&img=' + Img + '&large=1&rnd=' + rnd,'','dialogHeight:' + Height + 'px;dialogWidth:' + Width + 'px;resizable:1;status:0;');
	}
catch (ex)
	{
	alert('Error view image');
	}
}

function ImageViewTmp(Img, Width, Height)
{
try
	{
	var rnd = Math.floor(Math.random() * 201)
	window.showModelessDialog('image_view.aspx?tmp=1&img=' + Img + '&large=1&rnd=' + rnd,'','dialogHeight:' + Height + 'px;dialogWidth:' + Width + 'px;resizable:1;status:0;');
	}
catch (ex)
	{
	alert('Error view image');
	}
}

function ImageViewClientes(Cliente, Img, Width, Height)
{
try
	{
	var rnd = Math.floor(Math.random() * 201)
	window.showModelessDialog('image_view.aspx?Cliente='+ Cliente +'&img=' + Img + '&large=1&rnd=' + rnd,'','dialogHeight:' + Height + 'px;dialogWidth:' + Width + 'px;resizable:1;status:0;');
	}
catch (ex)
	{
	alert('Error view image');
	}
}

function ImageViewEnlaces(Enlace, Img, Width, Height)
{
try
	{
	var rnd = Math.floor(Math.random() * 201)
	window.showModelessDialog('image_view.aspx?Enlace='+ Enlace +'&img=' + Img + '&large=1&rnd=' + rnd,'','dialogHeight:' + Height + 'px;dialogWidth:' + Width + 'px;resizable:1;status:0;');
	}
catch (ex)
	{
	alert('Error view image');
	}
}

function ImageView(Seccion, Idioma, Grupo, Apartado, Img, Width, Height)
{
try
	{
	var rnd = Math.floor(Math.random() * 201)
	window.showModelessDialog('image_view.aspx?Seccion='+ Seccion +'&Idioma=' + Idioma + '&Grupo=' + Grupo + '&Apartado=' + Apartado + '&img=' + Img + '&large=1&rnd=' + rnd,'','dialogHeight:' + Height + 'px;dialogWidth:' + Width + 'px;resizable:1;status:0;');
	}
catch (ex)
	{
	alert('Error view image');
	}
}

function ControlLength(len)
{
	try
	{
		var s=event.srcElement.value;
		if (s.length>=len) return false;
		return true;
	}
	catch(err)
	{
		//NOP
	}
}

function ChkChanged()
{
	try
	{
		if (event.srcElement.checked==true)
		{
			document.getElementById('contOtros').style.visibility='visible';
			document.getElementById('tbOtros').focus();
		}
		else document.getElementById('contOtros').style.visibility='hidden';
	}
	catch(e)
	{
		//NOP
	}
}

function ValidateForm()
{
	try
	{
		if (ctrls.length==0) return true;
		for(i=0;i<ctrls.length;i++)
		{
			var p=ctrls[i].split(';');
			if (document.getElementById(p[0]).value=='')
			{
				alert('Hay que rellenar el campo ' + p[1]);
				document.getElementById(p[0]).focus();
				return false;
			}
		}
		return true;
	}
	catch(e)
	{
		//NOP
	}
}
//-->