function PaymentEstimator(myDivName,movie,shaderFrameName,isDynamic,pePlaceHolderName,isMultiplePEPage,onLoadFunc){if(!movie){movie="paymentestimator";}
this.myDiv=myDivName;this.shaderFrameName=shaderFrameName;this.placeHolder=pePlaceHolderName;this.pricing=new Object();this.movie=movie;this.peInitLeft=0;this.peInitTop=0;this.peLeft=0;this.peTop=0;this.initZIndex=0;this.isDynamic=(isDynamic===true)?true:false;this.isMultiplePEPage=(isMultiplePEPage===true)?true:false;this.stateToken=document.mainform.st.value;this.isSwfLoaded=false;this.onLoadCallback=(onLoadFunc==null||onLoadFunc==undefined||onLoadFunc=='undefined')?null:onLoadFunc;this.disclaimers=new Object();this.incentiveDisclaimers=new Object();}
PaymentEstimator.prototype.resize=function(newWidth,newHeight,resetPos,backgroundRefresh){if(backgroundRefresh!=true){backgroundRefresh=false;}
var peDiv=getDocObj(this.myDiv);var pePlaceHolderDiv=(!this.placeHolder)?null:getDocObj(this.placeHolder);var shaderFrame=getDocObj(this.shaderFrameName);var shaderBackgroundDiv=getDocObj('shadeBackgroundDiv');var peBorderAdjustment=2;if((peDiv!=null)&&(peDiv!=undefined)){if(parseInt(newHeight)<0){newHeight=peDiv.getHeight();}
if(parseInt(newWidth)<0){newWidth=peDiv.getWidth();}
newHeight=parseInt(newHeight)+peBorderAdjustment;newWidth=parseInt(newWidth)+peBorderAdjustment;peDiv.setHeight(newHeight);peDiv.setWidth(newWidth);if(!backgroundRefresh){if(resetPos){this.place(this.peInitLeft,this.peInitTop);if(this.initZIndex!=0){peDiv.setZIndex(this.initZIndex);}
this.resizePlaceHolder(newWidth,newHeight);shaderFrame.unDisplay();shaderFrame.hide();shaderBackgroundDiv.setHeight(0);shaderBackgroundDiv.hide();if(positionPaymentEstimator!=null||positionPaymentEstimator!=undefined){positionPaymentEstimator();}
}else{var toTop=this.peTop;if(this.isDynamic){toTop+=getScrollXY().y;}
this.place(this.peLeft,toTop);if(topZIndex!=(parseInt(peDiv.getZIndex())-1)){this.initZIndex=peDiv.getZIndex();}
if(topZIndex!=undefined&&topZIndex!=null)
{shaderBackgroundDiv.setZIndex(topZIndex);peDiv.setZIndex(sumInt(topZIndex,1));}
shaderBackgroundDiv.show();if(_isIE)
{shaderFrame.display();shaderFrame.show();}
shaderBackgroundDiv.setHeight(5000);}
}else{if(resetPos){this.resizePlaceHolder(newWidth,newHeight);}
}
}
}
PaymentEstimator.prototype.resizePlaceHolder=function(newWidth,newHeight){var pePlaceHolderDiv=(!this.placeHolder)?null:getDocObj(this.placeHolder);if(pePlaceHolderDiv!=null){pePlaceHolderDiv.setHeight(newHeight);pePlaceHolderDiv.setWidth(newWidth);}
}
PaymentEstimator.prototype.place=function(newLeft,newTop){var divName=getDocObj(this.myDiv);divName.setTop(newTop);divName.setLeft(newLeft);}
PaymentEstimator.prototype.getName=function(){return(this.movie);}
PaymentEstimator.prototype.setStateToken=function(stateTokenString){this.stateToken=stateTokenString;if(!this.isMultiplePEPage){this.writeStateToken();}
}
PaymentEstimator.prototype.writeStateToken=function(){setStateToken(this.stateToken);}
PaymentEstimator.prototype.setLoadedState=function(state){this.isSwfLoaded=(state=='true');if(this.onLoadCallback!=null&&this.onLoadCallback!=undefined&&this.onLoadCallback!='undefined'){this.onLoadCallback.call(null,this.movie);}
}
PaymentEstimator.prototype.getLoadedState=function(){return this.isSwfLoaded;}
PaymentEstimator.prototype.setPricingDisclosureShown=function(){if(setPricingDisclosureShown!=null&&setPricingDisclosureShown!=undefined&&setPricingDisclosureShown!='undefined'){setPricingDisclosureShown(this.movie,this.stateToken);}
}
PaymentEstimator.prototype.displayDisclaimer=function(id,displayBool){this.disclaimers[id]=displayBool;displayInventoryDisclaimer();}
PaymentEstimator.prototype.displayIncentiveDisclaimer=function(id,display){this.incentiveDisclaimers[id]=display;displayInventoryIncentiveDisclaimers();}
PaymentEstimator.prototype.clearIncentiveDisclaimer=function(){this.incentiveDisclaimers=new Object();}
