function menu_off(a,b) {
	a.src = 'img/' + b + '-on.gif' ; 

}
function menu_on(a,b) {
	a.src = 'img/' + b + '-off.gif' ; 

}

function przeladuj(x) {
  var a = document;

  if (!a) {
	  top.location.href = 'main.php?type=' + x ;
  }
  boczek.boczektitle.src = 'img/boczek-' + x + '.gif' ; 
}
function przeladuj2(x) {
  var a = document.boczek ;

  if (!a) {
	  top.location.href = 'main-eng.php?type=' + x ;
  }
  document.boczektitle.src = 'img/boczek-' + x + '.gif' ; 
}

function otworzOkno(x,y) {
	okno =	window.open('','Okladka','toolbar=no,menubar=no,location=no,personalbar=no,scrollbars=no,directories=no,status=no,resizable=no,width='+x+',height='+y) ;
	okno.resizeTo(x+10,y+29) ;
}

var today = new Date();
var expiry = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);

function SetCookie (name,value,expires,path,domain,secure) {
	document.cookie = name + "=" + escape (value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}
function checkCookie(searchString){
  var c = document.cookie;
  point = c.indexOf (searchString);
  if (point != -1){
    endAt = c.indexOf (";", point + searchString.length);
    if (endAt == -1) endAt = c.length;
    var temp = c.substring (point + searchString.length, endAt);
    return temp;
  }
  return false;
}
function checkCookie2(searchString){
  var c = document.cookie;
  point = c.indexOf (searchString);
  if (point != -1){
    endAt = c.indexOf (";", point + searchString.length);
    if (endAt == -1) endAt = c.length;
    var temp = c.substring (point + searchString.length, endAt);
    return temp;
  }
  return false;
}
function getCookie(){
  tempString = checkCookie ("linking=");
  if (tempString)
    window.alert(tempString);
}

function linkuj () {
tempString = checkCookie2 ("linking=");
	if (tempString) {
		top.location.href = 'main-eng.php?type=' + tempString ;
	}
	else {
		top.location.href = 'index-eng.htm' ;
	}
}
function linkuj2 () {
tempString = checkCookie2 ("linking=");
	if (tempString) {
		top.location.href = 'main.php?type=' + tempString ;
	}
	else {
		top.location.href = 'index.htm' ;
	}
}
function zoom(plik, size_x, size_y, scroll, loc, stat, posX, posY){

  size_x += 14;
  size_y += 32;
  
	if (posX == null) posX = Math.round(((screen.availWidth-size_x)/2)-5);
	if (posY == null) posY = Math.round(((screen.availHeight-size_y)/2)-14);

	if (scroll == null) scroll = 0;
	if (loc == null) loc = 0;
	if (stat == null) stat = 0;

	popup="width="+size_x+",height="+size_y+",left="+posX+",top="+posY+",toolbar=no,location="+loc+",directories=no,status="+stat+",menubar=no,scrollbars="+scroll+",resizable=no";
	opener = window.open( plik, 'zoom', popup);
}