regIdFlat = 0; oblIdFlat = 0; oblTypeFlat = 0; function whatMakeFlat(obl, reg, type) { obj = document.getElementById("sv-what-house"); if(obj && obl==2) { obj.style.display = "block"; } oblIdFlat = obl; regIdFlat = reg; oblTypeFlat = type; if(obl!=2) { goDinamicFlat(); } } function goDinamicFlat() { setElementFlat(); url = "http://www.svdevelopment.com/ru/web/flat_costs/"; document.whatDoFormFlat.action = url; document.whatDoFormFlat.submit(); closeWhatFlat(); } function goPriceFlat() { setElementFlat(); url = "http://www.svdevelopment.com/ru/web/val_object/"; document.whatDoFormFlat.action = url; document.whatDoFormFlat.submit(); closeWhatFlat(); } function setElementFlat() { document.getElementById("oblCalcFlat").value = oblIdFlat; document.getElementById("oblDinFlat").value = oblIdFlat; document.getElementById("regOblFlat").value = regIdFlat; document.getElementById("oblDId").value = regIdFlat; document.getElementById("regDinFlat").value = regIdFlat; document.getElementById("oblTypeFlat").value = oblTypeFlat; } function closeWhatFlat() { obj = document.getElementById("sv-what-house"); if(obj) { obj.style.display="none"; } } function openOblastFlat(id) { // alert(id+' '+lastShowedRegionFlat); obj = document.getElementById("omgOblFlat"+id); if(obj) { if(obj.src.indexOf("minus.gif")==-1) { obj.src="http://www.svdevelopment.com/img/minus.gif"; showHideRegionsFlat(id, ""); if(lastShowedRegionFlat>0 && lastShowedRegionFlat!=id) hideOblastFlat(lastShowedRegionFlat); obj = document.getElementById("ttlOblFlat_"+id); if(obj) { obj.className = "sv-reg-op"; } } else { obj.src="http://www.svdevelopment.com/img/plus.gif"; showHideRegionsFlat(id, "none"); } } lastShowedRegionFlat = id; } function hideOblastFlat(id) { obj = document.getElementById("omgOblFlat"+id); if(obj) { if(obj.src.indexOf("minus.gif")==-1) { } else { obj.src="http://www.svdevelopment.com/img/plus.gif"; showHideRegionsFlat(id, "none"); } } obj = document.getElementById("ttlOblFlat_"+id); if(obj) { obj.className = "sv-reg-cl"; } } function showHideRegionsFlat(id, action) { objs = document.getElementsByTagName("tr"); id = "trOblFlat_"+id; // s = ''; for(i in objs) { if((objs[i].className == "sv-dev-cellS0" || objs[i].className == "sv-dev-cellS1") && objs[i].id.indexOf(id+"_")==0) { // s+= i+"="+objs[i].className+":"+objs[i].title+"| id: "+id+" objs[i].id: "+objs[i].id+"\n"; objs[i].style.display = action; } } // alert(s); }