/*
CHROMELESS WINDOWS v.30.5
(c) Gabriel Suchowolski power[z]one / www.microbians.com / powerz@microbians.com
Distributed under the terms of the GNU Library General Public License (www.gnu.org)
Modified by Tim Fadden of Singular by Design, LLC. / www.singular-by-design.com / fredboy@lithiawater.com
*/
function openchromeless(theURL,wname,W,H,X,Y,NONEgrf,CLOSEdwn,CLOSEup,CLOSEovr,MINIdwn,MINIup,MINIovr,CLOCKgrf,titHTML,titWIN,winBORDERCOLOR,winBORDERCOLORsel,winBGCOLOR,winBGCOLORsel) {
var isie=false
var isv55=false
var iswin=false
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
}
if ( navigator.userAgent.toLowerCase().indexOf("win")!=-1 ) iswin=true
if (X==null) {
	if (titWIN=="fluted") X=Math.ceil(((screen.width-W)/2)-20)
	else if (titWIN=="seuss") X=Math.ceil(((screen.width-W)/2)-54)
	else if (titWIN=="polycomp") X=Math.ceil(((screen.width-W)/2)-60)
	else if (titWIN=="birthing of a universe") X=Math.ceil(((screen.width-W)/2)-44)
	else if (W==420) X=Math.ceil(((screen.width-W)/2)-10)		
	else if ((W<=419)||(H>=456)) X=Math.ceil((screen.width-W)/2)
	else X=Math.ceil(((screen.width-W)/2)-80)
	}
if (Y==null) Y=Math.ceil((screen.height-H)/2)
if (isie) { H=H+20+3;W=W+2;}
var s=",width="+ W +",height="+ H ;
if (MINIup=="img/mini_up.gif"){
	t=2;
	wx=11;
	hy=13;
	lx=38;
	miniBut=''+
'<img GALLERYIMG=no name=imgMINI src="'+MINIup+'" border=0 width=11 height=11  onmouseover="this.src=imgMINIovr.src" onmouseout="btnSTATUS=false;this.src=imgMINIup.src" onmouseup="this.src=imgMINIup.src" onmousedown="this.src=imgMINIdwn.src" onclick="minimizeWIN()">\n'
} else {
//this adjusts the distance to the top(t) and thickness(hy) of the acquire button.  The 
//actual distance to the top is dependent upon the text size setting in IE.  t=1 and hy=16 is
//the set for medium (IE'a default). t=4 and hy=13 is the set for smaller.
	t=1;
	wx=60;
	hy=16;
	lx=88;
	miniBut=''+
	'<a href="javascript:void(\'\')" onclick="mywinname02=openIT1(\'buy.html\', \''+titWIN+'\', 580, 440, null, null, \'mywinname02\', \'<font face=verdana size=1 color=black>&nbsp;&nbsp;&nbsp;a c q u i r e&nbsp;&nbsp;&nbsp;t h i s&nbsp;&nbsp;&nbsp;p r i n t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>\', \'acquire\');" onfocus="window.status=\'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a c q u i r e&nbsp;&nbsp;&nbsp;t h i s&nbsp;&nbsp;&nbsp;p r i n t\'; this.blur();"><img GALLERYIMG=no name=imgMINI src="'+MINIup+'" border=0 width=60 height=13 onmouseover="this.src=imgMINIovr.src; window.status=\'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a c q u i r e&nbsp;&nbsp;&nbsp;t h i s&nbsp;&nbsp;&nbsp;p r i n t\';" onmouseout="btnSTATUS=false;this.src=imgMINIup.src; window.status=\'\';" onmouseup="this.src=imgMINIup.src" onmousedown="this.src=imgMINIovr.src" ></a>\n'
	}
