<!--
function RedirectToIndex(IdUser, Home)
{
try
	{
		var Usr = new String(IdUser);
		if (Usr == '2') 
		{
			if (Home==1) parent.frames('pages').location = 'home_1.aspx';
			else if (Home==2) parent.frames('pages').location = 'home_2.aspx';
		}
		else 
		{
			parent.frames('pages').location = 'adminprivada.aspx?IdSeccion=8&IdGrupo=1&IdApartado=1';
		}
	}
catch (ex)
	{
	//do something;
	}
}

function LoadSrc()
{
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)) 
		{
		parent.frames('pages').location.href='AdminContenidosCaducidad.aspx?IdSeccion=' + IdSeccion +'&IdGrupo=' + IdGrupo + '&IdApartado=' + IdApartado;
		}
	else
		{
		parent.frames('pages').location='adminprivada.aspx?IdSeccion=' + IdSeccion +'&IdGrupo=' + IdGrupo + '&IdApartado=' + IdApartado;
		}
	}
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 img=new Image();
			img.src=event.srcElement.src;
			window.showModelessDialog(event.srcElement.src,'','dialogHeight:' + img.height + 'px;dialogWidth:' + img.width + 'px;resizable:1;');
		}*/
function Enlarge()
	{
	var img=new Image();
	img.src=event.srcElement.src;
	var w = img.width + 8;
	var h = img.height + 47;
	window.showModelessDialog(event.srcElement.src,'','dialogHeight:' + h + 'px;dialogWidth:' + w + 'px;resizable:1;');
	}

function DoFocus(ElementId)
{
try
	{
	var objElement = document.getElementById(ElementId);
	
	if (arguments.length > 1)
		{
		objElement.value = arguments[1];
		}
	
	objElement.select();
	}
catch (ex)
	{
	//do something;
	}
}
//-->
function historyback(t)
{
	for (i=0;i<t;i++) history.back();
}