
d16g={};d16g.getLogMsg=function(msg,that){if(typeof that!=="undefined"&&typeof that.getLabel==="function"){return that.getLabel()+msg;}else{return msg;}};d16g.log=function(msg,that){if(typeof console!=='undefined'&&typeof console.log==='function'&&d16g.adDebug===true){console.log(d16g.getLogMsg(msg,that));}};d16g.warn=function(msg,that){if(typeof console!=='undefined'&&typeof console.warn==='function'&&d16g.adDebug===true){console.warn(d16g.getLogMsg(msg,that));}};d16g.info=function(msg,that){if(typeof console!=='undefined'&&typeof console.info==='function'&&d16g.adDebug===true){console.info(d16g.getLogMsg(msg,that));}};d16g.error=function(msg,that){if(typeof console!=='undefined'&&typeof console.error==='function'&&d16g.adDebug===true){console.error(d16g.getLogMsg(msg,that));}};d16g.make=function(F){return new F();};d16g.extend=function(F){var G=function(){};G.prototype=new F();return G;};d16g.parseBool=function(value){var result;switch(typeof value){case'number':result=(value!==0);break;case'string':var test=value.toLowerCase();if(test==='yes'||test==='1'||test==='true'){result=true;}else if(test==='no'||test==='0'||test==='false'||test===''){result=false;}
break;case'boolean':result=value;break;case"undefined":d16g.warn("d16g.parseBool(): value type is not handled explicitly. Parameter type="+typeof value+", value="+value);break;case"function":d16g.warn("d16g.parseBool(): value type is not handled explicitly. Parameter type="+typeof value+", value="+value);break;default:d16g.warn("d16g.parseBool(): value type is not handled explicitly. Parameter type="+typeof value+", value="+value);}
return result;};d16g.defaultBoolFalse=function(value){var result=value;if(typeof value!=='boolean'){result=false;d16g.log("d16g.defaultBoolFalse(): Returning false as default. Parameter type="+typeof value+", value="+value);}
return result;};d16g.defaultBoolTrue=function(value){var result=value;if(typeof value!=='boolean'){result=true;d16g.log("d16g.defaultBoolTrue(): Returning true as default. Parameter type="+typeof value+", value="+value);}
return result;};d16g.adFeedback={};d16g.adFeedback.constants=function(){return{USER_ACTION:"userAction",WIDGET_OPEN:"widgetOpened",WIDGET_SUBMITTED:"widgetSubmitted",CHAR_LIMIT:1000};};d16g.adFeedback.logOpen=function(my){var constants=d16g.adFeedback.constants();var params=d16g.adFeedback.getMetaData(my);params[constants.USER_ACTION]=constants.WIDGET_OPEN;d16g.adFeedback.sendClog(params);};d16g.adFeedback.log=function(my){var constants=d16g.adFeedback.constants();var params=d16g.adFeedback.getMetaData(my);var feedbackContainerId="#adfeedbackpopover"+my.randomId;params[constants.USER_ACTION]=constants.WIDGET_SUBMITTED;jQuery(feedbackContainerId+" input").each(function(){if((this.type==="radio")||(this.type==="checkbox")){if(this.checked){params[this.name]=this.value;}}else{params[this.name]=this.value;}});jQuery(feedbackContainerId+" textarea").each(function(){var tmp=this.value.substring(0,constants.CHAR_LIMIT);params[this.name]=tmp;});jQuery(feedbackContainerId+" select").each(function(){params[this.name]=this.value;});d16g.adFeedback.sendClog(params);};d16g.adFeedback.getMetaData=function(my){var params={};params.browser=navigator.userAgent;params.impressionId=my.impressionId;params.pagetype=my.pageType;params.pagesubtype=my.pageSubType;params.slot=my.slotName;params.questionGroupId=my.questionGroupId;params.screenRes="h="+jQuery(window).height()+",w="+jQuery(window).width();return params;};d16g.adFeedback.sendClog=function(params){d16g.log("data to be logged:",this);for(var i in params){if(params.hasOwnProperty(i)){d16g.log('key is: '+i+', value is: '+params[i],this);}}
if(typeof(window.clientLogger)!='undefined'){d16g.log("sendingCLOG",this);window.clientLogger.sendCLOGEntry("displayad","feedback",params);}};d16g.log("d16g: finished d16g-0.4.js");