/*GommaLayout Jerry Masslo mondoquarto.org Gennaio 2004 */
function createCookie(name,value,days) { 
if (days) { 
var date = new Date(); 
date.setTime(date.getTime()+(days*24*60*60*1000)); 
var expires = '; expires='+date.toGMTString(); 
} 
else expires = ''; 
document.cookie = name+'='+value+expires+'; path=/';
return true;
} 
function readCookie(name) { 
var nameEQ = name + '='; 
var ca = document.cookie.split(';'); 
ritorno=false;
for(var i=0;i < ca.length;i++) { 
var c = ca[i]; 
while (c.charAt(0)==' ') c = c.substring(1,c.length); 
if (c.indexOf(nameEQ) == 0)ritorno=c.substring(nameEQ.length,c.length); 
} 
return ritorno; 
} 

caratteri=new Array('verdana','arial','courier','georgia','garamond',"'lucida console'","'trebuchet ms'",'tahoma',"'11S01 Black Tuesday'",'AddElectricCity','African','AlgerianD','Amano',"'Amelia BT'","'Americana XBd BT'","'AmerType Md BT'",'Aquaduct','Arbeka',"'AvantGarde Bk BT'","'Babylon5 Hollow'","'BankGothic Lt BT'","'Bauhaus Md BT'",'Beatbox','Bedrock','BinnerD','BlackForest','Book Antiqua',"'Bookman Old Style'","'Bremen Blk BT'",'Brisk',"'Brookhouse Heavy'","'CaslonOpnface BT'","'Century Gothic'","'Century725 Blk BT'",'ChiselD',"'Clarendon BT'","'Clarendon Hv BT'","'CloisterBlack BT'","'Comic Sans MS'","'Compacta Blk BT'","'CopprplGoth Hv BT'",'CountdownD',"'Courier New'",'Dunebug','Eklektic',"'EngrvrsOldEng Bd BT'",'EnviroD',"'Exotc350 Lt BT'",'Fixedsys',"'Follies LET'","'Forgotten Futurist'","'FormalScrp421 BT'","'Freefrm721 Blk BT'","'Freehand591 BT'",'FreestyleScrD','Frission',"'FrizQuadrata BT'","'Futura Md BT'",'Future','Galleria',"'Geometr231 BT'","'Geometr885 BT'",'Glacier','GlaserSteD','GoldMine','GoudyOlSt BT','Griffon',"'Hazel LET'",'Honda',"'Humnst777 Lt BT'","'HuxleyVertical BT'",'Impact','mancante',"'Jazz LET'","'Kabel Bk BT'","'Kaufmann BT'","'Lady Ice'",'Larabiefont','LatinWidD',"'Lois Ann'","'London Tube'","'Lucida Sans Unicode'","'Millenium BdEx BT'",'Modern',"'Monospac821 BT'","'Orbit-B BT'","'Palatino Linotype'","'ParkAvenue BT'",'Pepper',"'Pioneer BT'",'President',"'Ribbon131 BT'",'Roman','Sanlite',"'Sci Fied 2002'",'Script','SerpentineDBol',"'SF Arborcrest Medium'","'SF Laundromatic'","'SF Old Republic'","'SF Speedwaystar'","'SF Theramin Gothic Shaded'","'SF TransRobotics'","'SF Willamette'",'SquireD',"'Staccato222 BT'",'StopD',"'Swis721 BlkOul BT'","'Swis721 BlkRnd BT'",'Technical','Ultraworld',"'VAGRounded BT'","'Van Dijk'",'Xpressive','Zekton','Zrnic',"'New Aster'");
ClassiMenu =new /*forse non serve pių*/ Array('ClasseMenuA','ClasseMenuB','ClasseMenuC','ClasseMenuD','ClasseMenuE','ClasseMenuF','ClasseMenuG','ClasseMenuH','ClasseMenuI','ClasseMenuL','ClasseMenuM','ClasseMenuN','ClasseMenuO','ClasseMenuP');
Linkili =new Array('Linki0','Linki1','Linki2','Linki3','Linki4','Linki5','Linki6','Linki7','Linki8','Linki9','Linki10','Linki11','Linki12','Linki13','Linki14','Linki15','Linki16','Linki17','Linki18','Linki19','Linki20','Linki21','Linki22','Linki23','Linki24','Linki25','Linki26','Linki27','Linki28','Linki29','Linki30','Linki31','Linki32','Linki33','Linki34','Linki35','Linki36','Linki37','Linki38','Linki39','Linki40','Linki41','Linki42','Linki43','Linki44','Linki45','Linki46','Linki47','Linki48','Linki49','Linki50','Linki51','Linki52','Linki53','Linki54','Linki55','Linki56','Linki57','Linki58','Linki59','Linki60','Linki61','Linki62','Linki63','Linki64','Linki65','Linki66','Linki67','Linki68','Linki69','Linki70','Linki71','Linki72','Linki73','Linki74','Linki75','Linki76','Linki77','Linki78','Linki79','Linki80','Linki81');

