var PB_267 = { append_stylesheets: function(){ var cssNode1 = document.createElement('link'); cssNode1.type = 'text/css'; cssNode1.rel = 'stylesheet'; cssNode1.href = 'http://www.getbeezy.com/stylesheets/widget.css'; document.getElementsByTagName("head")[0].appendChild(cssNode1); var cssNode2 = document.createElement('link'); cssNode2.type = 'text/css'; cssNode2.rel = 'stylesheet'; cssNode2.href = 'http://www.getbeezy.com/stylesheets/cleanslate.css'; document.getElementsByTagName("head")[0].appendChild(cssNode2); }, get_script_element: function(){ return document.getElementById('PB_267_script'); }, get_widget_element: function(){ var container = document.getElementById('PB_267'); if (container == null) { container = document.createElement('div'); container.id = 'PB_267'; container.className = 'getbeezy_widget cleanslate'; // widget container needs to be inserted into the DOM wherever // the client inserted the script tag var scriptTag = this.get_script_element(); scriptTag.parentNode.replaceChild(container, scriptTag); } return container; }, switch_location: function(location_id){ this.set_widget_height(); document.getElementById('PB_267_home').className = "hide"; document.getElementById('PB_267_refresher').className = "centered show"; // avoid a memory leak by deleting the old script tags var oldScript = this.get_script_element(); if (oldScript != null) { oldScript.parentNode.removeChild(oldScript); delete oldScript; } var url = 'http://promoterbee.getbeezy.com/enhanced_listing/web_tools/267?location_id='+location_id; var newScript = document.createElement('script'); newScript.id = 'PB_267_script'; newScript.type = 'text/javascript'; newScript.src = url; // dynamic script tag is a hack to get cross-domain "AJAX" request var head = document.getElementsByTagName("head")[0]; head.appendChild(newScript); }, insert_widget_content: function(html){ var old_container = this.get_widget_element(); var new_container = document.createElement('div'); new_container.id = old_container.id; new_container.className = old_container.className; // IE crashes if the innerHTML call will make the page invalid... // our widget validates but it could be embedded in invalid HTML // so we insert the HTML into a node that isn't attached to the DOM // (and thus isn't inside invalid HTML) and then swap it into the DOM // (and IE doesn't validate the results of the replaceChild call) new_container.innerHTML = html; old_container.parentNode.replaceChild(new_container, old_container); }, do_tracking: function(tracking_params){ var beacon = new Image(); var params = "source=widget&"; params = params + tracking_params; params = params + "&" + new Date().getTime(); beacon.src = 'http://www.getbeezy.com/analytics/record?'+params; }, show_event_detail: function(id, parent_id){ this.set_widget_height(); document.getElementById('PB_267_home').className = "hide"; var elemName = 'PB_267_details_' + id; document.getElementById(elemName).className = "show"; this.do_tracking("page_views="+parent_id); }, show_home: function(id){ document.getElementById('PB_267_home').className = "show"; var elemName = 'PB_267_details_' + id; document.getElementById(elemName).className = "hide"; }, show_source: function(){ this.set_widget_height(); document.getElementById('PB_267_source').className = "show"; document.getElementById('PB_267_home').className = "hide"; }, close_source: function(){ document.getElementById('PB_267_source').className = "hide"; document.getElementById('PB_267_home').className = "show"; }, set_widget_height: function(){ var home = document.getElementById('PB_267_home'); var container = document.getElementById('PB_267_container'); var height_string = 'height: ' + home.offsetHeight + 'px !important'; container.style.cssText = height_string; }, serialize_form: function(form){ var params = '?'; var first_param = true; var elements = form.elements; for(var i = 0; i < elements.length; i++){ if (elements[i].value.length > 0) { if (first_param == true){first_param = false;} else {params = params + '&';} params = params + elements[i].name+'='+elements[i].value; } } return encodeURI(params); }, submit: function(){ this.set_widget_height(); document.getElementById('PB_267_home').className = "hide"; document.getElementById('PB_267_refresher').className = "centered show"; // avoid a memory leak by deleting the old script tags var oldScript = document.getElementById('PB__script'); if (oldScript != null) { oldScript.parentNode.removeChild(oldScript); delete oldScript; } var params = this.serialize_form(document.getElementById('PB_267_form')); var newScript = document.createElement('script'); newScript.id = 'PB_267_script'; newScript.type = 'text/javascript'; newScript.src = 'http://promoterbee.getbeezy.com/enhanced_listing/web_tool_emails;create_contact'+params; // dynamic script tag is a hack to get cross-domain "AJAX" request var head = document.getElementsByTagName("head")[0]; if (true){ head.appendChild(newScript); } else { alert('This is just the preview...'); } }, show_help: function(){ this.set_widget_height(); document.getElementById('PB_267_help').className = "show"; document.getElementById('PB_267_home').className = "hide"; }, close_help: function(){ document.getElementById('PB_267_help').className = "hide"; document.getElementById('PB_267_home').className = "show"; } }; PB_267.append_stylesheets(); PB_267.insert_widget_content('
\n
\n\n
\n \n \n\n
Subscribe by Email
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Receive Weekly Specials to your email!\n
\n \n\n \n\n \n\n\n
\n \"Subscribe\"\n \n
\n\n
\n
\n\n
\n\n
\n
\n Submitting...

\n \"Indicator\"\n
\n
\n\n
\n
\n Thanks! You\'ve been added to our list.\n
\n
\n\n
\n
Help
\n

\n » Back\n
\n
');