// Code by MaRoK - www.marok.org
// You can copy it, but don't remove these lines! 
// And remember: I'm still waiting for your beer... :)

var colore1='#534545';
var colore2='#653333';

// NB: per cambiare il colore dell'area centrale, occorre editare anche il file .php

document.write('<style>');
document.write('body       {background:'+colore1+'; color:white}');
document.write('div, input {font-family: Verdana, Sans-Serif; font-weight:bold; font-size:10px}');
document.write('form	   {display:inline}');
document.write('a	   {color:white; text-decoration:none}');
document.write('a:hover	   {color:white; text-decoration:underline}');
document.write('.caselle   {width:130px}');
document.write('.dati	   {font-size:8pt; vertical-align:top}');
document.write('#home	   {position:absolute; left:20px; bottom:20px; width:60px; height:20px; border:1px solid white; background:'+colore2+'; z-index:99}');
document.write('#leggi     {position:absolute; left:260px; top:20px; padding:10px; background:'+colore2+'; border:1px solid white; text-align:right}');
document.write('#logo	   {position:absolute; left:20px; top:20px; width:213px; height:47px; border:1px solid white; z-index:1}');
document.write('#scrivi    {position:absolute; left:20px; top:90px; width:215px; height:260px; border:1px solid white; background:'+colore2+'; z-index:99; padding:10px; text-align:right}');
document.write('</style>');

if (document.all&&!window.opera) document.write('<style>\nbody {overflow:auto}\n</'+'style>');
if (window.sidebar) document.write('<style>\n#scrivi {width:193px}\n</'+'style>');

function messcontacar()  {
	conta=1000-document.form_blog.msg.value.length ;
	document.form_blog.msgcar.value=conta;
  	}

function controlla() {
	var caratteri = 1000-document.form_blog.msg.value.length;
	var caratteri_di_troppo = document.form_blog.msg.value.length-1000;
	if (caratteri > -1) {top.iframe_blog.location.href="ghestbuk.php?function=save"}
	else {alert('Hai scritto '+caratteri_di_troppo+' caratteri di troppo! Fankulo!')}
	}

function ghestbuk() {
var aa=' <input type=text value="" class="caselle" maxlength=';
	
document.write('<div id="logo"><img src="ghestbuk.png" width=213 height=47 border=0 alt="Ghestbuk"></div><div id="scrivi">');
document.write('<form method="POST"  name="form_blog" action="ghestbuk.php?function=save" target="iframe_blog">');
document.write('Nome:'+aa+'30 name="name"><br>Email:'+aa+'64 name="email"><br>Sito:'+aa+'132 name="sito"><br>Citt&agrave;:'+aa+'20 name="citta"><br><br>');
document.write('<center>ScriviMI!<br>');
document.write('<textarea name="msg" rows=7 cols=20 maxlength=1000 style="behavior:url(maxlength.htc)" onkeyup="javascript:messcontacar();" onchange="javascript:messcontacar();"></textarea><br>');
document.write('<input type=text value="1000" name="msgcar" disabled size="3" maxlength="20" style="text-align:right">');
document.write('<input type="submit" value="Invia"></form></div><div id="leggi">');	

if (document.all||document.getElementById) {
	if (window.innerWidth) {larghezza_finestra = window.innerWidth; altezza_finestra = window.innerHeight}
	else 	{larghezza_finestra = window.document.body.clientWidth; altezza_finestra = window.document.body.clientHeight};
	if (larghezza_finestra<50) {larghezza_finestra=400};
	if (altezza_finestra<50) {altezza_finestra=300};
	document.write('<iframe name="iframe_blog" id="iframe_blog" src="ghestbuk.php?function=show" frameborder=0 width='+(larghezza_finestra-320)+' height='+(altezza_finestra-75)+'></'+'iframe>');
}

else if (document.layers)       {document.write('Per visualizzare questo guestbook hai bisogno di un browser. Netscape4 NON &egrave; un browser!')}
else 				{document.write('Per visualizzare questo guestbook hai bisogno di un browser. Quello che usi te NON &egrave; un browser!')}
	}
document.write('</div>');

document.write('<div id="home" onmouseover="this.style.background=\'#875555\'"  onmouseout="this.style.background=colore2"> <a href="http://www.maryoweb.org/">< Home </a></div>');