function createMenuList(_id) {
	var tab=document.createElement('table');
	with (tab) { id=_id; cellSpacing=0; cellPadding=0; style.display='none'; }
	var row=tab.insertRow(-1);
	with (row.insertCell(-1)) { width=1; rowSpan=3; bgColor="#D8D8D8"; }
	with (row.insertCell(-1)) { height=6; }
	with (row.insertCell(-1)) { width=1; rowSpan=3; bgColor="#D8D8D8"; }
	var row=tab.insertRow(-1);
	var col=row.insertCell(0);
	var row=tab.insertRow(-1);
	with(row.insertCell(0)) { height=6; }
	var row=tab.insertRow(-1);
	with(row.insertCell(0)) { height=1; bgColor="#4E4E4E"; colSpan=3; }
	menu.parentNode.appendChild(tab);
	tab.onmouseover=function() { this.style.display=''; visiblemenu=1; };
	tab.onmouseout=function() { this.style.display='none'; visiblemenu=0; };
}
function addElementMenu(id,lnk,image,blnk) {
	var target=(blnk==true)?' target="_blank"':'';
	id.rows[1].cells[0].innerHTML+='<a href="'+lnk+'"'+target+'><img src="'+image+'"></a>';
}
var visiblemenu=0;
function initMenu() {
	createMenuList('ei');
	addElementMenu(ei,'instalacje1.html','img/ei1.png');
	addElementMenu(ei,'instalacje2.html','img/ei2.png');
	addElementMenu(ei,'katalog.php','img/ei3.png');
	createMenuList('co');
	addElementMenu(co,'evo_lcd.html','img/co1.png');
	addElementMenu(co,'evo_led.html','img/co2.png');
	addElementMenu(co,'new_concept.html','img/co3.png');
	addElementMenu(co,'eco_140.html','img/co4.png');
	addElementMenu(co,'Katalog_SACH.pdf','img/co5.png',true);
	createMenuList('zs');
	addElementMenu(zs,'zestaw1.html','img/zs1.png');
	addElementMenu(zs,'zestaw2.html','img/zs2.png');
	addElementMenu(zs,'zestaw3.html','img/zs3.png');
}
function SprawdzFormularz(frm) {
	if (frm.dostawa.value==0) {
	   alert("Wybierz rodzaj dostawy.");
	   return false;
	}
	if (frm.osobowosc.value==0) {
	   alert("Wybierz osobowość.");
	   return false;
	}
	for (i=2;i<frm.length-2;i++)
	   if (frm.elements[i].value=="") {
	   	  alert("Wypełnij wymagane pola formularza.");
	   	  return false;
	   }
	return true;
}
