1 2 3/* 4 RealityShopping assistent - pomocne js funkce 5 11.06.2007 pf 6*/ 7 8 $(document).ready(function(){ 9 10 // MiG - dodelani nulovani pole pro zadani cisla nemovitosti (contract_no) 11 if ($("#reality_form input#contract_no").length > 0) 12 { 13 $("#reality_form input#contract_no").focus(function(){ 14 if ($(this).val() == REALITY_SELECT_TITLE_CONTRACT_NO) 15 $(this).val(""); 16 }); 17 18 $("#reality_form input#contract_no").blur(function(){ 19 if ($(this).val() == "") 20 $(this).val(REALITY_SELECT_TITLE_CONTRACT_NO); 21 }); 22 } // end if 23 24 }); 25 26 // assistent - el_id inputu, kam se ma provest focus. 27 Realityass_last_control_id = 0; 28 // --- 29 30 31 function ajax_search_czech() 32 { 33 $("#column_search_other").removeClass("active"); 34 $("#column_search_czech").addClass("active"); 35 Realityass_submit('Realityass'); 36 } 37 38 function ajax_search_other() 39 { 40 $("#column_search_czech").removeClass("active"); 41 $("#column_search_other").addClass("active"); 42 Realityass_submit('Realityass_other'); 43 } 44 45 // vymazani editu 46 function Realityass_clear_text(el_id) 47 { 48 se_v(el_id, ""); 49 } // end if 50 51 52 53 // odskrtnuti vsech checkboxu v divu 54 function Realityass_clear_checkbox(el_id) 55 { 56 checkbox_check_all(false, el_id); 57 } // end if 58 59 60 61 // odeslani assistenta 62 function Realityass_submit(group){ 63 64 //ge("reality_form").submit(); // puvodni submit 65 66 Realityass_submit_ajax(group); // ajaxovy submit 67 68 } // end function 69 // --- 70 71 72 73 // ajaxovy submit 74 function Realityass_submit_ajax(group) 75 { 76 ajax_init(); 77 78 parameters = ""; 79 80 queryString = get_fullformquery("reality_form"); 81 parameters = parameters + "group=" + group; 82 83 parameters = queryString + parameters; 84 85 // nulovani regionu, ktery je natvrdo nastaven na praha 86 //if (document.getElementById('cis_village_part') != null && document.getElementById('district').value == 0) parameters = parameters + '®ion=0'; 87 88 url = wwwroot + "/ajax_action.php" ; 89 90 AJAXForms.onreadystatechange = function () { processRequest("Realityass_action"); } ; 91 AJAXForms.open('POST', url, true); 92 AJAXForms.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 93 AJAXForms.setRequestHeader("Content-length", parameters.length); 94 AJAXForms.setRequestHeader("Connection", "close"); 95 AJAXForms.send(parameters); 96 97 } // end function 98 // --- 99 100 101 102 // funkce ktera provede aktualizaci html 103 function Realityass_action() 104 { 105 var res = ge("vyhledavani"); 106 107 res.innerHTML = AJAXForms.responseText; 108 109 if (Realityass_last_control_id != 0) 110 { 111 refocus("reality_form", ge_n(Realityass_last_control_id)); 112 } // end if 113 114 } // end function 115 // --- 116 117 118 119 120 // zpozdeny submit se zapamatovanim si el_id ze ktereho prisel pozadavek - kvuli refocusu a s citlivosti na submit s vyjimkou urcitych klaves 121 function Realityass_delay_submit(delay, el_id){ 122 123 ass_last_control_id = el_id; 124 125 delay_ms = 5000; // doba, ktera musi uplynout po stiknuti posledniho znaku, aby doslo k zavolani funkce 126 127 if (search_checkkeycode()) 128 { 129 if (delay == true) 130 { 131 diff = elapsedmilliseconds(); 132 133 Now = new Date(); 134 Start = Now.getTime(); 135 136 if (diff < delay_ms) // pauza po poslednim znaku - pokud rozdil nedosahl stanove hodnoty, potom dojde ke zruseni submitu 137 { 138 if (window.wait_till_submit) 139 { 140 clearTimeout(wait_till_submit); 141 } // end if 142 } // end if 143 } // end if 144 145 wait_till_submit = setTimeout(" document.reality_form.submit(); ", delay_ms); 146 147 } // end if 148 149 } // end function 150 // --- 151 152 153 154 // funkce vraci bool podle jeste stiknuta klavesa byal vyhodnocena jako dobra 155 function search_checkkeycode(){ 156 var validkey = true; 157 158 notvalidkeys = new Array(37,38,39,40,36,35,33,34,45); 159 160 for (var i = 0; i < notvalidkeys.length; i++) { 161 if (myKeycode == notvalidkeys[i]) { 162 validkey = false;
163 } // end if 164 } // end for 165 166 return validkey; 167 168 } // end function 169 170/* 171 // --- 172*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.