function tamBanner(name,valor){
   eval("document.getElementById('"+name+"').style.height='"+valor+"px'");
}
function viewFla(ruta,ancho,alto,pfv,noruta) {
    var addbase = '';
    base = ruta.split('/');
    if (noruta != undefined) {
        base = '';
    }
    else {
        if (base.length > 1) {
            addbase = "/";
            base.length = base.length - 1;
            base = base.join('/')+addbase;
        }
        else {
            base = '';
        }
    }
    document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='" + ancho + "' height='" +  alto + "' border='0'>");
    document.write("<param name='movie' value='" + ruta + "'>");
    document.write("<param name='quality' value='High'>");
    document.write("<param name='wmode' value='transparent'>");
    document.write("<param name='scale' value='exactfit'>");
    document.write("<param name='allowFullScreen' value='false'>");
    document.write("<param name='menu' value='false'>");
    document.write("<param name='base' value='" + base + "'>");
    if (pfv != undefined) {
        document.write("<param name='FlashVars' value='"+pfv+"'>");
    }
    document.write("<embed src='" + ruta + "' quality='High' allowFullScreen='false' scale='exactfit' menu='false' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + ancho + "' height='" +  alto + "'></embed>");
    document.write("</object>");
}

function fecha()
{	var TheFontFace  = "Arial";
	var TheFontColor = "#555555";
	var TheFontSize  = '12';
	var TheFontStyle = "normal"; 
	var TheSeparator = "-";
	var ShowDay ="yes";
	var Days = new Array("domingo","lunes","martes","miércoles","jueves","viernes","sábado");
	var TheDate = new Date();
	var TheWeekDay = TheDate.getDay();
	var Day ="";
	if (ShowDay == "yes")
	{	Day = Days[TheWeekDay];
		Day += " ";
	}

	var Mes= new Array("enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre");
	var TheMonth = TheDate.getMonth();
	if (ShowDay == "yes")
	{	Mes = Mes[TheMonth];
		Mes += " ";
	}

	var TheMonthDay = TheDate.getDate();
	if (TheMonthDay < 10) TheMonthDay = "0" + TheMonthDay;

	var TheYear = TheDate.getYear();
	if (TheYear < 1000) TheYear += 1900;

	var FontTagLeft  = "";
	var FontTagRight = "";

	if (TheFontStyle == "bold")
	{	FontTagLeft = "<b>";
		FontTagRight ="</b>";
	}

	if (TheFontStyle == "italic")
	{	FontTagLeft = "<i>";
		FontTagRight ="</i>";
	}

	if (TheFontStyle == "bolditalic")
	{	FontTagLeft = "<b><i>"; 
		FontTagRight = "</i></b>";
	}

	var D = "";
	D += "<font color='"+TheFontColor+"' face='"+TheFontFace+"'style='font-size:11 px'>";
	D += Day+", "+TheMonthDay+" de "+Mes+" del "+TheYear;
	D += "</font>";
	document.write(D);
}

function NewWindow(mypage,myname,w,h,scrollbar,resi)
{	LeftPosition = (screen.width-w)/2
	TopPosition = (screen.height-h)/2 
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrollbar+',resizable='+resi+',toolbar=no,directories=no,menubar=no,status=no'
	//window.open(mypage,myname,settings);
	
	var vent ;
	 vent =open(mypage,vent,settings);
	 vent.focus();
}

function resizeDialogToContent()
{
    // resize window so there are no scrollbars visible
    var dh = window.dialogHeight;
    while (isNaN(dh)) {
      dh = dh.substr(0,dh.length-1);
    }
    var dw = window.dialogWidth;
    while (isNaN(dw)) {
      dw = dw.substr(0,dw.length-1);
    }
    
    difh = dh - this.document.body.clientHeight;
    difw = dw - this.document.body.clientWidth;
    window.dialogHeight = this.document.body.scrollHeight+difh+'px';
    window.dialogWidth = this.document.body.scrollWidth+difw+'px';
}

function ftrim(cadena) {
	for(i=0; i<cadena.length; ) {
		if(cadena.charAt(i)==" ")
			cadena=cadena.substring(i+1, cadena.length);
		else
			break;
	}
	for(i=cadena.length-1; i>=0; i=cadena.length-1)	{
		if(cadena.charAt(i)==" ")
			cadena=cadena.substring(0,i);
		else
			break;
	}
	return cadena;
}

function open_cml_html(codigo){
   window.open('vercml.php?cod='+codigo, 'vVer_Cml', 'left=1 top=1 height=1 width=1 menubar=no resizable=no scrollbars=yes status=no toolbar=no dependent=yes hotkeys=no');
}