Lonkiul =new Array('Lonki0','Lonki1','Lonki2','Lonki3','Lonki4','Lonki5','Lonki6','Lonki7','Lonki8','Lonki9','Lonki10','Lonki11','Lonki12','Lonki13','Lonki14','Lonki15','Lonki16','Lonki17','Lonki18','Lonki19','Lonki20','Lonki21','Lonki22','Lonki23','Lonki24','Lonki25','Lonki26','Lonki27','Lonki28','Lonki29','Lonki30','Lonki31','Lonki32','Lonki33','Lonki34','Lonki35','Lonki36','Lonki37','Lonki38','Lonki39','Lonki40','Lonki41','Lonki42','Lonki43','Lonki44','Lonki45','Lonki46','Lonki47','Lonki48','Lonki49','Lonki50','Lonki51','Lonki52','Lonki53','Lonki54','Lonki55','Lonki56','Lonki57','Lonki58','Lonki59','Lonki60','Lonki61','Lonki62','Lonki63','Lonki64','Lonki65','Lonki66','Lonki67','Lonki68','Lonki69','Lonki70','Lonki71','Lonki72','Lonki73','Lonki74','Lonki75','Lonki76','Lonki77','Lonki78','Lonki79','Lonki80','Lonki81');




Paragrafi =new Array ('ColonneA','ColonneB','ColonneC','ColonneD','ColonneE','ColonneF','ColonneG','ColonneH','ColonneI', 'ColonneL','ColonneM','ColonneN','ColonneO','ColonneP');
Apri =new Array ('block','none');


croma=new Array('#ffffff','#f7f7f7','#f0f0f0','#e8eaee','#dbdbdb','#cdcdcd','#a4a4a4','#838383','#727272','#616161','#1a2326','#785243','#966654','#b08371','#c09b8d','#e3cad2','#cda0af','#c0879a','#ad677d','#9d6670','#cf6c67','#d88985','#e2a8a5','#ecc8c6','#f7e7e6','#ffb09f','#ffcbbf','#ff8971','#ff0000','#ea3e60','#e12700','#ae1f00','#844f00','#b76c4d','#ce7b00','#ff9900','#ffcc00','#ffe3bb','#fff4e6','#ffffec','#ffffa8','#ffff6c','#f4f400','#deff93','#c0ff2d','#a4ea00','#8dca00','#76a800','#00824e','#7d8b72','#809b64','#00c475','#2bffaa','#7dffcb','#ceffec','#9de1d9','#9ccdcb','#79bbb8','#55a6a2','#6f9591','#417e7b','#336462','#40535e','#4f6775','#648395','#32859c','#3996b0','#829cac','#a7bac5','#cbd6dc','#cee7ff','#b0d8ff','#7dbeff','#3399ff','#0078f0','#0000ff','#0061c1','#8375ac','#6700c4','#9622ff','#c17dff','#d5a6ff');

Testi =new Array ('50%','65%','75%','80%','90%','100%','120%','150%','200%','500px','620px','760px','900px','1100px','1400px','3000px');

/*function Mod(iddi){//capilettera e sfondo hover corpo
	var body=new Array(); 
body[0]=document.getElementById('Menu'); 
body[1]=document.getElementById('InterruttoreA');
body[2]=document.getElementById('InterruttoreB');
body[3]=document.getElementById('Piede');
body[4]=document.getElementById('InterruttoreC');
	for(i=0;i<body.length;i++){ 
	body[i].className = ClassiMenu[iddi];				
}
	createCookie('GommaLayoutJerryMod',iddi,365);
}
*/


function Capi(let){//capilettera e sfondo hover corpo
	var body=document.getElementById('Corpo'); 
	for(i=0;i<body.length;i++){ 
	body[i].className = Linkili[let];				
}
var body = document.getElementsByTagName ('p');
 for(i=0;i<body.length;i++){
 body[i].className = Linkili[let];
}
	createCookie('GommaLayoutJerryMod',let,365);
}


/*
function Rompi(salsa){
var body = document.getElementsByTagName ('p');
 for(i=0;i<body.length;i++){
 body[i].className = Paragrafi[salsa];
}
createCookie('GommaLayoutRompiB',salsa,365);
}
*/

function Linki(be){//sfondo hover voci menų
var body=document.getElementsByTagName('li'); 
 for(i=0;i<body.length;i++){
 body[i].className = Lonkiul[be];
}
createCookie('GommaLayoutLinki',be,365);
}

