var form_name = 'search_form'; // Google advertisement settings: var def_google_color_border = 'B54B00'; function changePage(page_var_name, target_page) { setVariable(page_var_name, target_page); submitForm(); } function setVariable(name, value) { document.forms.namedItem(form_name).elements.namedItem(name).value = value; //document.forms(form_name).item(name).value = value; } function setFormVariable(formName, name, value) { document.forms.namedItem(formName).elements.namedItem(name).value = value; //document.forms(formName).item(name).value = value; } function submitForm() { document.forms.namedItem(form_name).submit(); //document.forms(form_name).submit(); } function submitFormName(formName) { document.forms.namedItem(formName).submit(); //document.forms(formName).submit(); } function setActiveElement(element_name) { //FF fixed var obj = document.getElementsByName(element_name); for (var j=0; j < obj.length; j++) { if (obj.item(j).type != 'hidden') { obj.item(j).focus(); return true; } } return false; } function changeImage (new_src, new_width) { // http://www.ajaxload.info/#preview //document.images.property_image.src = 'http://www.bulgarian-offers.com/img/ajax-loader.gif'; document.images.property_image.src = new_src; document.images.property_image.width = new_width; } function imageError(theImage) { theImage.src = "http://www.bulgarian-offers.com/images/def_noimage.gif"; theImage.width = 100; theImage.Height = 100; } function imageErrorGeneral(theImage, img_width, img_height) { if (img_width == 60) { theImage.src = "http://www.bulgarian-offers.com/images/no_picture_60_49.gif"; theImage.width = 60; theImage.Height = 49; return; } if (img_width == 75) { theImage.src = "http://www.bulgarian-offers.com/images/no_picture_75_61.gif"; theImage.width = 75; theImage.Height = 61; return; } theImage.src = "http://www.bulgarian-offers.com/images/def_noimage.gif"; theImage.width = img_width; theImage.Height = img_height; } function imageErrorNews(theImage, img_width, img_height) { if (img_width == 60) { theImage.src = "http://www.bulgarian-offers.com/images/news_75_61.jpg"; theImage.width = 60; theImage.Height = 49; return; } if (img_width == 75) { theImage.src = "http://www.bulgarian-offers.com/images/news_75_61.jpg"; theImage.width = 75; theImage.Height = 61; return; } theImage.src = "http://www.bulgarian-offers.com/images/def_noimage.gif"; theImage.width = img_width; theImage.Height = img_height; } function ShowHide(el_name) { var el = document.getElementById(el_name); if(el.style.display == 'none') { el.style.display = ''; } else { el.style.display = 'none'; } } function disableHTMLButton(html_name) { var item = document.getElementsByName(html_name); for (var i=0; i < item.length; i++) { item.item(i).disabled = true; } } function changeCheckbox(html_name, new_status, i) { var item = document.getElementsByName(html_name); if (item.item(i)) { item.item(i).checked = new_status; } } setCookie("user_js_gmt_offset", (new Date().getTimezoneOffset())); function setCookie(name, value, expires, path, domain, secure) { document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function applyPrintMedia(element_name, style_name) { //FF fixed var obj = document.getElementsByName(element_name); for (var j=0; j < obj.length; j++) { obj.item(j).className = style_name; } } function addPropertyCallBackLatLng(lat, lng) { document.getElementsByName('add_prop_location_latitude').item(0).value = lat; document.getElementsByName('add_prop_location_longitude').item(0).value = lng; } function openWinLatLong(URI, winName, winWidth, winHeight) { // var sa = document.forms('add_property').item('add_prop_location_street_address').value; // var pc = document.forms('add_property').item('add_prop_location_postal_code').value; // var c = document.forms('add_property').item('add_prop_location_city').value; // var s = document.forms('add_property').item('add_prop_location_state').value; // var co = document.forms('add_property').item('add_prop_location_country').value; var sa = document.getElementsByName('add_prop_location_street_address').item(0).value; var pc = document.getElementsByName('add_prop_location_postal_code').item(0).value; var c = document.getElementsByName('add_prop_location_city').item(0).value; var s = document.getElementsByName('add_prop_location_state').item(0).value; var co = document.getElementsByName('add_prop_location_country').item(0).value; var address = ''; if (sa) { address = sa; } if (c) { address = address + ' ' + c; } if (s) { address = address + ' ' + s; } if (co) { address = address + ' ' + co; } // When user select point on the map 'call_back_function' will be called from parent window URI = URI + '&address='+address+'&call_back_function=addPropertyCallBackLatLng'; var newWin = window.open(URI, winName, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+winWidth+',height='+winHeight); newWin.focus(); //return newWin; } // FF Compatible function closeWindow() { if (isset(parent)) { parent.close(); } else { window.close(); } } function confirmAndSubmit (frm, usr_action) { if (confirm("Are you sure?\nСигурен(а) ли сте?")) { setFormVariable(frm, "user_action", usr_action); submitFormName(frm); } return false; } function isset(varname) { if(typeof( window[ varname ] ) != "undefined") return true; else return false; } function checkNumber(item, message) { var val = item.value; var anum=/(^\d+$)|(^\d+\.\d+$)/; if (anum.test(val)) { return true; } else { alert(message); item.value = ''; return false; } } //function isset(varname){ // return(typeof(window[varname])!='undefined'); //}