function sl_var_exists( varname ) { return typeof( window[ varname ] ) != "undefined"; } function sl_escape( value ) { return ( escape( replaceAll( String(value), "#", "") ) ); } function replaceAll (strOrig, strTarget, strSubString) { var intIndexOfMatch = strOrig.indexOf( strTarget ); while (intIndexOfMatch != -1) { strOrig = strOrig.replace( strTarget, strSubString ) intIndexOfMatch = strOrig.indexOf( strTarget ); } return strOrig; } var sl_iframe_css_final = "border: 0" if ( sl_var_exists("sl_iframe_css") ) sl_iframe_css_final = sl_iframe_css; //build param string using any variables that were defined on hosting page var sl_params = ""; if ( sl_var_exists("sl_list_limit") == false ) { sl_list_limit = 10; } //define width/height from variables if ( sl_var_exists("sl_width") ) { var sl_width = replaceAll(sl_width, "px", ""); //strip "px" from var }else{ var sl_width = "600"; } if ( sl_var_exists("sl_height") && Number(sl_height) ) { var sl_height = replaceAll(sl_height, "px", ""); //strip "px" from var }else{ var sl_height = 0; } //horizontal or vertical layout? var sl_layout_internal = "horizontal"; //default if (Number(sl_width) < 450 ) sl_layout_internal = "vertical"; //manual override? if ( sl_var_exists("sl_force_layout") ) { sl_layout_internal = sl_force_layout; } //set tile height, small tile depends on list limit if ( sl_height == 0 ){ if (sl_layout_internal == "vertical"){ sl_height = 300 + 20*(Number(sl_list_limit)); }else{ sl_height = 350 + 8*(Number(sl_list_limit)); } } sl_params += "&apikey=6L3Q4SMUOHEBBVSL4QKF"; sl_params += "&width=" + sl_width; sl_params += "&height=" + sl_height; if ( sl_var_exists("sl_zip") ) sl_params += "&zip=" + sl_escape(sl_zip); sl_params += "&force_layout=" + sl_escape(sl_layout_internal); if ( sl_var_exists("sl_map_frame_color") ) sl_params += "&map_frame_col=" + sl_escape(sl_map_frame_color); if ( sl_var_exists("sl_map_hide") ) sl_params += "&map_hide=" + sl_escape(sl_map_hide); if ( sl_var_exists("sl_map_height") ) sl_params += "&map_height=" + sl_escape(sl_map_height); if ( sl_var_exists("sl_list_limit") ) sl_params += "&list_limit=" + sl_escape(sl_list_limit); if ( sl_var_exists("sl_store_color") ) sl_params += "&store_col=" + sl_escape(sl_store_color); if ( sl_var_exists("sl_result_color") ) sl_params += "&result_col=" + sl_escape(sl_result_color); if ( sl_var_exists("sl_css_file") ) sl_params += "&css_file=" + sl_escape(sl_css_file); if ( sl_var_exists("sl_min_miles") ) sl_params += "&min_miles=" + sl_escape(sl_min_miles); if ( sl_var_exists("sl_max_miles") ) sl_params += "&max_miles=" + sl_escape(sl_max_miles); if ( sl_var_exists("sl_category") ) sl_params += "&category=" + sl_escape(sl_category); if ( sl_var_exists("sl_search") ) sl_params += "&search=" + sl_escape(sl_search); if ( sl_var_exists("sl_target") ) sl_params += "&target=" + sl_escape(sl_target); if ( sl_var_exists("sl_nodetails") ) sl_params += "&nodetails=" + sl_escape(sl_nodetails); document.write ('');