var setUrl='/global/survey/engine/data/index.php?a=s'; var surveyQTypes; var currentSurvey; var qTypes={}; var yesNo=[{ label: 'Yes', id:1 },{ label: 'No', id:0 }]; var fiveStar=[]; for(var x=1;x<=5;x++) fiveStar.push({ label: x, id:x }); var tenStar=fiveStar.slice(); for(var x=6;x<=10;x++) tenStar.push({ label: x, id:x }); var operators = { '==': function (a, b) { if (typeof a === 'undefined') { return false; } if ($.isArray(a)) { return a.indexOf(parseInt(b))>=0; } else { return a == b; } }, '!=': function (a, b) { if (typeof a === 'undefined') { return false; } if ($.isArray(a)) { return a.indexOf(parseInt(b))<0; } else { return a != b; } }, '<=': function (a, b) { if (typeof a === 'undefined') { return false; } return parseInt(a) <= parseInt(b); }, '>=': function (a, b) { if (typeof a === 'undefined') { return false; } return parseInt(a) >= parseInt(b); }, '<': function (a, b) { if (typeof a === 'undefined') { return false; } return parseInt(a) < parseInt(b); }, '>': function (a, b) { if (typeof a === 'undefined') { return false; } return parseInt(a) > parseInt(b); } }; $(function () { var dataSrv = "/global/survey/engine/data/index.php"; // var parser = document.createElement('a'); // parser.href = window.location.href; // // var dir=parser.pathname; var dir=window.location.pathname; if(dir[0]!="/") dir="/"+dir; var cookies=document.cookie.split(";"); var ignoreAll=false; var ignore=[]; $.each(cookies,function(index,value){ var cookie=value.trim(); if(cookie=="ignoreAllSurveys") ignoreAll=true; if(cookie.substring(0,14)=="surveyComplete") ignore.push(parseInt(cookie.substring(14,cookie.indexOf("=")))); }); if(!ignoreAll){ $.get(dataSrv,{a:'g',p:dir}).success(function (response) { //return promise surveyQTypes=response.types; $.each(response.survey,function(index,value){ if(ignore.indexOf(parseInt(value.id))<0){ //if value id is NOT in ignore document.cookie="surveyComplete"+value.id+"=1; path=/;expires=Fri, 31 Dec 9999 23:59:59 GMT"; //dont repeat survey showSurvey(value); return false; } }); /*if(response.survey.length){ popupDiv=jQuery('
', { id: 'survey_popup' }); popupDiv.append('*solicitation language here*