var popupWidth=500;var navig_agt=navigator.userAgent.toLowerCase();var ie=(navig_agt.indexOf("msie")!=-1)?true:false;var checkboxArray=new Array();var counter=0;var billTimer;var hideStaff;function showMoveRealestatesForm(staffId,staffName){document.getElementById("staffFromMoveReals").value=staffId;showPopup("moveRealestates");hideStaff=staffId;var hideStaffId="hideStaff"+staffId;var hideStaffDiv=document.getElementById(hideStaffId);hideStaffDiv.style.display="none";document.getElementById("staffName").innerHTML=staffName}function hideMoveRealestatesForm(){hidePopup("moveRealestates");var hideStaffId="hideStaff"+hideStaff;var hideStaffDiv=document.getElementById(hideStaffId);if(hideStaffDiv!=null){hideStaffDiv.style.display="block"}}function showPremiumOrderForm(){var premiumOrderForm=document.getElementById("premiumOrderForm");premiumOrderForm.style.visibility="visible";premiumOrderForm.style.width=popupWidth+"px";premiumOrderForm.style.left=document.body.clientWidth/2-popupWidth/2-15+"px";premiumOrderForm.style.top=document.documentElement.scrollTop+200+"px"}function hidePremiumOrderForm(){var premiumOrderForm=document.getElementById("premiumOrderForm");premiumOrderForm.style.visibility="hidden"}function showPopup(id){var popupElement=document.getElementById(id);if(popupElement!=null){popupElement.style.visibility="visible";popupElement.style.width=popupWidth+"px";popupElement.style.left=document.body.clientWidth/2-popupWidth/2-15+"px";popupElement.style.top=document.documentElement.scrollTop+200+"px"}}function hidePopup(id){var popupElement=document.getElementById(id);if(popupElement!=null)popupElement.style.visibility="hidden"}function showSaveSearchForm(){var saveSearchFormDiv=document.getElementById("saveSearchForm");saveSearchFormDiv.style.visibility="visible";saveSearchFormDiv.style.width=popupWidth+"px";saveSearchFormDiv.style.left=document.body.clientWidth/2-popupWidth/2-15+"px";saveSearchFormDiv.style.top=document.documentElement.scrollTop+200+"px"}function hideSaveSearchForm(){var saveSearchFormDiv=document.getElementById("saveSearchForm");saveSearchFormDiv.style.visibility="hidden"}function textareaLength(obj){var maxlength=obj.getAttribute?parseInt(obj.getAttribute("maxlength")):"";if(obj.getAttribute&&obj.value.length>maxlength){obj.value=obj.value.substring(0,maxlength)}}function hidePopupResult(){document.getElementById("popupResult").style.visibility="hidden"}function hidePopupError(){document.getElementById("popupError").style.visibility="hidden"}function setPopupErrorAndResult(){var result=document.getElementById("popupResult");var error=document.getElementById("popupError");if(result!=null){result.style.width=popupWidth+"px";result.style.left=document.body.clientWidth/2-popupWidth/2-15+"px";result.style.top=document.documentElement.scrollTop+200+"px"}if(error!=null){error.style.width=popupWidth+"px";error.style.left=document.body.clientWidth/2-popupWidth/2-15+"px";error.style.top=document.documentElement.scrollTop+200+"px"}}function showWaitForImageDiv(){var waitDiv=document.getElementById("waitForImageDiv");waitDiv.style.visibility="visible";waitDiv.style.width=popupWidth+"px";waitDiv.style.height=200+"px";waitDiv.style.left=document.body.clientWidth/2-popupWidth/2-15+"px";waitDiv.style.top=document.documentElement.scrollTop+200+"px";waitDiv.innerHTML='Kérem szíves türelmét, az adatok feltöltése folyamatban van!<br /> Ez néhány percet is igénybe vehet az Ön hálózati sebességétől függően.'}function formatNum(obj){var current=obj.value;current=current.replace(/\s+/g,'');var after=current;current=current.replace(/,/g,"");var decimalpoint=current.lastIndexOf(".");var n;var d;if(decimalpoint>=0){var f=current.split(".");d=f[1];n=f[0]}else{n=current}var index=parseInt((n.length-1)/3);if(index!=0){var prefixIndex=n.length-index*3;after=n.substr(0,prefixIndex)+" "+n.substr(prefixIndex,3);for(var i=2;i<=index;i++){after+=" "+n.substr(prefixIndex+3*(i-1),3)}if(decimalpoint>=0){after+="."+d}}obj.value=after}function enableManualGeoCode(){if(document.getElementById('autoGeoCode').checked){document.getElementById('lat').disabled=true;document.getElementById('lon').disabled=true}else{document.getElementById('lat').disabled=false;document.getElementById('lon').disabled=false}}function checkRealCategory(){selectedIndex=document.getElementById('category').selectedIndex;if(document.getElementById('category')[selectedIndex].innerHTML=="Egyéb ingatlan"){document.getElementById('realRight').style.visibility='visible';document.getElementById('realFunction').style.visibility='visible'}else{document.getElementById('realFunction').style.visibility='hidden';document.getElementById('realRight').style.visibility='hidden'}}function setRoomToDelete(id){if(confirm("Biztos benne, hogy töröli a helyiséget?")){document.getElementById('roomId').value=id;return true}return false}function setLetAreaToDelete(id){if(confirm("Biztos benne, hogy töröli a helyiséget?")){document.getElementById('letAreaId').value=id;return true}return false}function setParkplaceToDelete(id){if(confirm("Biztos benne, hogy töröli a parkolóhelyet?")){document.getElementById('parkplaceId').value=id;return true}return false}function setImageToDelete(id){if(confirm("Biztos benne, hogy töröli a képet?")){document.getElementById('imageId').value=id;return true}return false}function disableNaviButtons(){showWaitForImageDiv();document.getElementById('buttonPreviousStep').disabled="disabled";document.getElementById('buttonNextStep').disabled="disabled";document.getElementById('buttonStop').disabled="disabled";return true}function showFirm(){document.getElementById('firm').style.visibility="visible";document.getElementById('buttons').style.visibility="hidden";document.getElementById('buttons').innerHTML=""}function copyAddress(){document.getElementById('billCountry').selectedIndex=document.getElementById('country').selectedIndex;getBillCounties();document.getElementById('billPostcode').value=document.getElementById('postcode').value;document.getElementById('billStreet').value=document.getElementById('street').value;document.getElementById('billStreetNumber').value=document.getElementById('streetNumber').value;setBillCountyTimer()}function setBillCountyTimer(){if(document.getElementById('billCounty').length>1){document.getElementById('billCounty').selectedIndex=document.getElementById('county').selectedIndex;getBillLocalities();clearTimeout(billTimer);setBillLocalityTimer()}else{billTimer=setTimeout("setBillCountyTimer()",100)}}function setBillLocalityTimer(){if(document.getElementById('billLocality').length>1){clearTimeout(billTimer);setBillSelect()}else{billTimer=setTimeout("setBillLocalityTimer()",100)}}function setBillSelect(){selectedIndex=document.getElementById('locality').selectedIndex;selectedValue=document.getElementById('locality')[selectedIndex].value;for(index=1;index<document.getElementById('billLocality').length;index++){if(document.getElementById('billLocality')[index].value==selectedValue){document.getElementById('billLocality').selectedIndex=index}}}function checkUserType(type){var error=false;var isChecked=false;checkboxArray.length=0;getCheckboxUserClass('checkboxUser',document.body);for(i=0;i<checkboxArray.length;i++){if(checkboxArray[i].checked==true){isChecked=true;if(type==0&&checkboxArray[i].id!=0){error='Csak "Jelentkezőket" vehet fel.'}else if(type==2&&!(checkboxArray[i].id==1||checkboxArray[i].id==2)){error='Csak "Adminisztrátor"-t és/vagy "Tag"-ot módosíthat.'}}}if(isChecked&&!error){if(type==1){var text="Törlés után már nem tudja áthelyezni a felhasználó(k) ingatlan hirdetéseit.\nBiztos benne, hogy elutasítja és/vagy törölni kívánja a kijelölt személy(eke)t?";return confirm(text)}return true}else if(!isChecked){alert("Kérem válasszon ki legalább egy személyt.")}else{alert(error)}return false}function getCheckboxUserClass(strClassName,obj){if(obj.className==strClassName){checkboxArray[checkboxArray.length]=obj}for(var i=0;i<obj.childNodes.length;i++)getCheckboxUserClass(strClassName,obj.childNodes[i])}function addCategory(){var categoryId=null;var categoryTable=document.getElementById('categoryTable');selectedIndex=document.getElementById('mainCategories').selectedIndex;categoryId=document.getElementById('mainCategories')[selectedIndex].value;mainText=document.getElementById('mainCategories')[selectedIndex].innerHTML;if(selectedIndex==0)return;if(document.getElementById('subCategories').length>1){selectedIndex=document.getElementById('subCategories').selectedIndex;categoryId=document.getElementById('subCategories')[selectedIndex].value;subText=document.getElementById('subCategories')[selectedIndex].innerHTML;if(selectedIndex==0)return;mainText+=" - "+subText}if(categoryTable.innerHTML.indexOf(mainText)==-1){if(ie){var inputImage=document.createElement('input');inputImage.type="image";inputImage.src=baseUrl+"public/images/remove.png";inputImage.onclick=new Function('return removeCategory(\''+mainText+'\');');var inputHidden=document.createElement('input');inputHidden.type="hidden";inputHidden.name="businessCategory"+counter;inputHidden.value=categoryId;var myRow=categoryTable.insertRow();var firstCell=myRow.insertCell();firstCell.appendChild(inputImage);firstCell.appendChild(inputHidden);var secondCell=myRow.insertCell();secondCell.innerHTML=mainText}else{categoryTable.innerHTML+='<tr><td><input type="image" src="'+baseUrl+'public/images/remove.png" onclick="return removeCategory(\''+mainText+'\')" />'+'<input type="hidden" name="businessCategory'+counter+'" value="'+categoryId+'" /></td><td>'+mainText+'</td></tr>'}counter++}}function removeCategory(text){table=document.getElementById('categoryTable');for(i=0;i<table.rows.length;++i){if(table.rows[i].cells[1].innerHTML==text){table.deleteRow(i)}}return false}function checkDeleteReal(id){if(confirm("Biztos benne, hogy töröli az ingatlan hirdetést?")){if(id!=undefined){setReal(id)}return true}return false}function setReal(id){if(document.getElementById('realId')!=null){document.getElementById('realId').value=id}}function checkDeleteBusiness(id){if(confirm("Biztos benne, hogy töröli a céget?")){if(id!=undefined){setBusiness(id)}return true}return false}function setBusiness(id){document.getElementById('businessId').value=id}function checkDeleteSearch(id){if(confirm("Biztos benne, hogy töröli a keresést?")){if(id!=undefined){setSearch(id)}return true}return false}function setSearch(id){document.getElementById('searchId').value=id}function checkDeleteAd(id){if(confirm("Biztos benne, hogy töröli az apróhirdetést?")){if(id!=undefined){setAd(id)}return true}return false}function setAd(id){document.getElementById('adId').value=id}function redirectToAdOperation(id){window.location=baseUrl+"aprohirdetes-muveletek/"+id}function verifyDeleteUser(){alert('FELHASZNÁLÓ TÖRLÉSE');return confirm("Biztos benne, hogy töröli a felhasználót???")}function confirmJoinToFirm(name){var text="Biztos benne, hogy a(z) "+name+" céghez akar csatlakozni?";return confirm(text)}function onSubmitFormSetCategory(){selectedIndex=document.getElementById('category').selectedIndex;category=document.getElementById('category');category="/"+document.getElementById('category')[selectedIndex].innerHTML.toLowerCase().replace(' ','-');category=category.replace('á','a').replace('é','e').replace('ö','o').replace('ő','o').replace('ó','o').replace('ü','u').replace('ű','u').replace('ú','u').replace('í','i');category=category.replace('á','a').replace('é','e').replace('ö','o').replace('ő','o').replace('ó','o').replace('ü','u').replace('ű','u').replace('ú','u').replace('í','i');document.searchForm.action=baseUrl+"ingatlanok"+category}function showLogoLink(logo){if(logo=="link"){document.getElementById("HTMLcode").innerHTML="<b>Beillesztendő HTML kód:</b><br /><br />&lt;a href=&quot;http://www.ingatlanpiacter.hu&quot; title=&quot;Ingatlan Piactér - Eladó, kiadó ingatlanok, lakások, családi házak&quot;&gt;www.ingatlanpiacter.hu&lt; /a&gt;"}else if(logo=="logo120"){document.getElementById("HTMLcode").innerHTML="<b>Beillesztendő HTML kód:</b><br /><br />&lt;a href=&quot;http://www.ingatlanpiacter.hu&quot; title=&quot;Ingatlan Piactér - Eladó, kiadó ingatlanok, lakások, családi házak&quot;&gt;<br />&nbsp;&nbsp;&lt;img src=&quot;http://www.ingatlanpiacter.hu/public/images/logo/IngatlanPiacter120.png&quot; /&gt;<br />&lt;/a&gt;"}else if(logo=="logo120animated"){document.getElementById("HTMLcode").innerHTML="<b>Beillesztendő HTML kód:</b><br /><br />&lt;a href=&quot;http://www.ingatlanpiacter.hu&quot; title=&quot;Ingatlan Piactér - Eladó, kiadó ingatlanok, lakások, családi házak&quot;&gt;<br />&nbsp;&nbsp;&lt;img src=&quot;http://www.ingatlanpiacter.hu/public/images/logo/IngatlanPiacterAni120.gif&quot; /&gt;<br />&lt;/a&gt;"}else if(logo=="logo240"){document.getElementById("HTMLcode").innerHTML="<b>Beillesztendő HTML kód:</b><br /><br />&lt;a href=&quot;http://www.ingatlanpiacter.hu&quot; title=&quot;Ingatlan Piactér - Eladó, kiadó ingatlanok, lakások, családi házak&quot;&gt;<br />&nbsp;&nbsp;&lt;img src=&quot;http://www.ingatlanpiacter.hu/public/images/logo/IngatlanPiacter240.png&quot; /&gt;<br />&lt;/a&gt;"}else if(logo=="logo100x60"){document.getElementById("HTMLcode").innerHTML="<b>Beillesztendő HTML kód:</b><br /><br />&lt;a href=&quot;http://www.ingatlanpiacter.hu&quot; title=&quot;Ingatlan Piactér - Eladó, kiadó ingatlanok, lakások, családi házak&quot;&gt;<br />&nbsp;&nbsp;&lt;img src=&quot;http://www.ingatlanpiacter.hu/public/images/logo/IngatlanPiacter100x60.png&quot;/&gt;<br />&lt;/a&gt;"}document.getElementById("showHTML").style.visibility="visible"}function hideLogoLink(){document.getElementById("showHTML").style.visibility="hidden"}