ie4=document.all;
ns4=document.layers;
speed=3
var nt;
var ktop;
var screenW=(typeof(screen)=="object") ? screen.width : 1024;
var screenH=(typeof(screen)=="object") ? screen.height : 768;
var outW=screenW;
var outH=screenH;
var IE5=false;
var nwins=10;
var wispop=false;
if (navigator.appName == 'Microsoft Internet Explorer')  { 
	cPos=navigator.appVersion.indexOf('5.');
	if (cPos>=0) { 
		cSubv=navigator.appVersion.substr(cPos,3); 
		if (cSubv>=5.0) { IE5=true; }
	}
	else {
		cPos=navigator.appVersion.indexOf('6.');
		if (cPos>=0) { IE5=true; }
	}
}
if(document.all && !document.getElementById) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}
st=new Array()
st[0]="Strona główna";
st[1]="O piernikach";
st[2]="Pierniki - oferta";
st[3]="O nas";
st[4]="Czy wiesz...";
st[5]="Oferta specjalna";
st[6]="Kontakt";
st[7]="Promocje, aktualności...";
st[8]="Drewniana forma do pierników z XIX w.";
st[9]="Drewniana forma do pierników z początków XIX w.";
st[10]="Drewniana forma do pierników z końca XIX w.";
st[11]="Piernik z formy drewnianej";
st[12]="Pierniki z form drewnianych";
st[13]="Przepis na marcepan";
st[14]="Przepis na piernik świąteczny";
st[15]="Przepis na karmel";
st[16]="Przepis na lukier najprostszy";
st[17]="Przepis na kandyzowaną skórkę pomarańczową";
st[18]="Cerkiew w Chyrowej";
st[19]="Strona poświęcona obchodom Dnia Ziemi 2006";
st[20]="Pierniki trójwymiarowe";
st[21]="Piernikowe postacie";
st[22]="Pierniki dwustronne";
st[23]="Program XV Kermeszu w Olchowcu";
st[24]="Szczegółowy opis i historia Kermeszy w Olchowcu wraz z galerią zdjęć";
st[25]="Oferta świąteczna";
st[26]="Fotoreportaż z Dnia Ziemi 2005 na stronie Research.pl - Poznaj Swój Kraj i Okolice";
st[27]="Zestaw świątecznych ozdób choinkowych";
st[28]="Piernikowe aniołki - kliknij";
st[29]="Więcej wzorów - kliknij";

docs=new Array()
docs[0]="/";
docs[1]="pierniki.html";
docs[2]="pierniki_oferta.html";
docs[3]="o_nas.html";
docs[4]="pierniki_ciekawostki.html";
docs[5]="specjalna.html";
var iw=new Array(nwins)

function lload(ndoc)
{ window.document.location=docs[ndoc]; }


function onmm(msgnr, el, lout)
{
elem = document.getElementById(el);
if (lout) {
	window.status='';
	elem.style.cursor='auto'; 
	}
else	{
	window.status=st[msgnr];
	elem.style.cursor='hand'; 
	}
return true;
}

function onms(msgnr, lout)
{
if (lout) {window.status='';}
else	{ window.status=st[msgnr];}
return true;
}


function init()
{
	window.frames.ktext.window.scrollTo(0,0);
	scrollw(0);
}	

function scrollw(sign){
window.status = (sign > 0) ? 'W dół' : (sign < 0) ? 'W górę' : '';
window.frames.ktext.window.scrollBy(0,speed*sign);
fbody=window.frames.ktext.window.document.body;
if (ie4) {
	if (fbody.scrollTop==0) { up.style.visibility="hidden"; }
	else {	up.style.visibility="visible"; }	
	if (fbody.scrollTop>=fbody.scrollHeight-fbody.clientHeight) {
		dn.style.visibility="hidden"; }
	else { dn.style.visibility="visible"; }	
}	
if (nt) clearTimeout(nt);
if (sign!=0) nt=setTimeout("scrollw("+sign+")",20);
}

