var Ventana2;

function openIT(theURL,W,H, wname,S) {
  var prop;

  if (S!='no') S="yes"

  prop = "width="+W+",height="+H+",scrollbars="+S;


if (Ventana2) {
    if (Ventana2.closed) {
      Ventana2=open(theURL,wname,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");
      Ventana2.focus();
    }
    else {
      Ventana2=open(theURL,wname,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");
      Ventana2.focus();
    }
  }
  else {
      Ventana2=open(theURL,wname,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");
      Ventana2.focus();
  }
}

function clearInput(id,texto,tipo){
/*
  Esta función borrar el contenido por defecto de un input tipo texto y lo vuelve a mostrar.
  id: identificador del input
  texto: texto por defecto del input
  tipo: 'mostrar' o 'borrar'
*/
    if(tipo=='mostrar'){
        if(document.getElementById(id).value==''){
            document.getElementById(id).value=texto;
        }
    }
    if(tipo=='borrar'){
        if(document.getElementById(id).value==texto){
            document.getElementById(id).value='';
        }
    }

}

function emutation_ToObject(id) {
		if(document.layers){
			return (document.layers[id])?eval(document.layers[id]):null;
		}
		else if(document.all && !document.getElementById){
			return (eval("window."+id))?eval("window."+id):null;
		}
		else if(document.getElementById && document.body.style) {
			return (document.getElementById(id))?eval(document.getElementById(id)):null;
		}
	}

function emutation_FlashWrite(miEMswf, miEMcreativewidth, miEMcreativeheight, miEMwmode, miEMbgcolor, miID){

	var emswf = miEMswf;
	var emcreativewidth = miEMcreativewidth;
	var emcreativeheight = miEMcreativeheight;
	var emwmode = miEMwmode;
	var embgcolor = miEMbgcolor;

	ntcode = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+ emcreativewidth +"' height='"+ emcreativeheight +"' id='"+ miID +"'>";
	ntcode +="<param name='movie' value='" + emswf + "'>";
	ntcode +="<param name='quality' value='high'>";
	ntcode +="<param name='bgcolor' value='#" + embgcolor +"'>";
	ntcode +="<param name='wmode' value='"+ emwmode +"'>";
	ntcode +="<param name='menu' value='false'>";
	ntcode +="<embed src='" + emswf + "' quality='high' wmode='" + emwmode + "' width='" + emcreativewidth + "' height='" + emcreativeheight + "' bgcolor='#" + embgcolor +"' type='application/x-shockwave-flash' menu='false' name='"+ miID +"' swLiveConnect='true'></embed></object>";
  	document.write(ntcode);
}

function emutation_FlashInnerHTML(htmlElementId,code){
  var x=emutation_ToObject(htmlElementId);
  if(x){
    if(document.getElementById||document.all){
      x.innerHTML='';
      x.innerHTML=code;
      }
    else if(document.layers){
      x.document.open();
      x.document.write(code);
      x.document.close();
      }
    }
  }