regIdCommercial = 0; oblIdCommercial = 0; oblTypeCommercial = 0; function whatMakeCommercial(obl, reg, type) { obj = document.getElementById("sv-what-house"); if(obj && obl==2 && 0) { obj.style.display = "block"; } oblIdCommercial = obl; regIdCommercial = reg; oblTypeCommercial = type; if(obl!=2 || 1) { goDinamicCommercial(); } } function goDinamicCommercial() { setElementCommercial(); url = "http://www.svdevelopment.com/ru/web/commercial/"; document.whatDoFormCommercial.action = url; document.whatDoFormCommercial.submit(); closeWhatCommercial(); } function goPriceCommercial() { setElementCommercial(); url = "http://www.svdevelopment.com/ru/web/commercial/"; document.whatDoFormCommercial.action = url; document.whatDoFormCommercial.submit(); closeWhatCommercial(); } function setElementCommercial() { document.getElementById("oblCalcCommercial").value = oblIdCommercial; document.getElementById("oblDinCommercial").value = oblIdCommercial; document.getElementById("regOblCommercial").value = regIdCommercial; document.getElementById("oblDId").value = regIdCommercial; document.getElementById("regDinCommercial").value = regIdCommercial; document.getElementById("oblTypeCommercial").value = oblTypeCommercial; } function closeWhatCommercial() { obj = document.getElementById("sv-what-house"); if(obj) { obj.style.display="none"; } } function openOblastCommercial(id) { // alert(id+' '+lastShowedRegionCommercial); obj = document.getElementById("omgOblCommercial"+id); if(obj) { if(obj.src.indexOf("minus.gif")==-1) { obj.src="http://www.svdevelopment.com/img/minus.gif"; showHideRegionsCommercial(id, ""); if(lastShowedRegionCommercial>0 && lastShowedRegionCommercial!=id) hideOblastCommercial(lastShowedRegionCommercial); obj = document.getElementById("ttlOblCommercial_"+id); if(obj) { obj.className = "sv-reg-op"; } } else { obj.src="http://www.svdevelopment.com/img/plus.gif"; showHideRegionsCommercial(id, "none"); } } lastShowedRegionCommercial = id; } function hideOblastCommercial(id) { obj = document.getElementById("omgOblCommercial"+id); if(obj) { if(obj.src.indexOf("minus.gif")==-1) { } else { obj.src="http://www.svdevelopment.com/img/plus.gif"; showHideRegionsCommercial(id, "none"); } } obj = document.getElementById("ttlOblCommercial_"+id); if(obj) { obj.className = "sv-reg-cl"; } } function showHideRegionsCommercial(id, action) { objs = document.getElementsByTagName("tr"); id = "trOblCommercial_"+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); }