function openchromeless(theURL, wname, W, H, NONEgrf, titWIN) {

	if ( navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion)>=4 ) {
			isie=true
		if ( navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE ")+5,navigator.appVersion.indexOf("MSIE ")+8) >= 5.5 )
			isv55=true
		else
			isv55=false
	}
	else
	isie=false
	
	if ( navigator.userAgent.toLowerCase().indexOf("win")!=-1 )
		iswin=true
	else 
		iswin=false

	var windowW = W;
	var windowH = H;
	var windowX = Math.ceil( (window.screen.width  - windowW) / 2 );
	var windowY = Math.ceil( (window.screen.height - windowH) / 2 );

	if (isie) { H=H; W=W; }
	s = ",width="+ W +",height="+ H ;

	if (isie && iswin) {
	var chromeTIThtml = 														'\n' +
	'<html> 																	'+ '\n'+
	'<head> 																	'+ '\n'+
	'<title>&nbsp;CHROMELESS WINDOWS / TITLEBAR</title> 						'+ '\n'+
	'<script language="javascript"> 											'+ '\n'+
	'document.onselectstart = new Function("return false;") 					'+ '\n'+
	'document.ondragstart   = new Function("return false;") 					'+ '\n'+
	'document.oncontextmenu = new Function("return false;") 					'+ '\n'+
	'document.onmousemove   = moveWIN 											'+ '\n'+
	'var winSTATUS = "up"; 														'+ '\n'+
	'var ofx=0; 																'+ '\n'+
	'var ofy=0; 																'+ '\n'+
	'var px=0; 																	'+ '\n'+
	'var py=0; 																	'+ '\n'+
	'function moveWIN() { 														'+ '\n'+
	'	if ( winSTATUS == "down") { 											'+ '\n'+
	'		ofx =  event.x 														'+ '\n'+
	'		ofy =  event.y 														'+ '\n'+
	'		winSTATUS = "drag" 													'+ '\n'+
	'	} 																		'+ '\n'+
	'	else if ( winSTATUS == "drag") { 										'+ '\n'+
	'		px = event.screenX - ofx; 											'+ '\n'+
	'		py = event.screenY - ofy; 											'+ '\n'+
	'		top.window.x=px; 													'+ '\n'+
	'		top.window.y=py; 													'+ '\n'+
	'		top.window.moveTo(px , py); 										'+ '\n'+
	'	} else { 																'+ '\n'+
	'		winStatus = "up" 													'+ '\n'+
	'	} 																		'+ '\n'+
	'} 																			'+ '\n'+
	'</script> 																	'+ '\n'+
	'</head> 																	'+ '\n'+
	'<body leftmargin="0" topmargin="0">										'+ '\n'+
	'<img src="'+ NONEgrf +'" onmousedown="winSTATUS=\'down\';moveWIN()" 		'+ '\n'+
	'onmouseup="winSTATUS=\'up\';moveWIN()" border="0"> 						'+ '\n'+
	'</body>																	'+ '\n'+
	'</html>																	'+ '\n'
	
	var chromeFRMhtml =															'' +
	'<HTML>																		'+ '\n'+
	'<HEAD>                   													'+ '\n'+
	'<TITLE>'+ titWIN +'</TITLE>												'+ '\n'+
	'</HEAD>                  													'+ '\n'+
	'<script> 																	'+ '\n'+
	'function generatetitle() { 												'+ '\n'+
	'	if( window.frames["frmTIT"] ) {											'+ '\n'+
	'		frmTIT.document.write( "'+ convert(chromeTIThtml) +'" );			'+ '\n'+
	'	} else {																'+ '\n'+
	'		setTimeout("generatetitle()",20)									'+ '\n'+
	'	}																		'+ '\n'+
	'}																			'+ '\n'+
	'top.window.h='+H+'															'+ '\n'+
	'top.window.w='+W+'															'+ '\n'+
	'top.window.x='+windowX+'													'+ '\n'+
	'top.window.y='+windowY+'													'+ '\n'+
	'generatetitle()															'+ '\n'+
	'</script>																	'+ '\n'+
	'	<frameset border=0 framespacing=0 frameborder=0 rows="18,100%"> 		'+ '\n'+
	'		<frame name=frmTIT src="about:blank" scrolling=no>  				'+ '\n'+
	'		<frame name=main   src="'+theURL+'">            					'+ '\n'+
	'	</frameset>                                           					'+ '\n'+
	'</HTML>                                   									'

	splashWin = window.open( "" , wname, "fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0"+s);
	if (!(navigator.userAgent.toLowerCase().indexOf("mozilla/5")!=-1)) {
		splashWin.resizeTo( Math.ceil( W )       , Math.ceil( H ) );
	}
		splashWin.moveTo  ( Math.ceil( windowX ) , Math.ceil( windowY ) );
	splashWin.document.open();
	splashWin.document.write( chromeFRMhtml );
	splashWin.document.close();
	}
	else    {
		splashWin = window.open(theURL, wname, "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1"+s, true);
	}
	splashWin.focus();
	return splashWin
}                                                                               
                                                                                
function convert(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
}