function nps() 
{window.document.location="oferta_srednie.html";}
function npd() 
{ window.document.location="oferta_duze.html"; }
function npm() 
{ window.document.location="oferta_male.html"; }
function np3a() 
{ window.document.location="oferta_3anioly.html"; }

function swt(nt)
{
var tx=new Array();
tx[1]="Pierniczki małe, kolorowe i białe. Wielkość ok. 7 x 7 cm";
tx[2]="Pierniki średnie, różne kształty, białe i kolorowe.<br>Wielkość ok. 14 x 10 cm.";
tx[3]="Pierniki duże białe i kolorowe.<br>Wielkość ok. 18 x 14 cm.<br>";
tx[4]="Nasze ceny są równie atrakcyjne jak nasze pierniki.<br>Ponieważ jednak sprzedajemy je w różnych zestawach <nobr>i ilościach,</nobr> ceny ustalamy indywidualnie.";
tx[5]="Anioły w trzech rozmiarach:<br>7 x 7 cm, 10 x 14 cm, 14 x 18 cm.";
tx[6]="Serca w rozmiarach od 3,5 x 3,5 cm do 17 x 17 cm.<br>W ramach promocji napis według własnego projektu - gratis.";
if(document.getElementById)
	pp=document.getElementById("podpis");
else if(document.all)	
	pp=document.all.podpis;
else
	pp=document.podpis;	
pp.style.filter="progid:DXImageTransform.Microsoft.Fade(duration=1.0,overlap=1.0)";
if (pp.filters) pp.filters[0].apply()	
if (pp.innerHTML.toString().substr(0,27)==tx[nt].substr(0,27)) {
	pp.innerHTML=tx[4]; }
else
	{ pp.innerHTML=tx[nt]; }
if (pp.filters) pp.filters[0].play()	
}

function p_pop(hdoc,htitle,w,h,l,t)
{
rs="1";
sb='no';
wname='w'+rand(32767);
if (screenW<=640) { sb='yes'; }
else { 	sb ='no'; }
if (screenW>800) { sb='no'; rs='0'; }
wpars='"toolbar=no,menubar=no,location=no,status=no,scrollbars='+sb+',resizable='+rs+',width='+w+',height='+h+',left='+l+',top='+t+'"';	
window.open(hdoc,wname,wpars);
wispop=true;
}

function wclosea()
{
for (i=0;i<nwins;i++) { 
	if (iw[i]) iw[i].close(); }	
}

function wclear(inum)
{
ni=inum-8;
iw[ni]=null;
}

function i_pop(hdoc,inum,w,h,l,t)
{
rs="1";
sb='no';
wi='p'+inum;
ni=inum-8;
if (screenW<=640) { sb='yes'; }
else { 	sb ='no'; }
if (screenW>800) { sb='no'; rs='0'; }
wpars='"toolbar=no,menubar=no,location=no,status=no,scrollbars='+sb+',resizable='+rs+',width='+w+',height='+h+',left='+l+',top='+t+'"';	
for (i=0;i<nwins;i++) {
	if (iw[i]) { iw[i].focus(); }
}
iw[ni]=window.open(hdoc,wi,wpars);
}

function c_pop(hdoc,htitle,w,h,l,t)
{
p_pop(hdoc,htitle,w,h,l,t);
this.focus();
self.opener = this;
self.close();	
}

function rand ( n )
{
  return ( Math.floor ( Math.random ( ) * n + 1 ) );
}

function dm()
{ return; }

function bf()
{
if (document.all) { document.body.focus(); }
else  {	window.focus(); }
}		

function unblur() {
	this.blur();
} 

function blurLinks() {
	if (!document.getElementById) return;
	theLinks = document.getElementsByTagName("A");
	// theAreas = document.getElementsByTagName("AREA");
	for(i=0; i<theLinks.length; i++) {theLinks[i].onfocus = unblur;}
	// for(i=0; i<theAreas.length; i++) {theAreas[i].onfocus = unblur;}
} 	

