function nwindow(mypage,myname,w,h,scroll,pos)
{
	if (pos=="random")
	{
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	else if (pos=="center")
	{
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
	else
	{
		LeftPosition=0;
		TopPosition=20;
	}
	
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
	
	if(win.focus)
	{
		win.focus();
	}
}

function isInteger1(val)
{
	for (var i=0; i < val.length; i++)
	{
		if (!isDigit1(val.charAt(i)))
		{
			return (false);
		}
	}
	
	return (true);
} 

function isInteger2(val)
{
	for (var i=0; i < val.length; i++)
	{
		if (!isDigit2(val.charAt(i)))
		{
			return (false);
		}
	}
	
	return (true);
} 

function isDigit1(num)
{
	var string="1234567890";
	
	if (string.indexOf(num) != -1)
	{
		return (true);
	}
	
	return (false);
}

function isDigit2(num)
{
	var string="1234567890,";
	
	if (string.indexOf(num) != -1)
	{
		return (true);
	}
	
	return (false);
}

function validar_buscador ()
{
	if (document.getElementById('txt').value=="")
	{
		alert("Introduzca el texto a buscar");
		document.getElementById('txt').focus();
		return(false);
	}
}
