// JavaScript Document by ReYMoN

function fadetext(hex){
if(hex>0) { //If color is not black yet
hex-=11; // increase color darkness
document.getElementById("alaska").style.color="rgb(255,"+hex+","+hex+")";
setTimeout("fadetext("+hex+")",20); 
}
else
{
hex=255; //reset hex value
setTimeout("fadetext("+hex+")",2000);
}
}


function isEmpty(str) {
	for (var intLoop = 0; intLoop < str.length; intLoop++)
		if (" " != str.charAt(intLoop))
			return false;
	return true;
}


//onSubmit="return checkRequired(this.name, 1)"
//<input type="text" name="Campo" class="TextBox" size="20" required>
//<label id="FormularioCampo" class="Alerta">*</label>
function checkRequired(TheForm, Show)
	{
	for (var intLoop = 0; intLoop<document.forms[TheForm].elements.length; intLoop++)
		{
		if (null!=document.forms[TheForm].elements[intLoop].getAttribute("required")) 
			if (isEmpty(document.forms[TheForm].elements[intLoop].value))
			   {
			   //alert('Este dato es requerido:\n\n' + document.forms[TheForm].elements[intLoop].name);
			   document.forms[TheForm].elements[intLoop].focus();
			   if (Show == 1) {document.getElementById(TheForm + document.forms[TheForm].elements[intLoop].name).style.visibility='visible';}
			   return false;
			   }
		}
	
	return true;
	}