﻿
Hangtag.prototype = new Postcard();

function Hangtag(PM) {
    if (typeof Postcard != 'function') {
        alert('You must include postcard.js, as Hangtag inherits from it');
        return;
    }

    this.RoundCorner = null;
    this.HolePunch = null;

    this.OptionsFees = function(SizeIn, Quantity, Price) {
        if (arguments.length != 3)
            alert('OptionsFees() missing required parameters Size, Quantity, Price');

        // Round corner and punch is $75 setup for one or $100 setup for both, plus $5/M for either ($10/M for both).

        var setupFee = 0;
        var runMult = 0;
        if ((this.RoundCorner != null) && (this.RoundCorner == true)) {
            setupFee += 75;
            runMult += 1;
        }
        if ((this.HolePunch != null) && (this.HolePunch == true)) {
            setupFee += 75;
            runMult += 1;
        }
        setupFee = Math.min(setupFee, 100);

        var runFee = parseInt((runMult * 5) * (Quantity / 1000));
        var temp = setupFee + runFee;
        return temp;
    }
}
