function imprime(){
	/*
	var src = new String( document.location );
	if( src.indexOf( '?' ) !=-1 ){
		src = src+ "&print_view=true";
	}	else	{
		src = src + "?print_view=true";	
	}	document.location = src;*/
	/*
	document.getElementById('stylePrintSheet').setAttribute( 'media', 'all, print' );
	setTimeout("window.print();", 1200 );*/
	if (window.print) { window.print(); }
	else{
	var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
	document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
	WebBrowser1.ExecWB(6, 2); //Use a 1 vs a 2 for prompting deialog box
	WebBrowser1.outerHTML = "";
	}
}

function bookmark(){
	var title = document.title.replace(/([^a-z|A-Z|0-9|\-| ])/gi, "");
	if( document.all ) {
		window.external.AddFavorite( document.location, title );	
	}	else if( window.sidebar ){
		window.sidebar.addPanel( title, document.location, "" );
	}	return true;
}

//Validacion de dato numerico
function EsNumerico (sTexto)
{
var ValidChars ="0123456789";
var EsNumero=true;
 for(i=0; i<sTexto.length && EsNumero; i++)
	if (ValidChars.indexOf(sTexto.charAt(i)) == -1)
		EsNumero=false;
return EsNumero;
}


//Validacion del Login (cedula y fecha de naciemiento)
function fValidInput()
{
 var vRet = false;
 var CLoc = String(window.location);
 var sPatron = "?ErrCod=";
 var iGetPos = 0;
 var vCed= document.forms["formam"]["credential_0"].value;
 var vFNac= document.forms["formam"]["credential_1"].value;
 var sGetAux= "&credential_0=" + String(vCed) + "&credential_1=" + String(vFNac);
 
 iGetPos = CLoc.indexOf(sPatron);
 
 if(vCed.length == 0 || vFNac.length == 0 )
 {
	ErrorText = 2;
 }
 else
 {
	 if(EsNumerico(vFNac) && vFNac.length != 6) {
		ErrorText = 4;
	} else if(vFNac.length < 6 || vFNac.length > 6)
	{
		ErrorText = 1;
	} else if( !EsNumerico(vFNac) ){
		ErrorText = 3;
	} else if (isNaN(vFNac.substring(0,2)) || isNaN(vFNac.substring(2,2)) || isNaN(vFNac.substring(4,2))) {
		ErrorText = 1;
	} else if(parseInt(vFNac.substring(0,2)) < 1 || parseInt(vFNac.substring(0,2)) > 31 ||
			parseInt(vFNac.substring(2,2)) < 1 || parseInt(vFNac.substring(2,2)) > 12 ) {
		ErrorText = 1;
	} else {
		vRet = true;
	}
 }
 if(!vRet)
 {
	if (iGetPos>0)
	{
		CLoc = CLoc.substring(0,iGetPos);
	}
	CLoc =  CLoc + "?ErrCod=" + String(ErrorText) + sGetAux;
	window.location = CLoc;
 }
return vRet;
}
