// Javascript by MaRoK - www.marok.org
// Potete studiare ed usare questo codice quanto cazzo volete, purché lasciate queste righe!
// ...e naturalmente mi dovete birra e pheega!



// Per personalizzare il ghestbuk

if (!colore1) {var colore1='#7a633e'}; 				// colore di sfondo
if (!colore2) {var colore2='#ffffff'}; 				// colore del testo
if (!colore3) {var colore3='#dfdfdf'}; 				// colore del testo evidenziato
if (!carattere) {var carattere='Verdana, Sans-Serif'};		// font
if (!dimensione_carattere) {var dimensione_carattere='13px'};	// dimensione del font


// Questa funzione (invocata dall'iframe) dovrebbe impedire il bug del refresh di IE... ma non funziona.

function cancella() {
window.parent.form_blog.name.value='';
window.parent.form_blog.sito.value='';
window.parent.form_blog.email.value='';
window.parent.form_blog.citta.value='';
window.parent.form_blog.msg.value='';
}

// Questa funzione serve per dare dell'handicappato agli handicappati

function c6() {alert('Ci sei già, handicappato!'); return false};


// Foglio di stile 

document.write('<style type="text/css">');
document.write('body		{background:'+colore2+' url(\'../sfondo03.jpg\') fixed; color:'+colore2+'; margin:0px; padding:0px}');
document.write('form		{display:inline}');
document.write('center, form, input, textarea {color:black; font-size:10px}');
document.write('.data		{font-style:italic; display:block}');
document.write('.dati		{font-size:8pt; vertical-align:top}');
document.write('.luogo		{color:'+colore3+'; font-weight:bold}');
document.write('.nome		{font-weight:bold; color:'+colore2+'}');
document.write('.pagine		{font-weight:normal; color:'+colore2+'; text-align:center; border:1px dashed white; font-size:'+dimensione_carattere+'; width:360px; padding:10px; background:#896F47}');
document.write('.pagine	      a	{font-weight:bold}');
document.write('.subumano	{background: '+colore1+'; color:'+colore2+'; font-family:'+carattere+'; font-size:'+dimensione_carattere+'; font-weight:normal; scrollbar-base-color: '+colore1+'; scrollbar-face-color: '+colore1+'; scrollbar-highlight-color: '+colore2+'; scrollbar-shadow-color: silver; scrollbar-3dlight-color: grey; scrollbar-arrow-color: #ddeeff; scrollbar-track-color: '+colore1+'; scrollbar-darkshadow-color: #333333; overflow:hidden; width:100%}');
document.write('#amore		{position:absolute; top:50%; left:50%; width:150px; height:150px; margin: -75 0 0 -75; padding:0px; border:1px solid black; z-index:0; visibility:hidden}');
document.write('#anim		{position:absolute; left:48px; top:188px; width:160px; height:120px; border:1px solid black; z-index:1}');
document.write('#gollum		{position:absolute; right:10px; top:70px; width:170px; z-index:0; padding:0px; visibility:hidden}');
document.write('#leggi		{position:absolute; right:200px; top:150px; padding:10px; background:'+colore1+'; border:1px solid black; text-align:right}');
document.write('#logo		{position:absolute; left:20px; top:20px; width:213px; height:68px; border:1px solid black; z-index:1}');
document.write('#scrivi		{position:absolute; right:10px; top:20px; width:170px; z-index:99; padding:0px; text-align:right; visibility:hidden}');
document.write('a 		{color:'+colore2+'; text-decoration:none}');
document.write('a:hover 	{text-decoration:underline}');
document.write('</style>');


// Contatore di caratteri

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="http://favesoka.altervista.org/Grasso/ghestbuk.php?function=save"}
	else {alert('Hai scritto '+caratteri_di_troppo+' caratteri di troppo! Fankulo!')}
	}


// Interfaccia grafica	
	
