﻿
var menu_1=new Array()
menu_1[0]='<a style=" cursor: pointer;" onClick="napis(this.innerHTML); znikaj(\'1\'); zmieniaj(\'d1\', this.innerHTML); $(\'nieruchomosci\').value = this.innerHTML;">MIESZKANIA</a>'
menu_1[1]='<a  style=" cursor: pointer;" onClick="napis(this.innerHTML); znikaj(\'2\'); zmieniaj(\'d1\', this.innerHTML); $(\'nieruchomosci\').value = this.innerHTML;">LOKALE</a>'
menu_1[2]='<a style=" cursor: pointer;" onClick="napis(this.innerHTML); znikaj(\'0\'); zmieniaj(\'d1\', this.innerHTML); $(\'nieruchomosci\').value = this.innerHTML;">GRUNTY</a>'
menu_1[3]='<a style=" cursor: pointer;" onClick="napis(this.innerHTML); znikaj(\'1\'); zmieniaj(\'d1\', this.innerHTML); $(\'nieruchomosci\').value = this.innerHTML;">DOMY</a>'

var menu_2=new Array()
menu_2[0]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d2\', this.innerHTML); $(\'oferta\').value = this.innerHTML;">WSZYSTKIE</a>'
menu_2[1]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d2\', this.innerHTML); $(\'oferta\').value = this.innerHTML;">SPRZEDAŻ</a>'
menu_2[2]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d2\', this.innerHTML); $(\'oferta\').value = this.innerHTML;">WYNAJEM</a>'



var menu_oferty_1=new Array()
menu_oferty_1[0]='<a  style=" cursor: pointer; " onClick="znikaj2(\'1\'); zmieniaj(\'d1_oferta_nier\', this.innerHTML); $(\'oferta_typ\').value = this.innerHTML;">MIESZKANIA</a>'
menu_oferty_1[1]='<a  style=" cursor: pointer; " onClick="znikaj2(\'1\'); zmieniaj(\'d1_oferta_nier\', this.innerHTML); $(\'oferta_typ\').value = this.innerHTML;">DOM</a>'
menu_oferty_1[2]='<a  style=" cursor: pointer; " onClick="znikaj2(\'2\'); zmieniaj(\'d1_oferta_nier\', this.innerHTML); $(\'oferta_typ\').value = this.innerHTML;">LOKALE</a>'
menu_oferty_1[3]='<a  style=" cursor: pointer; " onClick="znikaj2(\'0\'); zmieniaj(\'d1_oferta_nier\', this.innerHTML); $(\'oferta_typ\').value = this.innerHTML;">GRUNTY</a>'

var menu_oferty_2=new Array()
menu_oferty_2[0]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d2_oferta_nier\', this.innerHTML); $(\'oferta_rodzaj\').value = this.innerHTML;">WSZYSTKIE</a>'
menu_oferty_2[1]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d2_oferta_nier\', this.innerHTML); $(\'oferta_rodzaj\').value = this.innerHTML;">SPRZEDAŻ</a>'
menu_oferty_2[2]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d2_oferta_nier\', this.innerHTML); $(\'oferta_rodzaj\').value = this.innerHTML;">WYNAJEM</a>'

var menu_oferty_1_=new Array()
menu_oferty_1_[0]='<a  style=" cursor: pointer; " onClick=" zmieniaj(\'d1_oferta_nier\', this.innerHTML); $(\'oferta_typ\').value = this.innerHTML;">MIESZKANIA</a>'
menu_oferty_1_[1]='<a  style=" cursor: pointer; " onClick=" zmieniaj(\'d1_oferta_nier\', this.innerHTML); $(\'oferta_typ\').value = this.innerHTML;">DOM</a>'
menu_oferty_1_[2]='<a  style=" cursor: pointer; " onClick=" zmieniaj(\'d1_oferta_nier\', this.innerHTML); $(\'oferta_typ\').value = this.innerHTML;">LOKALE</a>'
menu_oferty_1_[3]='<a  style=" cursor: pointer; " onClick=" zmieniaj(\'d1_oferta_nier\', this.innerHTML); $(\'oferta_typ\').value = this.innerHTML;">GRUNTY</a>'

var menu_mat=new Array()
menu_mat[0]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d5\', this.innerHTML); $(\'material\').value = \'\';">WSZYSTKIE</a>'
menu_mat[1]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d5\', this.innerHTML); $(\'material\').value = this.innerHTML;">CEGŁA</a>'
menu_mat[2]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d5\', this.innerHTML); $(\'material\').value = this.innerHTML;">PŁYTA</a>'
menu_mat[3]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d5\', this.innerHTML); $(\'material\').value = this.innerHTML;">RAMA H</a>'
menu_mat[4]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d5\', this.innerHTML); $(\'material\').value = this.innerHTML;">WIELKA PŁYTA</a>'


var menu_data=new Array()
menu_data[0]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d6\', this.innerHTML); $(\'kiedy\').value = \'\';">WSZYSTKIE</a>'
menu_data[1]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d6\', this.innerHTML); $(\'kiedy\').value = this.innerHTML;">DZISIEJSZE</a>'
menu_data[2]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d6\', this.innerHTML); $(\'kiedy\').value = this.innerHTML;">Z TYGODNIA</a>'
menu_data[4]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d6\', this.innerHTML); $(\'kiedy\').value = this.innerHTML;">Z MIESIĄCA</a>'
menu_data[6]='<a  style=" cursor: pointer;" onClick="zmieniaj(\'d6\', this.innerHTML); $(\'kiedy\').value = this.innerHTML;">Z ROKU</a>'


		
var menuwidth='' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=0  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?
var image_="";

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all
var ns=(document.layers)?true:false

if (ns6) {
	var wektor=1;
}  else {
	var wektor=0;
	}
	
if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'; background-image: url('+image_+'); z-index: 100; position:absolute;" 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 : window.pageXOffset+window.innerWidth
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 : window.pageYOffset+window.innerHeight
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
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")-wektor
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+0+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+5+"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
