var ie=document.all;
	var ns6=document.getElementById&&!document.all;
	var n=document.layers;
	
function ventana(cual,alto,txt,ancho,color){	

var LeftP = (screen.width) ? (screen.width-ancho)/2 : 0;
var TopP = (screen.height) ? (screen.height-alto)/2 : 0;

		vent="vent1"
		if(color)
		{
			color="0090FA" ;
			cerrar="cerrar2" ;
		}
		else
		{
			color="0090FA" ;
			cerrar="cerrar" ;
		}
			
		//txt="OBJETIVOS"
		if(ie){
			var paginaweb='\n' +
			'<html>																							'+ '\n'+
			'<head>                                                                                                                                                                         	'+ '\n'+
			'<title>&nbsp;CHROMELESS WINDOWS / TITLEBAR</title>                                                                                                                      		'+ '\n'+
			'<style type="text/css">                                                                                                                                                        	'+ '\n'+
			'#mywindow 		{ position: absolute; left:   0px; top:   0px; width: 100%; height: 22px; z-index: 2;                            	      clip:rect(0,100%;22,0); }         '+ '\n'+
			'#mywindowCLOSE 	{ position: absolute; left: 0px; top: 0px; width: 34px; height: 11px; z-index: 3;                            	      clip:rect(0,34,11,0);   }         '+ '\n'+
			'#mywindowNOMBRE 	{ position: absolute; left: 10px; top: 2px; z-index: 1}         '+ '\n'+
			'</style>                                                                                                                                                                       	'+ '\n'+
			'<script language="javascript">																				'+ '\n'+										
						'function mouseSTATUS() {                                                                                                                                                               '+ '\n'+
						'	this.x       = null;                                                                                                                                                            '+ '\n'+
						'	this.y       = null;                                                                                                                                                            '+ '\n'+
						'	this.bt      = "up";                                                                                                                                                            '+ '\n'+
						'	this.oldx    = null;                                                                                                                                                            '+ '\n'+
						'	this.oldy    = null;                                                                                                                                                            '+ '\n'+
						'	this.dx      = null;                                                                                                                                                            '+ '\n'+
						'	this.dy      = null;                                                                                                                                                            '+ '\n'+
						'	this.screeny = null;                                                                                                                                                            '+ '\n'+
						'	this.screenx = null;                                                                                                                                                            '+ '\n'+
						'                                                                                                                                                                                       '+ '\n'+
						'	this.element = null;                                                                                                                                                            '+ '\n'+
						'	this.event   = null;                                                                                                                                                            '+ '\n'+
						'}                                                                                                                                                                                      '+ '\n'+
						'                                                                                                                                                                                       '+ '\n'+
						'var mouse = new mouseSTATUS();                                                                                                                                                         '+ '\n'+
						'                                                                                                                                                                                       '+ '\n'+
						'function actualizateMouseSTATUS(e) {                                                                                                                                                   '+ '\n'+
						'	if (!e) var e = event                                                                                                                                                           '+ '\n'+
						'	if ( (e.type=="mousedown" || e.type=="mouseup") && e.button!=1) return true                                                                                                     '+ '\n'+
						'                                                                                                                                                                                       '+ '\n'+
						'	var x=e.x+document.body.scrollLeft                                                                                                                                              '+ '\n'+
						'	var y=e.y+document.body.scrollTop                                                                                                                                               '+ '\n'+
						'                                                                                                                                                                                       '+ '\n'+
						'	mouse.x   = x;                                                                                                                                                                  '+ '\n'+
						'	mouse.y   = y;                                                                                                                                                                  '+ '\n'+
						'                                                                                                                                                                                       '+ '\n'+
						'	     if ( e.type == "mousedown" ) mouse.bt = "down";                                                                                                                            '+ '\n'+
						'	else if ( e.type == "mouseup" )   mouse.bt = "up";                                                                                                                              '+ '\n'+
						'                                                                                                                                                                                       '+ '\n'+
						'	if (window.event) {                                                                                                                                                             '+ '\n'+
						'		mouse.screenx=window.event.screenX;                                                                                                                                     '+ '\n'+
						'		mouse.screeny=window.event.screenY;                                                                                                                                     '+ '\n'+
						'	} else {                                                                                                                                                                        '+ '\n'+
						'		mouse.screenx=-1;                                                                                                                                                       '+ '\n'+
						'		mouse.screeny=-1;                                                                                                                                                       '+ '\n'+
						'	}                                                                                                                                                                               '+ '\n'+
						'                                                                                                                                                                                       '+ '\n'+
						'}                                                                                                                                                                                      '+ '\n'+
						'                                                                                                                                                                                       '+ '\n'+
						'                                                                                                                                                                                       '+ '\n'+
						'function initMouseEvents() {                                                                                                                                                           '+ '\n'+
						'	document.onmousedown = actualizateMouseSTATUS                                                                                                                                   '+ '\n'+
						'	document.onmousemove = actualizateMouseSTATUS                                                                                                                                   '+ '\n'+
						'	document.onmouseup   = actualizateMouseSTATUS                                                                                                                                   '+ '\n'+
						'	document.onselectstart = selectstart                                                                                                                                            '+ '\n'+
						'	document.ondragstart   = new Function("actualizateMouseSTATUS(event); return false;")                                                                                           '+ '\n'+
						'}                                                                                                                                                                                      '+ '\n'+
						'                                                                                                                                                                                       '+ '\n'+
						'function selectstart(){                                                                                                                                                                '+ '\n'+
						'	if ( event.srcElement.tagName != "INPUT" && event.srcElement.tagName != "TEXTAREA") { return false; }                                                                           '+ '\n'+
						'	else { mouse.bt="up"; return true; }                                                                                                                                            '+ '\n'+
						'}                                                                                                                                                                                      '+ '\n'+
						'																							'+ '\n'+
						'initMouseEvents()                                                                                                                                                                      '+ '\n'+
						'																							'+ '\n'+
						'var mywindowbt    ="up";                                                                                                                                                               '+ '\n'+
						'var wincloseSTATUS="up";                                                                                                                                                               '+ '\n'+
						'																							'+ '\n'+
						'var ofx=0;                                                                                                                                                                             '+ '\n'+
						'var ofy=0;                                                                                                                                                                             '+ '\n'+
						'var opx=0;                                                                                                                                                                             '+ '\n'+
						'var opy=0;                                                                                                                                                                             '+ '\n'+
						'var px=0;                                                                                                                                                                              '+ '\n'+
						'var py=0;                                                                                                                                                                              '+ '\n'+
						'																							'+ '\n'+
						'var wcpx1=-1, wcpy1=-1;                                                                                                                                                                '+ '\n'+
						'var wcpx2=-1, wcpy2=-1;                                                                                                                                                                '+ '\n'+
						'																							'+ '\n'+
						'var wclosechanged = false;                                                                                                                                                             '+ '\n'+
						'																							'+ '\n'+
						'function initToMoveWin() {                                                                                                                                                             '+ '\n'+
						'		if (wincloseSTATUS=="up" && ( mywindowbt=="up" || mywindowbt=="over") ) {                                                                                               '+ '\n'+
						'					                                                 												'+ '\n'+
	
						'					                                                 												'+ '\n'+
						'					                                                 												'+ '\n'+
						'				wcpx1 = document.all["mywindowCLOSE"].style.pixelLeft=document.body.clientWidth-14                                                                      '+ '\n'+
						'				wcpy1 = document.all["mywindowCLOSE"].style.pixelTop =3                                                                                                  '+ '\n'+
						'				wcpx2 = wcpx1 + 11 - 1                                                                                                                                  '+ '\n'+
						'				wcpy2 = wcpy1 + 11 - 1                                                                                                                                  '+ '\n'+
						'				if ( mouse.x >= wcpx1 && mouse.x <= wcpx2 && mouse.y >= wcpy1 && mouse.y <= wcpy2) {                                                                    '+ '\n'+
						'					if (wclosechanged == false) {                                                                                                                   '+ '\n'+
	
						'						wclosechanged = true                                                                                                                    '+ '\n'+
						'					}                                                                                                                                               '+ '\n'+
						'						                                                                                                                                        '+ '\n'+
						'				} else if (wclosechanged == true) {                                                                                                                     '+ '\n'+
	
						'					wclosechanged = false                                                                                                                           '+ '\n'+
						'				}                                                                                                                                                       '+ '\n'+
						'		}                                                                                                                                                                       '+ '\n'+
						'																							'+ '\n'+
						'		     if (   mouse.y <= 22 && mouse.y >= 1   && mywindowbt == "up"   && mouse.bt =="up"    ) { mywindowbt = "over" }                                                     '+ '\n'+
						'		else if ( ( mouse.y  > 22 || mouse.y <  1 ) && mywindowbt == "over" && mouse.bt =="up"    ) { mywindowbt = "up"   }                                                     '+ '\n'+
						'		else if (   mouse.y <= 22 && mouse.y >= 1   && mywindowbt == "over" && mouse.bt == "down" ) {                                                                           '+ '\n'+
						'			self.window.focus();                                                                                                                                            '+ '\n'+
						'	                                                                                                                                                                                '+ '\n'+
						'			if ( mouse.x >= wcpx1 && mouse.x <= wcpx2 && mouse.y >= wcpy1 && mouse.y <= wcpy2 ) {                                                                           '+ '\n'+
						'				wincloseSTATUS="down"                                                                                                                                   '+ '\n'+
	
						'			} else {                                                                                                                                                        '+ '\n'+																	
						'				ofx =  mouse.x;                                                                                                                                         '+ '\n'+
						'				ofy =  mouse.y;                                                                                                                                         '+ '\n'+
						'				opx =  mouse.x;                                                                                                                                         '+ '\n'+
						'				opy =  mouse.y;                                                                                                                                         '+ '\n'+
						'			}	                                                                                                                                                        '+ '\n'+
						'			mywindowbt="down";                                                                                                                                              '+ '\n'+
						'		}                                                                                                                                                                       '+ '\n'+
						'		else if ( mouse.bt =="up" && mywindowbt == "down" ) {                                                                                                                   '+ '\n'+
						'			mywindowbt="up";                                                                                                                                                '+ '\n'+
						'			ofx=0;                                                                                                                                                          '+ '\n'+
						'			ofy=0;                                                                                                                                                          '+ '\n'+
						'			opx=0;                                                                                                                                                          '+ '\n'+
						'			opy=0;                                                                                                                                                          '+ '\n'+
						'																							'+ '\n'+
						'			if ( mouse.x >= wcpx1 && mouse.x <= wcpx2 && mouse.y >= wcpy1 && mouse.y <= wcpy2 && wincloseSTATUS=="down" ) { top.window.close() }                            '+ '\n'+
						'																							'+ '\n'+
						'			wincloseSTATUS="up"                                                                                                                                             '+ '\n'+
						'		                                                                                                                                                                        '+ '\n'+
						'																							'+ '\n'+
						'		}                                                                                                                                                                       '+ '\n'+
						'		else if ( mywindowbt == "down" && wincloseSTATUS == "up") {                                                                                                             '+ '\n'+
						'			var m_scrx = mouse.screenx;                                                                                                                                     '+ '\n'+
						'			var m_scry = mouse.screeny;                                                                                                                                     '+ '\n'+
						'			opx = px + ofx - m_scrx;                                                                                                                                        '+ '\n'+
						'			opy = py + ofy - m_scry;                                                                                                                                        '+ '\n'+
						'			px = m_scrx - ofx;                                                                                                                                              '+ '\n'+
						'			py = m_scry - ofy;                                                                                                                                              '+ '\n'+
						'			top.window.moveTo(px , py);                                                                                                                                     '+ '\n'+
						'		}                                                                                                                                                                       '+ '\n'+
						'	setTimeout("initToMoveWin()",50);                                                                                                                                               '+ '\n'+
						'}                                                                                                                                                                                      '+ '\n'+
			'</script>                                                                                												'+ '\n'+
			'</head>'+ '\n'+
			'<body TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0  bgcolor=#'+color+'>'+ '\n'+
				'<table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#'+color+'">'+ '\n'+
				'	<tr>'+ '\n'+
				'		<td><img src="img/sp.gif" width="21" height="1"></td>'+ '\n'+
				'		<td><img src="img/sp.gif" width="258" height="18"></td>'+ '\n'+
				'		<td><img src="img/sp.gif" width="11" height="1"></td>'+ '\n'+
				'	</tr>'+ '\n'+
				'</table>'+ '\n'+			
			'<div id=mywindow><img src="img/sp.gif" width=100% height=20 border="0"></div>'+ '\n'+			
			'<div id=mywindowNOMBRE><font style="font-family:Arial,Helvetica;font-size:11px;color:#ffffff;text-decoration:none;font-weight:bold">'+txt+'</font></div>'+ '\n'+			
			'<div id=mywindowCLOSE><a href="javascript:top.close()"><img src="/images/'+cerrar+'.gif" width="11" height="11" alt="" border="0"></a></div>'+ '\n'+
			'</body>                                                                                                                                                                        	'+ '\n'+
			'<script>initToMoveWin();</script>																			'+ '\n'+
			'</html>'+ '\n'												
			
			var sistema='\n' +
			'<HTML>	'+ '\n'+
			'<HEAD>'+ '\n'+
			
			'<script>'+ '\n'+					
			
				'function generatetitle() {'+ '\n'+
				
				'		arriba.document.open();	'+ '\n'+
				'		arriba.document.write( "'+ quitasaltolinea(paginaweb) +'" );'+ '\n'+
				'		arriba.document.close();	'+ '\n'+
				'		abajo.document.bgColor="#'+color+'"'+ '\n'+
				'		derecha.document.bgColor="#'+color+'"'+ '\n'+
				'		izquierda.document.bgColor="#'+color+'"'+ '\n'+
				'		//chromewint.document.bgColor="#'+color+'"'+ '\n'+
				'}'+ '\n'+
				'</script>'+ '\n'+	
			'</HEAD>'+ '\n'+
			'<frameset border=0 framespacing=0 frameborder=0 rows="18,*,1" onload="generatetitle()">'+ '\n'+
			'<frame name=arriba src="about:blank" scrolling=no noresize>'+ '\n'+
			'<frameset border=0 framespacing=0 frameborder=0 cols="1,*,1">'+ '\n'+
			'<frame name=izquierda src="about:blank" scrolling=no noresize>'+ '\n'+	
			'<frame name=main  src=' + cual + '>'+ '\n'+
			'<frame name=derecha src="about:blank" scrolling=no noresize>'+ '\n'+
			'</frameset>'+ '\n'+
			'<frame name=abajo src="about:blank" scrolling=no noresize>'+ '\n'+							
			'</frameset>'

			eval( vent + "=window.open('','" + vent + "','fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=15,left=550')")
			eval(vent + ".resizeTo( ancho ,alto)")
			eval(vent + ".moveTo (LeftP ,  TopP)")
			eval(vent + ".document.open()")
			eval(vent + ".document.write(sistema)")
			eval(vent + ".document.close()")
			eval(vent + ".focus()")
	}else{
			eval(vent + "=window.open('" + cual + "','"+vent+"','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=242,left=300,width="+ancho+",height="+alto+"')")						
	}
	//fernando
	return;
	//fin fernando	
}
function quitasaltolinea(txt) {
  var salida = txt.toString()
  var re     = /\\/g; 
  var salida = salida.replace(re, "\\\\");
  var re     = /\//g; var salida = salida.replace(re, "\\\/");
  var re     = /\"/g; var salida = salida.replace(re, "\\\"");
  var re     = /\'/g; var salida = salida.replace(re, "\\\'");
  var re     = /\n/g; var salida = salida.replace(re, "\\n");
  var re     = /  /g; var salida = salida.replace(re, "");
  var re     = /\t/g; var salida = salida.replace(re, "");
  var re     = /\r/g; var salida = salida.replace(re, "");
  return salida
}