function do_menu(which, yoff) {
if (!which) which=3;
if (!yoff) yoff=0;
// +12 = op1024_7x1 (kn1024_5x5), +27 = ofm1024_7x1 (7x5)
if (which & 1) {
	cordsa=new Array()
	cordsa[0]='24,'+(8+yoff)+',74,'+(50+yoff)+'';
	cordsa[1]='24,'+(51+yoff)+',74,'+(90+yoff)+'';
	cordsa[2]='24,'+(91+yoff)+',74,'+(130+yoff)+'';
	cordsa[3]='24,'+(131+yoff)+',74,'+(172+yoff)+'';
	cordsa[4]='24,'+(173+yoff)+',74,'+(210+yoff)+'';
	cordsa[5]='24,'+(211+yoff)+',74,'+(250+yoff)+'';
	document.writeln('<map name="menua">')
	for (var i=0;i<6;i++) {
		htxt='<area shape="rect" coords="'+cordsa[i]+'" ' + ((IE5) ? 'onclick="javascript:lload('+i+')" onmouseover="onmm('+i+',\'lmenu\')" onmouseout="onmm('+i+',\'lmenu\',1)" ' : 'href="'+docs[i]+'" onmouseover="window.status=\''+st[i]+'\';return true;" onmouseout="window.status=\'\';return true;"') + ' alt="' + st[i]+'" title="'+ st[i] + '">';
		document.writeln(htxt);
		}	
	document.writeln('</map>')
}
if (which & 2) {
	cordsb=new Array()
	cordsb[0]='13,'+(8+yoff)+',63,'+(50+yoff)+'';
	cordsb[1]='13,'+(51+yoff)+',63,'+(90+yoff)+'';
	cordsb[2]='13,'+(91+yoff)+',63,'+(130+yoff)+'';
	cordsb[3]='13,'+(131+yoff)+',63,'+(172+yoff)+'';
	cordsb[4]='13,'+(173+yoff)+',63,'+(210+yoff)+'';
	cordsb[5]='13,'+(211+yoff)+',63,'+(250+yoff)+'';
	document.writeln('<map name="menub">')
	for (var i=0;i<6;i++) {
		htxt='<area shape="rect" coords="'+cordsb[i]+'" ' + ((IE5) ? 'onclick="javascript:lload('+i+')" onmouseover="onmm('+i+',\'rmenu\')" onmouseout="onmm('+i+',\'rmenu\',1)" ' : 'href="'+docs[i]+'" onmouseover="window.status=\''+st[i]+'\';return true;" onmouseout="window.status=\'\';return true;"') + ' alt="' + st[i]+'" title="'+ st[i] + '">';
		document.writeln(htxt);
		}	
	document.writeln('</map>')
}
}

function getoutDims()
{
	if (document.all) {
		actW=document.body.clientWidth;
		actH=document.body.clientHeight;
		window.resizeTo(screenW, screenH);
		mW=screenW-document.body.clientWidth;
		mH=screenH-document.body.clientHeight;
		outW=actW+mW;
		outH=actH+mH;
		window.resizeTo(outW, outH);	
		
	} else {
		outW=window.outerWidth;
		outH=outerHeight;	
}		
	
}


function wsize(ww, wh)
{
  var myWidth = 0, myHeight = 0, sbd=20;
  if (this.opener) {
  	var ispop=opener.wispop; 
  	if (ispop) { return; }
  }	
  getoutDims();
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
    sbd=16;
   } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
   } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight; 
   }
 
 wm=outW-myWidth;
 hm=outH-myHeight;    
  if (myWidth > ww+wm || myHeight > wh+hm) {
	self.resizeTo(ww+wm+sbd,wh+hm+sbd);
	self.moveTo(5,20);
  }
}