function Lonki(ba){//colore voci menų - array scambiato con linki
var body = document.getElementsByTagName ('ul');
 for(i=0;i<body.length;i++){
 body[i].className = Linkili[ba];
}
createCookie('GommaLayoutLonki',ba,365);
}



function Font(size) {//dimensioni testo
	var body = document.getElementsByTagName('body')[0];
	body.style.fontSize = Testi[size];
	createCookie('GommaLayoutFont',size,365);
}

function Pag(largo) {//dimensioni pagina
	var body = document.getElementById('Contenitore');
	body.style.width = Testi[largo];
	createCookie('GommaLayoutPag',largo,365);
}



function Car(fam) { //tipo di carattere
var body = document.getElementsByTagName('body')[0]; 
body.style.fontFamily = caratteri[fam]; 
createCookie('Car',fam,365); 
}

function Sfondo1(color) { //sfondo menų basso e bordi estremi
var body=new Array(); 
body[0]=document.getElementById('SottoMenu'); 
body[1]=document.getElementById('XMenu');
body[2]=document.getElementById('BordinoSopra');
body[3]=document.getElementById('BordinoSotto');
body[4]=document.getElementById('Impostazioni');
body[5]=document.getElementById('InterruttoreA');
body[6]=document.getElementById('VecchieVersioni');
for(i=0;i<body.length;i++){ 
body[i].style.backgroundColor = croma[color];
}
var body = document.getElementsByTagName ('hr');
 for(i=0;i<body.length;i++){
 body[i].style.backgroundColor = croma[color];
}
var body =document.getElementById ('SottoVoci');
body.style.color = croma [color];
createCookie('GommaLayoutSfondo1',color,365); 
}

function Sfondo2(colore) { //sfondo menų alto e titoli estremi
var body=new Array(); 
body[0]=document.getElementById('Xh1'); 
body[1]=document.getElementById('Testata'); 
body[2]=document.getElementById('Xh2');
body[3]=document.getElementById('Menu');
body[4]=document.getElementById('SottoVoci');
for(i=0;i<body.length;i++){ 
body[i].style.backgroundColor = croma[colore];
} 
createCookie('GommaLayoutSfondo2',colore,365); 
}

function Sfondo3(colla){//sfondo corpo testo
var body=new Array()
body[0]=document.getElementById('Corpo');
body[1]=document.getElementById('Contenitore');
body[2]=document.getElementById('Piede');
for(i=0;i<body.length;i++){ 
body[i].style.backgroundColor = croma[colla];
}
createCookie('GommaLayoutSfondo3',colla,365);
}


function Testo(tinta) {//colore testo corpo
var body=new Array()
body[0] = document.getElementById('Corpo');
body[1] = document.getElementById('Piede');
//body[2] = document.getElementById('SottoVoci');
for(i=0;i<body.length;i++){ 
body[i].style.color = croma[tinta];
}
createCookie('GommaLayoutTesto',tinta,365);
}

function Configura(display) {//apri chiudi configura layout
	var body = document.getElementById('Impostazioni');
	body.style.display = Apri[display];
}

function Vecchi(mostra) {//apri chiudi vecchie versioni
	var body = document.getElementById('VecchieVersioni');
	body.style.display = Apri[mostra];
}




window.onload = function() {

size = (readCookie('GommaLayoutFont')? readCookie('GommaLayoutFont'):3);
largo = (readCookie('GommaLayoutPag')? readCookie('GommaLayoutPag'):3);
color = (readCookie('GommaLayoutSfondo1')? readCookie('GommaLayoutSfondo1'):65);
colore = (readCookie('GommaLayoutSfondo2')? readCookie('GommaLayoutSfondo2'):35);
fam = (readCookie('Car')? readCookie('Car'):0);
display = 1;
//salsa = (readCookie('GommaLayoutRompiB')? readCookie('GommaLayoutRompiB'):0);
be = (readCookie('GommaLayoutLinki')? readCookie('GommaLayoutLinki'):42);
ba = (readCookie('GommaLayoutLonki')? readCookie('GommaLayoutLonki'):51);
let = (readCookie('GommaLayoutJerryMod')? readCookie('GommaLayoutJerryMod'):35);
mostra = 1;
colla = (readCookie('GommaLayoutSfondo3')? readCookie('GommaLayoutSfondo3'):2);
tinta = (readCookie('GommaLayoutTesto')? readCookie('GommaLayoutTesto'):62);
//Rompi(salsa);
Capi(let);
Font(size);
Testo(tinta);
Linki(be);
Lonki(ba);
Pag(largo);
Sfondo1(color);
Sfondo2(colore);
Sfondo3(colla);
Car(fam);
Configura(display);
Vecchi(mostra);
}