function spruzzo() {	

document.write('<div id="scrivi">');
document.write('	<div style="border:1px solid black">');
document.write('	<table width="100%" cellspacing=0 cellpadding=2><tr>');
document.write('	<td style="background:'+colore1+'; font-size:10px">EspriMI</td>');
document.write('	<td align="right" style="background:'+colore1+'"><div id="espandi"><a href="#" onclick="document.getElementById(\'scrivi_exp\').style.display=\'\'; document.getElementById(\'riduci\').style.display=\'\'; document.getElementById(\'espandi\').style.display=\'none\'; return false"><img src="espandi.png" width=12 height=11 border=0 alt="Espandi!"></a></div><div id="riduci"><a href="#" onclick="document.getElementById(\'scrivi_exp\').style.display=\'none\'; document.getElementById(\'riduci\').style.display=\'none\'; document.getElementById(\'espandi\').style.display=\'\'; return false"><img src="riduci.png" width=12 height=11 border=0 alt="Riduci!"></a></div></td>');
document.write('	</tr></table>');
document.write('	</div>');
document.getElementById('espandi').style.display='none';
document.write('	<div id="scrivi_exp" style="border:1px solid black; background:#d4d0c8; border-top:none">');
document.write('	<table width="100%" cellspacing=0 cellpadding=10><tr><td align="right">');
document.write('	<form method="POST"  name="form_blog" action="http://favesoka.altervista.org/Grasso/ghestbuk.php?function=save" target="iframe_blog">');
document.write('	Nome: <input type=text name="name" value="" style="width:100px" maxlength=30><br>');
document.write('	Sito: <input type=text name="sito" value="" style="width:100px" maxlength=64><br>');
document.write('	Citt&agrave;: <input type=text name="citta" value="" style="width:100px" maxlength=20><br><br>');
document.write('	<center>ScriviMI!</center>');
document.write('	<textarea name="msg" style="width:150px; height:200px" maxlength=1000 style="behavior:url(maxlength.htc)" onkeyup="javascript:messcontacar();" onchange="javascript:messcontacar();"></textarea><br>');
document.write('	<center>');
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"></center>');
document.write('	</form>');
document.write('	</td></tr></table>');
document.write('	</div>');
document.getElementById('scrivi').style.visibility='visible';
document.write('</div>');

document.write('<div id="leggi" style="background:#d4d0c8; padding:0px">');

document.write('	<div style="background:#d4d0c8; border-bottom:1px solid black; font-size:10px; font-weight:normal; text-align:left; padding:2px; color:black">');
document.write('	<a href="figa.htm" onclick="alert(\'SBORROOOOOOOOH!\'); return false"><img src="boh.png" width=12 height=11 border=0 align="left" alt=""></a>Voci di un piccolo mondo marrone');
document.write('	</div>');

document.write('	<div id="leggi_exp" style="border:1px solid black; background:'+colore1+'; border-top:none; padding:10px; border:none">');

			if (document.all||document.getElementById)
				{if (2>3) {alert('oh cacchio! siamo nella merda!')}
			 	else 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=200};
			 	// alert (larghezza_finestra+'x'+altezza_finestra);		
		 		document.write('<iframe name="iframe_blog" id="iframe_blog" src="http://favesoka.altervista.org/Grasso/ghestbuk.php?function=show" frameborder=0 width='+(larghezza_finestra-400)+' height='+(altezza_finestra-222)+'></'+'iframe>');
			 	}
			else if (document.layers)       {document.write('<font face="Verdana" size=2><b><u><blink>Per visualizzare questo guestbook hai bisogno di un browser. Netscape4 &egrave; una merda e NON un browser! Fankulo!</blink></u></b></font>')}
			else 				{document.write('Per visualizzare questo guestbook hai bisogno di un browser. Quello che usi te &egrave; una merda, NON un browser! Fankulo!')}

			document.getElementById('gollum').style.visibility='visible';
			document.getElementById('amore').style.visibility='visible';

document.write('	</div>');

document.write('</div>');

// Drag and drop

if (document.all||document.getElementById||document.layers) {SET_DHTML(CURSOR_MOVE,"scrivi","leggi"); var iW = dd.getWndW(); dh = 1};

}


// Fondo pagina

function slurp(pag) {
	document.write('<br><br><br><br><center><div class="pagine">');
	for (i=0; i<5; i++) {
		if (pag==i) {document.write('<a href="ghest0'+i+'.htm" style="text-decoration:underline" onclick="alert(\'Ci sei gi&agrave;, handicappato!\'); return false">'+i+'</a> | ')}
		else {document.write('<a href="ghest0'+i+'.htm">'+i+'</a> | ')}
	}
		if (pag=='5') {document.write('<a href="index.html" style="text-decoration:underline" onclick="alert(\'Ci sei gi&agrave;, handicappato!\'); return false">'+pag+'</a>')}
		else {document.write('<a href="index.html" target="_top">5</a>')};
	document.write('</div></center><br><br>');
}