// Javascript by Dottor Marok - www.marok.org
// Chi copia deve birra e pheega!


// Questo codice e' stato ideato per essere compatibile con tutti i browser, passati presenti e futuri.
// E' stato testato direttamente su:
// Explorer5, Explorer 6, Firefox 1.5, Mozilla {0.6, 0.8, 1.0}, Netscape {3, 4, 6, 7} Opera {5, 6, 7, 8, 9}
// usando come sistemi operativi Windows 2000, Windows XP e Linux Ubuntu.
// Se non vi funziona, il vostro quoziente di sfiga supera ogni livello di soluzione.





// Correzioni al foglio di stile per browser handicappati:

// Explorer:
if (document.all&&!window.opera) document.write('<style>\nbody {overflow-y:hidden}\n#trunkatu {overflow-x: auto; overflow-y:auto}\n</style>'); 

// Netscape4:
if (document.layers) document.write('<style>\n#trunkatu {position:absolute; top:110px; left:50px;  z-index:0}\n</style>'); 

// Menu visibile se js e' disattivato:
if (document.all||document.layers||document.getElementById) {document.write('<style>\n.menu_accessibile {display:none}\n</style>')};



// Variabili Scorciatoia

function c6() {alert('Ci sei già, amico!')};
var stail1='position:absolute; ';
var stail2='position:fixed; ';
var stail3='width:599px; height:114px; top:20px; left:0px; border:1px solid #feffff; border-left:1px solid black; z-index:99';
var stail4='width:145px; top:0px; left:20px; border:1px solid #feffff; border-top:1px solid black;  background:#333333; z-index:98';


// Barra superiore

document.write('<div id="barra_sup" ');
if (document.all&&!window.opera) {document.write('style="'+stail1+stail3+'"')}
else if (document.getElementById) {document.write('style="'+stail1+stail2+stail3+'"')};
document.write('><a href="index.html"><img src="barra_sup.jpg" width=599 height=114 border=0 alt=""></a></div>');


// Barra di sinistra

if (document.all||document.layers||document.getElementById) {
document.write('<div id="barra_sx" ');
if (document.all&&!window.opera) {document.write('style="'+stail1+stail4+'">')}
else if (document.getElementById) {document.write('style="'+stail1+stail2+stail4+'">')}
else if (document.layers) {document.write('<layer width=200 left=20 top=0><table><tr><td bgcolor="#333333"')};
if (!document.layers) {document.write('<img src="blank.gif" width=112 height=145 alt="">')};
if (drummeria1=='1') {document.write('<a href="chi_siamo.htm" class="c6" onclick="c6(); return false"><img src="b_chi_siamo.png" width=112 height=20 alt=""></a>')}
		else {document.write('<a href="chi_siamo.htm"><img src="b_chi_siamo.png" width=112 height=20 border=0 alt="Chi siamo"></a>')};
if (drummeria1=='2') {document.write('<a href="date.htm" class="c6" onclick="c6(); return false"><img src="b_date.png" width=112 height=20 border=0 alt=""></a>')}
		else {document.write('<a href="date.htm"><img src="b_date.png" width=112 height=20 border=0 alt="Date"></a>')}
if (drummeria1=='3') {document.write('<a href="foto.htm" class="c6" onclick="c6(); return false"><img src="b_foto.png" width=112 height=20 border=0 alt=""></a>')}
		else {document.write('<a href="foto.htm"><img src="b_foto.png" width=112 height=20 border=0 alt="Foto"></a>')}
if (drummeria1=='4') {document.write('<a href="audiovideo.htm" class="c6" onclick="c6(); return false"><img src="b_audio_video.png" width=112 height=20 border=0 alt=""></a>')}
		else {document.write('<a href="audiovideo.htm"><img src="b_audio_video.png" width=112 height=20 border=0 alt="Audiovideo"></a>')}
if (drummeria1=='5') {document.write('<a href="discografia.htm" class="c6" onclick="c6(); return false"><img src="b_discografia.png" width=112 height=20 border=0 alt=""></a>')}
		else {document.write('<a href="discografia.htm"><img src="b_discografia.png" width=112 height=20 border=0 alt="Discografia"></a>')}
if (drummeria1=='6') {document.write('<a href="fanclub.htm" class="c6" onclick="c6(); return false"><img src="b_fanclub.png" width=112 height=20 border=0 alt=""></a>')}
		else {document.write('<a href="fanclub.htm"><img src="b_fanclub.png" width=112 height=20 border=0 alt="Fanclub"></a>')}
if (drummeria1=='7') {document.write('<a href="reperti.htm" class="c6" onclick="c6(); return false"><img src="b_reperti.png" width=112 height=20 border=0 alt=""></a>')}
		else {document.write('<a href="reperti.htm"><img src="b_reperti.png" width=112 height=20 border=0 alt="Reperti"></a>')}
if (drummeria1=='8') {document.write('<a href="link.htm" class="c6" onclick="c6(); return false"><img src="b_links.png" width=112 height=20 border=0 alt=""></a>')}
		else {document.write('<a href="link.htm"><img src="b_links.png" width=112 height=20 border=0 alt="Links"></a>')}
if (drummeria1=='9') {document.write('<a href="contatti.htm" class="c6" onclick="c6(); return false"><img src="b_contatti.png" width=112 height=20 border=0 alt=""></a>')}
		else {document.write('<a href="contatti.htm"><img src="b_contatti.png" width=112 height=20 border=0 alt="Contatti"></a>')}
// if (drummeria1=='10') {document.write('<a href="http://www.drummeria.com/forum/" class="c6" onclick="c6(); return false"><img src="b_guestbook.png" width=112 height=20 border=0 alt=""></a>')}
//		else {document.write('<a href="http://www.drummeria.com/forum/"><img src="b_forum.png" width=112 height=20 border=0 alt="Forum"></a>')}

if (drummeria1=='11') {document.write('<a href="credits.htm" class="c6" onclick="c6(); return false"><img src="b_credits.png" width=112 height=20 border=0 alt=""></a>')}
		else {document.write('<a href="credits.htm"><img src="b_credits.png" width=112 height=20 border=0 alt="Credits"></a>')}
document.write('<br></td></tr></table></layer></div>');
}

