/*------------------------------------------------------------
	Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
	Web Site: http://txkang.com
	Script featured on Dynamic Drive (http://www.dynamicdrive.com)
	
	Please retain this copyright notice in the script.
	License is granted to user to reuse this code on 
	their own website if, and only if, 
	this entire copyright notice is included.
--------------------------------------------------------------*/

//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','td','tr', 'h1', 'h2', 'h3', 'h4');

//Specify spectrum of different font sizes:

var szs = new Array( '11px','12px','14px','16px','18px','20px','22px','24px' );
var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 6 ) sz = 6;
	startSz = sz;
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
  var waznosc=new Date();
  var x=(sz-2);
  var tresc=x;
  waznosc.setTime(waznosc.getTime()+1000*60*60*24*7); //7dni
  document.cookie="czcionka=" + tresc + ";expires=" + waznosc.toGMTString();
}



/*Wybor wielkosci czcionki*/
function read_w(nazwa)
{
  nazwa+="=";
  startCookie=document.cookie.indexOf(nazwa);
  if (startCookie==-1) {return ""}
  startCookie+=nazwa.length;
  if (document.cookie.indexOf(";",startCookie)==-1)
   {
    koniecCookie=document.cookie.length;
   }
  else
   {
    koniecCookie=document.cookie.indexOf(";",startCookie);
   }
  textCookie=document.cookie.substring(startCookie,koniecCookie);


  if (textCookie=='0'){ts('body',0);}
  if (textCookie=='1'){ts('body',1);}
  if (textCookie=='2'){ts('body',2);}
  if (textCookie=='3'){ts('body',3);}
  if (textCookie=='4'){ts('body',4);}
  if (textCookie=='5'){ts('body',5);}
  if (textCookie=='6'){ts('body',6);}
  if (textCookie=='7'){ts('body',7);}
  if (textCookie=='8'){ts('body',8);}
  
  return true;
}


/*Wybor css*/
function read_c(nazwa)
{
  nazwa+="=";
  startCookie=document.cookie.indexOf(nazwa);
  if (startCookie==-1) {return ""}
  startCookie+=nazwa.length;
  if (document.cookie.indexOf(";",startCookie)==-1)
   {
    koniecCookie=document.cookie.length;
   }
  else
   {
    koniecCookie=document.cookie.indexOf(";",startCookie);
   }
  textCookie=document.cookie.substring(startCookie,koniecCookie);


  if (textCookie=='0'){zmien_css_0();}
  if (textCookie=='1'){zmien_css_1();}
  if (textCookie=='2'){zmien_css_2();}
  if (textCookie=='3'){zmien_css_3();}
  if (textCookie=='4'){zmien_css_4();}
  if (textCookie=='5'){zmien_css_5();}
  if (textCookie=='6'){zmien_css_6();}
  if (textCookie=='7'){zmien_css_7();}
  if (textCookie=='8'){zmien_css_8();}
  
  return true;
}

/*CSS - standard*/
function zmien_css_0()
{
  document.getElementById('typ_css_1').href='css/common.css';
  document.getElementById('typ_css_2').href='css/forum.css';
  document.getElementById('typ_css_3').href='css/galeria.css';
  /*Ciasteczko*/
  var waznosc=new Date();
  var tresc='0';
  waznosc.setTime(waznosc.getTime()+1000*60*60*24*7); //7dni
  document.cookie="ustawienia=" + tresc + ";expires=" + waznosc.toGMTString();
}

function zmien_css_1()
{
  document.getElementById('typ_css_1').href='css/1/common.css';
  document.getElementById('typ_css_2').href='css/1/forum.css';
  document.getElementById('typ_css_3').href='css/1/galeria.css';
  /*Ciasteczko*/
  var waznosc=new Date();
  var tresc='1';
  waznosc.setTime(waznosc.getTime()+1000*60*60*24*7); //7dni
  document.cookie="ustawienia=" + tresc + ";expires=" + waznosc.toGMTString();
}

function zmien_css_2()
{
  document.getElementById('typ_css_1').href='css/2/common.css';
  document.getElementById('typ_css_2').href='css/2/forum.css';
  document.getElementById('typ_css_3').href='css/2/galeria.css';
  /*Ciasteczko*/
  var waznosc=new Date();
  var tresc='2';
  waznosc.setTime(waznosc.getTime()+1000*60*60*24*7); //7dni
  document.cookie="ustawienia=" + tresc + ";expires=" + waznosc.toGMTString();
}

function zmien_css_3()
{
  document.getElementById('typ_css_1').href='css/3/common.css';
  document.getElementById('typ_css_2').href='css/3/forum.css';
  document.getElementById('typ_css_3').href='css/3/galeria.css';
  /*Ciasteczko*/
  var waznosc=new Date();
  var tresc='3';
  waznosc.setTime(waznosc.getTime()+1000*60*60*24*7); //7dni
  document.cookie="ustawienia=" + tresc + ";expires=" + waznosc.toGMTString();
}

function zmien_css_4()
{
  document.getElementById('typ_css_1').href='css/4/common.css';
  document.getElementById('typ_css_2').href='css/4/forum.css';
  document.getElementById('typ_css_3').href='css/4/galeria.css';
  /*Ciasteczko*/
  var waznosc=new Date();
  var tresc='4';
  waznosc.setTime(waznosc.getTime()+1000*60*60*24*7); //7dni
  document.cookie="ustawienia=" + tresc + ";expires=" + waznosc.toGMTString();
}


function zmien_css_5()
{
  document.getElementById('typ_css_1').href='css/5/common.css';
  document.getElementById('typ_css_2').href='css/5/forum.css';
  document.getElementById('typ_css_3').href='css/5/galeria.css';
  /*Ciasteczko*/
  var waznosc=new Date();
  var tresc='5';
  waznosc.setTime(waznosc.getTime()+1000*60*60*24*7); //7dni
  document.cookie="ustawienia=" + tresc + ";expires=" + waznosc.toGMTString();
}


function zmien_css_6()
{
  document.getElementById('typ_css_1').href='css/6/common.css';
  document.getElementById('typ_css_2').href='css/6/forum.css';
  document.getElementById('typ_css_3').href='css/6/galeria.css';
  /*Ciasteczko*/
  var waznosc=new Date();
  var tresc='6';
  waznosc.setTime(waznosc.getTime()+1000*60*60*24*7); //7dni
  document.cookie="ustawienia=" + tresc + ";expires=" + waznosc.toGMTString();
}


function zmien_css_7()
{
  document.getElementById('typ_css_1').href='css/7/common.css';
  document.getElementById('typ_css_2').href='css/7/forum.css';
  document.getElementById('typ_css_3').href='css/7/galeria.css';
  /*Ciasteczko*/
  var waznosc=new Date();
  var tresc='7';
  waznosc.setTime(waznosc.getTime()+1000*60*60*24*7); //7dni
  document.cookie="ustawienia=" + tresc + ";expires=" + waznosc.toGMTString();
}


function zmien_css_8()
{
  document.getElementById('typ_css_1').href='css/8/common.css';
  document.getElementById('typ_css_2').href='css/8/forum.css';
  document.getElementById('typ_css_3').href='css/8/galeria.css';
  /*Ciasteczko*/
  var waznosc=new Date();
  var tresc='8';
  waznosc.setTime(waznosc.getTime()+1000*60*60*24*7); //7dni
  document.cookie="ustawienia=" + tresc + ";expires=" + waznosc.toGMTString();
}