if (isie && iswin) {
var chromeTIThtml=''+
'<html>\n'+
'<head>\n'+
'<style type="text/css">\n'+
'#crtMOVE {position:absolute;left:0px;top:0px;z-index:2;}\n'+
'#txtTITLE {position:absolute;left:0px;top:0px;width:100%;height:20px;z-index:1;clip:rect(0,100%,20,0);}\n'+
'#btnCLOSE {position:absolute;left:-20px;top:4px;width:11px;height:11px;z-index:3;clip:rect(0,11,11,0);}\n'+
'#btnMINI {position:absolute;left:-20px;top:'+t+'px;width:'+wx+'px;height:'+hy+'px;z-index:3;clip:rect(0,'+wx+','+hy+',0);}\n'+
'#grfCLOCK {position:absolute;left:-20px;top:4px;width:11px;height:11px;z-index:3;clip:rect(0,11,11,0);}\n'+
'.tit{color: #000000;font-family: verdana, geneva, sans-serif;font-size:9px;}\n'+
'</style>\n'+
'<script language="javaScript" type="text/javascript" SRC="chromeless_31.js"></SCRIPT>\n'+
'<script language="javascript">\n'+
'var imgCLOSEdwn=new Image();imgCLOSEdwn.src="'+ CLOSEdwn +'"\n'+
'var imgCLOSEup=new Image();imgCLOSEup.src="'+ CLOSEup +'"\n'+
'var imgCLOSEovr=new Image();imgCLOSEovr.src="'+ CLOSEovr +'"\n'+
'var imgMINIdwn=new Image();imgMINIdwn.src="'+ MINIdwn +'"\n'+
'var imgMINIup=new Image();imgMINIup.src="'+ MINIup +'"\n'+
'var imgMINIovr=new Image();imgMINIovr.src="'+ MINIovr +'"\n'+
'var CLOCKgrfImg=new Image();CLOCKgrfImg.src="'+ CLOCKgrf +'"\n'+
'document.onselectstart=new Function("return false;")\n'+
'document.ondragstart=new Function("moveWIN();return false;")\n'+
'document.oncontextmenu=new Function("return false;")\n'+
'document.onmousemove=moveWIN\n'+
'winSTATUS="up"\n'+
'function setLAYOUT() {\n'+
'document.all["btnCLOSE"].style.pixelLeft=document.body.clientWidth-18\n'+
'if ( top.mainloaded ) {\n'+
'document.all["grfCLOCK"].style.visibility="hidden"\n'
if (MINIup=="img/mini_up.gif"){
if (isv55) {
chromeTIThtml +=''+
'document.all["btnMINI"].style.visibility="visible"\n'+
'document.all["btnMINI"].style.pixelLeft=document.body.clientWidth-'+lx+'\n'
}} else {
chromeTIThtml +=''+
'document.all["btnMINI"].style.visibility="visible"\n'+
'document.all["btnMINI"].style.pixelLeft=document.body.clientWidth-'+lx+'\n'
}
chromeTIThtml +=''+
'}\n'+
'else {\n'+
'document.all["btnMINI"].style.visibility="hidden"\n'+
'document.all["grfCLOCK"].style.pixelLeft=document.body.clientWidth-'+lx+'\n'+
'setTimeout("setLAYOUT()",500)\n'+
'}\n'+
'}\n'+
'function minimizeWIN() {\n'+
'top.window.moveTo(0,-4000)\n'+
'if ( (top.opener) && (!top.opener.closed) ) { top.opener.window.focus();}\n'+
'top.window.blur()\n'+
'}\n'+
'function moveWIN() {\n'+
'if ( winSTATUS=="down") {\n'+
'document.body.bgColor="'+winBGCOLORsel+'"\n'+
'parent.bordeM.document.body.bgColor="'+winBORDERCOLORsel+'"\n'+
'parent.bordeT.document.body.bgColor="'+winBORDERCOLORsel+'"\n'+
'parent.bordeB.document.body.bgColor="'+winBORDERCOLORsel+'"\n'+
'parent.bordeL.document.body.bgColor="'+winBORDERCOLORsel+'"\n'+
'parent.bordeR.document.body.bgColor="'+winBORDERCOLORsel+'"\n'+
'ofx=event.x\n'+
'ofy=event.y\n'+
'winSTATUS="drag"\n'+
'}\n'+
'else if ( winSTATUS=="drag") {\n'+
'px=event.screenX-ofx-1\n'+
'py=event.screenY-ofy-1\n'+
'top.window.x=px\n'+
'top.window.y=py\n'+
'top.window.moveTo(px,py)\n'+
'} else {\n'+
'document.body.bgColor="'+winBGCOLOR+'"\n'+
'parent.bordeM.document.body.bgColor="'+winBORDERCOLOR+'"\n'+
'parent.bordeT.document.body.bgColor="'+winBORDERCOLOR+'"\n'+
'parent.bordeB.document.body.bgColor="'+winBORDERCOLOR+'"\n'+
'parent.bordeL.document.body.bgColor="'+winBORDERCOLOR+'"\n'+
'parent.bordeR.document.body.bgColor="'+winBORDERCOLOR+'"\n'+
'winStatus="up"\n'+
'}\n'+
'}\n'+
'function openIT1(theURL, imgTIT, W, H, X, Y, wname, titHTML, titWIN) {\n'+
'	CLOSEdwn 		= "img/close_dwn.gif"\n'+
'	CLOSEup 		= "img/close_up.gif"\n'+
'	CLOSEovr 		= "img/close_dwn.gif"\n'+
'	MINIdwn 		= "img/mini_dwn.gif"\n'+
'	MINIup 			= "img/mini_up.gif"\n'+
'	MINIovr 		= "img/mini_dwn.gif"\n'+
'	NONEgrf 		= "img/none.gif"\n'+
'	CLOCKgrf		= "img/clock.gif"\n'+
'	winBORDERCOLOR   	= "#000000"\n'+
'	winBORDERCOLORsel	= "#000000"\n'+
'	winBGCOLOR    		= "#D9F2FF"\n'+
'	winBGCOLORsel 		= "#A4E3FF"\n'+
'	return openchromeless1(theURL, imgTIT, wname, W, H, X, Y, NONEgrf, CLOSEdwn, CLOSEup, CLOSEovr, MINIdwn, MINIup, MINIovr, CLOCKgrf, titHTML, titWIN, winBORDERCOLOR, winBORDERCOLORsel, winBGCOLOR, winBGCOLORsel)\n'+
'}\n'+
'</script>\n'+
'</head>\n'+
'<body onresize="setLAYOUT()" bgcolor='+winBGCOLOR+'>\n'+
'<div id=crtMOVE><img GALLERYIMG=no onmousedown="winSTATUS=\'down\';moveWIN()" onmouseup="winSTATUS=\'up\';moveWIN()" border=0 src="'+NONEgrf+'" width=110% height=500></div>\n'+
'<div id=txtTITLE>'+ '<table width=100% height=20 border=0 cellpadding=0 cellspacing=0><tr><td valign=middle align=left>'+titHTML+'</td></tr></table>'+'</div>\n'+
'<div id=btnCLOSE><a href="javascript:void(\'\')"><img GALLERYIMG=no name=imgCLOSE src="'+ CLOSEup +'" border=0 width=11 height=11 onmouseover="this.src=imgCLOSEovr.src" onmouseout="btnSTATUS=false;this.src=imgCLOSEup.src" onmouseup="this.src=imgCLOSEup.src" onmousedown="this.src=imgCLOSEdwn.src" onclick="top.window.close()"></a></div>\n'+
'<div id=btnMINI>'+miniBut+'</div>\n'+
'<div id=grfCLOCK><img GALLERYIMG=no name=imgCLOCK src="'+ CLOCKgrf +'" border=0 width=11 height=11></div>\n'+
'<script>setLAYOUT()</script>\n'+
'</body>\n'+
'</html>\n'
var chromeFRMhtml='' +
'<HTML>\n'+
'<HEAD>\n'+
'<TITLE>'+ titWIN +'</TITLE>\n'+
'</HEAD>\n'+
'<script>\n'+
'top.mainloaded=false\n'+
'function generatetitle() {\n'+
'if( window.frames["frmTIT"] && window.frames["bordeL"] && window.frames["bordeB"] && window.frames["bordeR"] && window.frames["bordeM"] ) {\n'+
'frmTIT.document.bgColor="'+ winBGCOLOR +'"\n'+
'frmTIT.document.open()\n'+
'frmTIT.document.write( "'+ quitasaltolinea(chromeTIThtml) +'" )\n'+
'frmTIT.document.close()\n'+
'bordeM.document.bgColor="'+ winBORDERCOLOR +'"\n'+
'bordeL.document.bgColor="'+ winBORDERCOLOR +'"\n'+
'bordeR.document.bgColor="'+ winBORDERCOLOR +'"\n'+
'bordeB.document.bgColor="'+ winBORDERCOLOR +'"\n'+
'bordeT.document.bgColor="'+ winBORDERCOLOR +'"\n'+
'} else {\n'+
'setTimeout("generatetitle()",20)\n'+
'}\n'+
'}\n'+
'top.window.h='+H+'\n'+
'top.window.w='+W+'\n'+
'top.window.x='+X+'\n'+
'top.window.y='+Y+'\n'+
'generatetitle()\n'+
'</script>\n'+
'<frameset onload="top.mainloaded=true" onfocus="top.window.moveTo(top.window.x,top.window.y)" border=0 framespacing=0 frameborder=0 cols="1,100%,1">\n'+
'<frame name=bordeL src="about:blank" scrolling=no noresize>\n'+
'<frameset border=0 framespacing=0 frameborder=0 rows="1,20,1,100%,1">\n'+
'<frame name=bordeT src="about:blank" scrolling=no noresize>\n'+
'<frame name=frmTIT src="about:blank" scrolling=no noresize>\n'+
'<frame name=bordeM src="about:blank" scrolling=no noresize>\n'+
'<frame name=main src="'+theURL+'">\n'+
'<frame name=bordeB src="about:blank" scrolling=no noresize>\n'+
'</frameset>\n'+
'<frame name=bordeR src="about:blank" scrolling=no noresize>\n'+
'</frameset>\n'+
'</HTML>'
var CWIN=window.open( "",wname,"fullscreen=1"+s)
CWIN.resizeTo(Math.ceil(W),Math.ceil(H))
CWIN.moveTo(Math.ceil(X),Math.ceil(Y))
CWIN.document.open()
CWIN.document.write( chromeFRMhtml )
CWIN.document.close()
}else{
var CWIN=window.open(theURL,wname,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto,resizable=1"+s+",left="+X+",top="+Y,true)
}
CWIN.focus()
return CWIN
}

function quitasaltolinea(txt) {
var salida=txt.toString()
var re=/\\/g;var salida=salida.replace(re,"\\\\");
re=/\//g;var salida=salida.replace(re,"\\\/");
re=/\"/g;var salida=salida.replace(re,"\\\"");
re=/\'/g;var salida=salida.replace(re,"\\\'");
re=/\n/g;var salida=salida.replace(re,"\\n");
return salida
}
