

/*
*
*  Funkcje dotyczace ciasteczek
*
*/ 

function setCookie(name, value, expire)
  {
  document.cookie = name + "=" + escape(value)
    + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
  }
function getCookie(Name)
  {
  var search = Name + "=";

  // jeżeli są jakiekolwiek ciasteczka
  if (document.cookie.length > 0)
    {
    // określenie początku ciasteczka o zadanej nazwie
    offset = document.cookie.indexOf(search);

    // jeżeli ciasteczko istnieje
    if (offset != -1)
      {
      //określenie początku wartości ciasteczka
      offset += search.length;

      //określenie końca ciasteczka
      end = document.cookie.indexOf(";", offset)
      if (end == -1) end = document.cookie.length

        //zwrócenie wartości ciasteczka
        return unescape(document.cookie.substring(offset, end))
      }
    }
  }


function register(name)
  {
  var today = new Date()
  var expires = new Date()
  expires.setTime(today.getTime() + 1000*60*3)
  setCookie(name, 1, expires)
  }



/*  Inne funkcje */
showHintBox=showHintBoxForVar=function( S,T,W, d,E,b ) {
  d=document;E=d.documentElement;b=d.body;if(!E)return;
  //check if hintBox appears somwhere in code
  if( ! ( S.h=document.getElementById( 'hintBox' ) ) ) {
  	//if not create new element
  	S.h=d.createElement('div');
  	//and add some looks
  	S.h.id='hintbox';
  } //here's IE bug fix - if hintBox appears within table tag it won't
  //accept table as inner html, so to preserve user defined formatting we clone node and add it in
  //the beginning of document
 	//do not remove !!!!
	else S.h=S.h.cloneNode(true);
	//if T string was not sent look for title tag and if it's not found give it default string
	S.h.innerHTML = !T ? (S.title?S.title:'&nbsp;value not defined&nbsp;'):unescape( T );
	//set properties essential for div positioning
	with( S.h.style ) { position='absolute'; zIndex=2; top=left=0;}
	//the heart of the script - enable onmousemove event
	S.onmousemove=function(e,l,t,mX, mY,c,h,w){
		e=e||event;
		var di=15; friction=.3;
		with( this.h.style ) {
			//show div
			display='block'; visibility='visible';
			mX = e.clientX+( E.scrollLeft || b.scrollLeft );
			mY = e.clientY+( E.scrollTop  || b.scrollTop  );
			c = clientSize();
			l=parseInt(left),	t=parseInt(top),	h=this.h.offsetHeight,	w=this.h.offsetWidth
			if( c[0]-mX-w < di )
				left=(l > mX-di-w?l+(mX-di-w-l)*friction:mX-di-w)+'px';
			else
				left= (l > mX-w-di && l < mX+di?l+(mX+di-l)*friction: mX+di)+'px';

			if( c[1]-mY-h < di )
				top=(t>mY-di-h?t+(mY-di-h-t)*friction:mY-di-h)+'px';
			else
				top=(t > mY-h-di && t < mY+di?t+(mY+di-t)*friction:mY+di)+'px';
		} return!1;
	}
	//add hiding
	S.onmouseout=function(){
		with( this ) {
			//remove div from document's node tree
	  	if(h)b.removeChild( h );
	  	//stop catching mouse position
			onmousemove=h=null;
		}
		return!1;
  }
  //add div to the document
	b.appendChild(S.h);
}

function clientSize() {
	if (window.innerHeight >= 0) {
		return [window.innerWidth, window.innerHeight];
	} else if (document.documentElement) {
		return [document.documentElement.clientWidth,		document.documentElement.clientHeight]
	} else if (document.body.clientHeight >= 0) {
		return [document.body.clientWidth,document.body.clientHeight]
	} else {
		return [0, 0]
	}
}

function zoom(act){
var size = document.getElementById('artykulik').style.fontSize;
//alert (size);
if (act == "in"){document.getElementById("artykulik").style.fontSize="larger";}
if (act == "out"){document.getElementById("artykulik").style.fontSize="100%";}
}


