function Ventana(nombre, ancho, alto, top, left) {
Vent=window.open(nombre,"DisplayWindow", "toolbar=0,width=" + ancho + ",height=" + alto + ",scrollbars=yes,top=" + top + ",left=" + left + "");
//Vent.document.close();
//Vent=window.open("newarea.asp","DisplayWindow", "toolbar=0,width=300,height=180,scrollbars=auto,top=80,left=420");
//Vent.focus();
}

function cursorwait() {
 document.body.style.cursor='wait';
}

function cursordone() {
 document.body.style.cursor='auto';
}


function VentanaS(nombre, ancho, alto, top, left) {
Vent2=window.open(nombre,"DisplayWindow", "toolbar=0,width=" + ancho + ",height=" + alto + ",scrollbars=no,top=" + top + ",left=" + left + "");
//Vent.document.close();
//Vent=window.open("newarea.asp","DisplayWindow", "toolbar=0,width=300,height=180,scrollbars=auto,top=80,left=420");
Vent2.focus();
//return true;
}


//Funcion para abrir la ventana de prueba de HCP 
function AbrirVentana(nombrep){ 
ventana9=window.open(nombrep,"","menubar=yes,toolbar=yes,scrollbars=yes,status=yes,directories=yes,height=200,width=300");
ventana9.focus();
}

function Ventana_Imprimir(nombre, ancho, alto, top, left) {
Vent2=window.open(nombre,"", "toolbar=0,width=" + ancho + ",height=" + alto + ",scrollbars=no,top=" + top + ",left=" + left + "");
//Vent2=window.open(nombre,"", "toolbar=0,scrollbars=no,top=" + top + ",left=" + left + "");
Vent2.focus();
}

function Imprimir_Ventana() {
Imprimir();
window.close();
}

function Imprimir(){
var Version = parseInt(navigator.appVersion);
var Browser = navigator.appName;

	if ((Browser == "Netscape")&&(Version > 3)) {
        //	alert("Para imprimir utilice la versión 5 o superior.");
		window.print();
	}else if (Browser == "Microsoft Internet Explorer"){
		if (Version<4)
			alert("Para imprimir utilice la versión 5 o superior.");
		else
		{
		document.body.insertAdjacentHTML("beforeEnd",
	    "<object id=\"printWB\" width=0 height=0 \
	    classid=\"clsid:8856F961-340A-11D0-A96B-00C04FD705A2\"></object>");
	    execScript("on error resume next: printWB.ExecWB 6, 1", "VBScript");
	    printWB.outerHTML = "";
		}
	}
}

function abrir_imagen_directa(imagen,pie,Ancho,Alto)
{
	MasAlto=Alto;  //+11;
	features = "width="+Ancho+",height="+MasAlto+",top=80,left=100,location=no,srollbars=no,toolbar=no,menubar=no";
	//path_imagen= "/common/imagen_directa.htm?img="+imagen+"&pie="+pie+"&w="+Ancho+"&h="+Alto;
	w_new = window.open(imagen,Ancho+Alto,features);
    w_new.focus();
	w_new.document.write("<html>");
	w_new.document.write("<head>");
	w_new.document.write("<title>"+pie+"</title>");
	w_new.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
	w_new.document.write("</head>");
	w_new.document.write("<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 bgcolor=#000000>");
	w_new.document.write("<table border=0 bgcolor=#000000 cellpadding=0 cellspacing=0 vspace=0 hspace=0>");
  //	w_new.document.write("<tr>");
  //    w_new.document.write("<td bgcolor=#000000 align=right height=11><a href=\'javascript:window.close()\'><img src=\'images/cerrar.gif\'  alt='Cerrar' width=\'61\' height=\'11\' border=0></a></td>");
  //	w_new.document.write("</tr>");
  	w_new.document.write("<tr>");
        w_new.document.write("<td >");
	w_new.document.write("<img src='");
	w_new.document.write(imagen + "'");
	w_new.document.write(" width='");
	w_new.document.write(Ancho + "'");
	w_new.document.write(" height='");
	w_new.document.write(Alto + "'");
	w_new.document.write(" alt='");
	//w_new.document.write(pie);
	w_new.document.write("'></td>");
  	w_new.document.write("</tr>");
	w_new.document.write("</table>");
	w_new.document.write("</body>");
	w_new.document.write("</html>");
}

function valida(tipval){
var xkey=window.event.keyCode;

	if(tipval=="int")
		if ((xkey < 48) || (xkey > 57)) event.returnValue = false;
	if(tipval=="str")
		if ((((xkey != 32) && (xkey < 65)) || ((xkey > 90) && (xkey < 97)))) event.returnValue = false;

}

function femail(correo){
if (correo.indexOf("@") == -1 ||
		            correo.indexOf(".") == -1 ||
		            correo.value == "") {
		                return false;
}
else{
	return true;
}
}


function corta(forma, caja, tamano) {
 with (forma) {
  if (caja.value.length>tamano-1)
   caja.value=caja.value.substring(0,tamano-1);
  caja.focus();
 }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
