function przelacz(id) {
 		current = (document.getElementById(id).style.display == 'none') ? 'block' : 'none';
  		document.getElementById(id).style.display = current;
	};

var allPageTags = new Array();

function showbanner() {
	
var allPageTags=document.getElementsByTagName("div");

for (i=0; i<allPageTags.length; i++) {
	
if (allPageTags[i].className=='theClass') {
	
allPageTags[i].style.display='block';
}
}
}


var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

function checkIt(string) {
    place = detect.indexOf(string) + 1; thestring = string;
	return place;
}

function checkIt2(string) {
    place2 = detect.indexOf(string) + 2; thestring2 = string;
	return place2;
}

	
if (checkIt('opera')) {browser = "opera";}
else if (checkIt('mac_powerpc')) { browser = "mac";}
else if (checkIt('msie')) {browser = "explorer" ;}
else if (!checkIt('compatible')) { browser = "netscape";}
else browser = "An unknown browser";

	
var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);
	
function hide() {
    if(ns4){
	document.layers['flash'].display = "none";
    }
    else if(ie4){
	document.all['flash'].style.display = "none";
    }
    else if(ie5 || ns6){
        document.getElementById('flash').style.display = "none";
    }
					
}
								
function show(id) {
    if(ns4){
	document.layers[id].visibility = "show";
    }
    else if(ie4){
        document.all[id].style.visibility = "visible";
    }
    else if(ie5 || ns6){
	document.getElementById(id).style.visibility = "visible";
    }
}
															
function cut(id,top,bottom,right,left) {
  if ( document.getElementById(id) ) {
    document.getElementById('expander').style.height = bottom+'px';
    }
  else if(ns4){
    document.layers[id].clip.top = top;
    document.layers[id].clip.bottom = bottom;
    document.layers[id].clip.right = right;
    document.layers[id].clip.left = left;	
    }
  else if(ie4){
    document.all[id].style.clip ="rect("+top+","+right+","+bottom+","+left+")";
    }
  else if(ie5 || ns6){
    document.getElementById(id).style.clip = "rect("+top+","+right+","+bottom+","+left+")";
    }
  }
										
function start() {
    if(browser!="opera"){
    }
}

var menu1=new Array()
menu1[0]='<a href="firma.php">Firma</a>'
menu1[1]='<a href="firma-b.php">Biuro</a>'

var menu2=new Array()
menu2[0]='<a href="ubezpieczenia-oferta.php">Oferta</a>'
menu2[1]='<a href="ubezpieczenia-wspolpraca.php">Partnerzy</a>'

var menu3=new Array()
menu3[0]='<a href="kontakt.php">Kontakt</a>'
menu3[1]='<a href="kontakt-f.php"><b style="color:red">Szybki kontakt</b></a>'

		
var menuwidth='165px'
var menubgcolor='lightyellow'
var disappeardelay=250
var hidemenu_onclick="yes"

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

var thumbnailviewer={
enableTitle: true,
enableAnimation: true,
definefooter: '<div class="footerbar">ZAMKNIJ X</div>',
defineLoading: '<img src="img/loading.gif" /> Wczytywanie...',

scrollbarwidth: 16,
opacitystring: 'filter:progid:DXImageTransform.Microsoft.alpha(opacity=10); -moz-opacity: 0.1; opacity: 0.1',
targetlinks:[],

createthumbBox:function(){

document.write('<div id="thumbBox" onClick="thumbnailviewer.closeit()"><div id="thumbImage"></div>'+this.definefooter+'</div>')
document.write('<div id="thumbLoading">'+this.defineLoading+'</div>')
this.thumbBox=document.getElementById("thumbBox")
this.thumbImage=document.getElementById("thumbImage")
this.thumbLoading=document.getElementById("thumbLoading")
this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
},


centerDiv:function(divobj){
var ie=document.all && !window.opera
var dom=document.getElementById
var scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
var scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
var docwidth=(ie)? this.standardbody.clientWidth : window.innerWidth-this.scrollbarwidth
var docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
var docheightcomplete=(this.standardbody.offsetHeight>this.standardbody.scrollHeight)? this.standardbody.offsetHeight : this.standardbody.scrollHeight
var objwidth=divobj.offsetWidth
var objheight=divobj.offsetHeight
var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/2+"px" : scroll_top+10+"px"
divobj.style.left=docwidth/2-objwidth/2+"px"
divobj.style.top=Math.floor(parseInt(topposition))+"px"
divobj.style.visibility="visible"
},

showthumbBox:function(){
this.centerDiv(this.thumbBox)
if (this.enableAnimation){
this.currentopacity=0.1
this.opacitytimer=setInterval("thumbnailviewer.opacityanimation()", 20)
}
},


loadimage:function(link){
if (this.thumbBox.style.visibility=="visible")
this.closeit()
var imageHTML='<img src="'+link.getAttribute("href")+'" style="'+this.opacitystring+'" />'
if (this.enableTitle && link.getAttribute("title"))
imageHTML+='<br />'+link.getAttribute("title")
this.centerDiv(this.thumbLoading)
this.thumbImage.innerHTML=imageHTML
this.featureImage=this.thumbImage.getElementsByTagName("img")[0]
this.featureImage.onload=function(){
thumbnailviewer.thumbLoading.style.visibility="hidden"
thumbnailviewer.showthumbBox()
}
if (document.all && !window.createPopup)
this.featureImage.src=link.getAttribute("href")
this.featureImage.onerror=function(){
thumbnailviewer.thumbLoading.style.visibility="hidden"
}
},

setimgopacity:function(value){
var targetobject=this.featureImage
if (targetobject.filters && targetobject.filters[0]){
if (typeof targetobject.filters[0].opacity=="number")
targetobject.filters[0].opacity=value*100
else
targetobject.style.filter="alpha(opacity="+value*100+")"
}
else if (typeof targetobject.style.MozOpacity!="undefined")
targetobject.style.MozOpacity=value
else if (typeof targetobject.style.opacity!="undefined")
targetobject.style.opacity=value
else
this.stopanimation()
},

opacityanimation:function(){
this.setimgopacity(this.currentopacity)
this.currentopacity+=0.1
if (this.currentopacity>1)
this.stopanimation()
},

stopanimation:function(){
if (typeof this.opacitytimer!="undefined")
clearInterval(this.opacitytimer)
},


closeit:function(){
this.stopanimation()
this.thumbBox.style.visibility="hidden"
this.thumbImage.innerHTML=""
this.thumbBox.style.left="-2000px"
this.thumbBox.style.top="-2000px"
},

cleanup:function(){
this.thumbLoading=null
if (this.featureImage) this.featureImage.onload=null
this.featureImage=null
this.thumbImage=null
for (var i=0; i<this.targetlinks.length; i++)
this.targetlinks[i].onclick=null
this.thumbBox=null
},

dotask:function(target, functionref, tasktype){
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
},

init:function(){
if (!this.enableAnimation)
this.opacitystring=""
var pagelinks=document.getElementsByTagName("a")
for (var i=0; i<pagelinks.length; i++){
if (pagelinks[i].getAttribute("rel") && pagelinks[i].getAttribute("rel")=="thumbnail"){
pagelinks[i].onclick=function(){
thumbnailviewer.stopanimation()
thumbnailviewer.loadimage(this)
return false
}
this.targetlinks[this.targetlinks.length]=pagelinks[i]
}
}

this.dotask(window, function(){if (thumbnailviewer.thumbBox.style.visibility=="visible") thumbnailviewer.centerDiv(thumbnailviewer.thumbBox)}, "resize")


}

}

