var city_val_array = new Array(); var city_nam_array = new Array(); city_val_array[0] = new Array('', '43','45','47','755'); city_nam_array[0] = new Array('כל האיזורים', 'סיטי ומרכז','נתיבי איילון','צפון','רמת החייל'); city_val_array[1] = new Array('', '774','779'); city_nam_array[1] = new Array('כל האיזורים', 'בורסה','בן גוריון'); city_val_array[2] = new Array('', '1042'); city_nam_array[2] = new Array('כל האיזורים', 'כל האזורים'); city_val_array[3] = new Array('', '1013'); city_nam_array[3] = new Array('כל האיזורים', 'כל האזורים'); function fillSelect(mobj1, mobj2){ var index=mobj1.selectedIndex-1 for (i=mobj2.options.length-1 ; i>0 ; i--){mobj2.options[i] = null;} if(mobj1.selectedIndex-1 < 0){ mobj2.options[0] = new Option('בחר איזור',''); return; } for(i=0 ; i < city_nam_array[mobj1.selectedIndex-1].length ; i++) { mobj2.options[i] = new Option(city_nam_array[index][i],city_val_array[index][i]); } } function numWithComma(num) { var strNum, temp, len, i; strNum = ""; temp = "" + num; len = temp.length; for (i=0; i 0) { strNum += "," + temp.substring(len-i-1,len-i); } else { strNum += temp.substring(len-i-1,len-i); } } temp = "" + strNum; len = temp.length; strNum = ""; for (i=len-1; i>=0; i--) { strNum += temp.substring(i,i+1); } return strNum; } function changeNumbers(dropdown, num) { if (dropdown.name == 'min_size') { // buildDropDownList(document.getElementById("max_size"),'שטח עד:',num,10000,50); } else if (dropdown.name == 'min_price') { if (mode == 1) buildDropDownList(document.getElementById("max_price"),'מחיר למ"ר עד: ',num,100000,1000); else buildDropDownList(document.getElementById("max_price"),'מחיר למ"ר עד: ',num,1000,10); } //else if (dropdown.name == 'min_total_price') //{ // if (mode == 1) // buildDropDownList(max_total_price,'בחר:',num,25000000,250000); // else // buildDropDownList(max_total_price,'בחר:',num,500000,5000); //} } function toWhichModeTOChange(perp) { if (perp == 58) //Rent { //buildDropDownList(document.getElementById("min_price"),'מחיר למ"ר מ:',10,1000,10); //buildDropDownList(document.getElementById("max_price"),'מחיר למ"ר עד:',10,1000,10); //buildDropDownList(min_total_price,'בחר:',5000,500000,5000); //buildDropDownList(max_total_price,'בחר:',5000,500000,5000); //document.getElementById("lblAssetsPrice").innerText = 'מחיר למ"ר:(₪)'; //document.getElementById("lblAssetsTotalPrice").innerText = 'מחיר השכרה לחודש:(₪)'; mode = 0; } else if (perp == 60) //Buy { //buildDropDownList(document.getElementById("min_price"),'מחיר למ"ר מ:',1000,100000,1000); //buildDropDownList(document.getElementById("max_price"),'מחיר למ"ר עד:',1000,100000,1000); //buildDropDownList(min_total_price,'בחר:',500000,25000000,250000); //buildDropDownList(max_total_price,'בחר:',500000,25000000,250000); //document.getElementById("lblAssetsPrice").innerText = 'מחיר למ"ר:(₪)'; //document.getElementById("lblAssetsTotalPrice").innerText = 'מחיר קניה סה"כ:(₪)'; mode = 1; } else { //buildDropDownList(document.getElementById("min_price"),'מחיר למ"ר מ: ',1,0,1); //buildDropDownList(document.getElementById("max_price"),'מחיר למ"ר עד:',1,0,1); //buildDropDownList(min_total_price,'בחר:',1,0,1); //buildDropDownList(max_total_price,'בחר:',1,0,1); mode = -1; } } function buildDropDownList(dropdown,start_value,min_num,max_num,step) { min_num = parseInt(min_num); max_num = parseInt(max_num); step = parseInt(step); var i,sum; dropdown.options.length = 0; i=1; dropdown.options[0] = new Option(start_value,-1); for(sum=min_num ; sum <= max_num ; sum+=step) { dropdown.options[i] = new Option(numWithComma(sum),sum); i++; } } function initSearchAssetForm(){ document.search_assest.numeric12.selectedIndex=0; document.search_assest.numeric4.selectedIndex=0; document.search_assest.numeric10.selectedIndex=0; fillSelect(document.getElementById('numeric10'),document.getElementById('numeric11')); document.search_assest.numeric11.selectedIndex=0; }