// Body fake per browser handicappati

if (!document.all&&!document.getElementById) {document.write('<font face="Verdana" size=2>')};



// Footer

function rullante() {
if (document.getElementById) {
document.write('<div style="visibility:hidden"><br><br>');
document.write('<!-- Inizio Codice Shinystat -->');
document.write('<script type="text/javascript" language="JavaScript" SRC="http://codice.shinystat.com/cgi-bin/getcod.cgi?USER=Drummeria"></script>');
document.write('<!-- Fine Codice Shinystat -->');
document.write('</div>');
}};



// Apripopup 

function apriMI(figura,larghezza,altezza,descrizione) {

    // tentativo di lavorare in assenza di parametri - ok solo se le immagini sono in cache
    marok = new Image;
    marok.src = figura;
    if (!larghezza&&marok.width>0) {larghezza=marok.width} else if (!larghezza) {larghezza=0};
    if (!altezza&&marok.height>0) {altezza=marok.height} else if (!altezza) {altezza=0};
    if (!descrizione) {descrizione='Foto by www.marok.org'};
    
    // lettura dimensione schermo, finestra utente per opera5 e opera7
    if (!document.all&&!document.layers&&!document.getElementById) 
     {schermoX=800; schermoY=540; barre='yes'}
    else if (navigator.userAgent.indexOf("Opera 5")>-1 || navigator.userAgent.indexOf("Opera/7")>-1 || navigator.userAgent.indexOf("Opera 7")>-1)
    	{schermoX=window.document.body.clientWidth; schermoY=window.document.body.clientHeight; barre='yes'}
    else if (navigator.userAgent.indexOf("Opera/6")>-1 || navigator.userAgent.indexOf("Opera 6")>-1)
    	{schermoX=screen.availWidth; schermoY=screen.availHeight-40}	
    else 
    	{schermoX=screen.availWidth; schermoY=screen.availHeight};
    
    // correzione per browser fessi 
    if (!document.all&&!document.getElementById&&!document.layers) {larghezza=(parseInt(larghezza))+20};
    if (larghezza<21) {larghezza=800};
    dimensioneY=(parseInt(altezza));
    if (!document.all&&!document.getElementById&&!document.layers) {altezza=(parseInt(altezza))+30};
    if (altezza<31) {altezza=530};
     
    // confronto dimensioni dell'immagine con dimensioni dello schermo 
    if 	(larghezza<schermoX&&altezza<schermoY) // caso immagine piccola (banale)
    		{larghezza_finestra=larghezza; altezza_finestra=altezza; barre='no'} 
    	// caso immagine che esce dallo schermo (e sono cazzi)
    else if (larghezza>schermoX&&altezza<schermoY) // piu' larga
    		{larghezza_finestra=(parseInt((parseInt(schermoX))-5)); altezza_finestra=(parseInt((parseInt(altezza))+20)); barre='yes'} 
    else if (larghezza<schermoX&&altezza>schermoY) // piu' alta
    		{larghezza_finestra=(parseInt((parseInt(larghezza))+16)); altezza_finestra=(parseInt((parseInt(schermoY))-25)); barre='yes'} 
    else    // piu' larga e piu' alta 
    		{larghezza_finestra=(parseInt((parseInt(schermoX))-5)); altezza_finestra=(parseInt((parseInt(schermoY))-25)); barre='yes'};
          
    // correzione per Mozilla: ingrandiamo leggermente la finestra
    if (window.sidebar) {larghezza_finestra=(parseInt((parseInt(larghezza_finestra))+5)); altezza_finestra=(parseInt((parseInt(altezza_finestra))+5))};
    
    // correzione per Opera, inutile perche poi fa il cazzo che gli pare
    if (window.opera) {larghezza_finestra=(parseInt((parseInt(larghezza_finestra))+20)); altezza_finestra=(parseInt((parseInt(altezza_finestra))+20)); barre='yes'};
     
    // i risultati dei calcoli e del sudore del giovane MaRoK vengono scritti nella window.open 
	popup = window.open('','_blank','width='+larghezza_finestra+',height='+altezza_finestra+',toolbar=no,resizable=yes,scrollbars='+barre+',left=0,top=0');

    // scriviamo dentro la popup
    
    popup.document.open();
    popup.document.write('<html>\n<head>\n<title>'+descrizione+'</'+'title>\n</'+'head>\n');
    if (document.getElementById) {popup.document.write('<body style="margin:0px"><center>\n<img src="'+figura+'" border=0 alt="'+descrizione+'" title="'+descrizione+'" onclick="window.close(); return false">\n</'+'body>\n</'+'html>')}
    else {popup.document.write('<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>\n<img src="'+figura+'" border=0 name="imagetest" alt="'+descrizione+'" title="'+descrizione+'">')};
    popup.document.write('</'+'body>\n</'+'html>');
    popup.document.title=descrizione;
    popup.document.close();
    }
    