function CerrarSesion()
{
	document.Abandonar.submit();
}

function ObtenerCadenaFechaHoy()
{
	var nombreMeses = new Array(11);
	nombreMeses = ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' ];
	var nombreDias = new Array(6);
	nombreDias = ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'];
	var fecha = new Date();
	return nombreDias[fecha.getDay()] + ', ' + fecha.getDate() + ' de ' + nombreMeses[fecha.getMonth()] + ' del año ' + fecha.getFullYear();
}
function CambiarEstilo( Obj, strEstilo )
{
	Obj.className = strEstilo;
}

function Ir( dir )
{
	location.href = dir;
}

function AbreVentana(NombreVentana,Direccion,Ancho,Alto,Caracteristicas)
{
	var ancho = screen.width;
	var alto = screen.height;
	var x0 = (ancho-Ancho)/2;
	if ( x0 < 0 ) 
		x0 = 0;
	var y0 = (alto-Alto)/2;
	if ( y0 < 0 )
		y0 = 0;
	var NuevaVentana;
	NuevaVentana = window.open(Direccion,NombreVentana,"screenX="+x0+",screenY="+y0+", height="+Alto+",width="+Ancho+Caracteristicas+",left=350,top=290")
	NuevaVentana.moveTo(x0,y0);
}

function AbreVentanaModal(Direccion,ancho,alto,Caracteristicas)
{
	var Usuario = window.showModalDialog(Direccion,window,"dialogHeight:" + alto + "px;dialogWidth:" + ancho + "px" + Caracteristicas);
	return Usuario;
}

function hacerVisible( obj )
{
	obj.style.visibility = '';
}

function hacerInvisible( obj )
{
	obj.style.visibility = 'hidden';
}

function Posicionar( obj, paramX, paramY )
{
	obj.style.left = paramX;
	obj.style.top = paramY;
}

function CambiarColorFondo( obj, color )
{
	obj.style.background = color;
}

function CambiarColorLetra( obj, color )
{
	obj.style.color = color;
}

function Instr( start, cad1, cad2 )
{
	for( var i=start;i<=cad1.length;i++)
	{
		if( cad1.substr( i, 1 ) == cad2 )
		{
			return i;
			break;
		}
	}
	return 0;
}

function Activar( obj )
{
	obj.disabled = false;
}
		
function Desactivar( obj )
{
	obj.disabled = true;
}

function Vacio( value )
{
	if( value == "" || value == null || !value ) return true;
	else return false;
}

function CambiarImagen( obj, img )
{
	obj.src = img;
}

function checkButton( radio ) 
{
	if ( radio.length ) {	
		for ( i = 0; i < radio.length; i++ )
			if ( radio[i].checked )
				return radio[i].value;
	}
	else
		return radio.value;
}

function CarProb( cad )
{
	/*
	.  = 46
	'  = 39
	" = 34
	/ = 47
	*/
	//if( cad == "." || cad == "/" || cad == "'" || cad == '"' ) return true;
	//alert('');
	if( cad == "'" || cad == '"' || cad == "<" || cad == ">" ) return true;
	else return false;
}

function MostrarPopUp( x, y, w, h, back, border, html )
{
	var oPopBody = oPopup.document.body;
/*
	var X = CapturarX();
	var Y = CapturarY();
	oPopBody.style.backgroundColor = "lightyellow";
	oPopBody.style.border = "solid black 1px";
	oPopBody.innerHTML = "Los usuarios de &quot;Mis Perfiles&quot; son distintas identidades para un mismo miembro. Con esto conseguimos aunar en un solo usuario a una comunidad completa ( Empresas, familias... )<br><br>Aunque el usuario por defecto a la hora de autocompletar los diseños será el que se dió en el registro, un usuario puede utilizar sus perfiles para crear trabajos con unos datos personales distintos al principal. Es una herramienta muy util en el caso que los datos del usuario a rellenar varíen constantemente.";
	oPopup.show(X, Y, 240, 200, document.body);
*/
	oPopBody.style.backgroundColor = back;
	oPopBody.style.border = border;
	oPopBody.innerHTML = html;
	oPopup.show(x, y, w, h, document.body);
}

function OcultarPopUp()
{
	oPopup.hide();
}

function Sistemico( func, ms )
{
	var idIntervalo = "";
	idIntervalo = window.setInterval( func, ms );
	return idIntervalo;
}

