var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); /** ** After the user click the website certain times, this javascript file ** will use cookies to trigger the survey page to automaticlly show up ** for the user input. ** The users we want do the survey is radomly one out of two. ** ** @program name: survey.js ** ** @version 1.0 ** ** @date: March 10th, 2003 ** ** @author: Wenfei Ye **/ // constant parameters var MAX_TIMES_VISITED = 100000; var EXPIRE_DAYS = 100; //var TEMP_EXPIRE_DAYS = 20/(24*3600); //10 seconds var TEMP_EXPIRE_DAYS = 1; var DELAY_SECONDS = 2000; // 2 seconds. 1000 millisecond = 1 second var YES = 1; var NO = 0; var SURVEY_URL = "/gol/bsa/site.nsf/fr/su05106.html"; //entry of the questionnaire page which //has 'yes','no' and 'later' on it. var FORM_URL = "/gol/bsa/site.nsf/fr/su05107.html"; // questionnaire page var WIDTH = 500; var HEIGHT = 500; var NUM_OF_SURVEY_PAGES = -3; // - (number of survey pages + 2) var TIMES_VISITED = "TimesVisited"; var PICKED = "Picked"; var SURVEY_DONE = "SurveyDone"; var BACK_URL = "BackURL"; function getCookie( NameOfCookie ) { if ( document.cookie.length > 0 ) { begin = document.cookie.indexOf(NameOfCookie+"="); if ( begin != -1 ) { begin += NameOfCookie.length + 1; end = document.cookie.indexOf( ";", begin ); if ( end == -1 ) end = document.cookie.length; return unescape( document.cookie.substring(begin, end) ); } } return null; } function setCookie( NameOfCookie, Value, Expiredays ) { var ExpireDate = new Date (); ExpireDate.setTime( ExpireDate.getTime() + ( Expiredays * 24 * 3600 * 1000) ); document.cookie = NameOfCookie + "=" + escape( Value ) + ( (Expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString() ) + "; path=/"; } function delCookie ( NameOfCookie ) { if ( getCookie(NameOfCookie) ) { document.cookie = NameOfCookie + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT" + "; path=/"; } } function openSurvey() { window.location = SURVEY_URL; } function doSurveyCookie() { TimesVisited = eval( getCookie(TIMES_VISITED) ) + 1; //alert("TimesVisited = " + TimesVisited ); // debug purpose setCookie( TIMES_VISITED, TimesVisited, EXPIRE_DAYS ); Picked = eval( getCookie(PICKED) ) + 0; SurveyDone = eval( getCookie(SURVEY_DONE) ) + 0; // Either the user has been picked out to do the survey, but not finish // the survey yet, or is the first time to visit. if ( SurveyDone == NO ) { //alert("SurveyDone = " + SurveyDone); // debug purpose if ( Picked == YES ) // the user has been picked out to do the survey, { //alert("Picked = " + Picked); // debug purpose if ( TimesVisited >= MAX_TIMES_VISITED ) { //alert("in if TimesVisited = " + TimesVisited); // debug purpose setCookie( BACK_URL, window.location, EXPIRE_DAYS ); //alert( getCookie(BACK_URL) ); // debug purpose setTimeout( 'openSurvey()', DELAY_SECONDS ); } else {} //TimesVisited < MAX_TIMES_VISITED } else // Picked = NO, it is the first time the user visit. { // the user is radomly picked 1 out of 2 //var index = Math.floor( Math.random() * 2 ); var index = 1; //alert ( "index = " + index); // debug purpose if ( index == 1 ) // the user is picked. { setCookie( PICKED, YES, EXPIRE_DAYS ); } // The user is picked no to do the Survey, // we assume s/he is done the Survey. else // index == 0, { setCookie( SURVEY_DONE, YES, EXPIRE_DAYS ); } } } // do nothing, since either the user already done the Survey // or has been picked no to do the Survey. else // SurveyDone = YES { //alert( "SurveyDone = " + SurveyDone ); // debug purpose } } function openWindow() { setCookie(SURVEY_DONE, YES, TEMP_EXPIRE_DAYS) window.open( FORM_URL,"Survey", "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=WIDTH,height=HEIGHT" ); window.focus(); } function getBackURL() { return BACK_URL; } // debug purpose function deleteCookies(){ delCookie ( TIMES_VISITED ); delCookie ( SURVEY_DONE ); delCookie ( PICKED ); } } /* FILE ARCHIVED ON 20:10:57 Oct 28, 2006 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 05:29:46 Jul 26, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* playback timings (ms): RulesEngine.query: 23.319 PetaboxLoader3.datanode: 13.831 */