//Tools für die thepatchworkshop-Dateien


//function opens window of chooseable size
var faux = null;
function ImageWindow(title, filename, width, height) {
	if(faux != null && !faux.closed) {
		faux.close();  	
	}
  	faux = window.open("","New","dependent,resizable,top=20,left=20,width=" + width + ",height=" + height);
	var fd = faux.document;
	fd.open();
	fd.write('<html><head><title>' + title + '</title></head>');
	fd.write('<body bgcolor="#b74b32" onLoad="window.focus()"  topMargin="0" leftMargin="0" marginHeight="0" marginWidth="0">');
	fd.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">');
	fd.write('<tr><td align="center" valign="middle"><a href="#" onClick="self.close();"><img src="' + filename + '" border="0" alt="Fenster schließen"></a></td></tr>');
	fd.write('</table></body></html>');
	fd.close();
}



//function opens window of chooseable size (with scrollbars)
function ImageWindowScrollbars(title, filename, width, height) {
	if(faux != null && !faux.closed) {
		 faux.close();  	
	}
  	faux = window.open("","New","top=20,left=20,width=" + width + ",height=" + height + "dependent,resizable,scrollbars");
	var fd = faux.document;
	fd.open();
	fd.write('<html><head><title>' + title + '</title></head>');
	fd.write('<body bgcolor="#b74b32" onLoad="window.focus()" topmargin="0" leftmargin="0">');
	fd.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">');
	fd.write('<tr><td align="center" valign="middle"><img src="' + filename + '"></td></tr>');
	fd.write('</table></body></html>');
	fd.close();
}


//function makes sure that page is loaded within frameset
//and allowes layer menu to swap into main frame
function Frametest() { 
var base="http://www.thepatchworkshop.de/index.htm";
//var base="file:///D:/WWWthepatchworkshop/index.htm";
	if(parent.location.href!=base) {
		parent.location.href=base;
		return true;
	}
	if(parent.frames[0]&&parent.frames['links'].Go) {
		parent.frames['links'].Go();
	}
}


//function makes sure that page is loaded within frameset
function JustFrametest() { 
var base="http://www.thepatchworkshop.de/index.htm";
//var base="file:///D:/WWWthepatchworkshop/index.htm";
	if(parent.location.href!=base) {
		parent.location.href=base;
		return true;
	}
}
