var POWERREVIEWS=(function(){var publicScope={common:{},display:{},submission:{}};var gFlagDisplayInitFinished=false;var gFlagDataInitFinished=false;var gMetaInfo=null;var gContentsHash={};var gBatchHash={};var gReviewHash={};var gResult={};publicScope.common.gResult=gResult;var optionsHash={};var gCallbacks={};var gNumObjectsRequested=0;var prEncode=encodeURIComponent||escape;var gPrBaseStylesheetId="prBaseStylesheet";var gPrMerchantOverrideStylesheetId="prMerchantOverrideStylesheet";var gStarClasses={"0":{large:"pr-stars-0",small:"pr-stars-0-sm"},"1":{large:"pr-stars-1",small:"pr-stars-1-sm"},"1.5":{large:"pr-stars-1_5",small:"pr-stars-1_5-sm"},"2":{large:"pr-stars-2",small:"pr-stars-2-sm"},"2.5":{large:"pr-stars-2_5",small:"pr-stars-2_5-sm"},"3":{large:"pr-stars-3",small:"pr-stars-3-sm"},"3.5":{large:"pr-stars-3_5",small:"pr-stars-3_5-sm"},"4":{large:"pr-stars-4",small:"pr-stars-4-sm"},"4.5":{large:"pr-stars-4_5",small:"pr-stars-4_5-sm"},"5":{large:"pr-stars-5",small:"pr-stars-5-sm"}};var defaults={pr_merchant_table:{"m9721":{"name":"Adorama","cobranded":"true"}},pr_merchant_id:9721,pr_site_id:null,pr_merchant_group_id:10036,pr_locale:"en_US",pr_read_review:"#ReviewHeader",pr_read_qa:"#QAHeader",pr_write_review:"",pr_ask_question:"",pr_answer_question:"",pr_js_controller_url:"http://services.powerreviews.com/JSController.do",pr_reviews_per_page:10,pr_questions_per_page:10,pr_zip_location:"/",pr_powerreviews_root:"pwr",pr_review_display_usage_tracker_path:"http://cdn.powerreviews.com/aux/",pr_allow_engine_css_override:true,pr_style_sheet:"",pr_analytics_script_src:"",pr_analytics_account:"",pr_badge_definitions_url:"javascript:POWERREVIEWS.common.showSmallPopup('http://www.powerreviews.com/legal/badge_definitions_~~~LOCALE~~~.html', 580, 460)",pr_expert_badge_definitions_url:"javascript:POWERREVIEWS.common.showSmallPopup('http://www.powerreviews.com/legal/expert_badge_definitions_~~~LOCALE~~~.html', 580, 460)",pr_frame_height:3000,pr_base_services_urls:{"-":"http://services.powerreviews.com/"},pr_base_follow_landing_urls:{"-":"http://social.powerreviews.com"},pr_resize_url:"",pr_snippet_min_reviews:0,pr_suppress_google_plus_one:false,pr_source:"web",pr_image_snippet_show_image:showImagePopup,pr_image_snippet_max:7,pr_snippet_star_click:"",pr_back_to_top_link:"#",pr_see_all_reviews_url:"",pr_nbr_displayed_profile_reviews:-1,pr_overwrite_inline_content:false,pr_badge_table:{"11024":{"locales":{"en_CA":{"hovertext":"","description":"","filename":"badge_se_en_CA.gif"},"en_GB":{"hovertext":"Staff Reviewer","description":"A Staff Expert is a merchant or brand employee with recognized expertise within the company who contributes a review based on in-depth knowledge of the product as well as related products.","filename":"badge_se_en_GB.gif"},"pt_BR":{"hovertext":"","description":"","filename":"badge_se_pt_BR.gif"},"en_US":{"hovertext":"Staff Reviewer","description":"A Staff Expert is a merchant or brand employee with recognized expertise within the company who contributes a review based on in-depth knowledge of the product as well as related products.","filename":"badge_se_en_US.gif"},"de_DE":{"hovertext":"Mitarbeiter-Bewerter","description":"","filename":"badge_se_de_DE.gif"},"it_IT":{"hovertext":"","description":"","filename":"badge_se_it_IT.gif"},"fr_CA":{"hovertext":"","description":"","filename":"badge_se_fr_CA.gif"},"jp_JP":{"hovertext":"","description":"","filename":"badge_se_jp_JP.gif"},"fr_FR":{"hovertext":"","description":"","filename":"badge_se_fr_FR.gif"}},"label":"staff-expert","isStaff":true},"11023":{"locales":{"en_CA":{"hovertext":"Staff Reviewer","description":"A Staff Reviewer is a merchant or brand employee who contributes a review based on ownership or usage of the product.","filename":"badge_sr_en_CA.gif"},"en_GB":{"hovertext":"Staff Reviewer","description":"A Staff Reviewer is a merchant or brand employee who contributes a review based on ownership or usage of the product.","filename":"badge_sr_en_GB.gif"},"en_US":{"hovertext":"Staff Reviewer","description":"A Staff Reviewer is a merchant or brand employee who contributes a review based on ownership or usage of the product.","filename":"badge_sr_en_US.gif"},"de_DE":{"hovertext":"Mitarbeiter-Bewerter","description":"","filename":"badge_sr_de_DE.gif"},"fr_CA":{"hovertext":"Critique de personnel","description":"","filename":"badge_sr_fr_CA.gif"},"jp_JP":{"hovertext":"","description":"","filename":"badge_sr_jp_JP.gif"},"fr_FR":{"hovertext":"","description":"","filename":"badge_sr_fr_FR.gif"},"en_AU":{"hovertext":"Staff Reviewer","description":"A Staff Reviewer is a merchant or brand employee who contributes a review based on ownership or usage of the product.","filename":"badge_sr_en_AU.gif"},"nl_NL":{"hovertext":"Staff Beoordeler","description":"A Staff Beoordeler is een handelaar of merk werknemer die beoordelingen inzend op basis van eigendom of gebruik van het product.","filename":"badge_sr_nl_NL.gif"}},"label":"staff","isStaff":true}},pr_attribution_table:{}};var params={};if(window&&window.location&&window.location.search){var query=window.location.search.substring(1).split("&");for(var i=0,len=query.length;i<len;++i){var parts=query[i].split("=");params[parts[0]]=parts[1];}}function getWithPrecedence(name){for(var i=1,len=arguments.length;i<len;++i){var hash=arguments[i];if(hash){var result=hash[name];if(typeof result!="undefined"){return result;}}}return null;}function get(name,options){return getWithPrecedence(name,options,params,window,defaults);}publicScope.common.get=get;function hashIt(str){var h=0;var i;for(i=0;i<str.length;i++){var charCode=str.charCodeAt(i);charCode=charCode*Math.abs(255-charCode);h+=charCode;}h=h%1023;h=h+"";var n=4;var a=h.split("");for(i=0;i<n-h.length;i++){a.unshift("0");}h=a.join("");h=h.substring(0,n/2)+"/"+h.substring(n/2,n);return h;}function prDisplayInit(mainDoc,options){if(gFlagDisplayInitFinished){return true;}else{if(!prDataInit(options)){return false;}}gFlagDisplayInitFinished=true;if(!document.getElementById(gPrBaseStylesheetId)){mainDoc.write('<link rel="stylesheet" href="'+getDocRoot(options)+'/engine/pr_styles_review.css" type="text/css" id="'+gPrBaseStylesheetId+'">\n');}var styleSheet=getDocRoot(options)+"/engine/merchant_styles2.css";var overrideStyleSheet=trim(get("pr_style_sheet",options));if(get("pr_allow_engine_css_override",options)&&overrideStyleSheet){styleSheet=overrideStyleSheet;}if(!document.getElementById(gPrMerchantOverrideStylesheetId)){mainDoc.write('<link rel="stylesheet" href="'+styleSheet+'" type="text/css" id="'+gPrMerchantOverrideStylesheetId+'">\n');}trackRDUsageInstance({"type":"init"},options);setTimeout(function(){trackRDUsageInstance({"type":"objects","count":gNumObjectsRequested},options);},5000);return true;}function prDataInit(options){if(gFlagDataInitFinished){return true;}else{if(!get("pr_page_id",options)&&!get("pr_merchant_user_id",options)){return false;}}gFlagDataInitFinished=true;return true;}function writeContentToDiv(divId,msg,callback){if(!document.getElementById(divId)){setTimeout(function(){writeContentToDiv(divId,msg,callback);},1000);}else{writeContentToDivNested(divId,msg,callback);}}function writeContentToDivNested(divId,msg,callback){try{if(!msg){msg="";}onDomReady(function(){replaceDivContent(document.getElementById(divId),msg);if(callback){callback();}});}catch(e){}}function replaceDivContent(div,content){if(div.parentNode){var newDiv=document.createElement("div");newDiv.id=div.id;newDiv.className=div.className;newDiv.innerHTML=content;div.parentNode.replaceChild(newDiv,div);return newDiv;}else{div.innerHTML=content;return div;}}function onDomReady(callback){if(typeof callback=="function"){(function(){if(isIE()){try{document.documentElement.doScroll("left");}catch(e){setTimeout(arguments.callee,50);return ;}}callback();callback=null;})();}}function isIE(){return typeof document.all!="undefined"&&typeof window.opera=="undefined"&&!(navigator.vendor=="KDE");}function loadImage(src){new Image().src=src;}function getDocRoot(options){var result=get("pr_zip_location",options);if(result.charAt(result.length-1)!="/"){result+="/";}result+=get("pr_powerreviews_root",options);return result;}publicScope.common.getDocRoot=getDocRoot;function clean(pageId){return pageId.replace(/\W/g,"__");}function PRProductData(pageId,fullCount,quickCount,averageRating){this.pageId=pageId;this.fullReviewCount=fullCount;this.quickReviewCount=quickCount;this.averageRating=averageRating;this.getFullReviewCount=function(){return this.fullReviewCount;};this.getQuickReviewCount=function(){return this.quickReviewCount;};this.getAverageRating=function(){return this.averageRating;};this.getPageId=function(){return this.pageId;};}function getInfoFromContents(pageId,locale,products){return products&&products["locales"]&&products["locales"][locale]&&products["locales"][locale]["p"+pageId];}function getRadioValue(radioName){var radioArr=document.getElementsByName(radioName);for(var i=0;i<radioArr.length;i++){if(radioArr[i].checked){return radioArr[i].value;}}return null;}function replaceAll(string,text,by){return string.replace(new RegExp(text,"g"),by);}function trim(trimMe){return trimMe&&trimMe.replace(/^\s+|\s+$/g,"");}function prReplaceCrWithBr(str){if(typeof str=="string"){return str.replace(/\n/g,"<br />");}else{return str;}}function loadObject(url,key,callback,options){var docRoot=getDocRoot(options);var key=key||url.substring(url.indexOf(docRoot)+docRoot.length+1);if(gResult[key]){callback(gResult[key]);}else{var script=document.createElement("script");var handle=function(){if(gResult[key]){if(script.parentNode){script.parentNode.removeChild(script);delete script;}callback(gResult[key]);}};if(isIE()){script.onreadystatechange=handle;}else{script.onload=handle;}script.type="text/javascript";script.charset="utf-8";script.src=url;document.getElementsByTagName("head")[0].appendChild(script);gNumObjectsRequested++;}}function requestDataWithCallback(url,key,callback){gCallbacks[key]=callback;addScript(url);}function addScript(url){var script=document.createElement("script");script.type="text/javascript";script.charset="utf-8";script.src=url;document.getElementsByTagName("head")[0].appendChild(script);}function generalCallback(oData){var key=oData.key;if(key){var callback=gCallbacks[key];if(callback){callback(oData);}}}publicScope.common.generalCallback=generalCallback;function addClassName(objElement,strClass,blnMayAlreadyExist){if(objElement.className){var arrList=objElement.className.split(" ");if(blnMayAlreadyExist){var strClassUpper=strClass.toUpperCase();for(var i=0;i<arrList.length;i++){if(arrList[i].toUpperCase()==strClassUpper){arrList.splice(i,1);i--;}}}arrList[arrList.length]=strClass;objElement.className=arrList.join(" ");}else{objElement.className=strClass;}}function removeClassName(objElement,strClass){if(objElement.className){var arrList=objElement.className.split(" ");var strClassUpper=strClass.toUpperCase();for(var i=0;i<arrList.length;i++){if(arrList[i].toUpperCase()==strClassUpper){arrList.splice(i,1);i--;}}objElement.className=arrList.join(" ");}}function hasClass(element,clsName){var r=new RegExp("\\b"+clsName+"\\b");return r.test(element.className);}function getElementsByClassName(oElm,strTagName,oClassNames){var arrElements=(strTagName=="*"&&oElm.all)?oElm.all:oElm.getElementsByTagName(strTagName);var arrReturnElements=new Array();var arrRegExpClassNames=new Array();if(typeof oClassNames=="object"){for(var i=0;i<oClassNames.length;i++){arrRegExpClassNames.push(new RegExp("(^|\\s)"+oClassNames[i].replace(/\-/g,"\\-")+"(\\s|$)"));}}else{arrRegExpClassNames.push(new RegExp("(^|\\s)"+oClassNames.replace(/\-/g,"\\-")+"(\\s|$)"));}var oElement;var bMatchesAll;for(var j=0;j<arrElements.length;j++){oElement=arrElements[j];bMatchesAll=true;for(var k=0;k<arrRegExpClassNames.length;k++){if(!arrRegExpClassNames[k].test(oElement.className)){bMatchesAll=false;break;}}if(bMatchesAll){arrReturnElements.push(oElement);}}return arrReturnElements;}function getAncestorBy(el,fn){if(fn(el)==true){return el;}else{if(el.parentNode){return arguments.callee(el.parentNode,fn);}else{return false;}}}function insertAfter(referenceNode,newNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);}function registerOptions(key,options){optionsHash[key]=options;if(options){options._key=key;}}function getRegisteredKey(options){if(options){return options["_key"];}else{return"";}}function getOptions(key){return optionsHash[key]||{};}publicScope.common.getOptions=getOptions;function grabContents(pageId,locale,callback,options){var contents=gContentsHash[pageId];if(!contents){loadObject(getDocRoot(options)+"/content/"+hashIt(pageId)+"/contents.js",null,function(obj){contents=getInfoFromContents(pageId,locale,obj);gContentsHash[pageId]=contents?contents:"none";callback(contents);},options);}else{if(contents=="none"){callback(null);}else{callback(contents);}}}function grabRollup(pageId,locale,callback,options){loadObject(getDocRoot(options)+"/content/"+hashIt(pageId)+"/"+pageId+"-"+locale+"-rollup.js",null,function(obj){if(obj){callback(obj.rollup);}},options);}function grabMeta(pageId,locale,callback,options){if(!gMetaInfo){loadObject(getDocRoot(options)+"/content/"+hashIt(pageId)+"/"+pageId+"-"+locale+"-meta.js",null,function(obj){gMetaInfo=obj?obj.metadata:null;callback();},options);}else{callback();}}function grabBatch(pageId,locale,batch,callback,options){if(!gBatchHash[pageId+"-"+batch]){var url=getDocRoot(options)+"/content/"+hashIt(pageId)+"/"+pageId+"-"+locale+"-"+batch+"-reviews.js";loadObject(url,null,function(reviews){var arr=[];for(var i=0;i<reviews.length;i++){var review=reviews[i].r;gReviewHash[review.id]=review;arr.push(review);}gBatchHash[pageId+"-"+batch]=arr;callback();},options);}else{callback();}}function grabBatches(pageId,locale,batches,callback,options){var outstanding=batches.length;for(var i=0;i<batches.length;i++){grabBatch(pageId,locale,batches[i],function(){if(--outstanding<=0){callback();}},options);}}function roundRating(r){return Math.round(r*2)/2;}function trackRDUsageInstance(parameters,options){}function getServicesUrl(overrideKey,relativePath,options){var url;if(overrideKey){url=get(overrideKey,options);}if(!url){urlMap=get("pr_base_services_urls",options);url=urlMap["-"];siteId=get("pr_site_id",options);if(siteId&&urlMap[siteId]){url=urlMap[siteId];}url+=relativePath;}return url;}function getBaseFollowLandingUrl(options){var urlMap=get("pr_base_follow_landing_urls",options);var url=urlMap["-"];var siteId=get("pr_site_id",options);if(siteId&&urlMap[siteId]){url=urlMap[siteId];}url+="/fbonsite/";return url;}function getFacebookManageSettingsUrl(parameters,options){var url=getServicesUrl(null,"FacebookDisplayProfileController.dox",options);var addlParametersString=getParameterStringFromObject(parameters);if(addlParametersString.length){url+="?"+addlParametersString;}return url;}function getFacebookMakeCommentUrl(parameters,options){var url=getServicesUrl(null,"FacebookReviewStatementController.dox?context=STATEMENT",options);var addlParametersString=getParameterStringFromObject(parameters);if(addlParametersString.length){url+="&"+addlParametersString;}return url;}function getFacebookGetAdviceUrl(parameters,options){var url=getServicesUrl(null,"FacebookGetAdviceController/getAdviceQuestionForm.dox",options);var addlParametersString=getParameterStringFromObject(parameters);if(addlParametersString.length){url+="?"+addlParametersString;}return url;}function showFacebookGetAdvicePopup(parameters,options){var pageId=get("pr_page_id",options);var locale=get("pr_locale",options);var merchantGroupId=get("pr_merchant_group_id",options);var siteId=get("pr_site_id",options)||"-";var avgRating=parameters.avgRating||0;var facebookAdviceUrl=getFacebookGetAdviceUrl({"mgId":merchantGroupId,"siteId":siteId,"pageId":pageId,"avgRating":avgRating,"locale":locale},options);showSmallPopup(facebookAdviceUrl,450,600,{"location":"no"});}publicScope.common.showFacebookGetAdvicePopup=showFacebookGetAdvicePopup;function getParameterStringFromObject(parameters){var paramArray=[];for(var param in parameters){paramArray.push(param+"="+prEncode(parameters[param]));}return paramArray.join("&");}function showImagePopup(url,width,height,options){window.open("http://images2.powerreviews.com/media_popup.html?type=image&url="+prEncode(url),"sizedWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width="+width+",height="+height+",top=100,left=100");}publicScope.common.showImagePopup=showImagePopup;window.showImagePopup=showImagePopup;function showSmallPopup(filename,height,width,overrideOptions){var defaultOptions={"toolbar":"no","directories":"no","status":"no","menubar":"no","scrollbars":"yes","resizable":"yes","location":"yes","top":"200","left":"200"};var optionArray=[];for(var opt in defaultOptions){optionArray.push(opt+"="+((overrideOptions&&overrideOptions[opt])||defaultOptions[opt]));}var optionsString=optionArray.join(",");var smallWindow=window.open(filename,"smallWindow","width="+width+",height="+height+","+optionsString);if(window.focus){smallWindow.focus();}}publicScope.common.showSmallPopup=showSmallPopup;window.showSmallPopup=showSmallPopup;function showVideoPopup(url,options){window.open("http://images2.powerreviews.com/media_popup.html?type=video&url="+prEncode(url),"sizedWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=435,height=350,top=100,left=100");}publicScope.common.showVideoPopup=showVideoPopup;window.showVideoPopup=showVideoPopup;function togglePopOut(o,cmd,targ,e){var toggleHide=function(){removeClassName(document.getElementById(o.target),"pr-open");addClassName(document.getElementById(o.target),"pr-closed");};var toggleShow=function(){removeClassName(document.getElementById(o.target),"pr-closed");addClassName(document.getElementById(o.target),"pr-open");};if(window.event){e=window.event;e.cancelBubble=true;target=window.event.srcElement;currentTarget=event.srcElement.id;}else{if(e){e.stopPropagation();target=e.target;currentTarget=e.currentTarget.id;}else{return ;}}if(cmd=="show"){if(document.getElementById(o.target).className!="pr-open"){this.timedShow=setTimeout(toggleShow,400);}else{if(getAncestorBy(target,function(e){if(e.id==o.target){return true;}})){if(this.timedHide!=null){window.clearTimeout(this.timedHide);}}}}else{if(cmd=="hide"){if(this.timedHide!=null){window.clearTimeout(this.timedShow);}if(currentTarget==o.link||currentTarget==o.target||getAncestorBy(target,function(e){if(e.id==o.target){return true;}})){this.timedHide=setTimeout(toggleHide,800);}else{if(this.timedHide!=null){window.clearTimeout(this.timedHide);}}}}}publicScope.common.togglePopOut=togglePopOut;function showElement(elementId){var modalContainer=document.getElementById(elementId);removeClassName(modalContainer,"pr-hidden");}publicScope.display.showElement=showElement;function hideElement(elementId){var modalContainer=document.getElementById(elementId);addClassName(modalContainer,"pr-hidden");}publicScope.display.hideElement=hideElement;function truncateString(string,start,limit,addEllipses){var returnString=string.substring(start,limit);if(addEllipses){returnString+="...";}return returnString;}function copyContents(targ,orig){var content=document.getElementById(orig).innerHTML;writeContentToDiv(targ,content);}function validateEmail(email){var re=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return re.test(email);}function validateAndProcessEmail(el,options){var oData=JSON.parse(el.getAttribute("prData"));var input=document.getElementById(oData.target);var email=input.value;var errorNode=document.getElementById("pr-fb-follow-errorMsg-"+oData.locale+"-"+oData.pageId);if(!hasClass(errorNode,"pr-none")){addClassName(errorNode,"pr-none");}if(validateEmail(email)){var cbFn=function(oResultData){var oResult=oResultData;if(oResult.result.status.toLowerCase()=="ok"){var content=processFollowThankYouTemplate(oData,oData.locale,options);}else{var content=processFollowErrorTemplate(oData,oData.locale,options);}writeContentToDiv("pr-fb-follow-wrapper-"+oData.locale+"-"+oData.pageId,content);};var baseUrl=getBaseFollowLandingUrl(options);var key="verifyFollowEmail-"+oData.type+"-"+oData.keyValue;var url=baseUrl+oData.type+"/"+oData.locale+"/"+oData.merchantGroupId+"/"+oData.siteId+"/"+oData.keyValue+"?email="+encodeURIComponent(email)+"&key="+encodeURIComponent(key);requestDataWithCallback(url,key,cbFn);input.disabled=true;var throbber=document.createElement("img");throbber.src=getDocRoot(options)+"/engine/images/pr_loading.gif";throbber.style.cssText="float:right;padding:0 20px";insertAfter(el,throbber);addClassName(el,"pr-none");}else{removeClassName(errorNode,"pr-none");}}publicScope.common.validateAndProcessEmail=validateAndProcessEmail;var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(input){var output="";var chr1,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;input=Base64._utf8_encode(input);while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else{if(isNaN(chr3)){enc4=64;}}output=output+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);}return output;},decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<input.length){enc1=this._keyStr.indexOf(input.charAt(i++));enc2=this._keyStr.indexOf(input.charAt(i++));enc3=this._keyStr.indexOf(input.charAt(i++));enc4=this._keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);}if(enc4!=64){output=output+String.fromCharCode(chr3);}}output=Base64._utf8_decode(output);return output;},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}else{if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}}return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=0;var c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}else{if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}}return string;}};var JSON;if(!JSON){JSON={};}(function(){function f(n){return n<10?"0"+n:n;}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key);}if(typeof rep==="function"){value=rep.call(holder,key,value);}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null";}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null";}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v;}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v);}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v;}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" ";}}else{if(typeof space==="string"){indent=space;}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify");}return str("",{"":value});};}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}return reviver.call(holder,key,value);}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);});}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j;}throw new SyntaxError("JSON.parse");};}}());function getIframeSourceUrl(options){var iframeSource=[];var appName=get("pr_app_name",options)||get("appName",options);var pageId=get("pr_page_id",options);if(!appName||appName==""||appName=="reviewSubmit"||appName=="submitReview"){var submitReviewUrl=getBaseSubmitReviewUrl(options);iframeSource.push(submitReviewUrl);iframeSource.push(submitReviewUrl.indexOf("?")>=0?"&":"?");iframeSource.push("pageId=");iframeSource.push(pageId);}else{if(appName=="askQuestion"){var askQuestionUrl=getBaseAskQuestionUrl(options);iframeSource.push(askQuestionUrl);iframeSource.push(askQuestionUrl.indexOf("?")>=0?"&":"?");iframeSource.push("pageId=");iframeSource.push(pageId);}else{if(appName=="answerQuestion"){var answerQuestionUrl=getBaseAnswerQuestionUrl(options);var questionId=get("pr_question_id",options)||get("questionId",options);iframeSource.push(answerQuestionUrl);iframeSource.push(answerQuestionUrl.indexOf("?")>=0?"&":"?");iframeSource.push("pageId=");iframeSource.push(pageId);iframeSource.push("&questionId=");iframeSource.push(questionId);}else{if(appName=="leaderboard"){return getLeaderboardUrl(options);}}}}var merchantId=get("pr_merchant_id",options);if(merchantId){iframeSource.push("&merchantId=");iframeSource.push(merchantId);}var promoCode=get("pr_promo_code",options);if(promoCode){iframeSource.push("&promoCode=");iframeSource.push(promoCode);}var merchantUserEmail=get("pr_merchant_user_email",options);if(merchantUserEmail){iframeSource.push("&merchantUserEmail=");iframeSource.push(merchantUserEmail);}var merchantUserId=get("pr_merchant_user_id",options)||get("pr_user_id",options);if(merchantUserId){iframeSource.push("&merchantUserId=");iframeSource.push(merchantUserId);}var locale=get("pr_locale",options);if(locale){if(locale=="en"){locale="en_US";}else{if(locale=="fr"){locale="fr_CA";}}iframeSource.push("&locale=");iframeSource.push(locale);}var merchantGroupId=get("pr_merchant_group_id",options);if(merchantGroupId){iframeSource.push("&merchantGroupId=");iframeSource.push(merchantGroupId);}var siteId=get("pr_site_id",options);if(siteId){iframeSource.push("&siteId=");iframeSource.push(siteId);}var styleSheet=get("pr_style_sheet",options);if(styleSheet){iframeSource.push("&cssOverride=");iframeSource.push(styleSheet);}var source=get("pr_source",options);iframeSource.push("&source=");iframeSource.push(source);var extraInfoStr="";var extraInfoHash=get("pr_extra_info",options);if(extraInfoHash&&typeof extraInfoHash=="object"){for(var oneKey in extraInfoHash){if(typeof oneKey=="string"&&extraInfoHash.hasOwnProperty(oneKey)){extraInfoStr+=oneKey+"^^"+extraInfoHash[oneKey];extraInfoStr+="#";}}}var orderId=get("pr_order_id",options);if(orderId){extraInfoStr+="order_id^^"+orderId+"#";}if(extraInfoStr){iframeSource.push("&extraInfo=");iframeSource.push(prEncode(extraInfoStr));}var nickname=get("pr_reviewer_nickname",options);if(nickname){iframeSource.push("&reviewerNickname=");iframeSource.push(nickname);}var reviewerLocation=get("pr_reviewer_location",options);if(reviewerLocation){iframeSource.push("&reviewerLocation=");iframeSource.push(reviewerLocation);}var reviewerType=get("pr_reviewer_type",options);if(reviewerType){iframeSource.push("&reviewerType=");iframeSource.push(reviewerType);}var reviewRating=get("pr_rating",options);if(reviewRating){iframeSource.push("&reviewRating=");iframeSource.push(reviewRating);}var campaignId=get("pr_campaign_id",options);if(campaignId){iframeSource.push("&campaignId=");iframeSource.push(campaignId);}var callbackEndReviewTemplate=get("pr_callback_end_review_template",options);if(callbackEndReviewTemplate){iframeSource.push("&callbackEndReviewTemplate=");iframeSource.push(callbackEndReviewTemplate);}var pageIdVariant=get("pr_page_id_variant",options);if(pageIdVariant){iframeSource.push("&variant=");iframeSource.push(pageIdVariant);}var returnUrl=get("pr_return_url",options);if(returnUrl){iframeSource.push("&returnUrl=");iframeSource.push(prEncode(returnUrl));}var resizeUrl=get("pr_resize_url",options);if(resizeUrl){iframeSource.push("&resizeUrl=");iframeSource.push(prEncode(resizeUrl));}else{var appLaunchSrc="";var scriptElems=document.getElementsByTagName("script");for(var i=0;i<scriptElems.length;i++){var src=scriptElems[i].getAttribute("src");if(src&&src.indexOf("appLaunch.js")>=0){appLaunchSrc=src;break;}}iframeSource.push("&windowLocation=");iframeSource.push(prEncode(window.location));iframeSource.push("&appLaunchSrc=");iframeSource.push(prEncode(appLaunchSrc));}var uniqueReviewId=get("pr_unique_review_id",options);if(uniqueReviewId){iframeSource.push("&uniqueReviewId=");iframeSource.push(uniqueReviewId);}return iframeSource.join("");}publicScope.submission.getIframeSourceUrl=getIframeSourceUrl;function writeOutIframe(options){var iframeSourceUrl=getIframeSourceUrl(options);var frameHeight=get("pr_frame_height",options);document.write("<iframe id='submitReviewIframe' src='"+iframeSourceUrl+"' frameborder='0' height='"+frameHeight+"' width='100%' allowTransparency='true' scrolling='auto'></iframe>");}publicScope.submission.writeOutIframe=writeOutIframe;function findY(obj){var result=0;if(obj&&obj.offsetParent){do{result+=obj.offsetTop;}while(obj=obj.offsetParent);}return result;}function updateIframe(h,t,options){if(typeof h=="number"){document.getElementById("submitReviewIframe").setAttribute("height",h);}if(typeof t=="number"&&t>0){var y=0;var scrollToId=get("pr_scroll_to_id",options);if(scrollToId){y=findY(document.getElementById(scrollToId));}window.scroll(0,y);}}publicScope.submission.updateIframe=updateIframe;function getBaseSubmitReviewUrl(options){return getServicesUrl("pr_submit_review_url","SubmitReview.do",options);}function getBaseAskQuestionUrl(options){return getServicesUrl("pr_ask_question_url","SubmitQuestion.dox",options);}function getBaseAnswerQuestionUrl(options){return getServicesUrl("pr_answer_question_url","SubmitAnswer.dox",options);}function getLeaderboardUrl(options){var result=[];var baseUrl=getBaseFollowLandingUrl(options);var siteId=prEncode(get("pr_site_id",options)||"-");var locale=get("pr_locale",options);var merchantGroupId=get("pr_merchant_group_id",options);result.push(baseUrl);result.push("profileLeaderboard/");result.push(locale+"/");result.push(merchantGroupId+"/");result.push(siteId+"/");return result.join("");}return publicScope;})();POWERREVIEWS.submission.writeOutIframe();
