function widget($args, $instance)
    {
        extract($args);
        extract($instance);
        $error_message = dsWidgets_Service_Base::getWidgetErrorMsg($before_widget . $before_title . $title . $after_title, $after_widget);
        if ($error_message) {
            echo $error_message;
            return;
        }
        $options = get_option(DSIDXWIDGETS_OPTION_NAME);
        $randString = dsWidgets_Service_Base::get_random_string('abcdefghijklmnopqrstuvwxyz1234567890', 5);
        $title = htmlspecialchars($instance["title"]);
        $rowCount = htmlspecialchars($instance["rowCount"]);
        $community = htmlspecialchars($instance["community"]);
        $state = htmlspecialchars($instance["state"]);
        $city = htmlspecialchars($instance["city"]);
        $zip = htmlspecialchars($instance["zip"]);
        $linkTitle = htmlspecialchars($instance["linkTitle"]);
        $statusType = htmlspecialchars($instance["statusType"]);
        $imagesStub = dsWidgets_Service_Base::$widgets_images_stub;
        $apiStub = dsWidgets_Service_Base::$widgets_api_stub;
        $width = htmlspecialchars($instance["width"]);
        $curURL = get_home_url();
        $idxpress_options = get_option(DSIDXPRESS_OPTION_NAME);
        if (!empty($idxpress_options["AccountID"])) {
            $aid = $idxpress_options["AccountID"];
        } else {
            $aid = $options["AccountID"];
        }
        if (!empty($idxpress_options["SearchSetupID"])) {
            $ssid = $idxpress_options["SearchSetupID"];
        } else {
            $ssid = $options["SearchSetupID"];
        }
        echo $before_widget;
        echo $before_title . $title . $after_title;
        echo <<<HTML
        <script type="text/javascript" id="divLocal{$randString}_">
\t\t\t\twindow.recentStatusHasDependency = true;
                LaunchBase{$randString} = function(){
                var recentStatusScript, _ds_midx;
                CreateObject{$randString} = function () { _ds_midx = { currentURL: '{$curURL}', curWidth: '{$width}', showHeader: false, productType: '0', curAPIStub: '{$apiStub}', curImageStub: '{$imagesStub}', targetDomain: window["zpress_widget_domain_token"], accountId: '{$aid}',searchSetupId: '{$ssid}',muteStyles: true,curTitle: '{$title}',rowCount: '{$rowCount}',community: '{$community}',state: '{$state}',city: '{$city}',zip: '{$zip}',linkTitle: '{$linkTitle}',curDivID: 'divLocal{$randString}_',querySchema: 'MmZDz28oMETkfu/J7uVDj5me5CwqyWZUYbd0g3HEW8Ar73U98rI41MBxO894vgPN',status: '{$statusType}' }; }
                AddJavaScriptToDOM{$randString}=function(c,d,e){if(1!=d){var a=document.createElement("script"),b=document.getElementsByTagName("script")[0];a.async=!0;a.src=c;a.onload=function(){ window[e] = 1;};b.parentNode.insertBefore(a,b)}return 1};
                CreateWidget{$randString} = function () {
                 (window.recentStatusFinished == 1) ? (window["ds.widget.view.recentstatus"].isProcessing = true, CreateObject{$randString}(), new window["ds.widget.view.recentstatus"](_ds_midx), window["ds.widget.view.recentstatus"].isProcessing = false, window.recentStatusHasDependency = false) : window.setTimeout("CreateWidget{$randString}(false)", 20); 
                }
                if (recentStatusScript != 1) { recentStatusScript = AddJavaScriptToDOM{$randString}("{$this->widgetsCdn}/Scripts/PostCompile/RecentStatus_v1_1.js", recentStatusScript, 'recentStatusFinished') }; 
                  CreateWidget{$randString}();
            }
            GetToken{$randString}=function(){if(!window.zpress_widget_domain_token&&1!=window.zpress_widget_domain_token_progress){window.zpress_widget_domain_token_progress=1;var c=-1<navigator.userAgent.indexOf("MSIE 7.0")?!0:!1,d=-1<navigator.userAgent.indexOf("MSIE 8.0")||-1<navigator.userAgent.indexOf("MSIE 9.0")?!0:!1;if(c)rr=document.createElement("script"),rr.async=!0,rr.id="domainScript",rr.type="text/javascript",rr.src="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=Basic&curDomain="+
            window.location.hostname+"&objectName_=error",rr.onload=rr.onreadystatechange=function(){"undefined"!=typeof window.error?alert("We had a problem authenticating this domain"):(window.zpress_widget_domain_token=window.encrypted_domain,LaunchBase{$randString}())},document.getElementsByTagName("head")[0].appendChild(rr);else if(c="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=CORS&objectName_=error",d){var a=new XDomainRequest;a.onload=function(){window.zpress_widget_domain_token=
            eval(a.responseText);LaunchBase{$randString}()};a.onerror=function(){};a.onprogress=function(){};a.open("GET",c,!0);a.send(null)}else{var b;if(b=new XMLHttpRequest)b.onreadystatechange=function(){if(4==b.readyState)if(200==b.status){var a=eval(b.responseText);"undefined"!=typeof a.listingsError?alert(a.listingsError[0].Message):(window.zpress_widget_domain_token=a,LaunchBase{$randString}())}},b.open("GET",c,!0),b.send()}}else window.zpress_widget_domain_token?LaunchBase{$randString}():
            window.setTimeout("GetToken{$randString}()",20)};GetToken{$randString}();
        </script>
HTML;
        echo $after_widget;
    }
    function widget($args, $instance)
    {
        extract($args);
        extract($instance);
        $error_message = dsWidgets_Service_Base::getWidgetErrorMsg($before_widget . $before_title . $title . $after_title, $after_widget);
        if ($error_message) {
            echo $error_message;
            return;
        }
        $options = get_option(DSIDXWIDGETS_OPTION_NAME);
        $randString = dsWidgets_Service_Base::get_random_string('abcdefghijklmnopqrstuvwxyz1234567890', 5);
        $horzCount = htmlspecialchars($instance["horzCount"]);
        $maxPrice = htmlspecialchars($instance["maxPrice"]);
        $state = htmlspecialchars($instance["state"]);
        $city = htmlspecialchars($instance["city"]);
        $zip = htmlspecialchars($instance["zip"]);
        $imagesStub = dsWidgets_Service_Base::$widgets_images_stub;
        $apiStub = dsWidgets_Service_Base::$widgets_api_stub;
        $curURL = get_home_url();
        $idxpress_options = get_option(DSIDXPRESS_OPTION_NAME);
        if (!empty($idxpress_options["AccountID"])) {
            $aid = $idxpress_options["AccountID"];
        } else {
            $aid = $options["AccountID"];
        }
        if (!empty($idxpress_options["SearchSetupID"])) {
            $ssid = $idxpress_options["SearchSetupID"];
        } else {
            $ssid = $options["SearchSetupID"];
        }
        echo $before_widget;
        if (defined('ZPRESS_API') && ZPRESS_API != '') {
            $widget_header = call_user_func('\\zpress\\themes\\Options::GetOption', 'theme_widgets_require_header');
            if (!empty($widget_header->meta) && $widget_header->meta == 'true') {
                echo $before_title;
                echo 'Slideshow';
                echo $after_title;
            }
        }
        echo <<<HTML
        <script type="text/javascript" id="divLocal{$randString}_">
            var slideshowScript, _ds_midx;
\t\t\twindow.slideshowHasDependency = true;
            LaunchBase{$randString} = function(){
                CreateObject{$randString} = function () { _ds_midx = { currentURL: '{$curURL}', productType: '0', curAPIStub: '{$apiStub}', curImageStub: '{$imagesStub}', targetDomain: window["zpress_widget_domain_token"],accountId: '{$aid}',searchSetupId: '{$ssid}',muteStyles: true,horzCount: '{$horzCount}',maxPrice: '{$maxPrice}',state: '{$state}',city: '{$city}',zip: '{$zip}',curDivID: 'divLocal{$randString}_',querySchema: '12dGTTViUjEzC1rrNlw6Lq6A6wZQlgBarlIcucpGTkQrUP3gCimYF6deRFaavu2IbPpaOkZ9I4K42QaAhLVEcA==' }; }
                AddJavaScriptToDOM{$randString}=function(c,d,e){if(1!=d){var a=document.createElement("script"),b=document.getElementsByTagName("script")[0];a.async=!0;a.src=c;a.onload=function(){ window[e] = 1;};b.parentNode.insertBefore(a,b)}return 1};
                CreateWidget{$randString} = function () {
                    (window.slideshowFinished == 1) ? (window["ds.widget.view.slideshow"].isProcessing = true, CreateObject{$randString}(), new window["ds.widget.view.slideshow"](_ds_midx), window["ds.widget.view.slideshow"].isProcessing = false, window.slideshowHasDependency = false) : window.setTimeout("CreateWidget{$randString}(false)", 20); 
                }
                if (slideshowScript != 1) { slideshowScript = AddJavaScriptToDOM{$randString}("{$this->widgetsCdn}/Scripts/PostCompile/Slideshow_v1_1.js", slideshowScript, 'slideshowFinished') }; 
                CreateWidget{$randString}();
            }


            GetToken{$randString}=function(){if(!window.zpress_widget_domain_token&&1!=window.zpress_widget_domain_token_progress){window.zpress_widget_domain_token_progress=1;var c=-1<navigator.userAgent.indexOf("MSIE 7.0")?!0:!1,d=-1<navigator.userAgent.indexOf("MSIE 8.0")||-1<navigator.userAgent.indexOf("MSIE 9.0")?!0:!1;if(c)rr=document.createElement("script"),rr.async=!0,rr.id="domainScript",rr.type="text/javascript",rr.src="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=Basic&curDomain="+
            window.location.hostname+"&objectName_=error",rr.onload=rr.onreadystatechange=function(){"undefined"!=typeof window.error?alert("We had a problem authenticating this domain"):(window.zpress_widget_domain_token=window.encrypted_domain,LaunchBase{$randString}())},document.getElementsByTagName("head")[0].appendChild(rr);else if(c="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=CORS&objectName_=error",d){var a=new XDomainRequest;a.onload=function(){window.zpress_widget_domain_token=
            eval(a.responseText);LaunchBase{$randString}()};a.onerror=function(){};a.onprogress=function(){};a.open("GET",c,!0);a.send(null)}else{var b;if(b=new XMLHttpRequest)b.onreadystatechange=function(){if(4==b.readyState)if(200==b.status){var a=eval(b.responseText);"undefined"!=typeof a.listingsError?alert(a.listingsError[0].Message):(window.zpress_widget_domain_token=a,LaunchBase{$randString}())}},b.open("GET",c,!0),b.send()}}else window.zpress_widget_domain_token?LaunchBase{$randString}():
            window.setTimeout("GetToken{$randString}()",20)};GetToken{$randString}();

        </script>
HTML;
        echo $after_widget;
    }
    function widget($args, $instance)
    {
        extract($args);
        extract($instance);
        $error_message = dsWidgets_Service_Base::getWidgetErrorMsg($before_widget . $before_title . $title . $after_title, $after_widget);
        if ($error_message) {
            echo $error_message;
            return;
        }
        $options = get_option(DSIDXWIDGETS_OPTION_NAME);
        $randString = dsWidgets_Service_Base::get_random_string('abcdefghijklmnopqrstuvwxyz1234567890', 5);
        $title = htmlspecialchars($instance["title"]);
        $tract = htmlspecialchars($instance["tract"]);
        $community = htmlspecialchars($instance["community"]);
        $state = htmlspecialchars($instance["state"]);
        $city = htmlspecialchars($instance["city"]);
        $zip = htmlspecialchars($instance["zip"]);
        $propType = htmlspecialchars($instance["propType"]);
        $periodType = htmlspecialchars($instance["periodType"]);
        $statusType = htmlspecialchars($instance["statusType"]);
        $imagesStub = dsWidgets_Service_Base::$widgets_images_stub;
        $apiStub = dsWidgets_Service_Base::$widgets_api_stub;
        $curURL = get_home_url();
        $idxpress_options = get_option(DSIDXPRESS_OPTION_NAME);
        if (!empty($idxpress_options["AccountID"])) {
            $aid = $idxpress_options["AccountID"];
        } else {
            $aid = $options["AccountID"];
        }
        if (!empty($idxpress_options["SearchSetupID"])) {
            $ssid = $idxpress_options["SearchSetupID"];
        } else {
            $ssid = $options["SearchSetupID"];
        }
        echo $before_widget;
        if (defined('ZPRESS_API') && ZPRESS_API != '') {
            $widget_header = call_user_func('\\zpress\\themes\\Options::GetOption', 'theme_widgets_require_header');
            if (!empty($widget_header->meta) && $widget_header->meta == 'true') {
                echo $before_title . 'Area Stats' . $after_title;
            }
        }
        echo <<<HTML
        <script type="text/javascript" id="divLocal{$randString}_">
\t\t\twindow.areaStatsHasDependency = true;
            LaunchBase{$randString} = function(){
                var historicalChartScript,historicalChartDep1Script,historicalChartDep2Script,historicalChartDep3Script, _ds_midx;
                CreateObject{$randString} = function () { _ds_midx = { currentURL: '{$curURL}', curAPIStub: '{$apiStub}', curImageStub: '{$imagesStub}', targetDomain: window["zpress_widget_domain_token"], accountId: '{$aid}',searchSetupId: '{$ssid}',muteStyles: true,message: '{$title}',tract: '{$tract}',community: '{$community}',city: '{$city}',state: '{$state}',zipCode: '{$zip}',propType: '{$propType}',curDivID: 'divLocal{$randString}_',chartType: 'line',querySchema: 'oXXi0sb6XR5WdK/vSGYAn12rcEoBW2Ngd/Oyx3/RCbZIV8mSvXrYIR4K5vWeaMSblc0c8/SrrXsKuifcmW5MBItoNGdGTYzHxJcxh9ISsYPoAsVhF+pY5eUXDftnio37',period: '{$periodType}',status: '{$statusType}' }; }
                AddJavaScriptToDOM{$randString}=function(c,d,e){ if(1!=d){var a=document.createElement("script"),b=document.getElementsByTagName("script")[0];a.async=true;a.src=c;a.onload=a.onreadystatechange=function(){ if(a.readyState){  if (a.readyState == "loaded" || a.readyState == "complete") {window[e] = 1;}}else{window[e] = 1;}};b.parentNode.insertBefore(a,b)}return 1};
                CreateWidget{$randString} = function () {
                 if ((window.historicalChartFinished == 1) && (window.historicalChartDep1Finished == 1) && (window.historicalChartDep2Finished != 1)) 
                { if (historicalChartDep2Script != 1)
                 { historicalChartDep2Script = AddJavaScriptToDOM{$randString}('{$this->widgetsCdn}/Scripts/Dependencies/g.raphael-min.js', historicalChartDep2Script, 'historicalChartDep2Finished');}}
                if ((window.historicalChartFinished == 1) && (window.historicalChartDep1Finished == 1) && (window.historicalChartDep2Finished == 1)) {
                if (1 != historicalChartDep3Script)
                {historicalChartDep3Script = AddJavaScriptToDOM{$randString}('{$this->widgetsCdn}/Scripts/Dependencies/g.line-min.js', historicalChartDep3Script, 'historicalChartDep3Finished');
                window.historicalChartDep3Finished == 1;}if (window.historicalChartDep3Finished == 1) 
                {window['ds.widget.view.historicalchart'].isProcessing = true;CreateObject{$randString}(); new window['ds.widget.view.historicalchart'](_ds_midx); window['ds.widget.view.historicalchart'].isProcessing = false; window.areaStatsHasDependency = false;}
                else {
                 window.setTimeout('CreateWidget{$randString}(false)', 20);}}
                else {
                window.setTimeout('CreateWidget{$randString}(false)', 20);} 
                }
                if (historicalChartScript != 1) { historicalChartScript = AddJavaScriptToDOM{$randString}("{$this->widgetsCdn}/Scripts/PostCompile/HistoricalChart_v1_1.js", historicalChartScript, 'historicalChartFinished') }; 
                if (historicalChartDep1Script != 1) { historicalChartDep1Script = AddJavaScriptToDOM{$randString}("{$this->widgetsCdn}/Scripts/Dependencies/raphael-min.js", historicalChartDep1Script, 'historicalChartDep1Finished') };
                CreateWidget{$randString}();
            }
            GetToken{$randString}=function(){if(!window.zpress_widget_domain_token&&1!=window.zpress_widget_domain_token_progress){window.zpress_widget_domain_token_progress=1;var c=-1<navigator.userAgent.indexOf("MSIE 7.0")?!0:!1,d=-1<navigator.userAgent.indexOf("MSIE 8.0")||-1<navigator.userAgent.indexOf("MSIE 9.0")?!0:!1;if(c)rr=document.createElement("script"),rr.async=!0,rr.id="domainScript",rr.type="text/javascript",rr.src="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=Basic&curDomain="+
            window.location.hostname+"&objectName_=error",rr.onload=rr.onreadystatechange=function(){"undefined"!=typeof window.error?alert("We had a problem authenticating this domain"):(window.zpress_widget_domain_token=window.encrypted_domain,LaunchBase{$randString}())},document.getElementsByTagName("head")[0].appendChild(rr);else if(c="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=CORS&objectName_=error",d){var a=new XDomainRequest;a.onload=function(){window.zpress_widget_domain_token=
            eval(a.responseText);LaunchBase{$randString}()};a.onerror=function(){};a.onprogress=function(){};a.open("GET",c,!0);a.send(null)}else{var b;if(b=new XMLHttpRequest)b.onreadystatechange=function(){if(4==b.readyState)if(200==b.status){var a=eval(b.responseText);"undefined"!=typeof a.listingsError?alert(a.listingsError[0].Message):(window.zpress_widget_domain_token=a,LaunchBase{$randString}())}},b.open("GET",c,!0),b.send()}}else window.zpress_widget_domain_token?LaunchBase{$randString}():
            window.setTimeout("GetToken{$randString}()",20)};GetToken{$randString}();
        </script>
HTML;
        echo $after_widget;
    }
    function widget($args, $instance)
    {
        if (!$this->instance) {
            $this->instance = true;
        } else {
            return;
        }
        extract($args);
        extract($instance);
        $error_message = dsWidgets_Service_Base::getWidgetErrorMsg($before_widget, $after_widget);
        if ($error_message) {
            echo $error_message;
            return;
        }
        $capabilities = dsWidgets_Service_Base::getCapabilities();
        $randString = dsWidgets_Service_Base::get_random_string('abcdefghijklmnopqrstuvwxyz1234567890', 5);
        wp_enqueue_script('googlemaps3', 'http://maps.googleapis.com/maps/api/js?sensor=false', array('jquery'), false, true);
        $options = get_option(DSIDXWIDGETS_OPTION_NAME);
        $state = htmlspecialchars($instance["state"]);
        $city = str_replace(" \r\n ", ",", htmlspecialchars($instance["city"]));
        $city = str_replace(" \r\n", ",", $city);
        $city = str_replace("\r\n ", ",", $city);
        $city = str_replace("\r\n", ",", $city);
        if (empty($capabilities->MinPrice)) {
            $instance['priceMin'] = '';
        }
        if (empty($capabilities->MaxPrice)) {
            $instance['priceMax'] = '';
        }
        if (empty($capabilities->MinImprovedSqFt)) {
            $instance['sqftMin'] = '';
        }
        $instance = wp_parse_args($instance, array("state" => $state, "city" => $city, "zip" => "", "priceMin" => "250000", "priceMax" => "550000", "priceFloor" => "100000", "priceCeiling" => "1000000", "bedsMin" => "2", "bathsMin" => "2", "sqftMin" => "1500", "statusType" => "1", "rowCountType" => "25", "sortType" => "0", "eDomain" => "", "height" => "494", "width" => "548"));
        $zip = htmlspecialchars($instance["zip"]);
        $priceMin = htmlspecialchars($instance["priceMin"]);
        $priceMax = htmlspecialchars($instance["priceMax"]);
        $priceFloor = htmlspecialchars($instance["priceFloor"]);
        $priceCeiling = htmlspecialchars($instance["priceCeiling"]);
        $bedsMin = htmlspecialchars($instance["bedsMin"]);
        $bathsMin = htmlspecialchars($instance["bathsMin"]);
        $sqftMin = htmlspecialchars($instance["sqftMin"]);
        $statusType = htmlspecialchars($instance["statusType"]);
        $rowCountType = htmlspecialchars($instance["rowCountType"]);
        $sortType = htmlspecialchars($instance["sortType"]);
        $imagesStub = dsWidgets_Service_Base::$widgets_images_stub;
        $apiStub = dsWidgets_Service_Base::$widgets_api_stub;
        $height = htmlspecialchars($instance["height"]);
        $width = htmlspecialchars($instance["width"]);
        $curURL = get_home_url();
        $idxpress_options = get_option(DSIDXPRESS_OPTION_NAME);
        if (!empty($idxpress_options["AccountID"])) {
            $aid = $idxpress_options["AccountID"];
        } else {
            $aid = $options["AccountID"];
        }
        if (!empty($idxpress_options["SearchSetupID"])) {
            $ssid = $idxpress_options["SearchSetupID"];
        } else {
            $ssid = $options["SearchSetupID"];
        }
        echo $before_widget;
        if (defined('ZPRESS_API') && ZPRESS_API != '') {
            $widget_header = call_user_func('\\zpress\\themes\\Options::GetOption', 'theme_widgets_require_header');
            if (!empty($widget_header->meta) && $widget_header->meta == 'true') {
                echo $before_title;
                echo 'Map Search';
                echo $after_title;
            }
        }
        echo <<<HTML
        <script type="text/javascript" id="divLocal{$randString}_">
\t\t\twindow.mapSearchHasDependency = true;
            var launchBaseCalled = false;
            var mapSearchDep1Finished = 1;
            LaunchBase{$randString} = function(){
                var mapSearchScript,mapSearchDep1RevScript, _ds_midx, mapSearchProgress;
                CreateObject{$randString} = function () { _ds_midx = { currentURL: '{$curURL}', curHeight: '{$height}', curWidth: '{$width}', productType: '0', curAPIStub: '{$apiStub}', curImageStub: '{$imagesStub}', targetDomain: window["zpress_widget_domain_token"],accountId: '{$aid}',searchSetupId: '{$ssid}',muteStyles: true,state: '{$state}',city: '{$city}',zip: '{$zip}',priceMin: '{$priceMin}',priceMax: '{$priceMax}',priceFloor: '{$priceFloor}',priceCeiling: '{$priceCeiling}',bedsMin: '{$bedsMin}',bathsMin: '{$bathsMin}',sqftMin: '{$sqftMin}',curDivID: 'divLocal{$randString}_',querySchema: 'HNIPilgrh/9PwdKmimpgPE05NfSeqIkyvHeXiSh+gUIUzKp3KXDCFoWJ/DzaOsYlntCSXtSk36hbB76URZk1Sirc9iLz3tiLPAN0SK/EbNCrr6XWxD7hAYVJcDwXtpN4',status: '{$statusType}',rowCount: '{$rowCountType}',sort: '{$sortType}' }; }
                AddJavaScriptToDOM{$randString}=function(c,d,e){ if(d!=1){var a=document.createElement("script"),b=document.getElementsByTagName("script")[0];a.id=e;a.type='text/javascript';a.async=true;a.src=c;a.onload=a.onreadystatechange=function(){ if(a.readyState){  if (a.readyState == "loaded" || a.readyState == "complete") {window[e] = 1;}}else{window[e] = 1;}};b.parentNode.insertBefore(a,b)}return 1};
                CreateWidget{$randString} = function () {
                 (window.mapSearchFinished == 1 && mapSearchDep1Finished == 1) ? (window["ds.widget.view.mapsearch"].isProcessing = true, CreateObject{$randString}(), new window["ds.widget.view.mapsearch"](_ds_midx), window["ds.widget.view.mapsearch"].isProcessing = false, window.mapSearchHasDependency = false, DetectMapScripts{$randString}()) : window.setTimeout("CreateWidget{$randString}(false)", 20); 
                }
                if (mapSearchScript != 1 && mapSearchProgress != 1) {mapSearchProgress=1, mapSearchScript = AddJavaScriptToDOM{$randString}("{$this->widgetsCdn}/Scripts/PostCompile/MapSearch_v1_1.js", mapSearchScript, 'mapSearchFinished') }; 
                 CreateWidget{$randString}();
            }
\t\t\tDetectMapScripts{$randString} = function(){
\t\t\t\tif (typeof google === 'object' && typeof google.maps === 'object') {
\t\t\t\t\tMapSearchMapCallback();
\t\t\t\t}
\t\t\t\telse{
\t\t\t\t\twindow.setTimeout("DetectMapScripts{$randString}()", 20)
\t\t\t\t}
\t\t\t}
            GetToken{$randString}=function(){
                if(!window.zpress_widget_domain_token && window.zpress_widget_domain_token_progress!=1){
                    window.zpress_widget_domain_token_progress=1;var c=-1<navigator.userAgent.indexOf("MSIE 7.0")?!0:!1,d=-1<navigator.userAgent.indexOf("MSIE 8.0")||-1<navigator.userAgent.indexOf("MSIE 9.0")?!0:!1;
                    if(c){
                        rr=document.createElement("script");
                        rr.async=1;
                        rr.id="domainScript";
                        rr.type="text/javascript";
                        rr.src="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=Basic&curDomain=" + window.location.hostname+"&objectName_=error";
                        rr.onload=rr.onreadystatechange=function(){
                            if("undefined"!=typeof window.error){
                                alert("We had a problem authenticating this domain");
                            }
                            else{
                                window.zpress_widget_domain_token=window.encrypted_domain;
                                if(rr.readyState && (rr.readyState == "loaded" || rr.readyState == "complete")){                         
                                    if(launchBaseCalled != true){
                                        LaunchBase{$randString}();
                                    }
                                    launchBaseCalled = true;
                                }
                                else{ 
                                    window.setTimeout("GetToken{$randString}()",20);
                                }
                            }
                        };
                        document.getElementsByTagName("head")[0].appendChild(rr);
                    }
                    else if(c="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=CORS&objectName_=error",d){var a=new XDomainRequest;a.onload=function(){window.zpress_widget_domain_token=
                        eval(a.responseText);LaunchBase{$randString}()};a.onerror=function(){};a.onprogress=function(){};a.open("GET",c,!0);a.send(null)}else{var b;if(b=new XMLHttpRequest)b.onreadystatechange=function(){if(4==b.readyState)if(200==b.status){var a=eval(b.responseText);"undefined"!=typeof a.listingsError?alert(a.listingsError[0].Message):(window.zpress_widget_domain_token=a,LaunchBase{$randString}())}},b.open("GET",c,!0),b.send()}
                    }
                    else{
                        if(window.zpress_widget_domain_token && launchBaseCalled != true) {
                            LaunchBase{$randString}();
                            launchBaseCalled = true;
                        }
                        else{
                            if(launchBaseCalled != true){
                                window.setTimeout("GetToken{$randString}()",20);
                        }
                    }
                } 
            }
            GetToken{$randString}();
        </script>
HTML;
        echo $after_widget;
        dsidx_footer::ensure_disclaimer_exists("search");
    }