function updatevoorbeeld() {
	dest.focus();
	dest.document.open();
	dest.document.write("<HTML><HEAD><STYLE>* { font-family:tahoma; font-size:11px }</STYLE></HEAD><BODY><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=100% HEIGHT=100%><TR><TD ALIGN=CENTER>Even geduld...</TD></TR></TABLE></BODY></HTML>");
	dest.document.close();

	geturl("GET","templates/"+toload+"/specs.txt?r="+new Date().getTime());
}

function maketitle(t) {
	return '<IMG SRC="/img/fontword.php?string='+escape(t)+'&bg='+specs["titlebg"].replace("#","")+'&fg='+specs["titlecolor"].replace("#","")+'&font='+specs["head"]+'&size='+specs["titlesize"]+'&minheight=1&bold='+specs["titlebold"]+'"><BR><IMG SRC="/img/dummy.gif" WIDTH=1 HEIGHT=3><BR>';
}
specs=new Array();
function use(t) {
	html=unescape(t);
	if (html.indexOf("<")!=-1) {

	frm=document.forms["config"];

	if (name=="") name="Michael";
	birthday="20/01/2006";
	title_welcome="Hey welkom allemaal";
	title_news="Enkele nieuwsberichten";
	title_contact="Bel me schrijf me...";
	title_guestbook="Laat van je horen";
	title_photo="Kiekjes van mij";

	while (html.indexOf("<!-- head -->")!=-1) html=html.replace("<!-- head -->",'<IMG SRC="/img/fontword.php?string='+escape(name)+'&bg='+specs["headbg"].replace("#","")+'&fg='+specs["headcolor"].replace("#","")+'&font='+specs["head"]+'&size='+specs["headsize"]+'">');
	while (html.indexOf("<!-- birth -->")!=-1) html=html.replace("<!-- birth -->",'<IMG SRC="/img/fontword.php?string='+escape(birthday)+'&bg='+specs["birthbg"].replace("#","")+'&fg='+specs["birthcolor"].replace("#","")+'&font='+specs["birth"]+'&size='+specs["birthsize"]+'">');
	while (html.indexOf("<!-- titlewelcome -->")!=-1) html=html.replace("<!-- titlewelcome -->",maketitle(title_welcome));
	while (html.indexOf("<!-- introtext -->")!=-1) html=html.replace("<!-- introtext -->",'Dit is een fictieve introtekst!<BR><BR>Hier zou je zelf vanalles kunnen schrijven, probeer het maar eens uit!<BR><BR>Surf lekker rond op mijn eigen website en bekijk zeker mijn foto\'s!<BR><BR>Groetjes en misschien tot later?<BR><BR>Daaaag,<BR>'+name);
	while (html.indexOf("<!-- introfoto -->")!=-1) html=html.replace("<!-- introfoto -->",'<TABLE CELLPADDING=5 CELLSPACING=0 BORDER=0 STYLE="background:white;border:1px solid black"><TR><TD><IMG SRC="/img/introfoto.jpg" WIDTH=240 HEIGHT=180></TD></TR></TABLE><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=100% STYLE="margin-top:3px"><TR><TD>"Ikke en mama"</TD><TD ALIGN=RIGHT><A HREF="#">Bekijk andere foto\'s</A></TD></TR></TABLE>');
	while (html.indexOf("<!-- introfotoright -->")!=-1) html=html.replace("<!-- introfotoright -->",'<TABLE STYLE="margin-left:20px;margin-bottom:8px;float:right;" CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD><TABLE CELLPADDING=5 CELLSPACING=0 BORDER=0 STYLE="background:white;border:1px solid black"><TR><TD><IMG SRC="/img/introfoto.jpg" WIDTH=240 HEIGHT=180></TD></TR></TABLE><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=100% STYLE="margin-top:3px"><TR><TD>"Ikke en mama"</TD><TD ALIGN=RIGHT><A HREF="#">Bekijk andere foto\'s</A></TD></TR></TABLE></TD></TR></TABLE><IMG SRC="/img/dummy.gif" WIDTH=1 HEIGHT=1><BR>');
	while (html.indexOf("<!-- introfotoleft -->")!=-1) html=html.replace("<!-- introfotoleft -->",'<TABLE STYLE="margin-right:20px;margin-bottom:8px;float:left;" CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD><TABLE CELLPADDING=5 CELLSPACING=0 BORDER=0 STYLE="background:white;border:1px solid black"><TR><TD><IMG SRC="/img/introfoto.jpg" WIDTH=240 HEIGHT=180></TD></TR></TABLE><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=100% STYLE="margin-top:3px"><TR><TD>"Ikke en mama"</TD><TD ALIGN=RIGHT><A HREF="#">Bekijk andere foto\'s</A></TD></TR></TABLE></TD></TR></TABLE><IMG SRC="/img/dummy.gif" WIDTH=1 HEIGHT=1><BR>');

	lf="";
	lf+="<CENTER>";
	lf+="<SPAN CLASS=\"nieuwstefotos\">Nieuwste&nbsp;foto's</SPAN><BR>";
	for (i=1;i<=3;i++) {
		lf+='<TABLE CELLPADDING=3 CELLSPACING=0 BORDER=0 STYLE="margin:3 0 3 0;background:white;border:1px solid black"><TR><TD><IMG SRC="/img/lastfoto'+i+'.jpg" WIDTH=72 HEIGHT=54></TD></TR></TABLE>';
	}
	lf+="<A HREF=\"#\">:: Meer ::</A></CENTER>";
	while (html.indexOf("<!-- lastfoto -->")!=-1) html=html.replace("<!-- lastfoto -->",lf);

	fakenewsdates = new Array("","25/02/2006","13/02/2006","11/02/2006","27/01/2006","25/01/2006");
	fakenewstitles = new Array("","Ik ben geboren, joepie!","Met mama in de zetel","Een broertje is leuk, maar...","Mijn papa laat zijn snor groeien","Alweer van melk veranderen... :(");
	nws="";
	nws+="<BR>";
	nws+="<!-- delimiter -->";
	nws+="<BR>";
	nws+="<DIV STYLE=\"text-align:left\">";
	nws+=maketitle(title_news);
	for (i=1;i<=5;i++) {
		nws+=fakenewsdates[i]+' - <A HREF="#">'+fakenewstitles[i]+'</A><BR><IMG SRC="/img/dummy.gif" WIDTH=1 HEIGHT=3><BR>';
	}
	nws+="</DIV>";
	while (html.indexOf("<!-- news -->")!=-1) html=html.replace("<!-- news -->",nws);



wt="<BR><!-- delimiter --><BR>";
wt+=maketitle("Geboorte-info");
wt+="Datum: <B>"+birthday+"</B>";
wt+=" - Uur: <B>10:47</B>";
wt+="<BR><BR>";
wt+="<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>";
wt+="<TR>";
wt+="<TD VALIGN=TOP>";
wt+="Gewicht: <B>3,7 kg</B><BR>";
wt+="Lengte: <B>50 cm</B><BR>";
wt+="</TD>";
wt+="<TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>";
wt+="<TD VALIGN=TOP>";
wt+="Mama: <B>Jeanne</B><BR>";
wt+="Papa: <B>Erik</B><BR>";
wt+="</TD>";
wt+="<TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>";
wt+="<TD VALIGN=TOP>";
wt+="Meter: <B>Eva</B><BR>";
wt+="Peter: <B>Lucien</B><BR>";
wt+="</TD>";
wt+="</TR>";
wt+= "</TABLE>";
	while (html.indexOf("<!-- weetjes -->")!=-1) html=html.replace("<!-- weetjes -->",wt);



	while (html.indexOf("<!-- delimiter -->")!=-1) html=html.replace("<!-- delimiter -->",'<DIV STYLE="border-top:1px solid '+specs["delimitercolor"]+';overflow:hidden;height:1px;margin:2 0 2 0"></DIV>');

	regexp = /a href=\"(.*?)\"/gi;
	replacement = "a href=\"javascript:alert('Demo')\"";
	html=html.replace(regexp, replacement);

	dest.document.open();
	dest.document.write(html);
	dest.document.close();

	} else {
		while (html.indexOf("\r")!=-1) html=html.replace("\r","");
		e=html.split("\n");
		for (i=0;i<e.length;i++) {
			if (e[i].indexOf("=")!=-1) {
				x=e[i].split("=");
				specs[x[0]]=x[1];
			}
		}
		geturl("GET","templates/"+toload+"/index.php?r="+new Date().getTime());
	}
}
