<!--
function RedirectToIndex()
{
	try
	{
		parent.frames('pages').location = 'index.aspx';
	}
	catch (ex)
	{
		//NOP
	}
}

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.href='AdminContenidosCaducidad.aspx?IdSeccion=' + IdSeccion + '&IdGrupo=' + IdGrupo + '&IdApartado=' + IdApartado;
		}
	else
		{
		//top.frames('pages').location='index_login.aspx?IdSeccion=' + IdSeccion + '&IdApartado=' + IdApartado + '&IdGrupo=' + IdGrupo;
		top.frames('pages').location='NuevoHome.aspx';
		}
	}
catch (ex)
	{
	//do something;
	alert('eroare');
	}
}
//---------------------------
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 AvisoLegalOpen(CodIdioma)
{
	try
	{
		var StrIdioma='';
		if (CodIdioma=='2') StrIdioma='_Cat';
		if (CodIdioma=='3') StrIdioma='_En';
		window.showModelessDialog('AvisoLegal' + StrIdioma + '.htm','','dialogHeight:400px;dialogWidth:600px;resizable:1;');
	}
	catch (ex)
	{
		alert('error AvisoLegalOpen()');
	}
}

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
	}
}

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');
	}
}
//-->