//This file added to support SBS's survey.

var surveyCookie = 'BESurvey'; 

var surveyChance = 5;

 

function GetCookie(Name) {

            var search = Name + "=";

            if (document.cookie.length > 0) {

                        offset = document.cookie.indexOf(search)

                        if (offset != -1) {

                                    offset += search.length

                                    end = document.cookie.indexOf(";", offset)

                                    if (end == -1)

                                                end = document.cookie.length

                                    return unescape(document.cookie.substring(offset, end))

                        }

            }

            return null;

}

 

function SetCookie (name, value) {

            document.cookie = name + "=" + escape (value) + '; path=/';

            //should expire at end of session

}

 

function DeleteCookie (name) {

            var exp = new Date();

            exp.setTime (exp.getTime() - 1);

            var cval = GetCookie (name);

            document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();

}

 

function closePopup() {

            var popupWindow = document.getElementById("SurveyPopup");

            popupWindow.style.visibility = "hidden";

            popupWindow.style.display = "none";

}

 

function OpenSurvey() {

            document.write('<style type="text/css">');

            document.write('#SurveyPopup { background-color:#FFFFFF; filter: alpha(opacity=97); -moz-opacity: 0.97; opacity: 0.97; }');

            document.write('</style><div id="SurveyPopup" style="position: absolute; top: 115px; left: 159px; height: 200; width: 450px; z-index: 999">');

            document.write('<table width="450" height="200" border="0" cellpadding="10" cellspacing="1" bgcolor="#333333">');

            document.write('<tr><td bgcolor="#FFFFFF"><p align="center"><b>Please Provide Your Feedback</b><br>');

            document.write('We want to make sure that NYC Business Express provides you with the business information and online tools that you need to start and operate your business. Please ');

            document.write('<a href="http://www.nyc.gov/html/sbs/html/contact/bizexpress_survey.shtml" target="_blank">answer a few questions</a> to let us know why you\'re using NYC Business Express, how we\'re doing, and what we can improve.</p>');

            document.write('<p>&nbsp;</p><p align="center">Thank you for your help.</p>');

            document.write('<p>&nbsp;</p><p align="center"><a href="http://www.nyc.gov/html/sbs/html/contact/bizexpress_survey.shtml" target="_blank">Go to Survey</a></p>');

            document.write('<p>&nbsp;</p><p align="center"><a href="javascript:closePopup();">Skip Survey and Continue</a></p></td></tr></table>');

            document.write('</div>');

}

 

 

function DoSurvey() {

//smanley 8/25/2009
//commented out until they want survey to go live.

//            if (GetCookie(surveyCookie) == null) {
//                        rndNum = Math.round(((surveyChance -1) * Math.random()) + 1);
//                        if (rndNum == 3) {
//                                    SetCookie(surveyCookie, "SHOWN");
//                                    OpenSurvey();
//                        } else {
//                                    SetCookie(surveyCookie, "NOT_SHOWN");
//                        }
//            }

}