thumbnailviewer.createthumbBox()
thumbnailviewer.dotask(window, function(){thumbnailviewer.init()}, "load")
thumbnailviewer.dotask(window, function(){thumbnailviewer.cleanup()}, "unload")

var thumbnailviewer2={
enableTitle: true,
enableTransition: true,
hideimgmouseout: false,

iefilterstring: 'progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)',
iefiltercapable: document.compatMode && window.createPopup? true : false,
preloadedimages:[],
targetlinks:[],
alreadyrunflag: false,

loadimage:function(linkobj){
var imagepath=linkobj.getAttribute("href")
var showcontainer=document.getElementById(linkobj.getAttribute("rev").split("::")[0])
var dest=linkobj.getAttribute("rev").split("::")[1]
var description=(thumbnailviewer2.enableTitle && linkobj.getAttribute("title"))? linkobj.getAttribute("title") : ""
var imageHTML='<img src="'+imagepath+'" style="border: 2px solid #fcc66f" />'
if (typeof dest!="undefined")
imageHTML='<a href="'+dest+'">'+imageHTML+'</a>'
if (description!="")
imageHTML+='<br />'+description
if (this.iefiltercapable){
showcontainer.style.filter=this.iefilterstring
showcontainer.filters[0].Apply()
}
showcontainer.innerHTML=imageHTML
this.featureImage=showcontainer.getElementsByTagName("img")[0]
this.featureImage.onload=function(){
if (thumbnailviewer2.iefiltercapable)
showcontainer.filters[0].Play()
}
this.featureImage.onerror=function(){
if (thumbnailviewer2.iefiltercapable)
showcontainer.filters[0].Stop()
}
},

hideimage:function(linkobj){
var showcontainer=document.getElementById(linkobj.getAttribute("rev").split("::")[0])
showcontainer.innerHTML=""
},


cleanup:function(){
if (this.featureImage){this.featureImage.onload=null; this.featureImage.onerror=null; this.featureImage=null}
this.showcontainer=null
for (var i=0; i<this.targetlinks.length; i++){
this.targetlinks[i].onclick=null
this.targetlinks[i].onmouseover=null
this.targetlinks[i].onmouseout=null
}
},

addEvent:function(target, functionref, tasktype){
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
},

init:function(){
this.iefiltercapable=(this.iefiltercapable && this.enableTransition)
var pagelinks=document.getElementsByTagName("a")
for (var i=0; i<pagelinks.length; i++){
if (pagelinks[i].getAttribute("rel") && /enlargeimage:/i.test(pagelinks[i].getAttribute("rel"))){
var initType=pagelinks[i].getAttribute("rel").split("::")[1]
if (initType=="mouseover"){
this.preloadedimages[this.preloadedimages.length]=new Image()
this.preloadedimages[this.preloadedimages.length-1].src=pagelinks[i].href
pagelinks[i]["onclick"]=function(){
return false
}
}
pagelinks[i]["on"+initType]=function(){
thumbnailviewer2.loadimage(this)
return false
}
if (this.hideimgmouseout)
pagelinks[i]["onmouseout"]=function(){
thumbnailviewer2.hideimage(this)
}
this.targetlinks[this.targetlinks.length]=pagelinks[i]
}
}


}

}


if (document.addEventListener)
thumbnailviewer2.addEvent(document, function(){thumbnailviewer2.alreadyrunflag=1; thumbnailviewer2.init()}, "DOMContentLoaded")
else if (document.all && document.getElementsByTagName("a").length>0){
thumbnailviewer2.alreadyrunflag=1
thumbnailviewer2.init()
}
thumbnailviewer2.addEvent(window, function(){if (!thumbnailviewer2.alreadyrunflag) thumbnailviewer2.init()}, "load")
thumbnailviewer2.addEvent(window, function(){thumbnailviewer2.cleanup()}, "unload")



function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0)
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=230+"px"
subobj.style.top=-20+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}
