function printPage()
{
var sOption="toolbar=no,location=no,directories=no,menubar=yes,";
	sOption+="resizable=yes,scrollbars=yes,width=750,height=500,left=100,top=25";
var sWinHTML = document.getElementById('inicioContenido').innerHTML;
var winprint=window.open("","",sOption);
	winprint.document.open();
	winprint.document.write('<html><LINK href=../css/sf.css rel=Stylesheet><body>');
	winprint.document.write(sWinHTML);
	winprint.document.write('</body></html>');
	winprint.document.close();
	winprint.focus(); 
	winprint.print();
}

function printCert()
{
var sOption="toolbar=no,location=no,directories=no,menubar=yes,";
	sOption+="resizable=yes,scrollbars=yes,width=750,height=500,left=100,top=25";
var sWinHTML = document.getElementById('inicioContenido').innerHTML;
var winprint=window.open("","",sOption);
	winprint.document.open();
	winprint.document.write('<html><LINK href=../css/cert.css rel=Stylesheet><body>');
	winprint.document.write(sWinHTML);
	winprint.document.write('</body></html>');
	winprint.document.close();
	winprint.focus(); 
	winprint.print();
}

function button(e, estilo)
{
var el=window.event? event.srcElement: e.target
if (el.tagName=="INPUT"&&el.type=="submit")
el.className=estilo
}

function formatea_fecha(ev, e)
{
/*	alert ('Evento : ' + ev);*/
	if ( (ev < 37 || ev > 40 ) && (ev!= 46) && (ev!= 8))
	{
		var txt = e.value;
		if (txt.length == 2)
			{
				txt = txt + "/";
			}
		if (txt.length == 5)
			{
				txt = txt + "/";
			}
		/*
		alert ('Largo : ' + txt.length );
		alert ('Value : ' + txt);
		*/
		e.value = txt;
		e.focus()
	}
	return true;
}

function validaFecha(texto,obj){
	var reg= /^(?=\d)(?:(?!(?:(?:0?[3-9]|1[0-3])(?:\.|-|\/)0?9(?:\.|-|\/)(?:1752)))(31(?!(?:\.|-|\/)(?:0?[2469]|11))|30(?!(?:\.|-|\/)0?2)|(?:29(?:(?!(?:\.|-|\/)0?2(?:\.|-|\/))|(?=\D0?2\D(?:(?!000[04]|(?:(?:1[^0-6]|[2468][^048]|[3579][^26])00))(?:(?:(?:\d\d)(?:[02468][048]|[13579][26])(?!\x20BC))|(?:00(?:42|3[0369]|2[147]|1[258]|09)\x20BC))))))|2[0-8]|1\d|0?[1-9])([-.\/])(1[012]|(?:0?[1-9]))\2((?=(?:00(?:4[0-5]|[0-3]?\d)\x20BC)|(?:\d{4}(?:$|(?=\x20\d)\x20)))\d{4}(?:\x20BC)?))?$/;
	if (texto.length!=0){
		if (texto.length==10){
			if (reg.test(texto)){
				obj.style.backgroundColor='#ffffff';
				return;
			}
			else{
			obj.style.backgroundColor='#ffffe1';
			alert('FECHA INCORRECTA');
			}
		}
		else{
		obj.style.backgroundColor='#ffffe1';
		alert('FECHA INCOMPLETA');
		}
	}
	else{
		obj.style.backgroundColor='#ffffe1';
		alert('INGRESE FECHA');
	}
}

function disablePage()
{
var textDiv = document.createElement("div");
textDiv.id = "textDiv";
textDiv.innerHTML = "<br>Por favor espere a que se grabe la solicitud.<br>Al finalizar, usted será direccionado automáticamente al detalle de la multa.<br>&nbsp;<br>"; 
textDiv.style.cssText = "position:fixed;width:" + screen.width +";top:10; background-color:#ffffff; color:#000000;text-align:center;margin-left:auto;margin-right:auto;";
	
var blurDiv = document.createElement("div");
blurDiv.id = "blurDiv";
blurDiv.appendChild(textDiv);
blurDiv.style.cssText = "text-align:center;position:absolute; top:0; right:0; width:" + screen.width + "px; height:" + screen.height + "px; background-color: #000000; opacity:0.5; filter:alpha(opacity=50)";
document.getElementsByTagName("body")[0].appendChild(blurDiv);
}

function enablePage()
{
var blurDiv = document.getElementById("blurDiv");
blurDiv.parentNode.removeChild(blurDiv);
}
