var ns = (document.layers) ? 1 : 0;
var ie = (document.all) ? 1 : 0;
var ns6= (!document.all && document.getElementById) ? 1 : 0;
var current="";
var cur="";
var W = self.innerWidth;

function positioning() {
}

function showLayer(id) {
  if(ie) { document.all[id].style.display = 'block';}
  else if (ns) { document.layers[id].display = 'block';}
  else if(ns6) {document.getElementById(id).style.display = 'block';}
}

function showLayer2(id) {
  var element = document.getElementById('mapa_glowna');
  element.src = '../images/dystrybutorzy/'+id+'.gif';
  //if(ie) { document.all[id].style.visibility = 'visible';}
  //else if (ns) { document.layers[id].visibility = 'visible';}
  //else if(ns6) {document.getElementById(id).style.visibility = 'visible';}
}

function hideLayer(id) {
  if(ie) { document.all[id].style.display = 'none';}
  else if (ns) { document.layers[id].display = 'none';}
  else if(ns6) {document.getElementById(id).style.display = 'none';}
}

function hideAll() {
  if(ie) { 
    for(i=1;i<=7;i++){
      if(current != 'm'+i) { eval("document.all['menu"+i+"'].style.visibility = 'hidden'");}
    }
  }
  else if (ns) {
    for(i=1;i<=7;i++){
      if(current != 'm'+i) { eval("document.layers['menu"+i+"'].visibility='hide'"); }
    } 
  }
  else if(ns6) {
    for(i=1;i<=7;i++){
      if(current != 'm'+i) { eval("document.getElementById('menu"+i+"').style.visibility = 'hidden'"); }
    }
  }
}

function change(id,img,warstwa)
{
 if(document.images)
 {
  if(ns) {
      warstwa ? document.layers[warstwa].document.images[id].src=img : document.images[id].src=img;
  } else {
  document.images[id].src=img;
  }
 }
}

function menu_off(id){
  if(id!='m1'){ change('m1','../images/m1.gif','menu'); }
  if(id!='m2'){ change('m2','../images/m2.gif','menu'); }
  if(id!='m3'){ change('m3','../images/m3.gif','menu'); } 
  if(id!='m4'){ change('m4','../images/m4.gif','menu'); }
  if(id!='m5'){ change('m5','../images/m5.gif','menu'); }
  if(id!='m6'){ change('m6','../images/m6.gif','menu'); }
  if(id!='m7'){ change('m7','../images/m7.gif','menu'); }
}


function show(url,title,w,h) {
	var url='window.php?img='+url+'&title='+title;
	var showWindow = window.open(url,"ShowWindow",'top=20,left=40,width='+w+',height='+h+',scrollbars=no');
	showWindow.focus();
}

function positioningMaps(){

}
 
function hideAdres(){
	hideLayer('adres1');
	hideLayer('adres2');
	hideLayer('adres3');
	hideLayer('adres4');
	hideLayer('adres5');
	hideLayer('adres6');
}

function hideMaps(){
	if(cur!='map1') hideLayer('map1');
	if(cur!='map2') hideLayer('map2');
	if(cur!='map3') hideLayer('map3');
	if(cur!='map4') hideLayer('map4');
	if(cur!='map5') hideLayer('map5');
	if(cur!='map6') hideLayer('map6');
}

i1=new Image(108,19); i1.src="images/m1.gif";
i1_on=new Image(108,19); i1_on.src="images/m1_on.gif";
i2=new Image(107,19); i2.src="images/m2.gif";
i2_on=new Image(107,19); i2_on.src="images/m2_on.gif";
i3=new Image(107,19); i3.src="images/m3.gif";
i3_on=new Image(107,19); i3_on.src="images/m3_on.gif";
i4=new Image(107,19); i4.src="images/m4.gif";
i4_on=new Image(107,19); i4_on.src="images/m4_on.gif";
i5=new Image(107,19); i5.src="images/m5.gif";
i5_on=new Image(107,19); i5_on.src="images/m5_on.gif";
i6=new Image(107,19); i6.src="images/m6.gif";
i6_on=new Image(107,19); i6_on.src="images/m6_on.gif";
i7=new Image(107,19); i7.src="images/m7.gif";
i7_on=new Image(107,19); i7_on.src="images/m7_on.gif";

