Array.prototype.compare = function(array, sorted) {
if (this.length != array.length) {
return false; 
}
if(sorted) {
this.sort();
array.sort();
}

for (var i = 0, loopCnt = array.length; i < loopCnt; i++) { 
if (this[i].compare) {
if (!this[i].compare(array[i])) {
return false;
}
}
if (this[i] !== array[i]) {
return false;
}
}
return true;
};

Array.prototype.contains = function(value, fnEquals) {
for (var arrayItem in this)
{
if (this[arrayItem].length == value.length)
{
return (typeof(fnEquals) != 'undefined') ? fnEquals(value, this[arrayItem]) : (value == this[arrayItem]);
}
}
return false;
};
// Sets the display style for a group of objects with the same name.
function DisplayObjects(tagName, objectsName, show) {
 var domObjects = QuerySelectorAll(tagName, objectsName);
 if (domObjects && domObjects.length) {
 for (var i = 0, loopCount = domObjects.length; i < loopCount; i++) {
 domObject = document.getElementById(domObjects[i].id);
 if (domObject) {
 domObject.style.display = show ? "" : "none";
 }
 }
 }
}

function EmptyStringIfNull(value) {
 if (value == null) {
 return "";
 }
 else {
 return value;
 }
}

function GetCssClassPropertyValue(CssClass, Property) {
 for (var i = 0, loopCount = document.styleSheets.length; i < loopCount; i++) {
 var Rules = (document.styleSheets[i]["rules"]) ? "rules" : "cssRules";
 var SheetRules = document.styleSheets[i][Rules];
 if (typeof (SheetRules) != "undefined") {
 for (var j = 0, loopCount2 = SheetRules.length; j < loopCount2; j++) {
 if (SheetRules[j].selectorText == CssClass) {
 if (SheetRules[j].style[Property]) {
 return SheetRules[j].style[Property];
 }
 }
 }
 }
 }
}

function SetCssClassPropertyValue(CssClass, Property, Value) {
 for (var i = 0, loopCount = document.styleSheets.length; i < loopCount; i++) {
 var Rules = (document.styleSheets[i]["rules"]) ? "rules" : "cssRules";
 var SheetRules = document.styleSheets[i][Rules];
 if (typeof (SheetRules) != "undefined") {
 for (var j = 0, loopCount2 = SheetRules.length; j < loopCount2; j++) {
 if (SheetRules[j].selectorText == CssClass) {
 if (SheetRules[j].style[Property]) {
 SheetRules[j].style[Property] = Value;
 break;
 }
 }
 }
 }
 }
}

function ScrollToElement(element, noScrollX, additionaOffsetY) {
 var selectedPosX = 0;
 var selectedPosY = 0;

 while (element != null) {
 selectedPosY += element.offsetTop;
 if (!noScrollX) {
 selectedPosX += element.offsetLeft;
 }
 element = element.offsetParent;
 }
 
 if (additionaOffsetY != null) {
 selectedPosY += additionaOffsetY;
 if (selectedPosY < 0) {
 selectedPosY = 0;
 }
 }
 window.scrollTo(selectedPosX, selectedPosY);
}

function GetElementPositionOnPage(element) {
 var selectedPosX = 0;
 var selectedPosY = 0;

 while (element != null) {
 selectedPosY += element.offsetTop;
 selectedPosX += element.offsetLeft;
 element = element.offsetParent;
 }

 elementPosition = new Object();
 elementPosition["posX"] = selectedPosX;
 elementPosition["posY"] = selectedPosY;
 return elementPosition;
}

function CreateForm(target, action, method) {
 var form = document.createElement("form");
 if (typeof (method) == "undefined") {
 method = "post";
 }
 form.setAttribute("method", method);
 form.setAttribute("action", action);
 form.setAttribute("target", target);
 document.body.appendChild(form);
 return form;
}

function AddFormField(form, field, value) {
 var hiddenField = document.createElement("input");
 hiddenField.setAttribute("name", field);
 hiddenField.setAttribute("value", value);
 form.appendChild(hiddenField);
}

function SetSelectedSingleValue(element, value) {
 if (value === null) {
 value = "";
 } 
 var selectedValueFound = false;
 for (var i = 0; i < element.options.length; i++) {
 if (element.options[i].value == value) {
 element.options[i].selected = true;
 selectedValueFound = true;
 break;
 } else {
 element.options[i].selected = false;
 }
 }
 return selectedValueFound;
}

function parseIntNull(value) {
 var intValue = parseInt(value);
 if (isNaN(intValue)) {
 return null;
 }
 else {
 return intValue;
 }
}

function parseFloatNull(value) {
 var floatValue = parseFloat(value);
 if (isNaN(floatValue)) {
 return null;
 }
 else {
 return floatValue;
 }
}

function GetPropertyName(obj, val) {
 for (var propName in obj) {
 if (obj[propName] == val) {
 return propName;
 }
 }
 return null;
}

function NumberIsRequired(element, defaultVal, minimumValue, maximumValue) {
 if (typeof (element) != "undefined") {
 var Pattern = /([\s]+)|([^0-9,-.]+)|([-.]+$)|-(?!\d|\.)|-(?=.-)|\.(?!\d)|\.(?=\d*\.)|^00+|^-(?=0+)/g;
 var value = element.value.replace(Pattern, "");
 if (value == "") {
 if (typeof (defaultVal) == "undefined") {
 defaultVal = 0;
 }
 value = defaultVal;
 }
 if (typeof (minimumValue) != "undefined" && value < minimumValue) {
 value = minimumValue;
 }
 if (typeof (maximumValue) != "undefined" && value > maximumValue) {
 value = maximumValue;
 }
 element.value = value;
 }
}

function IsNumberEvent(event, allowDecimal, signed, allowComma) {
 if (!((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode == 46 && allowDecimal) || (event.keyCode == 45 && signed) || (event.keyCode == 44 && allowComma))) {
 event.returnValue = false;
 }
}

function GetDOMElement(elemId) {
return document.getElementById(elemId);
}

function $(elemId) {
return GetDOMElement(elemId);
}

function CopyTextToClipboard(str) {
if (window.clipboardData && window.clipboardData.setData) {
window.clipboardData.setData("Text", str);
}
}

function AttachUnloadHandler() {
if (IE4OrNewer) {
document.body.onbeforeunload = HandleUnload;
}
else {
window.onunload = HandleUnload;
}
}

function GetCheckedValue(elemObj) {
 if (elemObj) {
 if (elemObj.type == "radio" || elemObj.type == "hidden") {
 return elemObj.value;
 }
 else {
 for (var i = 0; i < elemObj.length; i++) {
 if (elemObj[i].checked) {
 return elemObj[i].value;
 }
 }
 }
 }
 return null;
}

function SetCheckedVal(elemObj, val) {
 if (elemObj.type == "radio") {
 if (elemObj.value == val) {
 elemObj.checked = true;
 elemObj[i].focus();
 }
 }
 else {
 for (var i = 0; i < elemObj.length; i++) {
 if (elemObj[i].value == val) {
 elemObj[i].checked = true;
 elemObj[i].focus();
 }
 }
 }
}

function DOMInsertAdjacentHTML(elemObj, sWhere, sText, newNode) {
try {
if (IE4OrNewer && !Opera) {
elemObj.insertAdjacentHTML(sWhere, sText);
}
else if (NS6OrNewer) {
if (typeof (newNode) == 'undefined') {
var newRange = document.createRange();
newRange.setStartBefore(elemObj);
newNode = newRange.createContextualFragment(sText);
}
if (sWhere == 'beforeBegin') {
elemObj.parentNode.insertBefore(newNode, elemObj);
}
else if (sWhere == 'afterBegin') {
elemObj.insertBefore(newNode, elemObj.firstChild);
}
else if (sWhere == 'beforeEnd') {
elemObj.appendChild(newNode);
}
else if (sWhere == 'afterEnd') {
if (elemObj.nextSibling) {
elemObj.parentNode.insertBefore(newNode,elemObj.nextSibling);
}
else {
elemObj.parentNode.appendChild(newNode);
}
}
}
}
catch (e) {
}
}

function AddPrefixToListItem(listItemID, isSelected, prefix, prefixBlank) {
if (typeof(prefix) == 'undefined') {
prefix = '<span class="attention" style="font-family:Courier New; font-size:12px;"><b>*</b></span>';
}
if (typeof(prefixBlank) == 'undefined') {
prefixBlank = prefix.replace('*', '&nbsp;');
}
DOMInsertAdjacentHTML($(listItemID), "beforeBegin", (isSelected) ? prefix : prefixBlank);
}

function Trim(theString, additionalCharacters, trimAllWhiteSpace, specificCharacters) {
if (theString == "") {
return theString;
}
var trimCharacters = " ";
if (additionalCharacters != null && additionalCharacters != "") {
trimCharacters += additionalCharacters;
}
if (trimAllWhiteSpace == true) {
trimCharacters += "\t\n\r\f\v";
}
if (specificCharacters != null && specificCharacters != "") {
trimCharacters = specificCharacters;
}
var newString = theString;
while (trimCharacters.indexOf(newString.substring(0, 1)) >= 0) {
newString = Right(newString, newString.length - 1);
}
while (trimCharacters.indexOf(newString.substring(newString.length - 1, newString.length)) >= 0) {
newString = Left(newString, newString.length - 1);
}
return newString;
}

function TrimSpace(str) {
return( (""+str).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') );
}

function IsInList(strList, strItem, bolCaseSensitive) {
if (strList == "" || strItem == "") {
return false;
}
var tempList;
var tempItem;
if (bolCaseSensitive) {
tempList = strList;
tempItem = strItem;
} else {
tempList = strList.toLowerCase();
tempItem = strItem.toLowerCase();
}
var commaEndedList = "," + Trim(tempList) + ",";
var itemWithCommas = "," + Trim(tempItem) + ",";
var itemWithCommasAndSpace = ", " + Trim(tempItem) + ",";
var itemWithCommasFound = commaEndedList.indexOf(itemWithCommas) >= 0;
var itemWithCommasAndSpaceFound = commaEndedList.indexOf(itemWithCommasAndSpace) >= 0;
if (itemWithCommasFound || itemWithCommasAndSpaceFound) {
return true;
} else {
return false;
}
}

function StripNonNumeric(theString, additionalCharacters, allowNegatives){
var returnString, i, currentCharacter;
var validChars = "0123456789";
if (additionalCharacters != null) {
validChars += additionalCharacters;
}

returnString = "";
for (i = 0; i < theString.length; i++) {
currentCharacter = theString.charAt(i);
if (validChars.indexOf(currentCharacter) >= 0 || (allowNegatives && i == 0 && currentCharacter == "-")) {
returnString += currentCharacter;
}
}
return returnString;
}

function StripHtmlTags(html) {
 var l = html.length;
 var inside = false;
 var text = '';
 for (var i = 0; i < l; i++) {
 if (html.substr(i, 1) == '<') inside = true;
 if (!inside) text += html.substr(i, 1);
 if (html.substr(i, 1) == '>') inside = false;
 }
 return text;
}

function PreloadImages(imgArr, imgDir) {
if (imgArr.length > 0) {
var imgCacheArr = new Array();
for (var i = 0, loopCnt = imgArr.length; i < loopCnt; i++) {
imgCacheArr[i] = new Image();
imgCacheArr[i].src = ((imgDir) ? imgDir + '/' : '') + imgArr[i];
}
}
}

function FormatNum(num, decimalPlaces, appendZeros, insertCommas) {
var powerOfTen = Math.pow(10, decimalPlaces);
num = Math.round(num * powerOfTen) / powerOfTen;
if (!appendZeros && !insertCommas) {
return num;
}
else {
var stringNum = num.toString();
var posDecimal = stringNum.indexOf(".");
 if (appendZeros) {
 var zeroToAppendCnt = 0;
 if (posDecimal < 0) {
 stringNum += ".";
 zeroToAppendCnt = decimalPlaces;
 }
 else {
 zeroToAppendCnt = decimalPlaces - (stringNum.length - posDecimal - 1);
 }
 for (var i = 0; i < zeroToAppendCnt; i++) {
 stringNum += "0";
 }
}
if (insertCommas && (Math.abs(num) >= 1000)) {
var i = stringNum.indexOf(".");
if (i < 0) {
i = stringNum.length;
}
i -= 3;
while (i >= 1) {
stringNum = stringNum.substring(0, i) + ',' + stringNum.substring(i, stringNum.length);
i -= 3;
}
}
return stringNum;
}
}

function FormatPrice(num, precision) {
 if (precision == null || precision == 'undefined') {
 precision = 2;
 }
 if (precision == 0) {
 return '$' + FormatNum(num, precision, false, true);
 }
 else {
 return '$' + FormatNum(num, precision, true, true);
 }
}

function FormatDollar(num) {
return parseFloat(FormatNum(num, 2));
}

function ConvertCentsToDollars(num) {
return Math.round(num) / 100;
}

function SetRadioButtonListDisabled(rblName, isDisabled, selIdx) {
var coll = document.getElementsByName(rblName);
for (var i = 0, loopCnt = coll.length; i < loopCnt; i++) {
SetRadioButtonDisabled(coll[i], isDisabled, i);
if (isDisabled && typeof(selIdx) != 'undefined' && i == selIdx) {
coll[i].checked = true;
}
}
}

function SetRadioButtonDisabled(rbElem, isDisabled, rbIndex) {
rbElem.disabled = isDisabled;
var parentElem = rbElem.parentNode;
parentElem.disabled = isDisabled;
if (typeof(rbIndex) == 'undefined' || rbIndex == 0) {
parentElem = parentElem.parentNode;
var parentElemTagName = parentElem.tagName.toLowerCase();
if (parentElemTagName == 'span') {
parentElem.disabled = isDisabled;
}
else if (parentElemTagName == 'td') {
parentElem.parentNode.parentNode.parentNode.disabled = isDisabled;
}
}
}

function SetRadioButtonListChecked(rblName, rblVal) {
var coll = document.getElementsByName(rblName);
if (coll) {
for (var i = 0, loopCnt = coll.length; i < loopCnt; i++) {
coll[i].checked = (coll[i].value == rblVal);
}
}
}

function SetValue(name, setValue) {
 var elem = $(name);
 if (elem) {
 elem.value = setValue;
 }
}

function Left(theString, intLength) {
return theString.substring(0, intLength);
}

function Right(theString, intLength) {
return theString.substring(theString.length - intLength, theString.length);
}

function ReplaceSubstring(wholeString, substringToFind, replacementString) {
// This function is case sensitive
var tempArray = wholeString.split(substringToFind);
return tempArray.join(replacementString);
}

function ParseInt(num) {
return (num) ? parseInt(num) : num;
}

// window.open helper
function windowOpenHelper(sURL, sName, sFeatures, bReplace) {
var hWnd = window.open(sURL, sName, sFeatures, bReplace);
hWnd.focus();// if a window was already open this will bring it to the top
}

//convert string to boolean
function parseBool(value) {
return (value == 'true');
}

//get radio checked value by Name not ID
function GetRadioCheckedValueByName(rblName) {
 var inkElem = document.getElementsByName(rblName); //use name not id
 var ink = "";
 if (typeof (inkElem) != 'undefined' && inkElem.length > 0) {
 for (var i = 0; i < inkElem.length; i++) {
 if (inkElem[i].checked) {
 return inkElem[i].value;
 }
 }
 }
 return ink;
}

function RemoveAllOptions(selectbox) {
for (var i = selectbox.options.length - 1; i >= 0; i--) {
selectbox.remove(i);
}
}

function AddOption(selectbox, text, value) {
var optn = document.createElement("option");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}

//check if an array contains a given element
function Contains(array, element) {
 for (var index = 0, loopCount = array.length; index < loopCount; index++) {
 if (array[index] == element) {
 return true;
 }
 }
 return false;
}

// Return whether a hierarchy of properties exist in the object and returns it if it exists, otherwise returns null
function Exists(obj, props) {
if (typeof (obj) != 'undefined') {
var curObj = obj;
for (var i = 0, loopCnt = props.length; i < loopCnt; i++) {
if (typeof (curObj[props[i]]) == 'undefined') {
return null;
}
curObj = curObj[props[i]];
}
return curObj;
}
return null;
}

//returns the value from the query string based on the key passed in
function GetQueryStringValue(key) {
var querystring = window.location.search.substring(1);
var querystringArray = querystring.split("&");
var current;
for (var i = 0, loopCnt = querystringArray.length; i < loopCnt; i++) {
current = querystringArray[i].split("=");
if (current.length == 2 && current[0] == key) {
return current[1];
}
}
return '';
}

// Deep copy of object properties.
// Should be prototype of Object, but Object.prototype's interfear with AJAX.
function CopyTo(source, destination) {
 if (typeof (source) !== 'object' || source === null) {
 return source;
 }
 
// if (typeof (destination) !== typeof (source)) {
// destination = new source.constructor();
// }

 if (typeof (destination) == 'undefined') {
 var destination = new source.constructor();
 }

 for (var i in source) {
 if (source.hasOwnProperty(i)) {
 destination[i] = CopyTo(source[i], destination[i]);
 }
 }

 return destination;
};

function QuerySelectorAll(tagName, objName) {
if (objName) {
var domObjects;
if (typeof (document.querySelectorAll) != 'undefined') {
domObjects = document.querySelectorAll(tagName + '[name=' + objName + ']');
}
if (domObjects && domObjects.length) {
return domObjects;
}
else {
domObjects = document.getElementsByName(objName);
if (domObjects == null || domObjects.length == 0) {
domObjects = document.getElementsByTagName(tagName);
if (domObjects) {
var retObjects = new Array();
for (var i = 0, loopCnt = domObjects.length; i < loopCnt; i++) {
if (domObjects[i].name == objName) {
retObjects.push(domObjects[i]);
}
}
if (retObjects.length > 0) {
return retObjects;
}
}
}
}
}
return null;
}

//tooltip stuff
var tooltipElem;

function ShowTooltip(evnt, tooltipText) {
 if (typeof (tooltipElem) == 'undefined') {
 CreateTooltip();
 }
 if (tooltipElem) {
 tooltipElem.innerHTML = tooltipText;
 tooltipElem.style.left = (GetMouseX(evnt) + TOOLTIP_OFFSET_X + GetPageScrollLeft()) + 'px';
 tooltipElem.style.top = (GetMouseY(evnt) + TOOLTIP_OFFSET_Y + GetPageScrollTop()) + 'px';
 tooltipElem.style.display = '';
 }
}

function HideTooltip() {
 if (tooltipElem) {
 tooltipElem.style.display = 'none';
 }
}

function CreateTooltip() {
 tooltipElem = document.createElement('div');
 tooltipElem.id = TOOLTIP_ID;
 tooltipElem.name = tooltipElem.id;
 tooltipElem.className = TOOLTIP_CSS_NAME;
 tooltipElem.style.position = 'absolute';
 tooltipElem.style.zIndex = TOOLTIP_Z_INDEX;
 document.body.appendChild(tooltipElem);
 tooltipElem = document.getElementById(tooltipElem.id);
}

function GetMouseX(evnt) {
 return (evnt.clientX) ? evnt.clientX : (evnt.pageX) ? evnt.pageX : 0;
}

function GetMouseY(evnt) {
 return (evnt.clientY) ? evnt.clientY : (evnt.pageY) ? evnt.pageY : 0;
}

function GetPageScrollLeft() {
 if (document.all) {
 return (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
 }
 else if (typeof (window.pageXOffset) != 'undefined') {
 return window.pageXOffset;
 }
}

function GetPageScrollTop() {
 if (document.all) {
 return (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
 }
 else if (typeof (window.pageYOffset) != 'undefined') {
 return window.pageYOffset;
 }
}

function InitTooltip(objID, tooltipText) {
 var obj = document.getElementById(objID);
 AddEventHandler(obj, 'mouseover', function(evnt) { ShowTooltip(evnt, tooltipText); });
 AddEventHandler(obj, 'mouseout', function(evnt) { HideTooltip(); });
}//This function is used to check if email address is valid
function ChkEmail(theAddress) 
{
 var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.@";
 var checkStr = TrimSpace(theAddress);
 var allValid = true;
 
 for (i = 0; i < checkStr.length; i++)
 {
 ch = checkStr.charAt(i);
 for (j = 0; j < checkOK.length; j++){
 if (ch == checkOK.charAt(j)) {
 break;
}
 }
 if (j == checkOK.length)
 {
 allValid = false;
 break;
 }
 }
if (theAddress == "")
{alert("Email is a required field!");
return false;
}

if (theAddress.indexOf("@") == -1) 
{alert("Sorry, the email address you entered does not contain an '@' symbol.");
return false;
}

if (theAddress.indexOf(".") == -1) 
{alert("Sorry, the email address you entered does not contain a '.' symbol.");
return false;
}

if (theAddress.indexOf("@.") != -1) 
{
alert("Sorry, the email address you entered is missing a valid character after the '@' sign and before the first period.");
return false;
}

if (theAddress.indexOf("@") == 0) 
{
alert("Sorry, the email address you entered is missing a valid character before the '@' sign.");
return false;
}
if (!allValid)
{
alert("Sorry, the email address you entered contains invalid characters.");
return false;
}
else
{ 
return true;
} 
}

function TrimSpace(str) {
return( (""+str).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') );
}
//IMPORTNANT//
//Needs to be included before /CommonWeb/JavaScript/InstaPrice/StandardValidation.js
//Is included in combinedgzip.js for ordering pages

// Determine whether status is PUBLIC, INTERNAL, TRAINING, OR DEVELOPMENT
// DEFAULT IS PUBLIC !!!!!
var url = window.location.href.toUpperCase();

var DEV01 = url.indexOf("DW-"); //DevLocal
var DEV02 = url.indexOf("P1-"); //DevLocal
var DEV03 = url.indexOf("LOCALHOST");
var DEV04 = url.indexOf("AL-");
var DEV05 = url.indexOf("COURTNEY");
var DEV06 = url.indexOf("DAVID");
var DEV07 = url.indexOf("DENIZ");
var DEV08 = url.indexOf("JACOB");
var DEV09 = url.indexOf("MATT");
var DEV10 = url.indexOf("MICHAEL");
var DEV11 = url.indexOf("P2-"); //DevLocal
var INT01 = url.indexOf("IW-");
var STG01 = url.indexOf("SW-")
var TRN01 = url.indexOf("TW-");
var PROD01 = url.indexOf("PFLNET.NET");
var PROD02 = url.indexOf("PRINTINGFORLESS1.COM");
var PROD03 = url.indexOf("MIMEOPRINTINGCENTER.COM");
var PROD04 = url.indexOf("MYPFL.COM");
var PROD05 = url.indexOf("BART");
var PROD06 = url.indexOf("LISA");
var PROD07 = url.indexOf("192.168.6.214");
var PROD08 = url.indexOf("192.168.6.215");
var PROD09 = url.indexOf("/TOSYSTEM/");

var TrainingDB = url.indexOf("TRAININGDB.PFLNET.NET");
var Internal = url.indexOf("DB.PFLNET.NET");

if ((DEV01 > 0) || (DEV02 > 0) || (DEV03 > 0) || (DEV04 > 0) || (DEV05 > 0) || (DEV06 > 0) || (DEV07 > 0) || (DEV08 > 0) || (DEV09 > 0) || (DEV10 > 0) || (DEV11 > 0)) { var weblocation = "DEVELOPMENT"; }
else if ((INT01 > 0)) { var weblocation = "INTEGRATION"; }
else if ((STG01 > 0)) { var weblocation = "STAGING"; }
else if ((TRN01 > 0)) { var weblocation = "TRAINING"; }
else if ((TrainingDB > 0)) { var weblocation = "TRAINING"; }
else if (PROD01 > 0 || PROD02 > 0 || PROD03 > 0 || PROD04 > 0 || PROD05 > 0 || PROD06 > 0 || PROD07 > 0 || PROD08 > 0 || PROD09 > 0) { var weblocation = "PROD"; }
else { var weblocation = "PUBLIC"; }

var DevLocal = (weblocation == "DEVELOPMENT") && !((DEV01 > 0) || (DEV02 > 0) || (DEV11 > 0));// Add event handler
function AddEventHandler(obj, eventName, functionNotify) {
if (obj.attachEvent) {
obj.attachEvent('on' + eventName, functionNotify);
}
else if (obj.addEventListener) {
obj.addEventListener(eventName, functionNotify, true);
}
}

// Return the Unicode key code associated with the key that caused the event
function GetEventKeyCode(evnt) {
return evnt.keyCode ? evnt.keyCode : evnt.charCode ? evnt.charCode : evnt.which ? evnt.which : void 0;
}
// Validate max char length in a given string
function ValidateMaxLength(evnt, str, maxLength) {
var evntKeyCode = GetEventKeyCode(evnt);
// Ignore keys such as Delete, Backspace, Shift, Ctrl, Alt, Insert, Delete, Home, End, Page Up, Page Down and arrow keys
 var escChars = ",8,17,18,19,33,34,35,36,37,38,39,40,45,46,";
if (escChars.indexOf(',' + evntKeyCode + ',') == -1) {
 if (str.length >= maxLength) {
 alert("You cannot enter more than " + maxLength + " characters.");
 return false;
 }
 }
 return true;
}
var ValidateFunctionArray = new Array();
var USStateList = "AL,AK,AZ,AR,CA,CO,CT,DE,DC,FL,GA,HI,ID,IL,IN,IA,KS,KY,LA,ME,MD,MA,MI,MN,MS,MO,MT,NE,NV,NH,NJ,NM,NY,NC,ND,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VT,VA,WA,WV,WI,WY";
var CanadaProvinceList = "AB,BC,MB,NB,NF,NT,NS,ON,PE,QC,SK,YT";

function ValidateFunctions() {
for (var i = 0, loopCnt = ValidateFunctionArray.length; i < loopCnt; i++) {
if (!(ValidateFunctionArray[i])()) {
return false;
}
}
return true;
}

function IsFilled(fieldID, alertMsg, doNotFocus) {
var fieldElem = $(fieldID);
if (fieldElem && TrimSpace(fieldElem.value) == "") {
if (alertMsg != "") {
alert(alertMsg);
}
if (!fieldElem.disabled && fieldElem.style.display != 'none' && !doNotFocus) {
fieldElem.focus();
}
return false;
}
return true;
}

function IsSelected(fieldID, alertMsg, doNotFocus) {
var fieldElem = $(fieldID);
if (fieldElem && fieldElem.options[fieldElem.selectedIndex].value == "") {
if (alertMsg != "") {
alert(alertMsg);
}
if (!fieldElem.disabled && fieldElem.style.display != 'none' && !doNotFocus) {
fieldElem.focus();
}
return false;
}
return true;
}

function IsRadioChecked(fieldID, alertMsg) {
var fieldList = document.getElementsByName(fieldID);
if (fieldList && fieldList.length > 0) {
for (var i=0;i<fieldList.length;i++){
if (fieldList[i].checked) {
return true;
}
}
if (alertMsg != "") {
alert(alertMsg);
}
return false;
}
return true;
}

function IsRightLength(fieldID, maxLen, alertMsg) {
var fieldElem = $(fieldID);
if (fieldElem && fieldElem.value.length >= maxLen) {
if (alertMsg != "") {
alert(alertMsg);
}
if (!fieldElem.disabled && fieldElem.style.display != 'none') {
fieldElem.focus();
}
return false;
}
return true;
}

function IsValidEmail(fieldID) {
var fieldElem = $(fieldID);
if (fieldElem && !ChkEmail(fieldElem.value)) {
if (!fieldElem.disabled && fieldElem.style.display != 'none') {
fieldElem.focus();
}
return false;
}
return true;
}

function IsValidZipCode(stateFieldID, zipFieldID, alertMsg) {
var stateFieldElem = $(stateFieldID);
var zipFieldElem = $(zipFieldID);
if (stateFieldElem && zipFieldElem) {
var stateValue = stateFieldElem.options[stateFieldElem.selectedIndex].value;
if (IsInList(USStateList, stateValue, false)) {
pattern = "\\d{5}";
}
else if (IsInList(CanadaProvinceList, stateValue, false)) {
pattern = "[A-Z|a-z]\\d[A-Z|a-z]\\d[A-Z|a-z]\\d";
} 
else {
return true;
}
var re = new RegExp(pattern, 'g');
var ZipValue = TrimSpace(zipFieldElem.value);
ZipValue = ZipValue.replace(' ','').replace('-','');
var r = ZipValue.match(re);
if (r != ZipValue) {
if (alertMsg != "") {
alert(alertMsg);
}
if (!zipFieldElem.disabled && zipFieldElem.style.display != 'none') {
 zipFieldElem.focus();
}
return false;
}
}
return true;
}

function IsValidNumber(fieldID, alertMsg, additionalChars) {
var fieldElem = $(fieldID);
if (fieldElem && Trim(fieldElem.value) != StripNonNumeric(fieldElem.value, additionalChars)) {
if (alertMsg != "") {
alert(alertMsg);
}
if (!fieldElem.disabled && fieldElem.style.display != 'none') {
fieldElem.focus();
}
return false;
}
return true;
}

function IsVisible(fieldID, alertMsg) {
var fieldElem = $(fieldID);
if (!fieldElem) {
if (alertMsg != "") {
alert(alertMsg);
}
return false;
}
return true;
}

function IsValidExpDate(monthFieldID, yearFieldID, alertMsg, curMonth, curYear) {
var monthFieldElem = $(monthFieldID);
var yearFieldElem = $(yearFieldID);
if (monthFieldElem && yearFieldElem && (monthFieldElem.value*1) + 12 * (yearFieldElem.value*1) < curMonth + 12 * curYear) {
if (alertMsg != "") {
alert(alertMsg);
}
if (!yearFieldElem.disabled && yearFieldElem.style.display != 'none') {
yearFieldElem.focus();
}
return false;
}
return true;
}

function ValidateRequest(formName) {
var BadChars = false;
if (formName) {
var formElem = document.forms[formName];
if (formElem) {
var formField, tagNameLower, formFieldType, formFieldVal;
for (var i = 0, loopCnt = formElem.elements.length; i < loopCnt; i++) {
formField = formElem.elements[i];
tagNameLower = formField.tagName.toLowerCase();
formFieldType = formField.type;
if ((tagNameLower == 'input' && (formFieldType == 'text' || formFieldType == 'hidden')) || tagNameLower == 'textarea') {
formFieldVal = formField.value;
if (formFieldVal != '' && (formFieldVal.indexOf('<') != -1 || formFieldVal.indexOf('>') != -1)) {
BadChars = true;
formField.value = formFieldVal.replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
}
}
}
}
//if ( BadChars )
//alert('< and > characters are not allowed in this page.');
return true;
}

function HackValidators(validationGroup) {
if (typeof(Page_ClientValidate) == 'function' && !Page_ClientValidate(validationGroup)) {
// Scroll the object so that top of the object is visible at the top of the window
if (typeof(Page_InvalidControlToBeFocused) != 'undefined') {
if (Page_InvalidControlToBeFocused && Page_InvalidControlToBeFocused.scrollIntoView) {
Page_InvalidControlToBeFocused.scrollIntoView(true);
}
else {
var imgColl = document.getElementsByTagName('img');
var imgElem;
for (var i = 0, loopCnt = imgColl.length; i < loopCnt; i++) {
imgElem = imgColl[i];
if (imgElem.src.indexOf('/CommonWeb/images/RedAsteriskArrow.gif') != -1 && imgElem.parentNode && imgElem.parentNode.style.display != 'none' && imgElem.scrollIntoView) {
imgElem.scrollIntoView(true);
break;
}
}
}
}
alert('Please fill in required fields.');
// NOTE: The following is a required, otherwise the buttons have to be clicked twice to submit
if (typeof(Page_BlockSubmit) != 'undefined') {
Page_BlockSubmit = false;
}
return false;
}
return true;
}
var AdjustTypeEnum = {
'AdditionalMarkupPercent':0,
'Aqueous':1,
'Conversion':2,
'Envelope':3,
'DieCut':4,
'DrillHole':5,
'Finishing':6,
'Fold':7,
'HardProof':8,
'Ink':9,
'Lanyard':10,
'Mailing':11,
'NumPages':12,
'Padding':13,
'Paper':14,
'Postage':15,
'Product':16,
'Quantity':17,
'RoundCorner':18,
'Seal':19,
'SecondSheet':20,
'Shipping':21,
'SpecialDiscount':22,
'Spot':23,
'Turnaround':24,
'UpgradeDiscount':25,
'VariableData':26
};
//
// Code Generated by: InstaPriceAdminNavBar.aspx
//

var AttributeCommentTypeEnum = {
'design_hours':16,
'general_comment':1,
'height':10,
'paper_brand':12,
'paper_color':13,
'paper_finish':15,
'paper_type':14,
'paper_weight':11,
'proof_pages':17,
'shipmentid':18,
'spot_1':2,
'spot_2':3,
'spot_3':4,
'spot_4':5,
'spot_5':6,
'start_number':7,
'system_comment':8,
'width':9
};
//
// Code Generated by: InstaPriceAdminNavBar.aspx
//

var AttributeGroupIDEnum = {
'backing':27,
'binding':28,
'bundle':5,
'collate':36,
'collateinsert':8,
'collatestaple':37,
'conversion':29,
'cover':30,
'cut':38,
'deboss':11,
'design':34,
'diecut':12,
'drill':2,
'emboss':13,
'envwindow':3,
'foidstamp':21,
'fold':10,
'foldcollatestaple':9,
'imprint':26,
'insert':39,
'laminate':42,
'manualbaseprice':43,
'non_printed':35,
'other':44,
'perfnumber':22,
'plasticcarddieoptions':45,
'pockets':41,
'remitflap':15,
'roundcorners':4,
'score':16,
'seal':18,
'sheetsperunit':32,
'slits':24,
'staple':19,
'tab':20,
'washup':33
};
//
// Code Generated by: InstaPriceAdminNavBar.aspx
//

var AttributeIDEnum = {
'backing':57,
'bindcolor':68,
'binding':58,
'bindingside':67,
'bindthickness':36,
'coating':8,
'collate':17,
'collateinsertinto':43,
'collateinsertpieces':52,
'collatestaple':44,
'conversion':59,
'cover':60,
'cut':66,
'deboss':18,
'designservices':64,
'diecut':19,
'drillcount':46,
'drillholes':20,
'emboss':21,
'envelopes':14,
'envwindowlocation':47,
'foilstampsize':23,
'fold':11,
'foldcollatestaple':54,
'imprint':55,
'imprintcolor':61,
'ink':3,
'insert':24,
'laminate':74,
'mail':71,
'manualbaseprice':75,
'nonprintedproduct':65,
'other':76,
'paper':6,
'papercolor':73,
'perfnumber':26,
'plclanyardslot':77,
'plcroundcorners':78,
'plcroundcornersize':79,
'pockets':27,
'postage':72,
'proof':40,
'remitflap':28,
'roundcorners':48,
'roundcornersize':29,
'score':31,
'scoringfold':32,
'seal':33,
'sheetsperunit':62,
'ship':70,
'shrinkcount':49,
'shrinkpiecesperpack':34,
'slits':35,
'spot':56,
'staple':37,
'tab':38,
'turnaround':69,
'washup':63
};
//
// Code Generated by: InstaPriceAdminNavBar.aspx
//

var AttributePlacementEnum = {
'back':2,
'cover':3,
'envelope':5,
'front':1,
'inside':4,
'seconds':6
};
//
// Code Generated by: InstaPriceAdminNavBar.aspx
//

var AttributeValueIDEnum = {
'backing_chip_board':'392',
'backing_manually_priced':'391',
'bindcolor_black':'529',
'bindcolor_color':'530',
'bindcolor_manually_priced':'725',
'binding_glue':'394',
'binding_hand_stitch_1_or_2_stitches':'457',
'binding_hand_stitch_3_or_4_stitches':'458',
'binding_manually_priced':'395',
'binding_padding_with_chipboard':'752',
'binding_plastic_coil_binding':'524',
'binding_staple':'393',
'bindingside_long_side':'628',
'bindingside_manually_priced':'724',
'bindingside_short_side':'627',
'bindthickness_16_23_mm_coil':'497',
'bindthickness_8_mm_coil':'495',
'bindthickness_9_15_mm_coil':'496',
'bindthickness_extra_thick':'175',
'bindthickness_lt8_mm_coil':'494',
'bindthickness_manually_priced':'717',
'bindthickness_standard':'174',
'coating_gloss_aqueous':'307',
'coating_gloss_flood_varnish':'310',
'coating_gloss_spot_varnish':'350',
'coating_gloss_uv_coating':'786',
'coating_manually_priced':'312',
'coating_matte_aqueous':'308',
'coating_matte_flood_varnish':'311',
'coating_matte_spot_varnish':'349',
'collate_collate_book_21_40_pgs':'520',
'collate_collate_book_41_60_pgs':'521',
'collate_collate_book_61_80_pgs':'522',
'collate_collate_book_81_100_pgs':'523',
'collate_collate_book_up_to_20_pgs':'519',
'collate_insert_separators':'396',
'collate_manually_priced':'325',
'collateinsertinto_6x9_booklet':'189',
'collateinsertinto_9x12_booklet':'190',
'collateinsertinto_a2_envelopes':'187',
'collateinsertinto_a6_envelopes':'188',
'collateinsertinto_collate_insert_presentation_folder':'734',
'collateinsertinto_collate_insert_seal_catalog_envelopes':'735',
'collateinsertinto_collate_insert_seal_oversized_envelopes':'737',
'collateinsertinto_graduated_inserts_into_folders':'736',
'collateinsertinto_lb10_envelopes':'186',
'collateinsertinto_manually_priced':'191',
'collateinsertpieces_announcement_envelope_1_piece':'196',
'collateinsertpieces_announcement_envelope_2_pieces':'291',
'collateinsertpieces_announcement_envelope_3_pieces':'292',
'collateinsertpieces_announcement_envelope_4_pieces':'293',
'collateinsertpieces_baronial_envelope_1_piece':'294',
'collateinsertpieces_baronial_envelope_2_pieces':'295',
'collateinsertpieces_baronial_envelope_3_pieces':'296',
'collateinsertpieces_baronial_envelope_4_pieces':'297',
'collateinsertpieces_commercial_envelope_1_piece':'192',
'collateinsertpieces_commercial_envelope_2_pieces':'193',
'collateinsertpieces_commercial_envelope_3_pieces':'194',
'collateinsertpieces_commercial_envelope_4_pieces':'195',
'collateinsertpieces_large_booklet_envelope_1_pieces':'302',
'collateinsertpieces_large_booklet_envelope_2_pieces':'303',
'collateinsertpieces_large_booklet_envelope_3_pieces':'304',
'collateinsertpieces_large_booklet_envelope_4_pieces':'305',
'collateinsertpieces_manually_priced':'721',
'collateinsertpieces_small_booklet_envelope_1_piece':'298',
'collateinsertpieces_small_booklet_envelope_2_pieces':'299',
'collateinsertpieces_small_booklet_envelope_3_pieces':'300',
'collateinsertpieces_small_booklet_envelope_4_pieces':'301',
'collatestaple_1':'197',
'collatestaple_2':'198',
'collatestaple_3':'199',
'collatestaple_4':'200',
'collatestaple_5':'201',
'collatestaple_6':'202',
'collatestaple_manually_priced':'203',
'conversion_brochure_holder':'397',
'conversion_manually_priced':'722',
'conversion_presentation_folder_conversion_small':'459',
'conversion_rack_card_holder':'398',
'conversion_table_tent_score_slit':'456',
'cover_cover_wrap':'399',
'cover_manually_priced':'400',
'cover_poly_covers':'531',
'cut_manually_priced':'723',
'deboss_deboss_extra_small_pre_existing_die':'502',
'deboss_deboss_large_pre_existing_die':'499',
'deboss_deboss_medium_pre_existing_die':'500',
'deboss_deboss_small_pre_existing_die':'501',
'deboss_deboss_x_large_pre_existing_die':'498',
'deboss_large':'115',
'deboss_manually_priced':'117',
'deboss_medium':'114',
'deboss_small':'113',
'deboss_x_large':'116',
'deboss_x_small':'112',
'designservices_banner_design':'600',
'designservices_book_cover':'601',
'designservices_bookmark_design_1_sided':'602',
'designservices_bookmark_design_2_sided':'603',
'designservices_brochure_flyer_design_11x17_1_sided':'607',
'designservices_brochure_flyer_design_11x17_2_sided':'608',
'designservices_brochure_flyer_design_11x25_5_1_sided':'610',
'designservices_brochure_flyer_design_11x25_5_2_sided':'611',
'designservices_brochure_flyer_design_8_5x11_1_sided':'604',
'designservices_brochure_flyer_design_8_5x11_2_sided':'605',
'designservices_brochure_flyer_template_layout_11x17_1_sided':'623',
'designservices_brochure_flyer_template_layout_11x17_2_sided':'624',
'designservices_brochure_flyer_template_layout_8_5x11_1_sided':'606',
'designservices_brochure_flyer_template_layout_8_5x11_2_sided':'622',
'designservices_business_card_design':'594',
'designservices_business_card_design_2_sided':'595',
'designservices_business_card_template_layout':'612',
'designservices_business_card_template_layout_2_sided':'785',
'designservices_card_design_1_sided':'596',
'designservices_card_design_2_sided':'597',
'designservices_catalog_design_12_pages':'615',
'designservices_catalog_design_16_pages':'616',
'designservices_catalog_design_20_pages':'617',
'designservices_catalog_design_8_pages':'614',
'designservices_hourly_design_fee':'620',
'designservices_letterhead_envelope_design':'781',
'designservices_letterhead_envelope_design_2_sided':'784',
'designservices_letterhead_envelope_template_layout':'782',
'designservices_logo_package_3_options':'598',
'designservices_logo_package_6_options':'599',
'designservices_manually_priced':'621',
'designservices_postcard_greeting_card_template_layout':'613',
'designservices_poster_design_up_to_24x36':'618',
'designservices_presentation_file_folder_design':'619',
'designservices_typesetting_business_card':'783',
'diecut_die_cut_large_new':'454',
'diecut_die_cut_medium_new':'452',
'diecut_die_cut_medium_preexisting':'453',
'diecut_die_cut_small_preexisting':'451',
'diecut_die_cut_xlarge_preexisting':'455',
'diecut_die_cut_xsmall_preexisting':'450',
'diecut_door_hanger_die_cut':'306',
'diecut_large':'121',
'diecut_manually_priced':'123',
'diecut_medium':'120',
'diecut_small':'119',
'diecut_x_large':'122',
'diecut_x_small':'118',
'drillcount_1_hole':'644',
'drillcount_2_holes':'645',
'drillcount_3_holes':'646',
'drillcount_4_holes':'647',
'drillcount_5_holes':'648',
'drillcount_6_holes':'649',
'drillcount_7_holes':'650',
'drillcount_8_holes':'651',
'drillcount_manually_priced':'718',
'drillcount_multi_page':'127',
'drillcount_single_page':'126',
'drillholes_1_3':'124',
'drillholes_1_4_drill_hole':'370',
'drillholes_1_8_drill_hole':'324',
'drillholes_9_holes':'652',
'drillholes_gt3':'125',
'drillholes_manually_priced':'371',
'emboss_emboss_large_pre_existing_die':'504',
'emboss_emboss_medium_pre_existing_die':'505',
'emboss_emboss_small_pre_existing_die':'506',
'emboss_emboss_x_large_pre_existing_die':'503',
'emboss_emboss_x_small_pre_existing_die':'507',
'emboss_large':'131',
'emboss_manually_priced':'133',
'emboss_medium':'130',
'emboss_small':'129',
'emboss_x_large':'132',
'emboss_x_small':'128',
'envelopes_a10':'225',
'envelopes_a2':'220',
'envelopes_a6':'221',
'envelopes_a7':'222',
'envelopes_a8':'223',
'envelopes_a9':'224',
'envelopes_jumbo_11x17':'263',
'envelopes_jumbo_15x20':'264',
'envelopes_jumbo_16x20':'265',
'envelopes_jumbo_17x22':'266',
'envelopes_jumbo_22x27':'267',
'envelopes_lb1_1_2_catalog':'254',
'envelopes_lb1_booklet_envelope':'460',
'envelopes_lb1_catalog':'253',
'envelopes_lb10':'237',
'envelopes_lb10_1_2_catalog':'258',
'envelopes_lb10_booklet':'251',
'envelopes_lb10_booklet_envelopes_9_5x12_625_':'741',
'envelopes_lb10_security_envelopes':'463',
'envelopes_lb10_security_window_envelopes':'464',
'envelopes_lb10_window_envelopes':'462',
'envelopes_lb11':'238',
'envelopes_lb12':'239',
'envelopes_lb12_1_2_catalog':'259',
'envelopes_lb13_1_2_catalog':'260',
'envelopes_lb13_booklet':'252',
'envelopes_lb14':'240',
'envelopes_lb14_1_2_catalog':'261',
'envelopes_lb15_catalog':'262',
'envelopes_lb3_booklet':'241',
'envelopes_lb3_catalog':'255',
'envelopes_lb4_baronial':'226',
'envelopes_lb5_5_baronial':'228',
'envelopes_lb5_baronial':'227',
'envelopes_lb5_booklet':'242',
'envelopes_lb6_1_2_booklet':'244',
'envelopes_lb6_1_4':'231',
'envelopes_lb6_3_4':'232',
'envelopes_lb6_3_4_booklet':'246',
'envelopes_lb6_5_8_booklet':'245',
'envelopes_lb6_baronial':'229',
'envelopes_lb6_booklet':'243',
'envelopes_lb6_catalog':'256',
'envelopes_lb7':'233',
'envelopes_lb7_1_2_booklet':'248',
'envelopes_lb7_1_4_booklet':'247',
'envelopes_lb7_3_4_monarch':'234',
'envelopes_lb8_5_8':'235',
'envelopes_lb9':'236',
'envelopes_lb9_1_2_booklet':'250',
'envelopes_lb9_1_2_booklet_envelopes_peel_seal_9x12_':'740',
'envelopes_lb9_3_4_catalog':'257',
'envelopes_lb9_booklet':'249',
'envelopes_lb9_window_envelopes':'461',
'envelopes_lee':'230',
'envelopes_manually_priced':'362',
'envelopes_slimline':'219',
'envwindowlocation_custom':'137',
'envwindowlocation_manually_priced':'719',
'envwindowlocation_standard':'136',
'foilstampsize_foil_stamp_large_pre_existing_die':'509',
'foilstampsize_foil_stamp_medium_pre_existing_die':'510',
'foilstampsize_foil_stamp_small_pre_existing_die':'511',
'foilstampsize_foil_stamp_x_large_pre_existing_die':'508',
'foilstampsize_foil_stamp_x_small_pre_existing_die':'512',
'foilstampsize_large':'141',
'foilstampsize_manually_priced':'143',
'foilstampsize_medium':'140',
'foilstampsize_small':'139',
'foilstampsize_x_large':'142',
'foilstampsize_x_small':'138',
'fold_accordion_fold':'97',
'fold_barrel_roll_fold':'98',
'fold_double_parallel_fold':'389',
'fold_four_panel_fold':'101',
'fold_gate_fold':'99',
'fold_half_fold':'103',
'fold_half_fold_finished_catalog_more_than_12_pgs':'733',
'fold_half_then_half':'104',
'fold_half_then_tri_fold':'105',
'fold_manually_priced':'111',
'fold_map_fold':'106',
'fold_open_gate_fold':'107',
'fold_quarter_fold':'108',
'fold_tri_fold':'109',
'fold_tri_then_half_fold':'317',
'fold_z_fold':'110',
'foldcollatestaple_fold_collate_stitch':'319',
'foldcollatestaple_manually_priced':'289',
'imprint_large':'322',
'imprint_manually_priced':'373',
'imprint_medium':'321',
'imprint_numbering':'401',
'imprint_return_address_in_1_pms':'630',
'imprint_return_address_in_black':'320',
'imprintcolor_black':'402',
'imprintcolor_manually_priced':'404',
'imprintcolor_red':'403',
'ink_4_color':'83',
'ink_black':'85',
'ink_manually_priced':'87',
'insert_1_piece':'144',
'insert_2_pieces':'145',
'insert_3_pieces':'146',
'insert_insert_card_into_slits':'738',
'insert_manually_priced':'739',
'laminate_laminate_3_mil_up_to_11x17':'515',
'laminate_laminate_3_mil_up_to_5_5x8_5':'513',
'laminate_laminate_3_mil_up_to_8_5x11':'514',
'laminate_laminate_5_mil_up_to_11x17':'518',
'laminate_laminate_5_mil_up_to_5_5x8_5':'516',
'laminate_laminate_5_mil_up_to_8_5x11':'517',
'laminate_manually_priced':'729',
'mail_1st_class':'678',
'mail_1st_class_presorted':'679',
'mail_bulk_mail':'680',
'mail_manually_priced':'681',
'mail_not_mailed':'682',
'manualbaseprice_manually_priced':'730',
'nonprintedproduct_manually_priced':'632',
'nonprintedproduct_pantone_guide':'629',
'other_manually_priced':'753',
'paper_10_pt_c1s_cover':'328',
'paper_10_pt_carolina_c1s_cover':'15',
'paper_10_pt_kromekote_c1s_cover':'64',
'paper_10_pt_kromekote_c2s_cover':'73',
'paper_10_pt_nordic_c1s_cover':'436',
'paper_100lb_centura_gloss_cover':'70',
'paper_100lb_centura_gloss_text':'32',
'paper_100lb_centura_silk_cover':'60',
'paper_100lb_centura_silk_text':'31',
'paper_100lb_classic_crest_cover':'78',
'paper_100lb_classic_crest_text':'57',
'paper_100lb_classic_linen_cover':'390',
'paper_100lb_cougar_cover':'54',
'paper_100lb_cougar_text':'26',
'paper_100lb_dull_matte_text':'22',
'paper_100lb_gloss_cover':'23',
'paper_100lb_gloss_text':'12',
'paper_100lb_lustro_dull_cover':'55',
'paper_100lb_lustro_dull_cream_cover':'56',
'paper_100lb_lustro_dull_cream_text':'30',
'paper_100lb_lustro_dull_text':'29',
'paper_100lb_mccoy_silk_cover':'439',
'paper_100lb_mccoy_silk_text':'434',
'paper_100lb_nekoosa_linen_cover':'72',
'paper_100lb_solutions_cover':'351',
'paper_100lb_starwhite_cover':'385',
'paper_100lb_topkote_dull_matte_cover':'446',
'paper_100lb_uncoated_cover':'42',
'paper_110lb_classic_crest_cover':'418',
'paper_110lb_classic_crest_text':'417',
'paper_12_pt_c1s':'332',
'paper_12_pt_c2s':'339',
'paper_12_pt_kromekote_c1s_cover':'68',
'paper_12_pt_kromekote_c2s_cover':'77',
'paper_12_pt_nordic_c1s_cover':'437',
'paper_120lb_centura_gloss_cover':'76',
'paper_120lb_centura_silk_cover':'66',
'paper_120lb_dull_matte_cover':'44',
'paper_120lb_dull_matte_cover_14_pt_pc55':'749',
'paper_120lb_gloss_cover':'43',
'paper_120lb_gloss_cover_14_pt_pc55':'748',
'paper_120lb_mccoy_silk_cover':'440',
'paper_120lb_topkote_dull_matte_cover':'640',
'paper_120lb_topkote_gloss_cover':'639',
'paper_12pt_carolina_c1s_cover':'33',
'paper_13_oz_vinyl_banner':'279',
'paper_13_pt_magnet_stock':'82',
'paper_130lb_centura_gloss_cover':'386',
'paper_130lb_classic_crest_cover':'444',
'paper_130lb_topkote_dull_matte_cover':'447',
'paper_130lb_topkote_gloss_cover':'445',
'paper_2_part_ncr':'284',
'paper_20_mil_plastic':'765',
'paper_20lb_bond':'421',
'paper_24lb_bond':'419',
'paper_24lb_classic_columns_writing':'28',
'paper_24lb_classic_cotton_writing_25':'36',
'paper_24lb_classic_crest_writing':'27',
'paper_24lb_classic_laid':'424',
'paper_24lb_classic_linen_writing':'423',
'paper_24lb_strathmore_writing_25_cotton':'37',
'paper_24lb_uncoated':'277',
'paper_28lb_uncoated':'278',
'paper_28lb_uv_ultra_ii_translucent':'441',
'paper_3_part_ncr':'285',
'paper_30_mil_plastic':'641',
'paper_32lb_laser':'420',
'paper_36lb_uv_ultra_ii_translucent':'442',
'paper_4_part_ncr':'388',
'paper_60lb_astrobrights_text':'435',
'paper_60lb_fasson_crack_n_peel_block_out_high_gloss_litho':'383',
'paper_60lb_galaxy_offset_text':'427',
'paper_60lb_mactac_labels':'286',
'paper_60lb_whitehall_text':'432',
'paper_65lb_astrobrights_cover':'465',
'paper_70lb_classic_crest_text_':'387',
'paper_70lb_classic_linen_text':'426',
'paper_70lb_colorsource_text':'13',
'paper_70lb_domtar_colors_text':'428',
'paper_70lb_feltweave_text':'429',
'paper_70lb_nekoosa_linen_text':'430',
'paper_70lb_royal_fiber_text':'25',
'paper_70lb_skytone_text':'431',
'paper_70lb_uncoated_text':'10',
'paper_70lb_whitehall_text':'415',
'paper_75lb_classic_laid_text':'38',
'paper_8_pt_c1s_cover':'326',
'paper_80lb_astrobrights_cover':'53',
'paper_80lb_centura_gloss_cover':'49',
'paper_80lb_centura_gloss_text':'21',
'paper_80lb_centura_silk_cover':'48',
'paper_80lb_centura_silk_text':'20',
'paper_80lb_classic_columns_cover':'75',
'paper_80lb_classic_columns_text':'39',
'paper_80lb_classic_cotton_bristol':'81',
'paper_80lb_classic_crest_cover':'71',
'paper_80lb_classic_crest_text':'50',
'paper_80lb_classic_laid_cover':'69',
'paper_80lb_classic_linen_cover':'74',
'paper_80lb_classic_linen_cover_black':'425',
'paper_80lb_classic_linen_text':'52',
'paper_80lb_cougar_cover':'51',
'paper_80lb_cougar_text':'16',
'paper_80lb_dull_matte_cover':'14',
'paper_80lb_environment_cover':'58',
'paper_80lb_environment_text':'35',
'paper_80lb_evergreen_100_pc_cover':'65',
'paper_80lb_evergreen_100_pc_text':'40',
'paper_80lb_feltweave_cover':'61',
'paper_80lb_feltweave_text':'41',
'paper_80lb_gloss_cover':'17',
'paper_80lb_gloss_text':'9',
'paper_80lb_lustro_dull_cover':'46',
'paper_80lb_lustro_dull_cream_cover':'47',
'paper_80lb_lustro_dull_cream_text':'19',
'paper_80lb_lustro_dull_text':'18',
'paper_80lb_matte_text':'11',
'paper_80lb_mccoy_silk_cover':'438',
'paper_80lb_mccoy_silk_text':'433',
'paper_80lb_nekoosa_linen_cover':'62',
'paper_80lb_nekoosa_linen_text':'24',
'paper_80lb_photo_gloss':'633',
'paper_80lb_photo_gloss_on_foamboard':'643',
'paper_80lb_photo_gloss_with_foamboard':'642',
'paper_80lb_royal_fiber_cover':'63',
'paper_80lb_skytone_cover':'59',
'paper_80lb_skytone_text':'34',
'paper_80lb_starwhite_cover':'67',
'paper_80lb_starwhite_text':'45',
'paper_80lb_strathmore_cotton_bristol':'80',
'paper_80lb_uncoated_cover':'333',
'paper_88lb_strathmore_bristol':'448',
'paper_car_magnet_biz_dev':'731',
'paper_cbsl_bcrd_001':'280',
'paper_cbsl_lh_e_001':'281',
'paper_cbsl_lthd_001':'282',
'paper_cbsl_prez_001':'283',
'paper_environment_80lb_text':'340',
'paper_foam_board':'352',
'paper_joy_red_p_gc_v':'353',
'paper_joy_red_p_nc_v':'354',
'paper_knightkote_matte_100lb_cover':'331',
'paper_lustro_dull_100lb_cover':'330',
'paper_lustro_dull_120lb_cover':'334',
'paper_lustro_dull_cream_100lb_cover':'335',
'paper_lustro_dull_cream_80lb_text':'338',
'paper_lustro_gloss_100lb_cover':'355',
'paper_lustro_gloss_120lb_cover':'329',
'paper_lustro_gloss_80lb_text':'342',
'paper_manually_priced':'348',
'paper_mounted_foamboard':'287',
'paper_nekoosa_70lb_text':'336',
'paper_ornaments_p_gc_h':'356',
'paper_ornaments_p_nc_h':'357',
'paper_peace_letter_blocks_p_gc_h':'358',
'paper_peace_letter_blocks_p_nc_h':'359',
'paper_plastic_sign_biz_dev':'732',
'paper_post_it_notes_neon_text':'769',
'paper_post_it_notes_recycled_text':'770',
'paper_post_it_notes_text':'638',
'paper_seasons_greetings_p_gc_v':'360',
'paper_seasons_greetings_p_nc_v':'361',
'paper_topkote_dull_100lb_cover':'341',
'paper_topkote_dull_80lb_text':'337',
'papercolor_antique_gray':'532',
'papercolor_avalanche_white':'533',
'papercolor_avon_brilliant_white':'534',
'papercolor_balsa':'535',
'papercolor_baronial_ivory':'536',
'papercolor_birch':'537',
'papercolor_blue':'538',
'papercolor_canary':'539',
'papercolor_canary_yellow':'773',
'papercolor_carnation':'779',
'papercolor_carrara_white':'540',
'papercolor_celestial_blue':'541',
'papercolor_classic_cream':'542',
'papercolor_classic_natural':'543',
'papercolor_cosmic_orange':'544',
'papercolor_cottonwood':'545',
'papercolor_cream':'546',
'papercolor_desert_storm':'547',
'papercolor_fireball_fuchsia':'548',
'papercolor_frosted_glass':'549',
'papercolor_galaxy_gold':'550',
'papercolor_gamma_green':'551',
'papercolor_gemini_green':'552',
'papercolor_gray':'553',
'papercolor_green':'554',
'papercolor_ice_blue':'555',
'papercolor_kraft':'556',
'papercolor_lift_off_lemon':'557',
'papercolor_light_gray':'768',
'papercolor_lunar_blue':'558',
'papercolor_manually_priced':'728',
'papercolor_martian_green':'559',
'papercolor_natural':'560',
'papercolor_neon_lime':'776',
'papercolor_neon_orange':'775',
'papercolor_neon_pink':'777',
'papercolor_orbit_orange':'561',
'papercolor_pc_100_natural':'562',
'papercolor_pc100_natural':'563',
'papercolor_pc100_white':'564',
'papercolor_periwinkle':'565',
'papercolor_planetary_purple':'566',
'papercolor_plasma_pink':'567',
'papercolor_pulsar_pink':'568',
'papercolor_re_entry_red':'572',
'papercolor_recycled_bright_white':'569',
'papercolor_recycled_natural_white':'570',
'papercolor_recycled_white':'571',
'papercolor_rocket_red':'573',
'papercolor_rose':'574',
'papercolor_sirius':'575',
'papercolor_sirius_smooth':'576',
'papercolor_sky_blue':'771',
'papercolor_soft_white':'577',
'papercolor_solar_white':'578',
'papercolor_solar_yellow':'579',
'papercolor_spring_green':'772',
'papercolor_stardust_white':'580',
'papercolor_sunburst_yellow':'581',
'papercolor_terra_green':'582',
'papercolor_terrestrial_teal':'583',
'papercolor_thyme':'584',
'papercolor_tiara':'585',
'papercolor_tiara_hi_tech':'586',
'papercolor_tiara_smooth':'587',
'papercolor_tiara_vellum':'588',
'papercolor_ultimate_white':'589',
'papercolor_ultra_bright_white':'590',
'papercolor_ultra_grape':'778',
'papercolor_ultra_yellow':'774',
'papercolor_venus_violet':'591',
'papercolor_vulcan_green':'592',
'papercolor_white':'593',
'perfnumber_manually_priced':'151',
'perfnumber_multi_page_perf':'323',
'perfnumber_perforation':'150',
'perfnumber_three_perfs':'422',
'plclanyardslot_lanyard_slot_long_side':'755',
'plclanyardslot_lanyard_slot_short_side':'754',
'plclanyardslot_manually_priced':'756',
'plcroundcorners_all_four_corners':'760',
'plcroundcorners_manually_priced':'761',
'plcroundcornersize_1_4_round_corners':'780',
'plcroundcornersize_1_8_round_corners':'766',
'plcroundcornersize_manually_priced':'764',
'pockets_1_pocket_on_left':'152',
'pockets_1_pocket_on_right':'153',
'pockets_2_pockets':'154',
'pockets_manually_priced':'155',
'postage_manually_priced':'727',
'postage_postage':'712',
'proof_hard_copy_mock_up':'274',
'proof_hard_copy_proof':'625',
'proof_manually_priced':'631',
'proof_press_proof':'626',
'remitflap_custom':'157',
'remitflap_manually_priced':'713',
'remitflap_standard':'156',
'roundcorners_1_corner':'162',
'roundcorners_2_corners':'161',
'roundcorners_3_corners':'637',
'roundcorners_all_four_corners':'160',
'roundcorners_laminate_round_corners':'449',
'roundcorners_manually_priced':'363',
'roundcornersize_1_4':'158',
'roundcornersize_1_4_round_corners_with_laminate':'635',
'roundcornersize_1_8':'368',
'roundcornersize_3_8':'159',
'roundcornersize_3_8_round_corners_with_laminate_':'636',
'roundcornersize_manually_priced':'714',
'score_manually_priced':'372',
'score_standard':'318',
'scoringfold_manually_priced':'715',
'scoringfold_score_for_folding':'290',
'seal_glue':'163',
'seal_manually_priced':'366',
'seal_peel_seel':'164',
'sheetsperunit_10':'742',
'sheetsperunit_100':'407',
'sheetsperunit_15':'743',
'sheetsperunit_20':'745',
'sheetsperunit_25':'405',
'sheetsperunit_30':'744',
'sheetsperunit_35':'746',
'sheetsperunit_40':'747',
'sheetsperunit_50':'406',
'sheetsperunit_60':'788',
'sheetsperunit_70':'789',
'sheetsperunit_75':'787',
'sheetsperunit_80':'790',
'sheetsperunit_90':'791',
'sheetsperunit_manually_priced':'408',
'ship_custom':'653',
'ship_customer_pickup':'654',
'ship_discard':'655',
'ship_fedex_2_day':'656',
'ship_fedex_3_day':'657',
'ship_fedex_freight':'658',
'ship_fedex_ground':'659',
'ship_fedex_international_economy':'660',
'ship_fedex_international_ground':'661',
'ship_fedex_international_priority':'662',
'ship_fedex_overnight_am':'663',
'ship_fedex_overnight_pm':'664',
'ship_fedex_saturday':'665',
'ship_local_courier':'666',
'ship_manually_priced':'667',
'ship_truck_freight':'668',
'ship_ups_2_day':'669',
'ship_ups_3_day':'670',
'ship_ups_ground':'671',
'ship_ups_next_day':'672',
'ship_ups_next_day_saturday':'673',
'ship_usps_express':'674',
'ship_usps_first_class':'675',
'ship_usps_parcel_post':'676',
'ship_usps_priority':'677',
'shrinkcount_approx':'168',
'shrinkcount_exact':'169',
'shrinkcount_manually_priced':'720',
'shrinkpiecesperpack_gt_25':'166',
'shrinkpiecesperpack_manually_priced':'716',
'shrinkpiecesperpack_single_w_chipboard':'167',
'shrinkpiecesperpack_up_to_25':'165',
'slits_both_sides':'172',
'slits_left_side':'170',
'slits_manually_priced':'173',
'slits_right_side':'171',
'slits_slits_business_card':'750',
'slits_slits_other':'751',
'spot_manually_priced':'381',
'spot_spot_1':'343',
'spot_spot_2':'344',
'spot_spot_3':'345',
'spot_spot_4':'346',
'spot_spot_5':'347',
'staple_corner':'179',
'staple_custom':'180',
'staple_manually_priced':'369',
'tab_manually_priced':'365',
'tab_multi_tab':'182',
'tab_tab':'181',
'tab_tabbing':'634',
'turnaround_c10d':'683',
'turnaround_c12d':'684',
'turnaround_c14d':'685',
'turnaround_c1d':'686',
'turnaround_c2d':'687',
'turnaround_c3d':'688',
'turnaround_c4d':'689',
'turnaround_c5d':'690',
'turnaround_c6d':'691',
'turnaround_c7d':'692',
'turnaround_c8d':'693',
'turnaround_c9d':'694',
'turnaround_f3d':'695',
'turnaround_f4d':'696',
'turnaround_f6d':'697',
'turnaround_f9d':'698',
'turnaround_manually_priced':'726',
'turnaround_n10d':'699',
'turnaround_n4d':'700',
'turnaround_n5d':'701',
'turnaround_n6d':'702',
'turnaround_n8d':'703',
'turnaround_r2d':'704',
'turnaround_r3d':'705',
'turnaround_r5d':'706',
'turnaround_r8d':'707',
'turnaround_sr1d':'708',
'turnaround_sr2d':'709',
'turnaround_sr4d':'710',
'turnaround_sr7d':'711',
'washup_manually_priced':'409',
'washup_wash_up_charge_1':'410',
'washup_wash_up_charge_2':'411',
'washup_wash_up_charge_3':'412',
'washup_wash_up_charge_4':'413',
'washup_wash_up_charge_5':'414'
};
var AttributeValueNameEnum = {
392:'Chip Board',// backing_chip_board
391:'Manually Priced',// backing_manually_priced
529:'Black',// bindcolor_black
530:'Color',// bindcolor_color
725:'Manually Priced',// bindcolor_manually_priced
394:'Glue',// binding_glue
395:'Manually Priced',// binding_manually_priced
752:'Padding with chipboard',// binding_padding_with_chipboard
393:'Staple',// binding_staple
457:'Hand Stitch - 1 or 2 stitches',// binding_hand_stitch_1_or_2_stitches
458:'Hand Stitch - 3 or 4 stitches',// binding_hand_stitch_3_or_4_stitches
524:'Plastic coil binding',// binding_plastic_coil_binding
628:'Long Side',// bindingside_long_side
724:'Manually Priced',// bindingside_manually_priced
627:'Short Side',// bindingside_short_side
494:'<8 mm coil',// bindthickness_lt8_mm_coil
496:'9-15 mm coil',// bindthickness_9_15_mm_coil
717:'Manually Priced',// bindthickness_manually_priced
174:'Standard',// bindthickness_standard
495:'8 mm coil',// bindthickness_8_mm_coil
175:'Extra-thick',// bindthickness_extra_thick
497:'16-23 mm coil',// bindthickness_16_23_mm_coil
307:'Gloss Aqueous',// coating_gloss_aqueous
310:'Gloss Flood Varnish',// coating_gloss_flood_varnish
350:'Gloss Spot Varnish',// coating_gloss_spot_varnish
786:'Gloss UV Coating',// coating_gloss_uv_coating
308:'Matte Aqueous',// coating_matte_aqueous
311:'Matte Flood Varnish',// coating_matte_flood_varnish
349:'Matte Spot Varnish',// coating_matte_spot_varnish
312:'Manually Priced',// coating_manually_priced
519:'Collate book (up to 20 pgs)',// collate_collate_book_up_to_20_pgs
520:'Collate book (21-40 pgs)',// collate_collate_book_21_40_pgs
521:'Collate book (41-60 pgs)',// collate_collate_book_41_60_pgs
522:'Collate book (61-80 pgs)',// collate_collate_book_61_80_pgs
523:'Collate book (81-100 pgs)',// collate_collate_book_81_100_pgs
396:'Insert Separators',// collate_insert_separators
325:'Manually Priced',// collate_manually_priced
186:'Collate/Insert/Seal - #10 Env',// collateinsertinto_lb10_envelopes
187:'Collate/Insert/Seal - A2/A6/A7 env',// collateinsertinto_a2_envelopes
189:'Collate/Insert/Seal - 6x9 Booklet Env',// collateinsertinto_6x9_booklet
190:'Collate/Insert/Seal - Lg Booklet Env',// collateinsertinto_9x12_booklet
735:'Collate/Insert/Seal - Catalog Envelopes',// collateinsertinto_collate_insert_seal_catalog_envelopes
737:'Collate/Insert/Seal - Oversized Envelopes',// collateinsertinto_collate_insert_seal_oversized_envelopes
188:'Collate/Insert - File Folder',// collateinsertinto_a6_envelopes
734:'Collate/Insert - Presentation Folder',// collateinsertinto_collate_insert_presentation_folder
736:'Graduate inserts into folders',// collateinsertinto_graduated_inserts_into_folders
191:'Manually Priced',// collateinsertinto_manually_priced
196:'Announcement envelope - 1 piece',// collateinsertpieces_announcement_envelope_1_piece
291:'Announcement envelope - 2 pieces',// collateinsertpieces_announcement_envelope_2_pieces
292:'Announcement envelope - 3 pieces',// collateinsertpieces_announcement_envelope_3_pieces
293:'Announcement envelope - 4 pieces',// collateinsertpieces_announcement_envelope_4_pieces
294:'Baronial envelope - 1 piece',// collateinsertpieces_baronial_envelope_1_piece
295:'Baronial envelope - 2 pieces',// collateinsertpieces_baronial_envelope_2_pieces
296:'Baronial envelope - 3 pieces',// collateinsertpieces_baronial_envelope_3_pieces
297:'Baronial envelope - 4 pieces',// collateinsertpieces_baronial_envelope_4_pieces
302:'Large booklet envelope - 1 pieces',// collateinsertpieces_large_booklet_envelope_1_pieces
303:'Large booklet envelope - 2 pieces',// collateinsertpieces_large_booklet_envelope_2_pieces
304:'Large booklet envelope - 3 pieces',// collateinsertpieces_large_booklet_envelope_3_pieces
305:'Large booklet envelope - 4 pieces',// collateinsertpieces_large_booklet_envelope_4_pieces
721:'Manually Priced',// collateinsertpieces_manually_priced
298:'Small booklet envelope - 1 piece',// collateinsertpieces_small_booklet_envelope_1_piece
299:'Small booklet envelope - 2 pieces',// collateinsertpieces_small_booklet_envelope_2_pieces
300:'Small booklet envelope - 3 pieces',// collateinsertpieces_small_booklet_envelope_3_pieces
301:'Small booklet envelope - 4 pieces',// collateinsertpieces_small_booklet_envelope_4_pieces
192:'1 piece',// collateinsertpieces_commercial_envelope_1_piece
193:'2 pieces',// collateinsertpieces_commercial_envelope_2_pieces
194:'3 pieces',// collateinsertpieces_commercial_envelope_3_pieces
195:'4 pieces',// collateinsertpieces_commercial_envelope_4_pieces
197:'Collate & Staple - 2 pc',// collatestaple_1
198:'Collate & Staple - 3 pc',// collatestaple_2
199:'Collate & Staple - 4 pc',// collatestaple_3
200:'Collate & Staple - 5 pc',// collatestaple_4
201:'Collate & Staple - 6 pc',// collatestaple_5
202:'>6',// collatestaple_6
203:'Manually Priced',// collatestaple_manually_priced
397:'Brochure Holder',// conversion_brochure_holder
722:'Manually Priced',// conversion_manually_priced
459:'Presentation Folder Conversion - Small',// conversion_presentation_folder_conversion_small
398:'Rack Card Holder',// conversion_rack_card_holder
456:'Table Tent Score & Slit',// conversion_table_tent_score_slit
399:'Cover Wrap',// cover_cover_wrap
400:'Manually Priced',// cover_manually_priced
531:'Poly covers',// cover_poly_covers
723:'Manually Priced',// cut_manually_priced
112:'Deboss - X-small (up to 3.5x2)',// deboss_x_small
113:'Deboss - Small (up to 4x6) ',// deboss_small
114:'Deboss - Medium (up to 4x9) ',// deboss_medium
115:'Deboss - Large (up to 8.5x11) ',// deboss_large
116:'Deboss - X-large (up to 11x17) ',// deboss_x_large
502:'Deboss - X-small (standing die)',// deboss_deboss_extra_small_pre_existing_die
501:'Deboss - Small (standing die)',// deboss_deboss_small_pre_existing_die
500:'Deboss - Medium (standing die)',// deboss_deboss_medium_pre_existing_die
499:'Deboss - Large (standing die)',// deboss_deboss_large_pre_existing_die
498:'Deboss - X-large (standing die)',// deboss_deboss_x_large_pre_existing_die
117:'Manually Priced',// deboss_manually_priced
598:'Logo Package - 3 options',// designservices_logo_package_3_options
599:'Logo Package - 6 options',// designservices_logo_package_6_options
600:'Banner Design',// designservices_banner_design
601:'Book Cover',// designservices_book_cover
602:'Bookmark Design - 1-sided',// designservices_bookmark_design_1_sided
603:'Bookmark Design - 2-sided',// designservices_bookmark_design_2_sided
604:'Brochure/Flyer Design 8.5x11 - 1-sided',// designservices_brochure_flyer_design_8_5x11_1_sided
605:'Brochure/Flyer Design 8.5x11 - 2-sided',// designservices_brochure_flyer_design_8_5x11_2_sided
606:'Brochure/Flyer Template Layout 8.5x11 - 1-sided',// designservices_brochure_flyer_template_layout_8_5x11_1_sided
622:'Brochure/Flyer Template Layout 8.5x11 - 2-sided',// designservices_brochure_flyer_template_layout_8_5x11_2_sided
607:'Brochure/Flyer Design 11x17 - 1-sided',// designservices_brochure_flyer_design_11x17_1_sided
608:'Brochure/Flyer Design 11x17 - 2-sided',// designservices_brochure_flyer_design_11x17_2_sided
623:'Brochure/Flyer Template Layout 11x17 - 1-sided',// designservices_brochure_flyer_template_layout_11x17_1_sided
624:'Brochure/Flyer Template Layout 11x17 - 2-sided',// designservices_brochure_flyer_template_layout_11x17_2_sided
610:'Brochure/Flyer Design 11x25.5 - 1-sided',// designservices_brochure_flyer_design_11x25_5_1_sided
611:'Brochure/Flyer Design 11x25.5 - 2-sided',// designservices_brochure_flyer_design_11x25_5_2_sided
594:'Business Card Design - 1-sided',// designservices_business_card_design
595:'Business Card Design - 2-sided',// designservices_business_card_design_2_sided
612:'Business Card Template Layout - 1-sided',// designservices_business_card_template_layout
785:'Business Card Template Layout - 2-sided',// designservices_business_card_template_layout_2_sided
781:'Letterhead & Envelope Design - 1-sided',// designservices_letterhead_envelope_design
784:'Letterhead & Envelope Design - 2-sided',// designservices_letterhead_envelope_design_2_sided
782:'Letterhead & Envelope Template Layout',// designservices_letterhead_envelope_template_layout
596:'Postcard/Note/Greeting/Rack Cards Design - 1-sided',// designservices_card_design_1_sided
597:'Postcard/Note/Greeting/Rack Cards Design - 2-sided',// designservices_card_design_2_sided
613:'Postcard/Greeting Card Template Layout',// designservices_postcard_greeting_card_template_layout
614:'Catalog Design (8 pages)',// designservices_catalog_design_8_pages
615:'Catalog Design (12 pages)',// designservices_catalog_design_12_pages
616:'Catalog Design (16 pages)',// designservices_catalog_design_16_pages
617:'Catalog Design (20 pages)',// designservices_catalog_design_20_pages
618:'Poster Design (up to 24x36)',// designservices_poster_design_up_to_24x36
619:'Presentation/File Folder Design',// designservices_presentation_file_folder_design
783:'Typesetting - Business Card',// designservices_typesetting_business_card
620:'Hourly Design Fee',// designservices_hourly_design_fee
621:'Manually Priced',// designservices_manually_priced
453:'Die cut - Large (preexisting)',// diecut_die_cut_medium_preexisting
118:'Diecut - X-small (up to 3.5x2)',// diecut_x_small
119:'Diecut - Small (up to 4x6)',// diecut_small
120:'Diecut - Medium (up to 4x9)',// diecut_medium
121:'Diecut - Large (up to 8.5x11) ',// diecut_large
122:'Diecut - X-Large (up to 11x17) ',// diecut_x_large
450:'Diecut - X-small (standing die)',// diecut_die_cut_xsmall_preexisting
451:'Diecut - Small (standing die)',// diecut_die_cut_small_preexisting
452:'Diecut - Medium (standing die)',// diecut_die_cut_medium_new
454:'Diecut - Large (standing die)',// diecut_die_cut_large_new
455:'Diecut - X-Large (standing die)',// diecut_die_cut_xlarge_preexisting
306:'Door hanger die cut',// diecut_door_hanger_die_cut
123:'Manually Priced',// diecut_manually_priced
718:'Manually Priced',// drillcount_manually_priced
644:'1 hole',// drillcount_1_hole
126:'Single page',// drillcount_single_page
645:'2 holes',// drillcount_2_holes
127:'Multi page',// drillcount_multi_page
646:'3 holes',// drillcount_3_holes
647:'4 holes',// drillcount_4_holes
648:'5 holes',// drillcount_5_holes
649:'6 holes',// drillcount_6_holes
650:'7 holes',// drillcount_7_holes
651:'8 holes',// drillcount_8_holes
652:'9 holes',// drillholes_9_holes
124:'1-3 holes',// drillholes_1_3
370:'1/4" drill hole',// drillholes_1_4_drill_hole
324:'1/8" drill hole',// drillholes_1_8_drill_hole
125:'>3 holes',// drillholes_gt3
371:'Manually Priced',// drillholes_manually_priced
128:'Emboss - X-small (up to 3.5x2) ',// emboss_x_small
129:'Emboss - Small (up to 4x6) ',// emboss_small
130:'Emboss - Medium (up to 4x9) ',// emboss_medium
131:'Emboss - Large (up to 8.5x11) ',// emboss_large
132:'Emboss - X-large (up to 11x17) ',// emboss_x_large
507:'Emboss - X-small (standing die)',// emboss_emboss_x_small_pre_existing_die
506:'Emboss - Small (standing die)',// emboss_emboss_small_pre_existing_die
505:'Emboss - Medium (standing die)',// emboss_emboss_medium_pre_existing_die
504:'Emboss - Large (standing die)',// emboss_emboss_large_pre_existing_die
503:'Emboss - X-large (standing die)',// emboss_emboss_x_large_pre_existing_die
133:'Manually Priced',// emboss_manually_priced
460:'#1 Booklet Envelopes',// envelopes_lb1_booklet_envelope
219:'Slimline Envelopes',// envelopes_slimline
220:'A2 Envelopes (4.375 x 5.75)',// envelopes_a2
221:'A6 Envelopes (4.75 x 6.5)',// envelopes_a6
222:'A7 Envelopes (5.25 x 7.25)',// envelopes_a7
223:'A8 Envelopes (5.5 x 8.125)',// envelopes_a8
224:'A9 Envelopes (5.75 x 8.75)',// envelopes_a9
225:'A10 Envelopes',// envelopes_a10
226:'Slimline Envelopes',// envelopes_lb4_baronial
227:'#5 Baronial Envelopes',// envelopes_lb5_baronial
228:'#5.5 Baronial Envelopes (4.375 x 5.75)',// envelopes_lb5_5_baronial
229:'#6 Baronial Envelopes (4.75 x 6.5)',// envelopes_lb6_baronial
230:'Lee Envelopes (5.25 x 7.25)',// envelopes_lee
231:'#6 1/4 Envelopes (3.5 x 6)',// envelopes_lb6_1_4
232:'#6 3/4 Envelopes (3.625 x 6.5)',// envelopes_lb6_3_4
233:'#7 Envelopes',// envelopes_lb7
234:'#7 3/4 Monarch Envelopes',// envelopes_lb7_3_4_monarch
235:'#8 5/8 Envelopes',// envelopes_lb8_5_8
236:'#9 Envelopes (3.875 x 8.875)',// envelopes_lb9
461:'#9 window Envelopes (3.875 x 8.875)',// envelopes_lb9_window_envelopes
237:'#10 Envelopes (4.125 x 9.5)',// envelopes_lb10
462:'#10 Window Envelopes (4.125 x 9.5)',// envelopes_lb10_window_envelopes
463:'#10 Security Envelopes (4.125 x 9.5)',// envelopes_lb10_security_envelopes
464:'#10 Security Window Envelopes (4.125 x 9.5)',// envelopes_lb10_security_window_envelopes
238:'#11 Envelopes',// envelopes_lb11
239:'#12 Envelopes',// envelopes_lb12
240:'#14 Envelopes',// envelopes_lb14
241:'#3 Booklet Envelopes',// envelopes_lb3_booklet
242:'#5 Booklet Envelopes',// envelopes_lb5_booklet
243:'#6 Booklet Envelopes',// envelopes_lb6_booklet
244:'#6 1/2 Booklet Envelopes (6 x 9)',// envelopes_lb6_1_2_booklet
245:'#6 5/8 Booklet Envelopes',// envelopes_lb6_5_8_booklet
246:'#6 3/4 Booklet Envelopes',// envelopes_lb6_3_4_booklet
247:'#7 1/4 Booklet Envelopes',// envelopes_lb7_1_4_booklet
248:'#7 1/2 Booklet Envelopes',// envelopes_lb7_1_2_booklet
249:'#9 Booklet Envelopes',// envelopes_lb9_booklet
250:'#9 1/2 Booklet Envelopes (9 x 12)',// envelopes_lb9_1_2_booklet
740:'#9 1/2 Booklet Envelopes Peel-Seal (9 x 12) ',// envelopes_lb9_1_2_booklet_envelopes_peel_seal_9x12_
251:'#10 Booklet Envelopes (9.5 x 12.625)',// envelopes_lb10_booklet
741:'#10 Booklet Envelopes Peel-Seal (9.5 x 12.625) ',// envelopes_lb10_booklet_envelopes_9_5x12_625_
252:'#13 Booklet Envelopes (10 x 13)',// envelopes_lb13_booklet
253:'#1 Catalog Envelopes',// envelopes_lb1_catalog
254:'#1 1/2 Catalog Envelopes',// envelopes_lb1_1_2_catalog
255:'#3 Catalog Envelopes',// envelopes_lb3_catalog
256:'#6 Catalog Envelopes',// envelopes_lb6_catalog
257:'#9 3/4 Catalog Envelopes',// envelopes_lb9_3_4_catalog
258:'#10 1/2 Catalog Envelopes (9 x 12)',// envelopes_lb10_1_2_catalog
259:'#12 1/2 Catalog Envelopes (9.5 x 12.625)',// envelopes_lb12_1_2_catalog
260:'#13 1/2 Catalog Envelopes (10 x 13)',// envelopes_lb13_1_2_catalog
261:'#14 1/2 Catalog Envelopes',// envelopes_lb14_1_2_catalog
262:'#15 Catalog Envelopes',// envelopes_lb15_catalog
263:'Jumbo 11x17 Envelopes',// envelopes_jumbo_11x17
264:'Jumbo 15x20 Envelopes',// envelopes_jumbo_15x20
265:'Jumbo 16x20 Envelopes',// envelopes_jumbo_16x20
266:'Jumbo 17x22 Envelopes',// envelopes_jumbo_17x22
267:'Jumbo 22x27 Envelopes',// envelopes_jumbo_22x27
362:'Manually Priced',// envelopes_manually_priced
719:'Manually Priced',// envwindowlocation_manually_priced
136:'Standard window',// envwindowlocation_standard
137:'Custom window (size or placement)',// envwindowlocation_custom
138:'Foil stamp - X-small (up to 3.5x2) ',// foilstampsize_x_small
139:'Foil stamp - Small (up to 4x6) ',// foilstampsize_small
140:'Foil stamp - Medium (up to 4x9) ',// foilstampsize_medium
141:'Foil stamp - Large (up to 8.5x11) ',// foilstampsize_large
142:'Foil stamp - X-large (up to 11x17) ',// foilstampsize_x_large
512:'Foil stamp - X-small (standing die)',// foilstampsize_foil_stamp_x_small_pre_existing_die
511:'Foil stamp - Small (standing die)',// foilstampsize_foil_stamp_small_pre_existing_die
510:'Foil stamp - Medium (standing die)',// foilstampsize_foil_stamp_medium_pre_existing_die
509:'Foil stamp - Large (standing die)',// foilstampsize_foil_stamp_large_pre_existing_die
508:'Foil stamp - X-large (standing die)',// foilstampsize_foil_stamp_x_large_pre_existing_die
143:'Manually Priced',// foilstampsize_manually_priced
733:'Half fold finished catalog (more than 12 pgs)',// fold_half_fold_finished_catalog_more_than_12_pgs
97:'Accordion Fold',// fold_accordion_fold
98:'Barrel Roll Fold',// fold_barrel_roll_fold
99:'Gate Fold - Closed',// fold_gate_fold
389:'Double Parallel Fold',// fold_double_parallel_fold
101:'Four Panel Fold',// fold_four_panel_fold
103:'Half Fold',// fold_half_fold
104:'Half/Half Fold',// fold_half_then_half
105:'Half/Tri Fold',// fold_half_then_tri_fold
106:'Map Fold',// fold_map_fold
107:'Gate Fold - Open',// fold_open_gate_fold
108:'Quarter Fold',// fold_quarter_fold
109:'Tri Fold',// fold_tri_fold
317:'Tri then Half Fold',// fold_tri_then_half_fold
110:'Z Fold',// fold_z_fold
111:'Manually Priced',// fold_manually_priced
319:'Fold, Collate, Stitch',// foldcollatestaple_fold_collate_stitch
289:'Manually Priced',// foldcollatestaple_manually_priced
322:'Large',// imprint_large
321:'Medium',// imprint_medium
401:'NCR numbering',// imprint_numbering
630:'Return address in 1-PMS',// imprint_return_address_in_1_pms
320:'Return address in black',// imprint_return_address_in_black
373:'Manually Priced',// imprint_manually_priced
402:'Black',// imprintcolor_black
404:'Manually Priced',// imprintcolor_manually_priced
403:'Red',// imprintcolor_red
83:'4-Color',// ink_4_color
85:'Black',// ink_black
87:'Manually Priced',// ink_manually_priced
144:'1 piece',// insert_1_piece
738:'Insert card into slits',// insert_insert_card_into_slits
145:'2 pieces',// insert_2_pieces
146:'3 pieces',// insert_3_pieces
739:'Manually Priced',// insert_manually_priced
729:'Manually Priced',// laminate_manually_priced
513:'Laminate - 3 mil Edge Seal - up to 5.5 x 8.5',// laminate_laminate_3_mil_up_to_5_5x8_5
514:'Laminate - 3 mil Edge Seal - up to 8.5 x 11',// laminate_laminate_3_mil_up_to_8_5x11
515:'Laminate - 3 mil Edge Seal - up to 11 x 17',// laminate_laminate_3_mil_up_to_11x17
516:'Laminate - 5 mil Edge Seal - up to 5.5 x 8.5',// laminate_laminate_5_mil_up_to_5_5x8_5
517:'Laminate - 5 mil Edge Seal - up to 8.5 x 11',// laminate_laminate_5_mil_up_to_8_5x11
518:'Laminate - 5 mil Edge Seal - up to 11 x 17',// laminate_laminate_5_mil_up_to_11x17
678:'1st Class',// mail_1st_class
679:'1st Class - Presorted',// mail_1st_class_presorted
680:'Bulk Mail',// mail_bulk_mail
681:'Manually Priced',// mail_manually_priced
682:'Not Mailed',// mail_not_mailed
730:'Manually Priced',// manualbaseprice_manually_priced
629:'Pantone Guide',// nonprintedproduct_pantone_guide
632:'Manually Priced',// nonprintedproduct_manually_priced
753:'Manually Priced',// other_manually_priced
328:'10 PT C1S Cover',// paper_10_pt_c1s_cover
436:'10 pt Nordic C1S Cover',// paper_10_pt_nordic_c1s_cover
390:'100# Classic Linen Cover',// paper_100lb_classic_linen_cover
439:'100# McCoy Silk Cover',// paper_100lb_mccoy_silk_cover
434:'100# McCoy Silk Text',// paper_100lb_mccoy_silk_text
351:'100# Solutions Cover',// paper_100lb_solutions_cover
446:'100# Topkote Dull/Matte Cover',// paper_100lb_topkote_dull_matte_cover
417:'110# Classic Crest Cover',// paper_110lb_classic_crest_text
418:'110# Classic Crest Cover',// paper_110lb_classic_crest_cover
385:'110# Starwhite Cover',// paper_100lb_starwhite_cover
332:'12 PT C1S',// paper_12_pt_c1s
437:'12 pt Nordic C1S Cover',// paper_12_pt_nordic_c1s_cover
339:'12 pt. C2S',// paper_12_pt_c2s
749:'120# Dull/Matte Cover 14 pt PC55',// paper_120lb_dull_matte_cover_14_pt_pc55
748:'120# Gloss Cover 14 pt PC55',// paper_120lb_gloss_cover_14_pt_pc55
440:'120# McCoy Silk Cover',// paper_120lb_mccoy_silk_cover
640:'120# Topkote Dull/Matte Cover',// paper_120lb_topkote_dull_matte_cover
639:'120# Topkote Gloss Cover',// paper_120lb_topkote_gloss_cover
279:'13 oz Vinyl Banner',// paper_13_oz_vinyl_banner
444:'130# Classic Crest Cover',// paper_130lb_classic_crest_cover
447:'130# Topkote Dull/Matte Cover',// paper_130lb_topkote_dull_matte_cover
445:'130# Topkote Gloss Cover',// paper_130lb_topkote_gloss_cover
284:'2-Part NCR',// paper_2_part_ncr
765:'20 mil Plastic',// paper_20_mil_plastic
421:'20# Bond',// paper_20lb_bond
424:'24# Classic Laid Writing',// paper_24lb_classic_laid
423:'24# Classic Linen Writing',// paper_24lb_classic_linen_writing
419:'24# Laser',// paper_24lb_bond
277:'24# Uncoated Wove',// paper_24lb_uncoated
278:'28# Uncoated Wove',// paper_28lb_uncoated
441:'28# UV/Ultra II Translucent',// paper_28lb_uv_ultra_ii_translucent
285:'3-Part NCR',// paper_3_part_ncr
641:'30 mil Plastic',// paper_30_mil_plastic
420:'32# Laser',// paper_32lb_laser
442:'36# UV/Ultra II Translucent ',// paper_36lb_uv_ultra_ii_translucent
388:'4-Part NCR',// paper_4_part_ncr
435:'60# Astrobrights Text',// paper_60lb_astrobrights_text
383:'60# Fasson Crack n Peel',// paper_60lb_fasson_crack_n_peel_block_out_high_gloss_litho
427:'60# Galaxy Offset Text',// paper_60lb_galaxy_offset_text
286:'60# MacTac Labels',// paper_60lb_mactac_labels
432:'60# Whitehall Text',// paper_60lb_whitehall_text
465:'65# Astrobrights Cover',// paper_65lb_astrobrights_cover
431:'65# Skytone Text',// paper_70lb_skytone_text
426:'70# Classic Linen Text',// paper_70lb_classic_linen_text
428:'70# Domtar Colors Text',// paper_70lb_domtar_colors_text
429:'70# Feltweave Text',// paper_70lb_feltweave_text
430:'70# Nekoosa Linen Text',// paper_70lb_nekoosa_linen_text
415:'70# Whitehall Text',// paper_70lb_whitehall_text
326:'8 PT C1S Cover',// paper_8_pt_c1s_cover
425:'80# Classic Linen Cover Epic Black',// paper_80lb_classic_linen_cover_black
438:'80# McCoy Silk Cover',// paper_80lb_mccoy_silk_cover
433:'80# McCoy Silk Text',// paper_80lb_mccoy_silk_text
633:'80# Photo Gloss',// paper_80lb_photo_gloss
643:'80# Photo Gloss on Foamboard',// paper_80lb_photo_gloss_on_foamboard
642:'80# Photo Gloss with Foamboard',// paper_80lb_photo_gloss_with_foamboard
333:'80# Uncoated Cover',// paper_80lb_uncoated_cover
448:'88# Strathmore Bristol',// paper_88lb_strathmore_bristol
731:'Car Magnet-Biz Dev',// paper_car_magnet_biz_dev
280:'CBSL-BCrd-001',// paper_cbsl_bcrd_001
281:'CBSL-LH&E-001',// paper_cbsl_lh_e_001
282:'CBSL-Lthd-001',// paper_cbsl_lthd_001
283:'CBSL-Prez-001',// paper_cbsl_prez_001
340:'Environment 80# Text',// paper_environment_80lb_text
352:'Foam Board',// paper_foam_board
353:'Joy_Red_P_GC_V',// paper_joy_red_p_gc_v
354:'Joy_Red_P_NC_V',// paper_joy_red_p_nc_v
331:'Knightkote Matte 100# Cover',// paper_knightkote_matte_100lb_cover
330:'Lustro Dull 100# Cover',// paper_lustro_dull_100lb_cover
334:'Lustro Dull 120# Cover',// paper_lustro_dull_120lb_cover
335:'Lustro Dull Cream 100# Cover',// paper_lustro_dull_cream_100lb_cover
338:'Lustro Dull Cream 80# Text',// paper_lustro_dull_cream_80lb_text
355:'Lustro Gloss 100# Cover',// paper_lustro_gloss_100lb_cover
329:'Lustro Gloss 120# Cover',// paper_lustro_gloss_120lb_cover
342:'Lustro Gloss 80# Text',// paper_lustro_gloss_80lb_text
287:'Mounted Foamboard',// paper_mounted_foamboard
336:'Nekoosa 70# Text',// paper_nekoosa_70lb_text
356:'Ornaments_P_GC_H',// paper_ornaments_p_gc_h
357:'Ornaments_P_NC_H',// paper_ornaments_p_nc_h
358:'Peace_Letter_blocks_P_GC_H',// paper_peace_letter_blocks_p_gc_h
359:'Peace_Letter_blocks_P_NC_H',// paper_peace_letter_blocks_p_nc_h
732:'Plastic Sign-Biz Dev',// paper_plastic_sign_biz_dev
769:'Post-It Notes Neon Text',// paper_post_it_notes_neon_text
770:'Post-It notes Recycled Text',// paper_post_it_notes_recycled_text
638:'Post-It Notes Text',// paper_post_it_notes_text
360:'Seasons_Greetings_P_GC_V',// paper_seasons_greetings_p_gc_v
361:'Seasons_Greetings_P_NC_V',// paper_seasons_greetings_p_nc_v
341:'Topkote Dull 100# Cover',// paper_topkote_dull_100lb_cover
337:'Topkote Dull 80# Text',// paper_topkote_dull_80lb_text
9:'80# Gloss Text',// paper_80lb_gloss_text
10:'70# Uncoated Text',// paper_70lb_uncoated_text
11:'80# Dull/Matte Text',// paper_80lb_matte_text
12:'100# Gloss Text',// paper_100lb_gloss_text
13:'70# Colorsource Text',// paper_70lb_colorsource_text
14:'80# Dull/Matte Cover',// paper_80lb_dull_matte_cover
15:'10 pt Carolina C1S Cover',// paper_10_pt_carolina_c1s_cover
16:'80# Cougar Text',// paper_80lb_cougar_text
17:'80# Gloss Cover',// paper_80lb_gloss_cover
18:'80# Lustro Dull Text',// paper_80lb_lustro_dull_text
19:'80# Lustro Dull Cream Text',// paper_80lb_lustro_dull_cream_text
20:'80# Centura Silk Text',// paper_80lb_centura_silk_text
21:'80# Centura Gloss Text',// paper_80lb_centura_gloss_text
22:'100# Dull/Matte Text',// paper_100lb_dull_matte_text
23:'100# Gloss Cover',// paper_100lb_gloss_cover
24:'80# Nekoosa Linen Text',// paper_80lb_nekoosa_linen_text
25:'70# Royal Fiber Text',// paper_70lb_royal_fiber_text
26:'100# Cougar Text',// paper_100lb_cougar_text
27:'24# Classic Crest Writing',// paper_24lb_classic_crest_writing
28:'24# Classic Columns Writing',// paper_24lb_classic_columns_writing
29:'100# Lustro Dull Text',// paper_100lb_lustro_dull_text
30:'100# Lustro Dull Cream Text',// paper_100lb_lustro_dull_cream_text
31:'100# Centura Silk Text',// paper_100lb_centura_silk_text
32:'100# Centura Gloss Text',// paper_100lb_centura_gloss_text
33:'12pt. Carolina C1S Cover',// paper_12pt_carolina_c1s_cover
34:'80# Skytone Text',// paper_80lb_skytone_text
35:'80# Environment Text',// paper_80lb_environment_text
36:'24# Classic Cotton Writing 25',// paper_24lb_classic_cotton_writing_25
37:'24# Strathmore Writing 25 - Cotton',// paper_24lb_strathmore_writing_25_cotton
38:'75# Classic Laid Text',// paper_75lb_classic_laid_text
39:'80# Classic Columns Text',// paper_80lb_classic_columns_text
40:'80# Evergreen 100 PC Text',// paper_80lb_evergreen_100_pc_text
41:'80# Feltweave Text',// paper_80lb_feltweave_text
42:'100# Uncoated Cover',// paper_100lb_uncoated_cover
43:'120# Gloss Cover 14 pt',// paper_120lb_gloss_cover
44:'120# Dull/Matte Cover 14 pt',// paper_120lb_dull_matte_cover
45:'80# Starwhite Text',// paper_80lb_starwhite_text
46:'80# Lustro Dull Cover',// paper_80lb_lustro_dull_cover
47:'80# Lustro Dull Cream Cover',// paper_80lb_lustro_dull_cream_cover
48:'80# Centura Silk Cover',// paper_80lb_centura_silk_cover
49:'80# Centura Gloss Cover',// paper_80lb_centura_gloss_cover
387:'70# Classic Crest Text ',// paper_70lb_classic_crest_text_
50:'80# Classic Crest Text',// paper_80lb_classic_crest_text
51:'80# Cougar Cover',// paper_80lb_cougar_cover
52:'80# Classic Linen Text',// paper_80lb_classic_linen_text
53:'80# Astrobrights Cover',// paper_80lb_astrobrights_cover
54:'100# Cougar Cover',// paper_100lb_cougar_cover
55:'100# Lustro Dull Cover',// paper_100lb_lustro_dull_cover
56:'100# Lustro Dull Cream Cover',// paper_100lb_lustro_dull_cream_cover
57:'100# Classic Crest Text',// paper_100lb_classic_crest_text
58:'80# Environment Cover',// paper_80lb_environment_cover
59:'65# Skytone Cover',// paper_80lb_skytone_cover
60:'100# Centura Silk Cover',// paper_100lb_centura_silk_cover
61:'80# Feltweave Cover',// paper_80lb_feltweave_cover
62:'80# Nekoosa Linen Cover',// paper_80lb_nekoosa_linen_cover
63:'80# Royal Fiber Cover',// paper_80lb_royal_fiber_cover
64:'10 pt Kromekote C1S Cover',// paper_10_pt_kromekote_c1s_cover
65:'80# Evergreen 100 PC Cover',// paper_80lb_evergreen_100_pc_cover
66:'120# Centura Silk Cover',// paper_120lb_centura_silk_cover
67:'80# Starwhite Cover',// paper_80lb_starwhite_cover
68:'12 pt Kromekote C1S Cover',// paper_12_pt_kromekote_c1s_cover
69:'80# Classic Laid Cover',// paper_80lb_classic_laid_cover
70:'100# Centura Gloss Cover',// paper_100lb_centura_gloss_cover
71:'80# Classic Crest Cover',// paper_80lb_classic_crest_cover
72:'100# Nekoosa Linen Cover',// paper_100lb_nekoosa_linen_cover
73:'10 pt Kromekote C2S Cover',// paper_10_pt_kromekote_c2s_cover
74:'80# Classic Linen Cover',// paper_80lb_classic_linen_cover
75:'80# Classic Columns Cover',// paper_80lb_classic_columns_cover
76:'120# Centura Gloss Cover',// paper_120lb_centura_gloss_cover
386:'130# Centura Gloss Cover',// paper_130lb_centura_gloss_cover
77:'12 pt Kromekote C2S Cover',// paper_12_pt_kromekote_c2s_cover
78:'100# Classic Crest Cover',// paper_100lb_classic_crest_cover
80:'80# Strathmore Writing Cover',// paper_80lb_strathmore_cotton_bristol
81:'80# Classic Cotton Bristol',// paper_80lb_classic_cotton_bristol
82:'13 Pt Magnet Stock',// paper_13_pt_magnet_stock
348:'Manually Priced',// paper_manually_priced
532:'Antique Gray',// papercolor_antique_gray
533:'Avalanche White',// papercolor_avalanche_white
534:'Avon Brilliant White',// papercolor_avon_brilliant_white
535:'Balsa',// papercolor_balsa
536:'Baronial Ivory',// papercolor_baronial_ivory
537:'Birch',// papercolor_birch
538:'Blue',// papercolor_blue
539:'Canary',// papercolor_canary
773:'Canary Yellow',// papercolor_canary_yellow
779:'Carnation',// papercolor_carnation
540:'Carrara White',// papercolor_carrara_white
541:'Celestial Blue',// papercolor_celestial_blue
542:'Classic Cream',// papercolor_classic_cream
543:'Classic Natural',// papercolor_classic_natural
544:'Cosmic Orange',// papercolor_cosmic_orange
545:'Cottonwood',// papercolor_cottonwood
546:'Cream',// papercolor_cream
547:'Desert Storm',// papercolor_desert_storm
548:'Fireball Fuchsia',// papercolor_fireball_fuchsia
549:'Frosted Glass',// papercolor_frosted_glass
550:'Galaxy Gold',// papercolor_galaxy_gold
551:'Gamma Green',// papercolor_gamma_green
552:'Gemini Green',// papercolor_gemini_green
553:'Gray',// papercolor_gray
554:'Green',// papercolor_green
555:'Ice Blue',// papercolor_ice_blue
556:'Kraft',// papercolor_kraft
557:'Lift-off Lemon',// papercolor_lift_off_lemon
768:'Light Gray',// papercolor_light_gray
558:'Lunar Blue',// papercolor_lunar_blue
728:'Manually Priced',// papercolor_manually_priced
559:'Martian Green',// papercolor_martian_green
560:'Natural',// papercolor_natural
776:'Neon Lime',// papercolor_neon_lime
775:'Neon Orange',// papercolor_neon_orange
777:'Neon Pink',// papercolor_neon_pink
561:'Orbit Orange',// papercolor_orbit_orange
562:'PC 100 Natural',// papercolor_pc_100_natural
563:'PC100 Natural',// papercolor_pc100_natural
564:'PC100 White',// papercolor_pc100_white
565:'Periwinkle',// papercolor_periwinkle
566:'Planetary Purple',// papercolor_planetary_purple
567:'Plasma Pink',// papercolor_plasma_pink
568:'Pulsar Pink',// papercolor_pulsar_pink
572:'Re-Entry Red',// papercolor_re_entry_red
569:'Recycled Bright White',// papercolor_recycled_bright_white
570:'Recycled Natural White',// papercolor_recycled_natural_white
571:'Recycled White',// papercolor_recycled_white
573:'Rocket Red',// papercolor_rocket_red
574:'Rose',// papercolor_rose
575:'Sirius',// papercolor_sirius
576:'Sirius - Smooth',// papercolor_sirius_smooth
771:'Sky Blue',// papercolor_sky_blue
577:'Soft White',// papercolor_soft_white
578:'Solar White',// papercolor_solar_white
579:'Solar Yellow',// papercolor_solar_yellow
772:'Spring Green',// papercolor_spring_green
580:'Stardust White',// papercolor_stardust_white
581:'Sunburst Yellow',// papercolor_sunburst_yellow
582:'Terra Green',// papercolor_terra_green
583:'Terrestrial Teal',// papercolor_terrestrial_teal
584:'Thyme',// papercolor_thyme
585:'Tiara',// papercolor_tiara
586:'Tiara - Hi-Tech',// papercolor_tiara_hi_tech
587:'Tiara - Smooth',// papercolor_tiara_smooth
588:'Tiara - Vellum',// papercolor_tiara_vellum
589:'Ultimate White',// papercolor_ultimate_white
590:'Ultra Bright White',// papercolor_ultra_bright_white
778:'Ultra Grape',// papercolor_ultra_grape
774:'Ultra Yellow',// papercolor_ultra_yellow
591:'Venus Violet',// papercolor_venus_violet
592:'Vulcan Green',// papercolor_vulcan_green
593:'White',// papercolor_white
150:'Perforation',// perfnumber_perforation
422:'Three perfs',// perfnumber_three_perfs
323:'Two perfs',// perfnumber_multi_page_perf
151:'Manually Priced',// perfnumber_manually_priced
755:'Lanyard Slot Long Side',// plclanyardslot_lanyard_slot_long_side
754:'Lanyard Slot Short Side',// plclanyardslot_lanyard_slot_short_side
756:'Manually Priced',// plclanyardslot_manually_priced
760:'All four corners',// plcroundcorners_all_four_corners
761:'Manually Priced',// plcroundcorners_manually_priced
780:'1/4" round corners',// plcroundcornersize_1_4_round_corners
766:'1/8" round corners',// plcroundcornersize_1_8_round_corners
764:'Manually Priced',// plcroundcornersize_manually_priced
152:'1 pocket on left',// pockets_1_pocket_on_left
153:'1 pocket on right',// pockets_1_pocket_on_right
154:'2 pockets',// pockets_2_pockets
155:'Manually Priced',// pockets_manually_priced
727:'Manually Priced',// postage_manually_priced
712:'postage',// postage_postage
625:'Hard Copy Proof',// proof_hard_copy_proof
631:'Manually Priced',// proof_manually_priced
626:'Press Proof',// proof_press_proof
274:'Hard Copy Mock-up',// proof_hard_copy_mock_up
713:'Manually Priced',// remitflap_manually_priced
156:'Env church offering - Two-sided or Full Bleed',// remitflap_standard
157:'Custom remit flap',// remitflap_custom
162:'1 corner',// roundcorners_1_corner
161:'2 corners',// roundcorners_2_corners
637:'3 corners',// roundcorners_3_corners
160:'All four corners',// roundcorners_all_four_corners
449:'Laminate round corners',// roundcorners_laminate_round_corners
363:'Manually Priced',// roundcorners_manually_priced
368:'1/8"',// roundcornersize_1_8
714:'Manually Priced',// roundcornersize_manually_priced
158:'1/4" round corners',// roundcornersize_1_4
159:'3/8" round corners',// roundcornersize_3_8
635:'1/4" round corners on laminate',// roundcornersize_1_4_round_corners_with_laminate
636:'3/8" round corners on laminate ',// roundcornersize_3_8_round_corners_with_laminate_
318:'Score',// score_standard
372:'Manually Priced',// score_manually_priced
715:'Manually Priced',// scoringfold_manually_priced
290:'Score for folding',// scoringfold_score_for_folding
163:'Glue',// seal_glue
164:'Peel & Seel',// seal_peel_seel
366:'Manually Priced',// seal_manually_priced
408:'Manually Priced',// sheetsperunit_manually_priced
742:'10',// sheetsperunit_10
743:'15',// sheetsperunit_15
745:'20',// sheetsperunit_20
405:'25',// sheetsperunit_25
744:'30',// sheetsperunit_30
746:'35',// sheetsperunit_35
747:'40',// sheetsperunit_40
406:'50',// sheetsperunit_50
788:'60',// sheetsperunit_60
789:'70',// sheetsperunit_70
787:'75',// sheetsperunit_75
790:'80',// sheetsperunit_80
791:'90',// sheetsperunit_90
407:'100',// sheetsperunit_100
653:'Custom',// ship_custom
654:'Customer Pickup',// ship_customer_pickup
655:'Discard',// ship_discard
656:'FedEx 2 Day',// ship_fedex_2_day
657:'FedEx 3 Day',// ship_fedex_3_day
658:'FedEx Freight',// ship_fedex_freight
659:'FedEx Ground',// ship_fedex_ground
660:'FedEx International Economy',// ship_fedex_international_economy
661:'FedEx International Ground',// ship_fedex_international_ground
662:'FedEx International Priority',// ship_fedex_international_priority
663:'FedEx Overnight AM',// ship_fedex_overnight_am
664:'FedEx Overnight PM',// ship_fedex_overnight_pm
665:'FedEx Saturday',// ship_fedex_saturday
666:'Local Courier',// ship_local_courier
667:'Manually Priced',// ship_manually_priced
668:'Truck Freight',// ship_truck_freight
669:'UPS 2 Day',// ship_ups_2_day
670:'UPS 3 Day',// ship_ups_3_day
671:'UPS Ground',// ship_ups_ground
672:'UPS Next Day',// ship_ups_next_day
673:'UPS Next Day Saturday',// ship_ups_next_day_saturday
674:'USPS Express',// ship_usps_express
675:'USPS First Class',// ship_usps_first_class
676:'USPS Parcel Post',// ship_usps_parcel_post
677:'USPS Priority',// ship_usps_priority
720:'Manually Priced',// shrinkcount_manually_priced
168:'Approx ',// shrinkcount_approx
169:'Exact',// shrinkcount_exact
716:'Manually Priced',// shrinkpiecesperpack_manually_priced
165:'Up to 25',// shrinkpiecesperpack_up_to_25
166:'> 25',// shrinkpiecesperpack_gt_25
167:'Single w/chipboard',// shrinkpiecesperpack_single_w_chipboard
750:'Slits - business card',// slits_slits_business_card
751:'Slits - other',// slits_slits_other
170:'Slits on left side',// slits_left_side
171:'Slits on right side',// slits_right_side
172:'Slits on both sides',// slits_both_sides
173:'Manually Priced',// slits_manually_priced
343:'1 PMS',// spot_spot_1
344:'2 PMS',// spot_spot_2
345:'3 PMS',// spot_spot_3
346:'4 PMS',// spot_spot_4
347:'5 PMS',// spot_spot_5
381:'Manually Priced',// spot_manually_priced
179:'Corner staple',// staple_corner
180:'Custom',// staple_custom
369:'Manually Priced',// staple_manually_priced
181:'Tabbing with Mailing',// tab_tab
182:'Multi tab',// tab_multi_tab
634:'Tabbing',// tab_tabbing
365:'Manually Priced',// tab_manually_priced
683:'C10D',// turnaround_c10d
684:'C12D',// turnaround_c12d
685:'C14D',// turnaround_c14d
686:'C1D',// turnaround_c1d
687:'C2D',// turnaround_c2d
688:'C3D',// turnaround_c3d
689:'C4D',// turnaround_c4d
690:'C5D',// turnaround_c5d
691:'C6D',// turnaround_c6d
692:'C7D',// turnaround_c7d
693:'C8D',// turnaround_c8d
694:'C9D',// turnaround_c9d
695:'F3D',// turnaround_f3d
696:'F4D',// turnaround_f4d
697:'F6D',// turnaround_f6d
698:'F9D',// turnaround_f9d
726:'Manually Priced',// turnaround_manually_priced
699:'N10D',// turnaround_n10d
700:'N4D',// turnaround_n4d
701:'N5D',// turnaround_n5d
702:'N6D',// turnaround_n6d
703:'N8D',// turnaround_n8d
704:'R2D',// turnaround_r2d
705:'R3D',// turnaround_r3d
706:'R5D',// turnaround_r5d
707:'R8D',// turnaround_r8d
708:'SR1D',// turnaround_sr1d
709:'SR2D',// turnaround_sr2d
710:'SR4D',// turnaround_sr4d
711:'SR7D',// turnaround_sr7d
409:'Manually Priced',// washup_manually_priced
410:'Wash-Up Charge 1',// washup_wash_up_charge_1
411:'Wash-Up Charge 2',// washup_wash_up_charge_2
412:'Wash-Up Charge 3',// washup_wash_up_charge_3
413:'Wash-Up Charge 4',// washup_wash_up_charge_4
414:'Wash-Up Charge 5'// washup_wash_up_charge_5
};
var ChannelIDEnum = {
'OfficeMax':'0',
'LogoWorks':'1',
'VerticalLend':'2',
'PFLGeneral':'5',
'MarkZuckerbrod':'4',
'JohnLScottRealEstate':'6',
'LenderLeadSolutions':'7',
'GetSoloLlc':'8',
'ColdwellBankerBarbaraSueSeal':'9',
'RegencyFireplaceProducts':'10',
'FreshFruitBouquet':'12',
'OldColonyCompany':'13',
'PetroSkills':'14',
'UnitedFirstFinancial':'15',
'LifePathUnlimited':'11',
'Mimeo':'149'
};
var CouponCodeEnum = {
'HiVolDiscount':'HVD',
'ReferralCodePrefix':'RP1',
'ReferralProgramPrefix':'RP5',
'MakeGoodPrefix':'MG',
'FreeBusinessCards':'FBC',
'MarketingCouponFreeBusinessCards1':'MCFBC1',
'BizFilingsFreeBusinessCards':'BFFBC40',
'VISAFreeBusinessCards':'VISABUSINESS'
};
var CoverInsideEnum = {
'ForCover':'C',
'ForInside':'I',
'InkInside':'InkInside',
'PaperInside':'PaperInside',
'SpotInside':'SpotInside'
};
//
// Code Generated by: InstaPriceAdminNavBar.aspx
//

var CQChangeTypeEnum = {
'Coating':0,
'Finishing':1,
'Ink':2,
'Mail':3,
'None':11,
'Paper':4,
'Product':5,
'ProductSize':6,
'QuantityManual':7,
'QuantityProduct':8,
'SaveQuote':9,
'Spot':10
};
var DiscountTypeEnum = {
'Promotional':0,
'Referral':1,
'HiVol':2,
'SpecialDiscount':3
};
var EnvelopeTypeEnum = {
'YesImageName':'envelope-blank.jpg',
'PrintedImageName':'envelopeFT.jpg'
};
var GridPriceTypeEnum = {
'wholesaleprintprice':'1',
'retailprintprice':'2',
'wholesaleshippingprice':'3',
'retailshippingprice':'4',
'retailprintbase':'5',
'retailprinteach':'6',
'retailshipbase':'7',
'retailshipeach':'8',
'wholesaleprintbase':'9',
'wholesaleprinteach':'10',
'wholesaleshipbase':'11',
'wholesaleshipeach':'12'
};
var InkEnum = {
'DelimValue':'/',
'DelimText':' / '
};
var NoValueEnum = {
57:'No',// backing
68:'',// bindcolor
58:'No',// binding
67:'',// bindingside
36:'',// bindthickness
8:'No Coating',// coating
17:'No Collation',// collate
43:'No Collation',// collateinsertinto
52:'',// collateinsertpieces
44:'No Collation & Staple',// collatestaple
59:'No Conversion',// conversion
60:'No',// cover
66:'',// cut
18:'',// deboss
64:'None',// designservices
19:'No Die Cut',// diecut
46:'',// drillcount
20:'No Drill Holes',// drillholes
21:'No Emboss',// emboss
14:'No Envelopes',// envelopes
47:'No Envelope Window',// envwindowlocation
23:'No Foil',// foilstampsize
11:'No Fold',// fold
54:'None',// foldcollatestaple
55:'Blank',// imprint
61:'None',// imprintcolor
3:'None',// ink
24:'',// insert
74:'',// laminate
71:'',// mail
75:'',// manualbaseprice
65:'',// nonprintedproduct
76:'',// other
6:'No Paper',// paper
73:'Default Color',// papercolor
26:'No Perforation',// perfnumber
77:'No Lanyard Slot',// plclanyardslot
78:'No Round Corners',// plcroundcorners
79:'No Round Corners',// plcroundcornersize
27:'No Pockets',// pockets
72:'',// postage
40:'',// proof
28:'',// remitflap
48:'No Round Corners',// roundcorners
29:'No Round Corners',// roundcornersize
31:'No Score',// score
32:'',// scoringfold
33:'No Seal',// seal
62:'None',// sheetsperunit
70:'',// ship
49:'',// shrinkcount
34:'',// shrinkpiecesperpack
35:'No Slits',// slits
56:'No Spot Color',// spot
37:'No Staple',// staple
38:'',// tab
69:'',// turnaround
63:'No'// washup
};
var NumPagesEnum = {
'CatalogsFive8Value':0,
'CatalogsFive8Text':8,
'CatalogsFive12Value':0.75,
'CatalogsFive12Text':12,
'CatalogsFive16Value':1,
'CatalogsFive16Text':16,
'CatalogsFive20Value':1.75,
'CatalogsFive20Text':20,
'CatalogsFive24Value':2,
'CatalogsFive24Text':24,
'CatalogsFive28Value':2.75,
'CatalogsFive28Text':28,
'CatalogsFive32Value':3,
'CatalogsFive32Text':32,
'CatalogsFive36Value':3.75,
'CatalogsFive36Text':36,
'CatalogsFive40Value':4,
'CatalogsFive40Text':40,
'CatalogsFive44Value':4.75,
'CatalogsFive44Text':44,
'CatalogsFive48Value':5,
'CatalogsFive48Text':48,
'CatalogsFive52Value':5.75,
'CatalogsFive52Text':52,
'CatalogsFive56Value':6,
'CatalogsFive56Text':56,
'CatalogsFive60Value':6.75,
'CatalogsFive60Text':60,
'CatalogsFive64Value':7,
'CatalogsFive64Text':64,
'CatalogsEight4Value':0,
'CatalogsEight4Text':4,
'CatalogsEight8Value':1,
'CatalogsEight8Text':8,
'CatalogsEight12Value':2,
'CatalogsEight12Text':12,
'CatalogsEight16Value':3,
'CatalogsEight16Text':16,
'CatalogsEight20Value':4,
'CatalogsEight20Text':20,
'CatalogsEight24Value':5,
'CatalogsEight24Text':24,
'CatalogsEight28Value':6,
'CatalogsEight28Text':28,
'CatalogsEight32Value':7,
'CatalogsEight32Text':32,
'CatalogsEight36Value':8,
'CatalogsEight36Text':36,
'CatalogsEight40Value':9,
'CatalogsEight40Text':40,
'CatalogsEight44Value':10,
'CatalogsEight44Text':44,
'CatalogsEight48Value':11,
'CatalogsEight48Text':48,
'CatalogsEight52Value':12,
'CatalogsEight52Text':52,
'CatalogsEight56Value':13,
'CatalogsEight56Text':56,
'CatalogsEight60Value':14,
'CatalogsEight60Text':60,
'CatalogsEight64Value':15,
'CatalogsEight64Text':64
};
var OrderingPageEnum = {
'cardsbookmarks':'cardsbookmarks',
'brochureseleven':'brochureseleven',
'brochureseight':'brochureseight',
'brochuresfourteen':'brochuresfourteen',
'brochurestwentyfive':'brochurestwentyfive',
'brochurerackcardholders':'brochurerackcardholders',
'cardsbusinesscards':'cardsbusinesscards',
'cardssrbusinesscards':'cardssrbusinesscards',
'calendars':'calendars',
'catalogsfive':'catalogsfive',
'catalogseight':'catalogseight',
'cdcovers':'cdcovers',
'cardsdoorhangers':'cardsdoorhangers',
'stationeryenvelopesonly':'stationeryenvelopesonly',
'filefolders':'filefolders',
'cardsgreetingcards':'cardsgreetingcards',
'stationerylrgenvelopes':'stationerylrgenvelopes',
'stationeryletterhead':'stationeryletterhead',
'stationeryletterheadonly':'stationeryletterheadonly',
'newsletterseleven':'newsletterseleven',
'newsletterseight':'newsletterseight',
'newsletterstwentyfive':'newsletterstwentyfive',
'cardspostcards':'cardspostcards',
'brochuresposters':'brochuresposters',
'presentationfolders':'presentationfolders',
'cardsrackcards':'cardsrackcards',
'statementstuffers':'statementstuffers',
'customorders':'customorders',
'greetingcards':'holidaycards',
'channelorder':'channelorder',
'largeposterprinting':'largeposterprinting',
'customproduct':'customproduct',
'customproductnoseconds':'customproductnoseconds',
'notepadprinting':'notepadprinting',
'carbonlessncrprinting':'carbonlessncrprinting',
'postitnotesprinting':'postitnotesprinting',
'customplasticcardprinting':'customplasticcardprinting'
};
//
// Code Generated by: InstaPriceAdminNavBar.aspx
//

var PageModeEnum = {
'ChangeOrder':6,
'ChangeProductOptions':4,
'NotSet':0,
'Order':2,
'QuickPrice':3,
'Quote':1,
'RequestQuote':5
};
var PaperFinishEnum = {
'uncoated':'1',
'coated':'2',
'c1s':'3',
'c2s':'4',
'cast_coat':'5',
'columns':'6',
'dull':'7',
'felt':'8',
'gloss':'9',
'hi_tech':'10',
'laid':'11',
'linen':'12',
'parchment':'13',
'silk':'14',
'smooth':'15',
'vellum':'16',
'wove':'17',
'matte':'18'
};
var PriceForEnum = {
'Base':'Base',
'Each':'Each',
'SetupCharge':'SetupCharge'
};
var PricingPercentTypeEnum = {
'MultiVersion':'0',
'Channel':'1',
'Markup':'2'
};
var PricingTypeEnum = {
'printing_subtotal':'1',
'envelopes':'2',
'second_sheets':'3',
'proof_charges':'4',
'rush_charges':'5',
'shipping_handling':'6',
'mailing_services':'7',
'design_services':'8',
'other_product':'9',
'order_total':'10',
'unit_price':'11',
'coupon_discount':'12',
'high_volume_discount':'13',
'discounted_total':'14',
'pfl_pro_discount':'15',
'pfl_pro_total':'16',
'mailing_subtotal':'17',
'product_total':'18',
'proof_discount':'19',
'total_savings':'20',
'pfl_pro_rush_savings':'21'
};
//
// Code Generated by: InstaPriceAdminNavBar.aspx
//

var ProductIDEnum = {
'bookmarks_2x6':59,
'bookmarks_2x7':60,
'brochures_11x17':3,
'brochures_11x25_5':56,
'brochures_8_5x11':9,
'brochures_8_5x14':10,
'brochures_8_5x4_25':85,
'business_cards':13,
'business_cards_short_run':99,
'calendars_5_5x8_5':65,
'calendars_8_5x11':66,
'card_enclosure':86,
'catalogs_5_5x8_5':6,
'catalogs_8_5x11':11,
'cd_covers':14,
'custom_business_cards':22,
'custom_quote':34,
'door_hangers_3_5x8_5':69,
'door_hangers_4_25x11':68,
'envelopes_9_1_2x12_5_8':62,
'envelopes_9x12':61,
'envelopes_lb10_window':89,
'envelopes_only':43,
'file_folders':67,
'generic_custom_1_1':100,
'generic_custom_1_2':101,
'generic_custom_1_3':102,
'generic_custom_1_4':103,
'generic_custom_2_1':104,
'generic_custom_2_2':105,
'generic_custom_2_3':106,
'generic_custom_2_4':107,
'generic_custom_3_1':108,
'generic_custom_3_2':109,
'generic_custom_3_3':110,
'generic_custom_3_4':111,
'generic_custom_4_1':112,
'generic_custom_4_2':113,
'generic_custom_4_3':114,
'generic_custom_4_4':115,
'generic_other':135,
'greeting_cards':15,
'holiday_deluxe_greeting_card':90,
'holiday_deluxe_note_card':91,
'holiday_premium_greeting_card':92,
'holiday_premium_note_card':93,
'index_cards_3x5':84,
'legal_letterhead':88,
'letterhead_envelopes':18,
'letterhead_only':17,
'literature_holder':116,
'menus_7x12':95,
'ncr_form_5_5x8_5':117,
'ncr_form_8_5x11':118,
'ncr_form_8_5x14':119,
'newsletters_11x17':4,
'newsletters_11x25_5':94,
'newsletters_8_5x11':12,
'note_cards':71,
'notepad_4_25x5_5':120,
'notepad_5_5x8_5':121,
'notepads_8_5x11':96,
'plastic_cards_3_1_2x2':143,
'plastic_cards_3_3_8x2_1_8':142,
'plastic_cards_3x5':144,
'plastic_cards_4x6':145,
'post_it_2_75x3_25_sheets':136,
'post_it_2_75x3_50_sheets':137,
'post_it_3x4_25_sheets':138,
'post_it_3x4_50_sheets':139,
'post_it_4x6_25_sheets':140,
'post_it_4x6_50_sheets':141,
'postcards_4_25x5_5':57,
'postcards_4x6':5,
'postcards_5_5x8_5':7,
'postcards_5x7':8,
'postcards_6x11':81,
'postcards_6x9':70,
'posters_11_5x18':20,
'posters_17x24':16,
'posters_22x30':97,
'posters_28x38':98,
'presentation_folders_9x12':52,
'presentation_folders_cbsl_9x12':87,
'rack_cards_4x9':19,
'social_net_card_3_3_8x2_1_8':82,
'social_net_card_basic_3_3_8x2_1_8':83,
'statement_stuffers_10_5x7':78,
'statement_stuffers_10_5x8_5':74,
'statement_stuffers_3_5x7':76,
'statement_stuffers_3_5x8_5':72,
'statement_stuffers_5_5x8_5':75,
'statement_stuffers_7x7':77,
'statement_stuffers_7x8_5':73,
'web_site':149
};
var ProofTypeEnum = {
'PDFValue':'PDF',
'PDFText':'<nobr>Adobe Acrobat PDF Proof</nobr>',
'JPEGValue':'JPEG',
'JPEGText':'<nobr>JPEG Proof Via Web Page</nobr>',
'DOValue':'DO',
'DOText':'DO',
'DHPValue':'Digital Hard Proof',
'DHPText':'<nobr>Digital Hard Proof</nobr>',
'PPValue':'Press Proof',
'PPText':'<nobr>4 x 6 Press Proof</nobr>'
};
//
// Code Generated by: InstaPriceAdminNavBar.aspx
//

var SaveActionsEnum = {
'CreateAnother':0,
'SaveAndCreateAnother':3,
'SaveQuote':2,
'SendQuote':1,
'UpdateOrder':4
};
var ShipTypeEnum = {
'FedExGroundValue':'FDXG',
'FedExGroundText':'Ground',
'FedEx3DayValue':'FDX3DA',
'FedEx3DayText':'3 Day',
'FedEx2DayValue':'FDX2DA',
'FedEx2DayText':'2 Day Air',
'FedExOvernightPMValue':'FDXNDA',
'FedExOvernightPMText':'Overnight',
'CPUValue':'CPU',
'CPUText':'Customer Pickup',
'BulkMailValue':'BM',
'BulkMailText':'Bulk Mail',
'FirstClassPresortedValue':'1CP',
'FirstClassPresortedText':'1st Class - Presorted',
'FirstClassValue':'1C',
'FirstClassText':'1st Class',
'ManuallyPricedValue':'MP',
'ManuallyPricedText':'Manually Priced'
};
//
// Code Generated by: InstaPriceAdminNavBar.aspx
//

var ValidationResultType = {
'Alert':1,
'Arrow':2,
'Confirmation':3,
'Error':7,
'EscalatedConfirmation':5,
'None':0,
'Required':6,
'Warning':4
};
/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/NoValueEnum.js" />
var AqueousPricings;
var VALIDATE_AQUEOUS = 'Aqueous';
var VALIDATE_MUST_NOT_COAT = 'MustNotCoat';

function AqueousPricing(aqueousPricingID, coatingFID, mustNotCoat, coverInside, rblAqueousName, cbMustNotCoatID, rblUVCoatingName) {
this.aqueousPricingID = aqueousPricingID;
this.coatingFID = coatingFID;
this.coatingFIDOri = coatingFID;
this.mustNotCoat = mustNotCoat;
this.coverInside = coverInside;
this.rblAqueousName = rblAqueousName;
this.cbMustNotCoatID = cbMustNotCoatID;
this.rblUVCoatingName = rblUVCoatingName;

this.forCover = (this.coverInside == CoverInsideEnum.ForCover);
this.forInside = (this.coverInside == CoverInsideEnum.ForInside);

this.InsertAqueousPricing();
}

AqueousPricing.prototype.InsertAqueousPricing = function() {
if (typeof(AqueousPricings) == 'undefined') {
AqueousPricings = new Object;
}
AqueousPricings[this.aqueousPricingID] = this;
};

AqueousPricing.prototype.ResetAqueous = function() {
 this.UpdateRadioButtons();
};

AqueousPricing.prototype.ChangeAqueous = function(coatingFID) {
this.ValidateAqueous(((this.productPricingObj) ? this.productPricingObj.GetPaperID() : null), coatingFID, this.mustNotCoat, false);

if (this.productPricingObj) {
this.productPricingObj.AdjustPrices(AdjustTypeEnum.Aqueous);
this.productPricingObj.HandleShowSubmitChanges();
}
};

AqueousPricing.prototype.SetAqueous = function(coatingFID, coatingBID) {
 this.coatingFID = coatingFID;
 this.coatingBID = coatingBID;
 this.UpdateRadioButtons();
};

AqueousPricing.prototype.UpdateRadioButtons = function() {
 if (this.coatingFID == '') {
 SetRadioButtonListChecked(this.rblAqueousName, this.coatingFID);
 SetRadioButtonListChecked(this.rblUVCoatingName, this.coatingFID);
 }
 else if (this.coatingFID == AttributeValueIDEnum.coating_gloss_aqueous) {
 SetRadioButtonListChecked(this.rblAqueousName, this.coatingFID);
 SetRadioButtonListChecked(this.rblUVCoatingName, '');
 }
 else { //if (this.coatingFID == AttributeValueIDEnum.coating_uv_coating)
 SetRadioButtonListChecked(this.rblUVCoatingName, this.coatingFID);
 }
};

AqueousPricing.prototype.ChangeMustNotCoat = function(mustNotCoat) {
this.ValidateAqueous(((this.productPricingObj) ? this.productPricingObj.GetPaperID() : null), this.coatingFID, mustNotCoat, false);
};

AqueousPricing.prototype.SetMustNotCoat = function(mustNotCoat) {
this.mustNotCoat = mustNotCoat;
if ($(this.cbMustNotCoatID)) {
$(this.cbMustNotCoatID).checked = mustNotCoat;
}
};

AqueousPricing.prototype.GetTotalAqueousPrice = function(productID, inkFID, inkBID, spotFID, spotBID, quantity, signatures, paperID, percentCollection) {
 var price = 0;
 var frontPrice;
 var backPrice;
 if (typeof (signatures) != 'undefined' && signatures != null) {
 for (var i = 0, loopCnt = signatures.length; i < loopCnt; i++) {
 price += this.GetAqueousPrice(productID, signatures[s].GetAttributeValueID(AttributeIDEnum.ink, AttributePlacementEnum.front), signatures[s].GetAttributeValueID(AttributeIDEnum.spot, AttributePlacementEnum.front), quantity, signatures[s].GetAttributeValueID(AttributeIDEnum.paper, AttributePlacementEnum.front), signatures[s].TotalSignaturePricingPercent(), percentCollection) +
this.GetAqueousPrice(productID, signatures[s].GetAttributeValueID(AttributeIDEnum.ink, AttributePlacementEnum.back), signatures[s].GetAttributeValueID(AttributeIDEnum.spot, AttributePlacementEnum.back), quantity, signatures[s].GetAttributeValueID(AttributeIDEnum.paper, AttributePlacementEnum.front), signatures[s].TotalSignaturePricingPercent(), percentCollection);
 }
 }
 else {
 frontPrice = this.GetAqueousPrice(productID, inkFID, spotFID, quantity, paperID, 1, percentCollection);
 //Do not price UV coating for postcards with mailing on IP
 if (this.coatingFID == AttributeValueIDEnum.coating_gloss_uv_coating &&
 this.productPricingObj && 
 this.productPricingObj.HasMailing() &&
 (productID == ProductIDEnum.postcards_4_25x5_5 ||
 productID == ProductIDEnum.postcards_4x6 ||
 productID == ProductIDEnum.postcards_5_5x8_5 ||
 productID == ProductIDEnum.postcards_5x7 ||
 productID == ProductIDEnum.postcards_6x11 ||
 productID == ProductIDEnum.postcards_6x9)) {
 backPrice = 0;
 }
 else {
 backPrice = this.GetAqueousPrice(productID, inkBID, spotBID, quantity, paperID, 1, percentCollection);
 }
 price = frontPrice + backPrice;
 }
 return price;
};

AqueousPricing.prototype.GetAqueousPrice = function(productID, inkID, spotID, quantity, paperID, signaturePricingPercent, percentCollection) {
if (this.coatingFID == '' ||
(inkID == '' && spotID == '') ||
(inkID != AttributeValueIDEnum.ink_4_color && this.IsFourColorSideOnlyForAqueous(productID))) {
return 0;
 }

 var quantityBreak = 0;
 var productIndex;
 if (typeof (finishingArr[this.coatingFID][productID]) != 'undefined') {
 productIndex = productID;
 }
 else { //no product override
 productIndex = '';
 }

 // Find the biggest quantity break that is less than or equal to the given quantity
 for (var arrQty in finishingArr[this.coatingFID][productIndex]) {
 if (!isNaN(arrQty)) {
 var arrQtyNum = parseInt(arrQty);
 if (quantity >= arrQtyNum && quantityBreak < arrQtyNum) {
 quantityBreak = arrQtyNum;
 }
 }
 }

 var aqueousBase = finishingArr[this.coatingFID][productIndex][quantityBreak][FINISHING_IDX_BASE];
 var aqueousEach = finishingArr[this.coatingFID][productIndex][quantityBreak][FINISHING_IDX_EACH];
 var setupCharge = finishingArr[this.coatingFID][productIndex][quantityBreak][FINISHING_IDX_SET_UP_CHARGE];

percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.Aqueous, ChannelID);

var price = 0;
// Calculate aqueous price
if (this.productPricingObj && this.productPricingObj.quantityList.length != 0) { //business cards
var quantityList = this.productPricingObj.quantityList;
for (var i = 0, loopCnt = quantityList.length; i < loopCnt; i++) { //loop through version quantities
price += this.CalculateAqueousPrice(quantityList[i], signaturePricingPercent, aqueousBase, aqueousEach, percentCollection, setupCharge);
}
}
else { //one quantity products
price = this.CalculateAqueousPrice(quantity, signaturePricingPercent, aqueousBase, aqueousEach, percentCollection, setupCharge);
}
return price;
};

AqueousPricing.prototype.IsFourColorSideOnlyForAqueous = function(productID) {
return (productID == ProductIDEnum.business_cards || productID == ProductIDEnum.business_cards_short_run ||
 productID == ProductIDEnum.bookmarks_2x6 || productID == ProductIDEnum.bookmarks_2x7 ||
 productID == ProductIDEnum.door_hangers_3_5x8_5 || productID == ProductIDEnum.door_hangers_4_25x11 ||
 productID == ProductIDEnum.rack_cards_4x9 || productID == ProductIDEnum.postcards_4x6 ||
 productID == ProductIDEnum.postcards_4_25x5_5 || productID == ProductIDEnum.postcards_5x7 ||
 productID == ProductIDEnum.postcards_5_5x8_5 || productID == ProductIDEnum.postcards_6x9 ||
 productID == ProductIDEnum.postcards_6x11 || productID == ProductIDEnum.greeting_cards ||
 productID == ProductIDEnum.note_cards || productID == ProductIDEnum.holiday_deluxe_greeting_card ||
 productID == ProductIDEnum.holiday_deluxe_note_card || productID == ProductIDEnum.holiday_premium_greeting_card || 
 productID == ProductIDEnum.holiday_premium_note_card);
};

AqueousPricing.prototype.CalculateAqueousPrice = function(quantity, signaturePricingPercent, aqueousBase, aqueousEach, percentCollection, setupCharge) {
var price;

price = signaturePricingPercent * (aqueousBase + (quantity * aqueousEach)) + setupCharge;

if (typeof(percentCollection) != 'undefined') {
return percentCollection.ApplyPricingPercents(price);
}
else {
return FormatDollar(price);
}
};

AqueousPricing.prototype.ValidateAqueous = function(paperID, coatingFID, mustNotCoat, forPaperChange) {
 var ret = this.IsValidCoating(paperID, coatingFID, mustNotCoat, forPaperChange);
 if (!ret.VALIDATE_RESULT) {
 if (ret.VALIDATE_MESSAGE) {
 alert(ret.VALIDATE_MESSAGE);
 }
 this.SetAqueous(ret.VALIDATE_AQUEOUS);
 this.SetMustNotCoat(ret.VALIDATE_MUST_NOT_COAT);
 }
 else {
 this.coatingFID = coatingFID;
 this.mustNotCoat = mustNotCoat;
 }
 return ret.VALIDATE_RESULT;
};

AqueousPricing.prototype.IsValidCoating = function(paperID, coatingFID, mustNotCoat, forPaperChange) {
 var paperFinish2 = null;
 if (typeof (paperInfoArr[paperID][PAPERINFO_IDX_FINISH2ID]) != 'undefined') {
 paperFinish2 = paperInfoArr[paperID][PAPERINFO_IDX_FINISH2ID];
 }
 //gloss paper or magnet
 var paperAllowsCoating = paperFinish2 == PaperFinishEnum.gloss || paperID == AttributeValueIDEnum.paper_13_pt_magnet_stock;

 //hide/show coating section
 var elem = document.getElementsByTagName("div");
 for (var i = 0; i < elem.length; i++) {
 if (elem[i].id.match("CoatingSection$") == "CoatingSection") {
 if (paperAllowsCoating) {
 elem[i].style.display = 'block';
 }
 else {
 elem[i].style.display = 'none';
 }
 }
 }

 if (paperID == AttributeValueIDEnum.paper_13_pt_magnet_stock && coatingFID == '') {
 return this.GetValidationObject(false, '', AttributeValueIDEnum.coating_gloss_aqueous, false);
 }
 else if (!paperAllowsCoating && coatingFID != '') {
 return this.GetValidationObject(false, '', (forPaperChange) ? '' : this.coatingFID, this.mustNotCoat);
 }
 else if (forPaperChange && paperAllowsCoating && coatingFID == '') { //set aqueous default
 return this.GetValidationObject(false, '', AttributeValueIDEnum.coating_gloss_aqueous, this.mustNotCoat);
 }
 else if (coatingFID != '' && mustNotCoat) {
 return this.GetValidationObject(false, 'Must Not Coat option is not available for ' + AttributeValueNameEnum[coatingFID] + '.', coatingFID, false);
 }
 //No UV coating for brochures, newsletters, catalogs and calendars with mailing
 else if (this.productPricingObj && this.productPricingObj.HasMailing()
 && coatingFID == AttributeValueIDEnum.coating_gloss_uv_coating
 && (this.productPricingObj.productID == ProductIDEnum.brochures_11x17
 || this.productPricingObj.productID == ProductIDEnum.brochures_11x25_5
 || this.productPricingObj.productID == ProductIDEnum.brochures_8_5x11
 || this.productPricingObj.productID == ProductIDEnum.brochures_8_5x14
 || this.productPricingObj.productID == ProductIDEnum.brochures_8_5x4_25
 || this.productPricingObj.productID == ProductIDEnum.newsletters_11x17
 || this.productPricingObj.productID == ProductIDEnum.newsletters_11x25_5
 || this.productPricingObj.productID == ProductIDEnum.newsletters_8_5x11
 || this.productPricingObj.productID == ProductIDEnum.catalogs_5_5x8_5
 || this.productPricingObj.productID == ProductIDEnum.catalogs_8_5x11
 || this.productPricingObj.productID == ProductIDEnum.calendars_5_5x8_5
 || this.productPricingObj.productID == ProductIDEnum.calendars_8_5x11)) {
 return this.GetValidationObject(false, 'UV Coating is not available with mailing on this page - please call for options.', AttributeValueIDEnum.coating_gloss_aqueous, false);
 }
 return this.GetValidationObject(true);
};

AqueousPricing.prototype.GetValidationObject = function(validateResult, validateMessage, coatingFID, mustNotCoat) {
return {
VALIDATE_RESULT : validateResult,
VALIDATE_MESSAGE : validateMessage,
VALIDATE_AQUEOUS : coatingFID,
VALIDATE_MUST_NOT_COAT : mustNotCoat
};
};

AqueousPricing.prototype.IsChanged = function() {
return (this.coatingFIDOri != this.coatingFID);
};
/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/NoValueEnum.js" />
var BackingPricings;

function BackingPricing(finishingPricingID, finishingID, rblName, imageID) {
this.imageID = imageID;
this.finishingPricingObj = new FinishingPricing(finishingPricingID, finishingID, rblName);

this.InsertBackingPricing();
}

BackingPricing.prototype.InsertBackingPricing = function() {
if (typeof (BackingPricings) == 'undefined') {
BackingPricings = new Object;
}
BackingPricings[this.finishingPricingObj.finishingPricingID] = this;
};

BackingPricing.prototype.ResetBacking = function() {
SetRadioButtonListChecked(this.rblName, this.finishingID);
};

BackingPricing.prototype.ChangeBacking = function(finishingID) {
this.finishingPricingObj.finishingID = finishingID;
if (this.productPricingObj) {
this.productPricingObj.HandleAttributePrices(AdjustTypeEnum.Backing);
}
};

BackingPricing.prototype.GetBackingPrice = function(finishingID, quantity, isCoverStock, productID, percentCollection, signatures) {
return this.finishingPricingObj.GetFinishingPrice(finishingID, quantity, productID, percentCollection, signatures, this.productPricingObj.quantityList);
};var BindingPricings;

function BindingPricing(userControlID, bindingID, sheetsPerUnitID, backingID, coverID, rblSheetsPerUnitID, rblPaddingID) {
 this.userControlID = userControlID;
 this.bindingObjID = userControlID.replace(/_/g, "$") + '$' + bindingID;
 this.rblSheetsPerUnitID = rblSheetsPerUnitID;
 this.rblPaddingID = rblPaddingID;
 new FinishingPricing(this.bindingObjID, bindingID, '');
 new FinishingPricing(rblSheetsPerUnitID, sheetsPerUnitID, rblSheetsPerUnitID);
 new FinishingPricing('Backing', backingID, '');
 new FinishingPricing('Cover', coverID, '');
 new FinishingPricing('Collate', this.SetCollateID(), '');
 
 this.InsertBindingPricing();
}

BindingPricing.prototype.InsertBindingPricing = function() {
 if (typeof (BindingPricings) == 'undefined') {
 BindingPricings = new Object;
 }
 BindingPricings[this.userControlID] = this;
};

BindingPricing.prototype.Reset = function() {
SetRadioButtonListChecked(this.rblSheetsPerUnitID, FinishingPricings[this.rblSheetsPerUnitID].finishingID);
if (FinishingPricings['Cover'].finishingID != '') { //set padding radio button cover trumps backing
SetRadioButtonListChecked(this.rblPaddingID, FinishingPricings['Backing'].finishingID);
}
else {
SetRadioButtonListChecked(this.rblPaddingID, FinishingPricings['Cover'].finishingID);
}
};

BindingPricing.prototype.SetBinding = function(bindingID) {
FinishingPricings[this.bindingObjID].SetFinishingID(bindingID);
};

BindingPricing.prototype.SetSheetsPerUnit = function(sheetsPerUnitID) {
FinishingPricings[this.rblSheetsPerUnitID].SetFinishingID(sheetsPerUnitID);
};

BindingPricing.prototype.SetBacking = function(backingID) {
FinishingPricings['Backing'].SetFinishingID(backingID);
};

BindingPricing.prototype.SetCover = function(coverID) {
FinishingPricings['Cover'].SetFinishingID(coverID);
};

BindingPricing.prototype.SetCollate = function(collateID) {
FinishingPricings['Collate'].SetFinishingID(collateID);
};

BindingPricing.prototype.Change = function(control, value) {
 var controlID = control[0].name;
 if (typeof (controlID) == 'undefined') {
 controlID = control;
 }
 var paperID = ((this.productPricingObj) ? this.productPricingObj.GetPaperID() : null);
 var productID = ((this.productPricingObj) ? this.productPricingObj.productID : null);
 if (controlID == this.rblSheetsPerUnitID) {
 this.Validate(value, FinishingPricings['Backing'].finishingID, FinishingPricings['Cover'].finishingID, paperID, productID, false);
 //check that quantity is divisible by sheetsPerUnit for NCR
 if (this.productPricingObj && this.productPricingObj.orderingPage == OrderingPageEnum.carbonlessncrprinting && value != '') {
 this.productPricingObj.HandleSheetsPerUnitChange();
 }
 //check that quantity (number of pads) times sheetsPerUnit is greater than min quantity for Notepads
 else if (this.productPricingObj && this.productPricingObj.orderingPage == OrderingPageEnum.notepadprinting && value != '') {
 this.productPricingObj.HandleSheetsPerUnitChange();
 }
 }
 else if (controlID == this.rblPaddingID) {
 if (value == AttributeValueIDEnum.cover_cover_wrap) { //coverwrap includes chipboard
 this.Validate(FinishingPricings[this.rblSheetsPerUnitID].finishingID, AttributeValueIDEnum.backing_chip_board, value, paperID, productID, false);
 }
 else { //value == AttributeValueIDEnum.backing_chip_board || value == ''
 this.Validate(FinishingPricings[this.rblSheetsPerUnitID].finishingID, value, '', paperID, productID, false);
 }
 }

 //set glue for binding based on sheetsPerUnit
 if (FinishingPricings[this.rblSheetsPerUnitID].finishingID == '') {
 FinishingPricings[this.bindingObjID].finishingID = '';
 }
 else {
 if (FinishingPricings['Cover'].finishingID != '') {
 FinishingPricings[this.bindingObjID].finishingID = AttributeValueIDEnum.binding_staple;
 }
 else {
 FinishingPricings[this.bindingObjID].finishingID = AttributeValueIDEnum.binding_glue;
 }
 }

 //adjust pricing
 if (this.productPricingObj) {
 this.productPricingObj.HandleAttributePrices(AdjustTypeEnum.Padding);
 }
};

BindingPricing.prototype.Validate = function(sheetsPerUnitID, backingID, coverID, paperID, productID, forSizeChange) {
var ret = this.IsValid(sheetsPerUnitID, backingID, coverID, paperID, productID, forSizeChange);
if (!ret.VALIDATE_RESULT) {
if (ret.VALIDATE_MESSAGE) {
alert(ret.VALIDATE_MESSAGE);
}
}
FinishingPricings[this.rblSheetsPerUnitID].SetFinishingID(ret.VALIDATE_SHEETSPERUNITID);
FinishingPricings['Backing'].SetFinishingID(ret.VALIDATE_BACKINGID);
FinishingPricings['Cover'].SetFinishingID(ret.VALIDATE_COVERID);
FinishingPricings['Collate'].SetFinishingID(this.SetCollateID());
this.SetPaddingRadioButton(ret.VALIDATE_BACKINGID, ret.VALIDATE_COVERID);

return ret.VALIDATE_RESULT;
};

BindingPricing.prototype.IsValid = function(sheetsPerUnitID, backingID, coverID, paperID, productID, forSizeChange) {
var returnMsg = '';
var returnState = true;
if (this.productPricingObj && this.productPricingObj.orderingPage == OrderingPageEnum.carbonlessncrprinting) { //validation only for NCR ordering page
if ((paperID == AttributeValueIDEnum.paper_3_part_ncr || paperID == AttributeValueIDEnum.paper_4_part_ncr) &&
coverID != '' && sheetsPerUnitID == AttributeValueIDEnum.sheetsperunit_100) {
returnMsg = 'The maximum booklet size for 3-part or 4-part NCR forms is 50 sets';
returnState = false;
sheetsPerUnitID = AttributeValueIDEnum.sheetsperunit_50;
}

if (productID == ProductIDEnum.ncr_form_8_5x14 && coverID != '') {
returnMsg = 'Booklets are not available for 8 1/2 x 14 NCR Forms';
if (forSizeChange) {
returnState = false;
}
else {
returnState = false;
backingID = AttributeValueIDEnum.backing_chip_board;
coverID = '';
}
}

//enable sheetsPerUnit radio buttons based on backingID and coverID
var sheetsPerUnitElem = document.getElementsByName(this.rblSheetsPerUnitID);
if (sheetsPerUnitElem != null && typeof (sheetsPerUnitElem) != 'undefined') {
if (backingID == '' && coverID == '') { //disable sheetsPerUnit
for (var i = 0, loopCnt = sheetsPerUnitElem.length; i < loopCnt; i++) {
sheetsPerUnitElem[i].disabled = true;
}
sheetsPerUnitID = '';
}
else { //enable sheetsPerUnit and select default of 50 if not set
for (var i = 0, loopCnt = sheetsPerUnitElem.length; i < loopCnt; i++) {
sheetsPerUnitElem[i].disabled = false;
}
if (sheetsPerUnitID == '') {
sheetsPerUnitID = AttributeValueIDEnum.sheetsperunit_50;
}
}
}
}
return this.GetValidationObject(returnState, returnMsg, sheetsPerUnitID, backingID, coverID);
};

BindingPricing.prototype.GetValidationObject = function(validateResult, validateMessage, sheetsPerUnitID, backingID, coverID) {
return {
VALIDATE_RESULT : validateResult,
VALIDATE_MESSAGE : validateMessage,
VALIDATE_SHEETSPERUNITID : sheetsPerUnitID,
VALIDATE_BACKINGID : backingID,
VALIDATE_COVERID : coverID
};
};

BindingPricing.prototype.SetCollateID = function() {
if (FinishingPricings['Backing'].finishingID != '' || FinishingPricings['Cover'].finishingID != '') {
 return AttributeValueIDEnum.collate_insert_separators;
 }
 return null;
};

BindingPricing.prototype.SetPaddingRadioButton = function(backingID, coverID) {
 if (this.rblPaddingID != '') {
 var paddingID = backingID;
 if (coverID != '') {
 paddingID = coverID;
 }
 SetRadioButtonListChecked(this.rblPaddingID, paddingID);
 }
};

BindingPricing.prototype.DisableSheetsPerUnit = function() {
var sheetsPerUnitElem = document.getElementsByName(this.rblSheetsPerUnitID);
if (sheetsPerUnitElem != null && typeof (sheetsPerUnitElem) != 'undefined') {
for (var i = 0, loopCnt = sheetsPerUnitElem.length; i < loopCnt; i++) {
sheetsPerUnitElem[i].disabled = true;
}
}
};
/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/NoValueEnum.js" />
/// <reference path="FinishingPricing.js" />
/// <reference path="PrintedEnvelopePricing.js" />
var BlankEnvelopePricings;

function BlankEnvelopePricing(blankEnvelopePricingID, blankEnvelopeSizeID, blankEnvelopeQuantity, blankEnvelopeQuantityInputID, blankEnvelopePaperID) {
this.blankEnvelopePricingID = blankEnvelopePricingID;
this.blankEnvelopeSizeID = blankEnvelopeSizeID;
this.blankEnvelopeQuantity = blankEnvelopeQuantity;
this.blankEnvelopeQuantityInputID = blankEnvelopeQuantityInputID;
this.blankEnvelopePaperID = blankEnvelopePaperID;
if (blankEnvelopePaperID == '') { //set envelope paper if not passed
this.blankEnvelopePaperID = AttributeValueIDEnum.paper_24lb_uncoated;
}
 
this.InsertBlankEnvelopePricing();
}

BlankEnvelopePricing.prototype.InsertBlankEnvelopePricing = function() {
if (typeof(BlankEnvelopePricings) == 'undefined') {
BlankEnvelopePricings = new Object;
}
BlankEnvelopePricings[this.blankEnvelopePricingID] = this;
};

BlankEnvelopePricing.prototype.ResetBlankEnvelopeQuantity = function() {
 SetValue(this.blankEnvelopeQuantityInputID, this.blankEnvelopeQuantity);
};

BlankEnvelopePricing.prototype.ChangeEnvelopeQuantity = function(blankEnvelopeQuantity) {
this.blankEnvelopeQuantity = ParseInt(blankEnvelopeQuantity);

if (this.productPricingObj) {
this.productPricingObj.HandleMailingBlankEnvelopes();
this.productPricingObj.AdjustPrices(AdjustTypeEnum.Envelope);
this.productPricingObj.HandleShowSubmitChanges();
}
};

BlankEnvelopePricing.prototype.SetEnvelopeQuantity = function(envelopeQuantity) {
 this.blankEnvelopeQuantity = envelopeQuantity;
$(this.blankEnvelopeQuantityInputID).value = envelopeQuantity;
};

BlankEnvelopePricing.prototype.IsChanged = function() {
return (this.blankEnvelopeQuantityOri != this.blankEnvelopeQuantity);
};

BlankEnvelopePricing.prototype.GetBlankEnvelopePrice = function(percentCollection) {
if (this.blankEnvelopeSizeID == '' && this.productPricingObj) {
this.productPricingObj.SetBlankEnvelopeSize();
}
if (this.blankEnvelopeSizeID == '' || this.blankEnvelopeQuantity < 0 || this.blankEnvelopePaperID == null) {
return 0;
}
percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.Envelope, ChannelID);
return this.CalculateBlankEnvelopePrice(blankEnvelopeArr[this.blankEnvelopeSizeID][this.blankEnvelopePaperID][BLANKENVELOPE_IDX_BASE], blankEnvelopeArr[this.blankEnvelopeSizeID][this.blankEnvelopePaperID][BLANKENVELOPE_IDX_EACH], this.blankEnvelopeQuantity, percentCollection);
};

BlankEnvelopePricing.prototype.CalculateBlankEnvelopePrice = function(base, each, quantity, percentCollection) {
 var price = 0;
 if (quantity > 0)
 {
price = base + (each * quantity);
 }
if (typeof(percentCollection) != 'undefined') {
return percentCollection.ApplyPricingPercents(price);
}
else {
return FormatDollar(price);
}
};

BlankEnvelopePricing.prototype.SetBlankEnvelopeType = function(blankEnvelopeTypeID) {
SetRadioButtonListChecked(FinishingPricings[this.productPricingObj.blankEnvelopeImprintID].rblName, blankEnvelopeTypeID);
};var ConfirmAsIss;

function ConfirmAsIs(confirmAsIsID, tblConfirmChangesID, tblConfirmAsIsID, isInternalWeb, SubmitOnly) {
 this.confirmAsIsID = confirmAsIsID;
 this.tblConfirmChangesID = tblConfirmChangesID;
 this.tblConfirmAsIsID = tblConfirmAsIsID;
 this.isInternalWeb = isInternalWeb;
 this.SubmitOnly = SubmitOnly;

 this.ConfirmChanges();
 this.InsertConfirmAsIs();
}

ConfirmAsIs.prototype.InsertConfirmAsIs = function() {
 if (typeof (ConfirmAsIss) == 'undefined') {
 ConfirmAsIss = new Object;
 }
 ConfirmAsIss[this.confirmAsIsID] = this;
};

ConfirmAsIs.prototype.ConfirmChanges = function(anyChangesMade) {
var tblConfirmChangesElem = $(this.tblConfirmChangesID);
if (tblConfirmChangesElem && !this.SubmitOnly) {
tblConfirmChangesElem.style.display = (anyChangesMade) ? '' : 'none';
}
var tblConfirmAsIsElem = $(this.tblConfirmAsIsID);
if (tblConfirmAsIsElem && !this.SubmitOnly) {
tblConfirmAsIsElem.style.display = (anyChangesMade || this.isInternalWeb) ? 'none' : '';
}
};

ConfirmAsIs.prototype.OnDiscardChanges = function() {
 location.replace(window.location.href);
 return true;
};

ConfirmAsIs.prototype.OnSubmitChanges = function() {
 if ('none' == $(this.tblConfirmChangesID).style.display) {
 alert('You have reversed all your changes; there are no changes to submit.');
 return false;
 }
 $(this.tblConfirmChangesID).style.display = 'none';
 return true;
};

ConfirmAsIs.prototype.OnConfirmProductAsIs = function() {
 if ('none' == $(this.tblConfirmAsIsID).style.display) {
 // IE6 hack...
 // The user hit "Confirm Product As Is" but there are multi-version
 // changes. This is because the user hit the button before the focus
 // changed which raises the event that swaps the confirm button with
 // the submit/discard buttons.
 // The button swap event has now been fired, so all we need to do
 // here is abort the submit.
 alert('You have made changes; please click "Submit Changes" or "Discard Changes" below.');
 return false;
 }
 return true; 
};

ConfirmAsIs.prototype.FinalValidation = function() {

/* 4/20/09 MJ - IMPORTANT NOTE: Multi version pricing functionality will be disabled for business cards until CQ Phase 2 per/DK note.
if(this.productPricingObj.hasNameQtyPricing) {
var versionNamesAreValid = true;
var nameQtyPricingObj = NameQtyPricings[this.productPricingObj.nameQtyPricingID];
if (typeof(ProductCt) == 'undefined') {
ProductCt = 1;
}
  
for (i = 0; i < ProductCt; i++) {
for (j = 0; j < VersionCt[i]; j++) {
if (0 != VersionQty[i][j] && InitialNameText(i, j) == VersionName[i][j]) {
if (versionNamesAreValid) {
alert('Please enter a name for each business card.');
NameCtrl(i, j).focus();
versionNamesAreValid = false;
}
}
}
}
if (!versionNamesAreValid) {
return false;
}
}
*/

/*if (this.productPricingObj.hasInstaPrice) {
var instaPriceObj = InstaPrices[this.productPricingObj.instaPriceID];
var minQtyIsValid = true;
if (this.productPricingObj.hasNameQtyPricing) {
var nameQtyPricingObj = NameQtyPricings[this.productPricingObj.nameQtyPricingID];
minQtyIsValid = ((instaPriceObj.minQuantity * nameQtyPricingObj.GetVersionCount()) < nameQtyPricingObj.GetSumNameQuantities());
}
else {
minQtyIsValid = (instaPriceObj.minQuantity < instaPriceObj.quantity);
}

if (!minQtyIsValid) {
var msg = '';
if (this.productPricingObj.hasNameQtyPricing) {
msg = 'with ' + this.productPricingObj.GetVersionCount() + ' versions ';
}
alert('The minimum quantity to order ' + msg + 'is ' + instaPriceObj.minQuantity + '.');

return false;
}
}*/

if (typeof (CtrlStoreEmailID) != 'undefined' && '' != CtrlStoreEmailID) {
var ctrlStoreEmail = document.getElementById(CtrlStoreEmailID);
if (null != ctrlStoreEmail) {
if ('' == ctrlStoreEmail.value) {
alert('Please enter your store email address.');
return false;
}
}
}
return true;
};
/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/NoValueEnum.js" />
var ConversionPricings;

function ConversionPricing(finishingPricingID, finishingID, rblName, imageID) {
this.imageID = imageID;
this.finishingPricingObj = new FinishingPricing(finishingPricingID, finishingID, rblName);

this.InsertConversionPricing();
}

ConversionPricing.prototype.InsertConversionPricing = function() {
if (typeof (ConversionPricings) == 'undefined') {
ConversionPricings = new Object;
}
ConversionPricings[this.finishingPricingObj.finishingPricingID] = this;
};

ConversionPricing.prototype.ResetConversion = function() {
SetRadioButtonListChecked(this.rblName, this.finishingID);
};

ConversionPricing.prototype.SetConversion = function(finishingID) {
ConversionPricing.finishingPricingObj.SetFinishingID(finishingID);
};

ConversionPricing.prototype.ChangeConversion = function(finishingID) {
this.finishingPricingObj.finishingID = finishingID;
if (this.productPricingObj) {
this.productPricingObj.HandleAttributePrices(AdjustTypeEnum.Conversion);
}
};

ConversionPricing.prototype.GetConversionPrice = function(finishingID, quantity, isCoverStock, productID, percentCollection, signatures) {
return this.finishingPricingObj.GetFinishingPrice(finishingID, quantity, productID, percentCollection, signatures, this.productPricingObj.quantityList);
};var Coupons;
var CouponValues;

function Coupon(couponCode, discountType, couponValues) {
this.couponCode = couponCode;
this.discountType = discountType;
this.couponValues = couponValues;

this.InsertCoupon();

this.InitializeCouponValues();
}

Coupon.prototype.InsertCoupon = function() {
if (typeof(Coupons) == 'undefined') {
Coupons = new Object;
}
Coupons[this.couponCode] = this;
};

Coupon.prototype.InitializeCouponValues = function() {
if (this.couponValues) {
for (var i = 0, loopCnt = this.couponValues.length; i < loopCnt; i++) {
this.couponValues[i].couponObj = this;
}
}
};

Coupon.prototype.GetCouponAmount = function(totalPrice) {
var couponValueObj;
for (var i = 0, loopCnt = this.couponValues.length; i < loopCnt; i++) {
couponValueObj = this.couponValues[i];
if (couponValueObj.minOrderAmt <= totalPrice) {
return (couponValueObj.amount) ? couponValueObj.amount : (couponValueObj.percent) ? couponValueObj.percent * totalPrice : 0;
}
}
return 0;
};

function CouponValue(couponValueID, amount, percent, minOrderAmt) {
this.couponValueID = couponValueID;
this.amount = amount;
this.percent = percent;
this.minOrderAmt = minOrderAmt;

this.InsertCouponValue();
}

CouponValue.prototype.InsertCouponValue = function() {
if (typeof(CouponValues) == 'undefined') {
CouponValues = new Object;
}
CouponValues[this.couponValueID] = this;
};
var FinishingAttributes;

function FinishingAttribute(finishingPricingID, finishingID, rblName, adjustTypeEnum) {
this.finishingPricingID = finishingPricingID;
this.finishingPricingObj = new FinishingPricing(finishingPricingID, finishingID, '');
this.rblName = rblName;
this.adjustTypeEnum = adjustTypeEnum;

this.Insert();
}

FinishingAttribute.prototype.Insert = function() {
if (typeof (FinishingAttributes) == 'undefined') {
FinishingAttributes = new Object;
}
FinishingAttributes[this.finishingPricingObj.finishingPricingID] = this;
};

FinishingAttribute.prototype.Reset = function() {
SetRadioButtonListChecked(this.rblName, this.finishingPricingObj.finishingID);
};

FinishingAttribute.prototype.ChangeID = function(finishingID) {
this.finishingPricingObj.SetFinishingID(finishingID);

if (this.productPricingObj) {
this.productPricingObj.HandleAttributePrices(this.adjustTypeEnum);
}
};/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/AdjustTypeEnum.js" />
var FinishingPricings;

function FinishingPricing(finishingPricingID, finishingID, rblName) {
this.finishingPricingID = finishingPricingID;
this.finishingID = finishingID;
this.finishingIDOri = finishingID;
this.rblName = rblName;

this.InsertFinishingPricing();
}

FinishingPricing.prototype.InsertFinishingPricing = function() {
if (typeof(FinishingPricings) == 'undefined') {
FinishingPricings = new Object;
}
FinishingPricings[this.finishingPricingID] = this;
};

FinishingPricing.prototype.SetFinishingID = function(finishingID) {
this.finishingID = finishingID;
if (this.rblName != '') {
SetRadioButtonListChecked(this.rblName, finishingID);
}
};

FinishingPricing.prototype.IsChanged = function() {
 return (this.finishingIDOri != this.finishingID);
};

FinishingPricing.prototype.GetFinishingPrice = function(finishingID, quantity, productID, percentCollection, signatures, quantityList) {
 if (finishingID == '' || finishingID == 'undefined' || finishingID == null || quantity <= 0) { //check for NO value in finishing ID and zero quantity
 return 0;
 }
 var quantityBreak = 0;
 var productIndex;
 if (typeof (finishingArr[finishingID][productID]) != 'undefined') {
 productIndex = productID;
 }
 else { //no product override
 productIndex = '';
 }

 // Find the biggest quantity break that is less than or equal to the given quantity
 for (var arrQty in finishingArr[finishingID][productIndex]) {
 if (!isNaN(arrQty)) {
 var arrQtyNum = parseInt(arrQty);
 if (quantity >= arrQtyNum && quantityBreak < arrQtyNum) {
 quantityBreak = arrQtyNum;
 }
 }
 }

 var totalWholeSignatures = 1;
 if (typeof (signatures) != 'undefined' && signatures != null) { //signatures exist
 totalWholeSignatures = 0;
 for (var s = 0, loopCnt = signatures.length; s < loopCnt; s++) {
 if (signatures[s].ContainsAttributeValueID(finishingID, null)) {
 totalWholeSignatures += signatures[s].TotalWholeSignatures();
 }
 }
 }

 if (finishingID == AttributeValueIDEnum.tab_tab ||
 finishingID == AttributeValueIDEnum.tab_manually_priced ||
 finishingID == AttributeValueIDEnum.tab_multi_tab) {
 percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.Mailing, ChannelID);
 }
 else {
 percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.Finishing, ChannelID);
 }

 var price = 0;
 // Calculate finishing price
 if (typeof (quantityList) != 'undefined' && quantityList.length != 0) { //business cards
 for (var i = 0, loopCnt = quantityList.length; i < loopCnt; i++) {
 price += this.CalculateFinishingPrice(quantityList[i],
 finishingArr[finishingID][productIndex][quantityBreak][FINISHING_IDX_BASE],
 finishingArr[finishingID][productIndex][quantityBreak][FINISHING_IDX_EACH],
 percentCollection, 
 totalWholeSignatures, 
 finishingArr[finishingID][productIndex][quantityBreak][FINISHING_IDX_SET_UP_CHARGE]);
 }
 }
 else { //one quantity products
 price = this.CalculateFinishingPrice(quantity,
 finishingArr[finishingID][productIndex][quantityBreak][FINISHING_IDX_BASE],
 finishingArr[finishingID][productIndex][quantityBreak][FINISHING_IDX_EACH],
 percentCollection, 
 totalWholeSignatures, 
 finishingArr[finishingID][productIndex][quantityBreak][FINISHING_IDX_SET_UP_CHARGE]);
 }
 return price;
};

FinishingPricing.prototype.CalculateFinishingPrice = function(quantity, finishingBase, finishingEach, percentCollection, totalWholeSignatures, setupCharge) {
 var price = 0;

 if (quantity > 0) //check that the quantity is greater than zero
 {
 price = (totalWholeSignatures * (finishingBase + (quantity * finishingEach)));
 if (totalWholeSignatures > 0) {
 price += setupCharge;
 }
 }

 if (typeof (percentCollection) != 'undefined') {
 return percentCollection.ApplyPricingPercents(price);
 }
 else {
 return FormatDollar(price);
 }
};

FinishingPricing.prototype.GetValidationObject = function(validateResult, validateMessage, finishingID) {
return {
VALIDATE_RESULT : validateResult,
VALIDATE_MESSAGE : validateMessage,
VALIDATE_FINISHINGID : finishingID
}
};

/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/NoValueEnum.js" />
var FoldPricings;

function FoldPricing(finishingPricingID, finishingID, rblName, coverInside, imageID) {
this.coverInside = coverInside;
this.imageID = imageID;
this.finishingPricingObj = new FinishingPricing(finishingPricingID, finishingID, rblName);

this.InsertFoldPricing();
}

FoldPricing.prototype.InsertFoldPricing = function() {
if (typeof(FoldPricings) == 'undefined') {
FoldPricings = new Object;
}
FoldPricings[this.finishingPricingObj.finishingPricingID] = this;
};

FoldPricing.prototype.ResetFold = function() {
 SetRadioButtonListChecked(this.rblName, this.finishingID);
};

FoldPricing.prototype.ChangeFold = function(finishingID) {
this.ValidateFold(((this.productPricingObj) ? this.productPricingObj.productID : null), finishingID, ((this.productPricingObj) ? this.productPricingObj.IsCoverPaper() : null), false, false);

if (this.productPricingObj) {
LoadImage(this.imageID, foldImageArr[this.productPricingObj.productID][this.finishingPricingObj.finishingID]);
this.productPricingObj.HandleMailingBlankEnvelopes();
this.productPricingObj.HandleAttributePrices(AdjustTypeEnum.Fold);
}
};

FoldPricing.prototype.GetFoldPrice = function(finishingID, quantity, isCoverStock, productID, percentCollection, signatures) {
var foldPrice = 0;
 //check to see if paper is coverstock and there is a finishingID (fold selected)
 if (isCoverStock && finishingID != '')
 {
 //find the score for fold price product
 foldPrice += this.finishingPricingObj.GetFinishingPrice(AttributeValueIDEnum.scoringfold_score_for_folding, quantity, productID, percentCollection, null, this.productPricingObj.quantityList);
 }
 foldPrice += this.finishingPricingObj.GetFinishingPrice(finishingID, quantity, productID, percentCollection, signatures, this.productPricingObj.quantityList);
 return foldPrice;
};

FoldPricing.prototype.ValidateFold = function(productID, finishingID, isCoverPaper, forSizeChange, forPaperChange) {
var ret = this.IsValidFold(productID, finishingID, isCoverPaper, forSizeChange, forPaperChange);
if (!ret.VALIDATE_RESULT) {
if (ret.VALIDATE_MESSAGE) {
alert(ret.VALIDATE_MESSAGE);
}
this.finishingPricingObj.SetFinishingID(ret.VALIDATE_FINISHINGID);
if (typeof (VALIDATE_PAPER) != 'undefined' && typeof (ret.VALIDATE_PAPER) != 'undefined') {
this.productPricingObj.SetPaper(ret.VALIDATE_PAPER);
this.productPricingObj.AdjustPrices(AdjustTypeEnum.Paper, this.paperPricingID);
this.productPricingObj.HandleShowSubmitChanges();
}
}
else {
this.finishingPricingObj.finishingID = finishingID;
}
return ret.VALIDATE_RESULT;
};

FoldPricing.prototype.IsValidFold = function(productID, finishingID, isCoverPaper, forSizeChange, forPaperChange) {
if ((productID == ProductIDEnum.statement_stuffers_3_5x7 || productID == ProductIDEnum.statement_stuffers_3_5x8_5 ||
 productID == ProductIDEnum.statement_stuffers_5_5x8_5) && finishingID && finishingID != null) {
return this.finishingPricingObj.GetValidationObject(false, 'This size statement stuffer cannot be folded.', (forSizeChange) ? finishingID : '');
}
else if (this.productPricingObj && this.productPricingObj.HasMailing() &&
 (productID == ProductIDEnum.newsletters_11x25_5 || productID == ProductIDEnum.brochures_11x25_5) &&
 finishingID == AttributeValueIDEnum.fold_open_gate_fold) {
return this.finishingPricingObj.GetValidationObject(false, 'Mailing Services are not available for the ' + AttributeValueNameEnum[AttributeValueIDEnum.fold_open_gate_fold] + ' option.', this.finishingPricingObj.finishingID);
}
else if ((productID == ProductIDEnum.statement_stuffers_7x7 || productID == ProductIDEnum.statement_stuffers_7x8_5) &&
 (finishingID == AttributeValueIDEnum.fold_tri_fold || finishingID == AttributeValueIDEnum.fold_z_fold)) {
return this.finishingPricingObj.GetValidationObject(false, 'You cannot select a ' + AttributeValueNameEnum[AttributeValueIDEnum.fold_tri_fold] + ' or ' + AttributeValueNameEnum[AttributeValueIDEnum.fold_z_fold] + ' fold with this size statement stuffer.', this.finishingPricingObj.finishingID);
}
else if (finishingID == AttributeValueIDEnum.fold_tri_then_half_fold && isCoverPaper) {
return this.finishingPricingObj.GetValidationObject(false, AttributeValueNameEnum[AttributeValueIDEnum.fold_tri_then_half_fold] + ' is not available on cover stock.', (forPaperChange) ? AttributeValueIDEnum.fold_tri_fold : this.finishingPricingObj.finishingID);
}
else if (this.productPricingObj) {
var ret = this.productPricingObj.ValidateFoldPaperMailing(null, finishingID);
if (!ret.VALIDATE_RESULT) {
var retObj = this.finishingPricingObj.GetValidationObject(false, ret.VALIDATE_MESSAGE, finishingID);
retObj.VALIDATE_PAPER = ret.VALIDATE_PAPER;
return retObj;
}
}
return this.finishingPricingObj.GetValidationObject(true);
};

FoldPricing.prototype.ValidateNumPages = function(productID, numPages) {
this.finishingPricingObj.SetFinishingID((numPages == 4) ? AttributeValueIDEnum.fold_half_fold : AttributeValueIDEnum.foldcollatestaple_fold_collate_stitch);
};
var IMAGES_DIR = "../images";

function PreloadImageArrays() {
var imgArr = new Array();
if (typeof(inkImageArr) != 'undefined') {
for (var i in inkImageArr) {
if (typeof (inkImageArr[i]) != 'function') {
for (var j in inkImageArr[i]) {
if (typeof (inkImageArr[i][j]) != 'function') {
for (var k in inkImageArr[i][j]) {
if (typeof (inkImageArr[i][j][k]) != 'function') {
if (typeof (inkImageArr[i][j][k]) != 'function') {
for (var l in inkImageArr[i][j][k]) {
if (typeof (inkImageArr[i][j][k][l]) != 'function') {
imgArr[imgArr.length] = inkImageArr[i][j][k][l];
}
}
}
}
}
}
}
}
}
}
if (typeof(foldImageArr) != 'undefined') {
for (var i in foldImageArr) {
if (typeof (foldImageArr[i]) != 'function') {
for (var j in foldImageArr[i]) {
if (typeof (foldImageArr[i][j]) != 'function') {
imgArr[imgArr.length] = foldImageArr[i][j];
}
}
}
}
}
PreloadImages(imgArr, IMAGES_DIR);
}

function LoadImage(imageID, imgSrc, noImgDir) {
 var img = $(imageID)
 if (img != null && typeof(img) != 'undefined') {
 img.src = ((!noImgDir) ? IMAGES_DIR + '/' : '') + imgSrc;
 }
}
/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/NoValueEnum.js" />
/// <reference path="Enums/ProductIDEnum.js" />
var InkPricings;
var VALIDATE_INK = 'Ink';

function InkPricing(inkPricingID, inkFID, inkBID, splitInk, inkFImageID, inkBImageID, rblInkFID, rblInkBID, coverInside, rblInkInsideName, txtPMSFront1, txtPMSFront2, txtPMSBack1, txtPMSBack2) {
this.inkPricingID = inkPricingID;
this.inkFID = inkFID;
this.inkFIDOri = inkFID;
this.inkBID = inkBID;
this.inkBIDOri = inkBID;
this.splitInk = splitInk;
this.inkFImageID = inkFImageID;
this.inkBImageID = inkBImageID;
this.rblInkFID = rblInkFID;
this.rblInkBID = rblInkBID;
this.coverInside = coverInside;
this.rblInkInsideName = rblInkInsideName;
this.txtPMSFront1 = txtPMSFront1;
this.txtPMSFront2 = txtPMSFront2;
this.txtPMSBack1 = txtPMSBack1;
this.txtPMSBack2 = txtPMSBack2;
this.txtPMSFront1Ori = txtPMSFront1;
this.txtPMSFront2Ori = txtPMSFront2;
this.txtPMSBack1Ori = txtPMSBack1;
this.txtPMSBack2Ori = txtPMSBack2;

if (typeof(coverInside) != 'undefined') {
this.forCover = (this.coverInside == CoverInsideEnum.ForCover);
this.forInside = (this.coverInside == CoverInsideEnum.ForInside);
}
this.InsertInkPricing();
}

InkPricing.prototype.InsertInkPricing = function() {
if (typeof(InkPricings) == 'undefined') {
InkPricings = new Object;
}
InkPricings[this.inkPricingID] = this;
};

InkPricing.prototype.ResetInk = function(productID) {
if (productID == ProductIDEnum.file_folders) { //ink radio button is combined
SetRadioButtonListChecked(this.rblInkFID, this.inkFID + '/' + this.inkBID);
}
else {
SetRadioButtonListChecked(this.rblInkFID, this.inkFID);
SetRadioButtonListChecked(this.rblInkBID, this.inkBID);
}
};

InkPricing.prototype.ChangeInk = function(side, ink) {
this.ValidateInk(side, ink);

if (this.productPricingObj) {
this.ChangeInkImage(side, ink, this.productPricingObj.GetPaperID());
this.productPricingObj.AdjustPrices(AdjustTypeEnum.Ink, this.inkPricingID);
if (ink.indexOf(InkEnum.DelimValue) > -1 && this.splitInk) { //check for inkID/spotID vs filefolders that are inkFID/inkBID
this.productPricingObj.AdjustPrices(AdjustTypeEnum.Spot, this.productPricingObj.spotPricingID);
this.ShowHidePMSColor(side);
this.ValidatePMSColor(side);
}
this.productPricingObj.HandleShowSubmitChanges();
}
};

InkPricing.prototype.ShowHidePMSColor = function (side) {
 var spotAttributeID;
 var sideName;
 if (side == AttributePlacementEnum.front) {
 spotAttributeID = SpotPricings[this.productPricingObj.spotPricingID].spotFID;
 sideName = 'Front';
 }
 else {
 spotAttributeID = SpotPricings[this.productPricingObj.spotPricingID].spotBID;
 sideName = 'Back';
 }

 switch (spotAttributeID) {
 case AttributeValueIDEnum.spot_spot_1:
 document.getElementById(sideName + 'PMS1').style.display = 'block';
 document.getElementById(sideName + 'PMS2').style.display = 'none';
 break;
 case AttributeValueIDEnum.spot_spot_2:
 document.getElementById(sideName + 'PMS1').style.display = 'block';
 document.getElementById(sideName + 'PMS2').style.display = 'block';
 break;
 default:
 document.getElementById(sideName + 'PMS1').style.display = 'none';
 document.getElementById(sideName + 'PMS2').style.display = 'none';
 }
};

InkPricing.prototype.ChangePMSComment = function(control) {
 var side = "Back";
 if (control.name.indexOf("Front") >= 0) {
 side = "Front"
 }
 var pmsCount = control.name.substring(control.name.length - 1, control.name.length);
 this["txtPMS" + side + pmsCount] = control.value;
 this.ValidatePMSColor(side);
};


InkPricing.prototype.ValidatePMSColor = function(side) {
 // No validation
 if (this.productPricingObj != 'undefined') {
 this.productPricingObj.HandleShowSubmitChanges();
 }
 return true;
};

InkPricing.prototype.ChangeInkImage = function(side, ink, paperID) {
 var inkImageID = (side == AttributePlacementEnum.back) ? this.inkBImageID : this.inkFImageID;

 if (typeof TemplateSelectionArr == "undefined") {
 var imgSrc = (this.splitInk) ? (ink.indexOf(InkEnum.DelimValue) > -1) ? (side == AttributePlacementEnum.front) ? inkImageArr[this.productPricingObj.productID][side][this.inkFID][SpotPricings[this.productPricingObj.spotPricingID].spotFID] : inkImageArr[this.productPricingObj.productID][side][this.inkBID][SpotPricings[this.productPricingObj.spotPricingID].spotBID] : inkImageArr[this.productPricingObj.productID][side][this.GetInk(side)][''] : inkImageArr[this.productPricingObj.productID][side][this.inkFID][this.inkBID];

 //hardcoded exception for Magnet Stock on business cards
 if (side == AttributePlacementEnum.back && this.productPricingObj.productID == ProductIDEnum.business_cards &&
paperID == AttributeValueIDEnum.paper_13_pt_magnet_stock) {
 imgSrc = "businesscardbackmagnet.jpg";
 }

 LoadImage(inkImageID, imgSrc);
 }
};

InkPricing.prototype.GetInk = function(side) {
if (typeof (side) != 'undefined') {
return (side == AttributePlacementEnum.front) ? this.inkFID : (side == AttributePlacementEnum.back) ? this.inkBID : (side == AttributePlacementEnum.inside) ? this.inkFID : this.inkFID + '/' + this.inkBID;
}
else {
if (this.inkFID == 'Custom' && this.inkBID == 'Custom') {
return 'Custom';
}
return this.inkFID + '/' + this.inkBID;
}
};

InkPricing.prototype.SetInk = function(side, ink) {
 var inkObj = this.GetSplitInk(side, ink);
 var inkValue = ink;
 this.inkFID = inkObj.inkFID;
 this.inkBID = inkObj.inkBID;
 if (side == AttributePlacementEnum.front) {
 if (inkObj.hasSpot) {
 SetRadioButtonListChecked(this.rblInkFID, ink);
 }
 else {
 SetRadioButtonListChecked(this.rblInkFID, this.inkFID);
 }
 }
 else if (side == AttributePlacementEnum.back) {
 if (inkObj.hasSpot) {
 SetRadioButtonListChecked(this.rblInkBID, ink);
 }
 else {
 SetRadioButtonListChecked(this.rblInkBID, this.inkBID);
 }
 }
 else if (side == AttributePlacementEnum.inside) {
 SetRadioButtonListChecked(this.rblInkInsideName, this.inkFID);
 }
};

InkPricing.prototype.GetSplitInk = function(side, ink) {
 var inkObj = new Object;
 inkObj.inkFID = this.inkFID;
 inkObj.inkBID = this.inkBID;
 if (this.splitInk) {
 if (ink.indexOf(InkEnum.DelimValue) == -1) {
 if (side == AttributePlacementEnum.front) {
 inkObj.inkFID = ink;
 }
 else if (side == AttributePlacementEnum.back) {
 inkObj.inkBID = ink;
 }
 }
 else {
 var inkArr = ink.split('/');
 inkObj.hasSpot = true;
 if (side == AttributePlacementEnum.front) {
 inkObj.inkFID = inkArr[0];
 }
 else if (side == AttributePlacementEnum.back) {
 inkObj.inkBID = inkArr[0];
 }
 if (typeof (SpotPricings[this.productPricingObj.spotPricingID]) != 'undefined') {
 SpotPricings[this.productPricingObj.spotPricingID].SetSpot(side, inkArr[1]);
 }
 }
 }
 else {
 if (this.forInside) {
 inkObj.inkFID = ink;
 inkObj.inkBID = ink;
 }
 else {
 var inkArr = ink.split('/');
 if (inkArr.length > 1) {
 inkObj.inkFID = inkArr[0];
 inkObj.inkBID = inkArr[1];
 }
 }
 }
 return inkObj;
};

InkPricing.prototype.GetTotalInkPrice = function(productID, quantity, signatures, percentCollection) {
var price = 0;
if (typeof (signatures) != 'undefined' && signatures != null) {
for (var s = 0, loopCnt = signatures.length; s < loopCnt; s++) {
price += this.GetInkPrice(productID, signatures[s].GetAttributeValueID(AttributeIDEnum.ink, AttributePlacementEnum.front), quantity, signatures[s].TotalSignaturePricingPercent(), percentCollection) +
this.GetInkPrice(productID, signatures[s].GetAttributeValueID(AttributeIDEnum.ink, AttributePlacementEnum.back), quantity, signatures[s].TotalSignaturePricingPercent(), percentCollection);
}
}
else {
price = this.GetInkPrice(productID, this.inkFID, quantity, 1, percentCollection) +
this.GetInkPrice(productID, this.inkBID, quantity, 1, percentCollection);
}
return price;
};

InkPricing.prototype.GetInkPrice = function(productID, inkID, quantity, signaturePricingPercent, percentCollection) {
 var price = 0;
 if (inkID == '') {
 return price;
 }

 var quantityBreak = 0;
 var productIndex;
 if (typeof (finishingArr[inkID][productID]) != 'undefined') {
 productIndex = productID;
 }
 else { //no product override
 productIndex = '';
 }

 // Find the biggest quantity break that is less than or equal to the given quantity
 for (var arrQty in finishingArr[inkID][productIndex]) {
 if (!isNaN(arrQty)) {
 var arrQtyNum = parseInt(arrQty);
 if (quantity >= arrQtyNum && quantityBreak < arrQtyNum) {
 quantityBreak = arrQtyNum;
 }
 }
 }

 var inkBase = finishingArr[inkID][productIndex][quantityBreak][FINISHING_IDX_BASE];
 var inkEach = finishingArr[inkID][productIndex][quantityBreak][FINISHING_IDX_EACH];
 var setupCharge = finishingArr[inkID][productIndex][quantityBreak][FINISHING_IDX_SET_UP_CHARGE];

 percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.Ink, ChannelID);

 // Calculate ink price
 if (this.productPricingObj && this.productPricingObj.quantityList.length != 0) { //business cards
 var quantityList = this.productPricingObj.quantityList;
 for (var i = 0, loopCnt = quantityList.length; i < loopCnt; i++) { //loop through version quantities
 price += this.CalculateInkPrice(quantityList[i], signaturePricingPercent, inkBase, inkEach, percentCollection, setupCharge);
 }
 }
 else { //one quantity products
 price = this.CalculateInkPrice(quantity, signaturePricingPercent, inkBase, inkEach, percentCollection, setupCharge);
 }
 return price;
};

InkPricing.prototype.GetInkName = function(inkID) {
switch (inkID) {
case AttributeValueIDEnum.ink_4_color:
case AttributeValueIDEnum.ink_black:
return AttributeValueNameEnum[inkID];
case AttributeValueIDEnum.spot_spot_1:
case AttributeValueIDEnum.spot_spot_2:
case AttributeValueIDEnum.spot_spot_3:
case AttributeValueIDEnum.spot_spot_4:
case AttributeValueIDEnum.spot_spot_5:
return AttributeValueNameEnum[inkID].replace(' PMS', 'Spot');
default:
 return NoValueEnum[AttributeIDEnum.ink];
 }
};

InkPricing.prototype.CalculateInkPrice = function(quantity, signaturePricingPercent, inkBase, inkEach, percentCollection, setupCharge) {
var price;

price = signaturePricingPercent * (inkBase + (quantity * inkEach)) + setupCharge;

if (typeof(percentCollection) != 'undefined') {
return percentCollection.ApplyPricingPercents(price);
}
else {
return FormatDollar(price);
}
};

InkPricing.prototype.ValidateInk = function(side, ink) {
var ret = this.IsValidInk(side, ink);
if (!ret.VALIDATE_RESULT) {
if (ret.VALIDATE_MESSAGE) {
alert(ret.VALIDATE_MESSAGE);
}
this.SetInk(side, ret.VALIDATE_INK);
}
else {
this.SetInk(side, ink);
}
return ret.VALIDATE_RESULT;
};

InkPricing.prototype.IsValidInk = function(side, ink) {
var inkObj = this.GetSplitInk(side, ink);
var retObj = this.productPricingObj.HandleInkChange(inkObj.inkFID, inkObj.inkBID);
if (!retObj.success) {
return this.GetValidationObject(false, '', ((',' + retObj.errorType + ',').indexOf(',' + AdjustTypeEnum.Ink + ',') != -1) ? this.GetInk(side) : ink);
}
else {
return this.GetValidationObject(true);
}
};

InkPricing.prototype.GetValidationObject = function(validateResult, validateMessage, ink) {
return {
VALIDATE_RESULT : validateResult,
VALIDATE_MESSAGE : validateMessage,
VALIDATE_INK : ink
};
};

InkPricing.prototype.ValidateNumPages = function(isDisabled) {
 if (this.forInside) {
if (isDisabled) {
var rblInkInsideElem = $(this.rblInkInsideName);
if (rblInkInsideElem) {
var inkFID = rblInkInsideElem.value;
if (this.inkFID != inkFID) {
this.ChangeInk(AttributePlacementEnum.inside, inkFID);
}
}
}
SetRadioButtonListDisabled(this.rblInkInsideName, isDisabled, 0);
}
};

InkPricing.prototype.IsChanged = function() {
 return (this.inkFIDOri != this.inkFID ||
 this.inkBIDOri != this.inkBID ||
 this.txtPMSFront1Ori != this.txtPMSFront1 ||
 this.txtPMSFront2Ori != this.txtPMSFront2 ||
 this.txtPMSBack1Ori != this.txtPMSBack1 ||
 this.txtPMSBack2Ori != this.txtPMSBack2);
};

InkPricing.prototype.SetPMSFocus = function(obj, setString) {
obj.value = setString;
if (obj.createTextRange) {
var range = obj.createTextRange();
range.collapse(true);
range.moveEnd('character', 4);
range.moveStart('character', 4);
range.select();
}
};
var InstaPrices;

function InstaPrice(instaPriceID, isChangeProductOptions, quantity, minQuantity, maxQuantity, quantityInputID, isChangeOrder, couponDiscountPercent, PFLProSettings) {
this.instaPriceID = instaPriceID;
this.isChangeProductOptions = isChangeProductOptions;
this.quantity = quantity;
this.minQuantity = minQuantity;
this.maxQuantity = maxQuantity;
this.quantityInputID = quantityInputID;
this.isChangeOrder = isChangeOrder;
this.upgradeDiscountPrice = 0;
this.couponDiscountPercent = couponDiscountPercent;
this.specialDiscountPrice = 0;
this.PFLProSettings = PFLProSettings;

this.InsertInstaPrice();
}

InstaPrice.prototype.InsertInstaPrice = function() {
if (typeof(InstaPrices) == 'undefined') {
InstaPrices = new Object;
}
InstaPrices[this.instaPriceID] = this;
};

InstaPrice.prototype.ResetQuantity = function() {
 SetValue(this.quantityInputID, this.quantity);
};

InstaPrice.prototype.SetLabelIDs = function(lblBasePrintingPriceID, lblCoverBasePrintingPriceID, lblInsideBasePrintingPriceID, lblAqueousCoatingID, lblCoverGlossVarnishID, lblPaperUpgradeID, lblCoverPaperUpgradeID, lblInsidePaperUpgradeID, lblFoldingID, lblInsideFoldCollateStapleID, lblSealID, lblRoundCornerID, lblEnvelopesID, lblSecondSheetsID, lblRushChargeID, lblShippingHandlingID, lblMailingServicesID, lblPrintingSubtotalID, lblPrintingCostEachID, lblOrderTotalID, lblHiVolDiscountID, lblCouponDiscountID, lblDiscountedTotalID, lblUnitCostID, rowHiVolDiscountID, rowCouponDiscountID, rowDiscountedTotalID, lblPaddingID, lblVariableDataID, lblPFLProSuggestedRetailPriceID, lblPFLProWholesaleNetPriceID, lblPFLProWholesaleNetUnitPriceID, lblPFLProShippingAndHandlingPriceID, lblLanyardID) {
 this.lblBasePrintingPriceID = lblBasePrintingPriceID;
 this.lblCoverBasePrintingPriceID = lblCoverBasePrintingPriceID;
 this.lblInsideBasePrintingPriceID = lblInsideBasePrintingPriceID;
 this.lblAqueousCoatingID = lblAqueousCoatingID;
 this.lblCoverGlossVarnishID = lblCoverGlossVarnishID;
 this.lblPaperUpgradeID = lblPaperUpgradeID;
 this.lblCoverPaperUpgradeID = lblCoverPaperUpgradeID;
 this.lblInsidePaperUpgradeID = lblInsidePaperUpgradeID;
 this.lblFoldingID = lblFoldingID;
 this.lblInsideFoldCollateStapleID = lblInsideFoldCollateStapleID;
 this.lblSealID = lblSealID;
 this.lblRoundCornerID = lblRoundCornerID;
 this.lblEnvelopesID = lblEnvelopesID;
 this.lblSecondSheetsID = lblSecondSheetsID;
 this.lblRushChargeID = lblRushChargeID;
 this.lblShippingHandlingID = lblShippingHandlingID;
 this.lblMailingServicesID = lblMailingServicesID;
 this.lblPrintingSubtotalID = lblPrintingSubtotalID;
 this.lblPrintingCostEachID = lblPrintingCostEachID;
 this.lblOrderTotalID = lblOrderTotalID;
 this.lblHiVolDiscountID = lblHiVolDiscountID;
 this.lblCouponDiscountID = lblCouponDiscountID;
 this.lblDiscountedTotalID = lblDiscountedTotalID;
 this.lblUnitCostID = lblUnitCostID;
 this.rowHiVolDiscountID = rowHiVolDiscountID;
 this.rowCouponDiscountID = rowCouponDiscountID;
 this.rowDiscountedTotalID = rowDiscountedTotalID;
 this.lblPaddingID = lblPaddingID;
 this.lblVariableDataID = lblVariableDataID;
 this.lblPFLProSuggestedRetailPriceID = lblPFLProSuggestedRetailPriceID;
 this.lblPFLProWholesaleNetPriceID = lblPFLProWholesaleNetPriceID;
 this.lblPFLProWholesaleNetUnitPriceID = lblPFLProWholesaleNetUnitPriceID;
 this.lblPFLProShippingAndHandlingPriceID = lblPFLProShippingAndHandlingPriceID;
 this.lblLanyardID = lblLanyardID;
};

InstaPrice.prototype.SetChangeLabelIDs = function(lblChangePrintingID, lblChangePaperID, lblChangeAqueousID, lblChangeRoundCornersID, lblChangeFoldID, lblChangeEnvelopesID, lblChangeProdSpeedID, lblChangeShipMethodID, lblChangeMailingMethodID, lblPriceChangeSubTotalID, lblUpdatedProdTotalID, lblChangeInsidePrinting, lblChangeInsidePaper, lblPriceChangeUpgradeDiscount, lblPriceChangeCouponDiscount, lblPriceChangeSpecialDiscountID, lblUpdatedCostEachID, lblChangeFoldCollateStaple, lblChangeSecondSheets, lblPriceChangeHiVolDiscount, lblChangeSeal, lblChangePaddingID, lblChangeVariableDataID, lblPriceChangePFLProDiscount, lblChangeLanyardID) {
 this.lblChangePrintingID = lblChangePrintingID;
 this.lblChangePaperID = lblChangePaperID;
 this.lblChangeAqueousID = lblChangeAqueousID;
 this.lblChangeLanyardID = lblChangeLanyardID;
 this.lblChangeRoundCornersID = lblChangeRoundCornersID;
 this.lblChangeFoldID = lblChangeFoldID;
 this.lblChangeEnvelopesID = lblChangeEnvelopesID;
 this.lblChangeProdSpeedID = lblChangeProdSpeedID;
 this.lblChangeShipMethodID = lblChangeShipMethodID;
 this.lblChangeMailingMethodID = lblChangeMailingMethodID;
 this.lblPriceChangeSubTotalID = lblPriceChangeSubTotalID;
 this.lblUpdatedProdTotalID = lblUpdatedProdTotalID;
 this.lblChangeInsidePrinting = lblChangeInsidePrinting;
 this.lblChangeInsidePaper = lblChangeInsidePaper;
 this.lblPriceChangeUpgradeDiscount = lblPriceChangeUpgradeDiscount;
 this.lblPriceChangeCouponDiscount = lblPriceChangeCouponDiscount;
 this.lblPriceChangeSpecialDiscountID = lblPriceChangeSpecialDiscountID;
 this.lblUpdatedCostEachID = lblUpdatedCostEachID;
 this.lblChangeFoldCollateStaple = lblChangeFoldCollateStaple;
 this.lblChangeSecondSheets = lblChangeSecondSheets;
 this.lblPriceChangeHiVolDiscount = lblPriceChangeHiVolDiscount;
 this.lblChangeSeal = lblChangeSeal;
 this.lblChangePaddingID = lblChangePaddingID;
 this.lblChangeVariableDataID = lblChangeVariableDataID;
 this.lblPriceChangePFLProDiscount = lblPriceChangePFLProDiscount;
};

InstaPrice.prototype.SetOriginalPrices = function(basePrintingPrice, baseProductPrice, baseDieCutPrice, baseDrillholePrice, insideBaseDrillholePrice, baseInkPrice, coverBaseInkPrice, insideBaseInkPrice, baseSpotPrice, coverBaseSpotPrice, insideBaseSpotPrice, basePaperPrice, coverBasePaperPrice, insideBasePaperPrice, aqueousPrice, coverGlossVarnishPrice, paperUpgradePrice, coverPaperUpgradePrice, insidePaperUpgradePrice, foldPrice, insideFoldCollateStaple, sealPrice, roundCornerPrice, envelopePrice, secondSheetPrice, turnaroundPrice, shipTypePrice, mailingPrice, printingSubtotal, totalPrice, hiVolDiscount, promotionalDiscount, referralDiscount, discountPrice, additionalMarkupPercent, doNotSetOri, insideBasePrintingPrice, couponDiscount, baseConversionPrice, paddingPrice, sheetsPerUnitPrice, backingPrice, coverPrice, bindingPrice, variableDataPrice, imprintPrice, imprintColorPrice, collatePrice, pflProDiscount, pflProRushSavings, pflProProofSavings, lanyardPrice) {
 this.basePrintingPrice = basePrintingPrice;
 this.baseProductPrice = baseProductPrice;
 this.baseDieCutPrice = baseDieCutPrice;
 this.baseDrillholePrice = baseDrillholePrice;
 this.insideBaseDrillholePrice = insideBaseDrillholePrice;
 this.baseInkPrice = baseInkPrice;
 this.coverBaseInkPrice = coverBaseInkPrice;
 this.insideBaseInkPrice = insideBaseInkPrice;
 this.baseSpotPrice = baseSpotPrice;
 this.coverBaseSpotPrice = coverBaseSpotPrice;
 this.insideBaseSpotPrice = insideBaseSpotPrice;
 this.basePaperPrice = basePaperPrice;
 this.coverBasePaperPrice = coverBasePaperPrice;
 this.insideBasePaperPrice = insideBasePaperPrice;
 this.aqueousPrice = aqueousPrice;
 this.coverGlossVarnishPrice = coverGlossVarnishPrice;
 this.paperUpgradePrice = paperUpgradePrice;
 this.coverPaperUpgradePrice = coverPaperUpgradePrice;
 this.insidePaperUpgradePrice = insidePaperUpgradePrice;
 this.foldPrice = foldPrice;
 this.insideFoldCollateStaple = insideFoldCollateStaple;
 this.sealPrice = sealPrice;
 this.lanyardPrice = (typeof(lanyardPrice) != "undefined") ? lanyardPrice : 0;
 this.roundCornerPrice = roundCornerPrice;
 this.envelopePrice = envelopePrice;
 this.secondSheetPrice = secondSheetPrice;
 this.turnaroundPrice = turnaroundPrice;
 this.shipTypePrice = shipTypePrice;
 this.mailingPrice = mailingPrice;
 this.printingSubtotal = printingSubtotal;
 this.totalPrice = totalPrice;
 this.hiVolDiscount = hiVolDiscount;
 this.promotionalDiscount = promotionalDiscount;
 this.referralDiscount = referralDiscount;
 this.discountPrice = discountPrice;
 this.additionalMarkupPercent = additionalMarkupPercent;
 this.insideBasePrintingPrice = insideBasePrintingPrice;
 this.couponDiscount = couponDiscount;
 if (typeof (baseConversionPrice) == 'undefined') {
 baseConversionPrice = 0;
 }
 this.baseConversionPrice = baseConversionPrice;
 if (typeof (paddingPrice) == 'undefined') {
 paddingPrice = 0;
 }
 this.paddingPrice = paddingPrice;
 if (typeof (sheetsPerUnitPrice) == 'undefined') {
 sheetsPerUnitPrice = 0;
 }
 this.sheetsPerUnitPrice = sheetsPerUnitPrice;
 if (typeof (backingPrice) == 'undefined') {
 backingPrice = 0;
 }
 this.backingPrice = backingPrice;
 if (typeof (coverPrice) == 'undefined') {
 coverPrice = 0;
 }
 this.coverPrice = coverPrice;
 if (typeof (bindingPrice) == 'undefined') {
 bindingPrice = 0;
 }
 this.bindingPrice = bindingPrice;
 if (typeof (variableDataPrice) == 'undefined') {
 variableDataPrice = 0;
 }
 this.variableDataPrice = variableDataPrice;
 if (typeof (imprintPrice) == 'undefined') {
 imprintPrice = 0;
 }
 this.imprintPrice = imprintPrice;
 if (typeof (imprintColorPrice) == 'undefined') {
 imprintColorPrice = 0;
 }
 this.imprintColorPrice = imprintColorPrice;
 if (typeof (collatePrice) == 'undefined') {
 collatePrice = 0;
 }
 this.collatePrice = collatePrice;
 if (typeof (pflProDiscount) == 'undefined') {
 pflProDiscount = 0;
 }
 this.pflProDiscount = pflProDiscount;
 if (typeof (pflProRushSavings) == 'undefined') {
 pflProRushSavings = 0;
 }
 this.pflProRushSavings = pflProRushSavings;
 if (typeof (pflProProofSavings) == 'undefined') {
 pflProProofSavings = 0;
 }
 this.pflProProofSavings = pflProProofSavings;

 if (this.isChangeProductOptions && !doNotSetOri) {
 this.basePrintingPriceOri = basePrintingPrice;
 this.baseProductPriceOri = baseProductPrice;
 this.baseDieCutPriceOri = baseDieCutPrice;
 this.baseDrillholePriceOri = baseDrillholePrice;
 this.insideBaseDrillholePriceOri = insideBaseDrillholePrice;
 this.baseInkPriceOri = baseInkPrice;
 this.coverBaseInkPriceOri = coverBaseInkPrice;
 this.insideBaseInkPriceOri = insideBaseInkPrice;
 this.baseSpotPriceOri = baseSpotPrice;
 this.coverBaseSpotPriceOri = coverBaseSpotPrice;
 this.insideBaseSpotPriceOri = insideBaseSpotPrice;
 this.basePaperPriceOri = basePaperPrice;
 this.coverBasePaperPriceOri = coverBasePaperPrice;
 this.insideBasePaperPriceOri = insideBasePaperPrice;
 this.aqueousPriceOri = aqueousPrice;
 this.coverGlossVarnishPriceOri = coverGlossVarnishPrice;
 this.paperUpgradePriceOri = paperUpgradePrice;
 this.coverPaperUpgradePriceOri = coverPaperUpgradePrice;
 this.insidePaperUpgradePriceOri = insidePaperUpgradePrice;
 this.foldPriceOri = foldPrice;
 this.insideFoldCollateStapleOri = insideFoldCollateStaple;
 this.sealPriceOri = sealPrice;
 this.lanyardPriceOri = lanyardPrice;
 this.roundCornerPriceOri = roundCornerPrice;
 this.envelopePriceOri = envelopePrice;
 this.secondSheetPriceOri = secondSheetPrice;
 this.turnaroundPriceOri = turnaroundPrice;
 this.shipTypePriceOri = shipTypePrice;
 this.mailingPriceOri = mailingPrice;
 this.printingSubtotalOri = printingSubtotal;
 this.totalPriceOri = totalPrice;
 this.hiVolDiscountOri = hiVolDiscount;
 this.promotionalDiscountOri = promotionalDiscount;
 this.referralDiscountOri = referralDiscount;
 this.discountPriceOri = discountPrice;
 this.additionalMarkupPercentOri = additionalMarkupPercent;
 this.insideBasePrintingPriceOri = insideBasePrintingPrice;
 this.couponDiscountOri = couponDiscount;
 this.baseConversionPriceOri = baseConversionPrice;
 this.paddingPriceOri = paddingPrice;
 this.sheetsPerUnitPriceOri = sheetsPerUnitPrice;
 this.backingPriceOri = backingPrice;
 this.coverPriceOri = coverPrice;
 this.bindingPriceOri = bindingPrice;
 this.variableDataPriceOri = variableDataPrice;
 this.imprintPriceOri = imprintPrice;
 this.imprintColorPriceOri = imprintColorPrice;
 this.collatePriceOri = collatePrice;
 this.pflProDiscountOri = pflProDiscount;
 }
};

InstaPrice.prototype.SetCoupons = function(coupons) {
this.coupons = coupons;
this.AdjustCouponPrices();
};

InstaPrice.prototype.ChangeQuantity = function(quantity, loc, confirmMessage) {
 this.ValidateQuantity(ParseInt(quantity), loc, confirmMessage);

 if (this.productPricingObj) {
 this.productPricingObj.HandleQuantityChange(this.quantity);
 this.productPricingObj.HandleShowSubmitChanges();
 }

 if (typeof (this.PFLProSettings) != 'undefined' && this.PFLProSettings != null) {
 this.AdjustTotalPrices();
 }
};

InstaPrice.prototype.SetQuantity = function(quantity) {
 this.quantity = quantity;
 if ('undefined' != $(this.quantityInputID).value) {
 // For Total Quantity textbox.
 $(this.quantityInputID).value = this.quantity;
}
if ('undefined' != $(this.quantityInputID).innerHTML && '' != $(this.quantityInputID).innerHTML) {
 // For Total Quantity label.
 $(this.quantityInputID).innerHTML = this.quantity;
 // For Total Quantity hidden field matching textbox name/id.
 if ($(this.quantityInputID.replace('lblQuantity', 'txtQuantity'))) {
 $(this.quantityInputID.replace('lblQuantity', 'txtQuantity')).value = this.quantity;
}
}
};

InstaPrice.prototype.SetVersionCt = function(versionCt) {
this.versionCt = versionCt;
};

InstaPrice.prototype.ChangeAdditionalMarkupPercent = function(additionalMarkupPercent) {
this.additionalMarkupPercent = additionalMarkupPercent;

if (this.productPricingObj) {
this.productPricingObj.HandleAdditionalMarkupPercentChange(this.additionalMarkupPercent);
}
};

InstaPrice.prototype.ChangeProofType = function(proofType) {
 this.pflProProofSavings = this.GetProofSavings(proofType);
};

InstaPrice.prototype.GetProofSavings = function(proofType) {
 var savings;
 switch (proofType) {
 case ProofTypeEnum.DHPValue:
 savings = 30;
 break;
 case ProofTypeEnum.PPValue:
 savings = 100;
 break;
 default:
 savings = 0;
 break;
 }
 return savings;
};

InstaPrice.prototype.AdjustBasePrintingPrice = function(coverInside) {
 if (coverInside == CoverInsideEnum.ForCover) {
this.coverBasePrintingPrice = this.GetBasePrintingPrice(coverInside);
}
else if (coverInside == CoverInsideEnum.ForInside) {
this.insideBasePrintingPrice = this.GetBasePrintingPrice(coverInside);
}
else {
this.basePrintingPrice = this.GetBasePrintingPrice(coverInside);
}
this.RenderPrice(this.GetLblBasePrintingPriceID(coverInside), this.GetBasePrintingPrice(coverInside));
this.AdjustTotalPrices();
};

InstaPrice.prototype.GetLblBasePrintingPriceID = function(coverInside) {
return (coverInside == CoverInsideEnum.ForCover) ? this.lblCoverBasePrintingPriceID : (coverInside == CoverInsideEnum.ForInside) ? this.lblInsideBasePrintingPriceID : this.lblBasePrintingPriceID;
};

InstaPrice.prototype.AdjustBaseProductPrice = function(price) {
this.baseProductPrice = price;
this.AdjustBasePrintingPrice();
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustBaseDieCutPrice = function(price) {
this.baseDieCutPrice = price;
this.AdjustBasePrintingPrice();
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustBaseDrillholePrice = function(price, coverInside) {
if (coverInside == CoverInsideEnum.ForInside) {
this.insideBaseDrillholePrice = price;
}
else {
this.baseDrillholePrice = price;
}
this.AdjustBasePrintingPrice(coverInside);
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustBaseInkPrice = function(price, coverInside) {
if (coverInside == CoverInsideEnum.ForCover) {
this.coverBaseInkPrice = price;
}
else if (coverInside == CoverInsideEnum.ForInside) {
this.insideBaseInkPrice = price;
}
else {
this.baseInkPrice = price;
}
this.AdjustBasePrintingPrice(coverInside);
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustBaseSpotPrice = function(price, coverInside) {
 if (coverInside == CoverInsideEnum.ForCover) {
 this.coverBaseSpotPrice = price;
 }
 else if (coverInside == CoverInsideEnum.ForInside) {
 this.insideBaseSpotPrice = price;
 }
 else {
 this.baseSpotPrice = price;
 }
 this.AdjustBasePrintingPrice(coverInside);
 this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustAqueousPrice = function(price, coverInside) {
if (coverInside == CoverInsideEnum.ForCover) {
this.coverGlossVarnishPrice = price;
}
else {
this.aqueousPrice = price;
}
this.RenderPrice(this.GetLblAqueousPriceID(coverInside), price);
this.AdjustTotalPrices();
};

InstaPrice.prototype.GetLblAqueousPriceID = function(coverInside) {
return (coverInside == CoverInsideEnum.ForCover) ? this.lblCoverGlossVarnishID : this.lblAqueousCoatingID;
};

InstaPrice.prototype.AdjustPaperBasePrice = function(price, coverInside) {
 if (coverInside == CoverInsideEnum.ForCover) {
 this.coverBasePaperPrice = price;
 }
 else if (coverInside == CoverInsideEnum.ForInside) {
 this.insideBasePaperPrice = price;
 }
 else {
 this.basePaperPrice = price;
 }

 this.AdjustBasePrintingPrice(coverInside);
 this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustPaperUpgradePrice = function(price, coverInside) {
 if (coverInside == CoverInsideEnum.ForCover) {
 this.coverPaperUpgradePrice = price;
 }
 else if (coverInside == CoverInsideEnum.ForInside) {
 this.insidePaperUpgradePrice = price;
 }
 else {
 this.paperUpgradePrice = price;
 }
 this.RenderPrice(this.GetLblPaperUpgradeID(coverInside), price);
 this.AdjustTotalPrices();
};

InstaPrice.prototype.GetLblPaperUpgradeID = function(coverInside) {
return (coverInside == CoverInsideEnum.ForCover) ? this.lblCoverPaperUpgradeID : (coverInside == CoverInsideEnum.ForInside) ? this.lblInsidePaperUpgradeID : this.lblPaperUpgradeID;
};

InstaPrice.prototype.AdjustFoldPrice = function(price, coverInside) {
if (coverInside == CoverInsideEnum.ForInside) {
this.insideFoldCollateStaple = price;
}
else {
this.foldPrice = price;
}
this.RenderPrice(this.GetLblFoldPriceID(coverInside), price);
this.AdjustTotalPrices();
};

InstaPrice.prototype.GetLblFoldPriceID = function(coverInside) {
return (coverInside == CoverInsideEnum.ForInside) ? this.lblInsideFoldCollateStapleID : this.lblFoldingID;
};

InstaPrice.prototype.AdjustConversionPrice = function(price) {
this.baseConversionPrice = price;
this.AdjustBasePrintingPrice();
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustBindingPrice = function(price) {
 this.bindingPrice = price;
 this.AdjustPaddingPrice();
 this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustSheetsPerUnitPrice = function(price) {
 this.sheetsPerUnitPrice = price;
 this.AdjustPaddingPrice();
 this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustCollatePrice = function(price) {
 this.collatePrice = price;
 this.AdjustPaddingPrice();
 this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustBackingPrice = function(price) {
this.backingPrice = price;
this.AdjustPaddingPrice();
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustCoverPrice = function(price) {
this.coverPrice = price;
this.AdjustPaddingPrice();
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustSealPrice = function(price) {
 this.sealPrice = price;
 this.RenderPrice(this.lblSealID, price);
 this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustLanyardPrice = function(price) {
this.lanyardPrice = price;
this.RenderPrice(this.lblLanyardID, price);
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustRoundCornerPrice = function(price) {
this.roundCornerPrice = price;
this.RenderPrice(this.lblRoundCornerID, price);
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustEnvelopePrice = function(price) {
this.envelopePrice = price;
this.RenderPrice(this.lblEnvelopesID, price);
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustSecondSheetPrice = function(price) {
this.secondSheetPrice = price;
this.RenderPrice(this.lblSecondSheetsID, price);
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustTurnaroundPrice = function(price, ipPrice) {
 this.turnaroundPrice = price;
 this.RenderPrice(this.lblRushChargeID, price);
 if (typeof (this.PFLProSettings) != 'undefined' && this.PFLProSettings != null) {
 this.pflProRushSavings = ipPrice - price;
 }
 this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustShipTypePrice = function(price) {
this.shipTypePrice = price;
this.RenderPrice(this.lblShippingHandlingID, price);
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustMailingPrice = function(price) {
this.mailingPrice = price;
this.RenderPrice(this.lblMailingServicesID, price);
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustImprintPrice = function(price) {
 this.imprintPrice = price;
 this.AdjustVariableDataPrice();
 this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustImprintColorPrice = function(price) {
 this.imprintColorPrice = price;
 this.AdjustVariableDataPrice();
 this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustVariableDataPrice = function() {
 this.variableDataPrice = this.GetVariableDataPrice();
 this.RenderPrice(this.lblVariableDataID, this.variableDataPrice);
};

InstaPrice.prototype.AdjustPaddingPrice = function() {
 this.paddingPrice = this.GetPaddingPrice();
 this.RenderPrice(this.lblPaddingID, this.paddingPrice);
};

InstaPrice.prototype.GetVariableDataPrice = function() {
 return this.imprintPrice + this.imprintColorPrice;
};

InstaPrice.prototype.GetPaddingPrice = function() {
 return this.bindingPrice + this.sheetsPerUnitPrice + this.collatePrice + this.backingPrice + this.coverPrice;
};

InstaPrice.prototype.AdjustPFLProDiscount = function() {
 if (typeof (this.PFLProSettings) != 'undefined' && this.PFLProSettings != null) {
 var pflProDiscount = Math.round((this.GetPrintingSubtotal() +
 this.envelopePrice +
 this.secondSheetPrice) * (this.PFLProSettings.Discount)) * .01;
 this.pflProDiscount = 0;
 if (pflProDiscount >= this.hiVolDiscount) {
 this.pflProDiscount = pflProDiscount;
 }

 if (this.IsPFLProReseller()) {
 var pflProSuggestedRetailPrice = this.GetPFLProSuggestedRetailPrice();
 var pflProWholesaleNetPrice = this.GetPFLProWholesaleNetPrice();
 var pflProShippingHandlingPrice = this.GetShippingHandlingPrice()
 this.RenderPrice(this.lblPFLProSuggestedRetailPriceID, pflProSuggestedRetailPrice);
 this.RenderPrice(this.lblPFLProWholesaleNetPriceID, pflProWholesaleNetPrice);
 this.RenderPrice(this.lblPFLProWholesaleNetUnitPriceID, this.GetCostEach(pflProWholesaleNetPrice), 4);
 this.RenderPrice(this.lblPFLProShippingAndHandlingPriceID, pflProShippingHandlingPrice);
 }
 }
};

InstaPrice.prototype.AdjustCouponPrices = function() {
this.hiVolDiscount = 0;
this.promotionalDiscount = 0;
this.referralDiscount = 0;

if (this.coupons) {
var couponCode;
var discountType;
var couponAmount;
var totalCouponAmount = 0;
var txtCouponCodeElem;
var hiVolDiscount = 0;

for (var i = 0, loopCnt = this.coupons.length; i < loopCnt; i++) {
couponCode = this.coupons[i].couponCode;
discountType = this.coupons[i].discountType;
if (this.isChangeOrder) {
couponAmount = this.coupons[i].GetCouponAmount(this.GetUpdatedProductTotal());
}
else {
couponAmount = this.coupons[i].GetCouponAmount(this.totalPrice - this.mailingPrice);
}
totalCouponAmount += couponAmount;

if (discountType == DiscountTypeEnum.HiVol) {
hiVolDiscount = couponAmount;
}
else if (discountType == DiscountTypeEnum.Promotional || discountType == DiscountTypeEnum.Referral) {
if (discountType == DiscountTypeEnum.Promotional) {
if (this.productPricingObj && this.productPricingObj.txtCouponCodeID) {
txtCouponCodeElem = $(this.productPricingObj.txtCouponCodeID);
}

if (couponAmount > 0 && hiVolDiscount > 0 && couponCode.toUpperCase().indexOf(CouponCodeEnum.MakeGoodPrefix) != 0) {
if (couponAmount > hiVolDiscount) {
this.promotionalDiscount = couponAmount;
hiVolDiscount = 0;
if (typeof (this.couponAmountHigherAlert) == 'undefined') {
this.couponAmountHigherAlert = "Your order qualifies for our high-volume discount, but the promotional code you entered gives you the best deal! These discounts cannot be combined, so we will apply the higher-value discount.";
alert(this.couponAmountHigherAlert);
}
}
else {
this.promotionalDiscount = 0;
totalCouponAmount -= couponAmount;
if (txtCouponCodeElem && txtCouponCodeElem.value != '') {
txtCouponCodeElem.value = '';
if (typeof (this.hiVolDiscountHigherAlert) == 'undefined') {
this.hiVolDiscountHigherAlert = "Your order qualifies for our high-volume discount! To give you the best deal, we will apply this higher-value discount instead of the promotional code you entered. These discounts cannot be combined.";
alert(this.hiVolDiscountHigherAlert);
}
}
}
}
else {
this.promotionalDiscount = couponAmount;
}

if (txtCouponCodeElem && txtCouponCodeElem.value == '' && this.promotionalDiscount > 0 && hiVolDiscount == 0) {
txtCouponCodeElem.value = couponCode;
}
}
else if (discountType == DiscountTypeEnum.Referral) {
this.referralDiscount = couponAmount;
}
}
}

this.SetDiscountRowVisibility(null, totalCouponAmount);

if (hiVolDiscount > this.pflProDiscount) {
this.hiVolDiscount = hiVolDiscount;
this.SetDiscountRowVisibility(DiscountTypeEnum.HiVol, this.hiVolDiscount);
}

this.RenderPrice(this.lblHiVolDiscountID, this.hiVolDiscount);
var lblCallUsElem = $('lblCallUs');
if (lblCallUsElem) { //hide high volume discount on hard coded ordering pages
lblCallUsElem.style.display = (this.hiVolDiscount > 0) ? '' : 'none'; //show call us when there is a high volume discount
var rowCallUsElem = $('rowCallUs');
if (rowCallUsElem) {
rowCallUsElem.style.display = (this.hiVolDiscount > 0) ? '' : 'none'; //show message when there is a high volume discount
}
var lblOrderTotalElem = $(this.lblOrderTotalID);
if (lblOrderTotalElem) {
lblOrderTotalElem.style.display = (this.hiVolDiscount > 0) ? 'none' : ''; //hide order total when there is a high volume discount
}
var rowUnitCostElem = $('rowUnitCost');
if (rowUnitCostElem) {
rowUnitCostElem.style.display = (this.hiVolDiscount > 0) ? 'none' : ''; //hide unit cost when there is a high volume discount
}
if (this.hiVolDiscount > 0) {
this.SetDiscountRowVisibility(null, 0); //hide discounted total
this.SetDiscountRowVisibility(DiscountTypeEnum.HiVol, 0); //hide HiVol discount
}
}
else {
this.SetDiscountRowVisibility(DiscountTypeEnum.HiVol, this.hiVolDiscount);
}
this.RenderPrice(this.lblCouponDiscountID, this.promotionalDiscount + this.referralDiscount);
this.SetDiscountRowVisibility(DiscountTypeEnum.Promotional, this.promotionalDiscount + this.referralDiscount);
this.AdjustTotalPrices();
}

};

InstaPrice.prototype.AdjustUpgradeDiscount = function(price) {
this.upgradeDiscountPrice = price;
this.AdjustTotalPrices();
};

InstaPrice.prototype.AdjustSpecialDiscount = function(price) {
this.specialDiscountPrice = price;
this.AdjustTotalPrices();
};

InstaPrice.prototype.SetDiscountRowVisibility = function(discountType, couponAmount) {
 var lblID = (discountType == DiscountTypeEnum.HiVol) ? this.rowHiVolDiscountID : (discountType == DiscountTypeEnum.Promotional || discountType == DiscountTypeEnum.Referral) ? this.rowCouponDiscountID : (discountType == null) ? this.rowDiscountedTotalID : null;
 var lblElem = $(lblID);
 if (lblElem) {
 lblElem.style.display = (couponAmount > 0) ? '' : 'none';
 }
};

InstaPrice.prototype.RenderToolTipPrice = function(lblID, price, precision) {
 if (precision == null || precision == 'undefined') {
 precision = 2;
 }
 var lblElem = $(lblID);
 if (lblElem) {
 lblElem.title = FormatPrice(price, precision);
 }
};

InstaPrice.prototype.RenderPrice = function(lblID, price, precision) {
 var lblElem = $(lblID);
 if (lblElem) {
 lblElem.innerHTML = FormatPrice(price, precision);
 }
};

InstaPrice.prototype.RenderPercent = function(lblID, percent) {
 var lblElem = $(lblID);
 if (lblElem) {
 lblElem.innerHTML = Math.round(percent * 100) + "%";
 }
};

InstaPrice.prototype.AdjustTotalPrices = function() {
 this.basePrintingPrice = this.GetBasePrintingPrice();
 this.printingSubtotal = this.GetPrintingSubtotal();
 this.totalPrice = this.GetTotalPrice();
 this.AdjustPFLProDiscount();
 this.discountPrice = this.GetDiscountPrice();
 if (typeof (document.price) != 'undefined' && typeof (document.price.PAYMENTNEEDED) != 'undefined') {
 var paymentNeededGroup = document.price.PAYMENTNEEDED; //cobrand free business card pages
 if (this.discountPrice != 0) {
 paymentNeededGroup[1].checked = true;
 } else {
 paymentNeededGroup[0].checked = true;
 }
 }
 this.RenderTotalPrices();
};

InstaPrice.prototype.GetBasePrintingPrice = function(coverInside) {
 var price = 0;
 if (coverInside == CoverInsideEnum.ForCover) {
 price = this.baseProductPrice +
 this.coverBaseInkPrice +
 this.coverBaseSpotPrice +
 this.coverBasePaperPrice +
 this.baseDrillholePrice;
 }
 else if (coverInside == CoverInsideEnum.ForInside) {
 price = this.insideBaseInkPrice +
 this.insideBaseSpotPrice +
 this.insideBasePaperPrice +
 this.insideBaseDrillholePrice;
 }
 else {
 price = this.baseProductPrice +
 this.baseInkPrice +
 this.coverBaseInkPrice +
 this.baseSpotPrice +
 this.coverBaseSpotPrice +
 this.basePaperPrice +
 this.coverBasePaperPrice +
 this.baseDrillholePrice +
 this.baseDieCutPrice +
 this.baseConversionPrice;
 }
 return price;
};

InstaPrice.prototype.GetPrintingSubtotal = function() {
 return this.GetBasePrintingPrice() +
 this.GetBasePrintingPrice(CoverInsideEnum.ForInside) +
 this.aqueousPrice +
this.coverGlossVarnishPrice +
this.paperUpgradePrice +
this.coverPaperUpgradePrice +
this.insidePaperUpgradePrice +
this.foldPrice +
this.insideFoldCollateStaple +
this.sealPrice +
this.lanyardPrice +
this.roundCornerPrice +
this.GetPaddingPrice() +
this.variableDataPrice;
};

InstaPrice.prototype.GetTotalPrice = function() {
return this.printingSubtotal +
this.envelopePrice +
this.secondSheetPrice +
this.turnaroundPrice +
this.shipTypePrice +
this.mailingPrice;
};

InstaPrice.prototype.GetDiscountPrice = function() {
 return this.totalPrice -
Math.max(this.pflProDiscount, this.hiVolDiscount) -
this.promotionalDiscount -
this.referralDiscount;
};

InstaPrice.prototype.GetQuantity = function() {
 return this.quantity;
};

InstaPrice.prototype.GetPPSProductTotal = function() {
 return this.discountPrice -
this.turnaroundPrice -
this.shipTypePrice -
this.secondSheetPrice -
this.mailingPrice -
this.lanyardPrice - 
this.envelopePrice;
};

InstaPrice.prototype.GetPPSUnitCost = function() {
 return (this.quantity) ? (this.GetPPSProductTotal() / this.quantity) : '';
};

InstaPrice.prototype.GetTurnaroundPrice = function() {
return this.turnaroundPrice;
};

InstaPrice.prototype.GetShipPrice = function() {
return this.shipTypePrice;
};

InstaPrice.prototype.GetSecondSheetPrice = function() {
return this.secondSheetPrice;
};

InstaPrice.prototype.GetMailingPrice = function() {
return this.mailingPrice;
};

InstaPrice.prototype.GetEnvelopePrice = function() {
return this.envelopePrice;
};

InstaPrice.prototype.GetPFLProResellerMargin = function() {
return (typeof (this.PFLProSettings) != 'undefined' && this.PFLProSettings != null) ? this.PFLProSettings.ResellerMargin * 0.01 : 0;
};

InstaPrice.prototype.IsPFLProReseller = function() {
 return (typeof (this.PFLProSettings) != 'undefined' && this.PFLProSettings != null);
};

InstaPrice.prototype.GetPFLProSuggestedRetailPrice = function() {
 var pflProSuggestedRetailPrice = 0;
 if (typeof (this.PFLProSettings) != 'undefined' && this.PFLProSettings != null) {
 var shippingHandlingPrice = this.GetShippingHandlingPrice();
 pflProSuggestedRetailPrice = ((this.discountPrice - shippingHandlingPrice) / (1 - this.GetPFLProResellerMargin())) + shippingHandlingPrice;
 }
 return pflProSuggestedRetailPrice;
};

InstaPrice.prototype.GetPFLProWholesaleNetPrice = function() {
 var pflProWholesaleNetPrice = 0;
 if (typeof (this.PFLProSettings) != 'undefined' && this.PFLProSettings != null) {
 var shippingHandlingPrice = this.GetShippingHandlingPrice();
 pflProWholesaleNetPrice = (this.discountPrice - shippingHandlingPrice);
 }
 return pflProWholesaleNetPrice;
};

InstaPrice.prototype.GetShippingHandlingPrice = function() {
return this.shipTypePrice + this.turnaroundPrice + this.mailingPrice;
};

InstaPrice.prototype.RenderTotalPrices = function() {
 if (this.isChangeProductOptions) {
 if (this.isChangeOrder) {
 this.RenderPrice(this.lblChangePrintingID, this.GetBasePrintingPriceDiff());
 }
 else {
 this.RenderPrice(this.lblChangePrintingID, this.GetPrintingSubtotalPriceDiff());
 }
 this.RenderPrice(this.lblChangePaperID, this.GetPaperPriceDiff());
 this.RenderPrice(this.lblChangeAqueousID, this.GetAqueousPriceDiff());
 this.RenderPrice(this.lblChangeLanyardID, this.GetLanyardPriceDiff());
 this.RenderPrice(this.lblChangeRoundCornersID, this.GetRoundCornerPriceDiff());
 this.RenderPrice(this.lblChangeFoldID, this.GetFoldPriceDiff());
 this.RenderPrice(this.lblChangeEnvelopesID, this.GetEnvelopePriceDiff());
 this.RenderPrice(this.lblChangeProdSpeedID, this.GetTurnaroundPriceDiff());
 this.RenderPrice(this.lblChangeShipMethodID, this.GetShipTypePriceDiff());
 this.RenderPrice(this.lblChangeMailingMethodID, this.GetMailingPriceDiff());
 this.RenderPrice(this.lblPriceChangeSubTotalID, this.GetTotalPriceDiff());
 this.RenderPrice(this.lblUpdatedProdTotalID, this.GetUpdatedProductTotal());
 this.RenderPrice(this.lblUpdatedCostEachID, this.GetCostEach(this.printingSubtotalOri + this.GetPrintingSubtotalPriceDiff()));
 this.RenderToolTipPrice(this.lblUpdatedCostEachID, this.GetCostEach(this.printingSubtotalOri + this.GetPrintingSubtotalPriceDiff()), 4);
 this.RenderPrice(this.lblChangeInsidePrinting, this.GetInsidePrintingPriceDiff());
 this.RenderPrice(this.lblChangeInsidePaper, this.GetInsidePaperPriceDiff());
 this.RenderPrice(this.lblPriceChangeHiVolDiscount, this.GetHighVolumeDiscountDiff());
 this.RenderPrice(this.lblPriceChangePFLProDiscount, this.GetPFLProDiscountDiff());
 this.RenderPrice(this.lblChangeFoldCollateStaple, this.GetFoldPriceDiff(CoverInsideEnum.ForInside));
 this.RenderPrice(this.lblChangeSecondSheets, this.GetSecondSheetPriceDiff());
 this.RenderPrice(this.lblChangeSeal, this.GetSealPriceDiff());
 this.RenderPrice(this.lblPriceChangeUpgradeDiscount, this.upgradeDiscountPrice);
 this.RenderPrice(this.lblPriceChangeCouponDiscount, this.GetCouponPriceDiff());
 this.RenderPrice(this.lblPriceChangeSpecialDiscountID, this.specialDiscountPrice);
 this.RenderPrice(this.lblChangePaddingID, this.GetPaddingPriceDiff());
 this.RenderPrice(this.lblChangeVariableDataID, this.GetVariableDataPriceDiff());
 }
 else {
 this.RenderPrice(this.lblPrintingSubtotalID, this.printingSubtotal);
 this.RenderPrice(this.lblOrderTotalID, this.totalPrice);
 this.RenderPrice(this.lblDiscountedTotalID, this.discountPrice);
 this.RenderPrice(this.lblPrintingCostEachID, this.GetCostEach(this.totalPrice - this.shipTypePrice - this.mailingPrice - this.pflProDiscount));
 this.RenderToolTipPrice(this.lblPrintingCostEachID, this.GetCostEach(this.totalPrice - this.shipTypePrice - this.mailingPrice - this.pflProDiscount), 4);
 this.RenderPrice(this.lblUnitCostID, this.GetCostEach(this.discountPrice));
 this.RenderToolTipPrice(this.lblUnitCostID, this.GetCostEach(this.discountPrice), 4);
 }
};

InstaPrice.prototype.GetCostEach = function(price) {
return (this.quantity) ? (price / this.quantity) : '';
};

InstaPrice.prototype.GetTotalPriceDiff = function() {
 return this.GetPrintingSubtotalPriceDiff() +
 this.GetEnvelopePriceDiff() +
 this.GetSecondSheetPriceDiff() +
 this.GetTurnaroundPriceDiff() +
 this.GetShipTypePriceDiff() +
 this.GetMailingPriceDiff();
};

InstaPrice.prototype.GetBasePrintingPriceDiff = function() {
 return (this.basePrintingPrice - this.basePrintingPriceOri);
};

InstaPrice.prototype.GetPrintingSubtotalPriceDiff = function() {
 return (this.printingSubtotal - this.printingSubtotalOri);
};

InstaPrice.prototype.GetPaperPriceDiff = function() {
 var price = (this.paperUpgradePrice + this.coverPaperUpgradePrice) - (this.paperUpgradePriceOri + this.coverPaperUpgradePriceOri);
 return price;
};

InstaPrice.prototype.GetAqueousPriceDiff = function() {
 return (this.aqueousPrice + this.coverGlossVarnishPrice) - (this.aqueousPriceOri + this.coverGlossVarnishPriceOri);
};

InstaPrice.prototype.GetLanyardPriceDiff = function() {
return (this.lanyardPrice - this.lanyardPriceOri);
};

InstaPrice.prototype.GetRoundCornerPriceDiff = function() {
return (this.roundCornerPrice - this.roundCornerPriceOri);
};

InstaPrice.prototype.GetFoldPriceDiff = function(coverInside) {
 return (coverInside == CoverInsideEnum.ForInside) ? this.insideFoldCollateStaple - this.insideFoldCollateStapleOri : this.foldPrice - this.foldPriceOri;
};

InstaPrice.prototype.GetEnvelopePriceDiff = function() {
 return (this.envelopePrice - this.envelopePriceOri);
};

InstaPrice.prototype.GetTurnaroundPriceDiff = function() {
 return (this.turnaroundPrice - this.turnaroundPriceOri);
};

InstaPrice.prototype.GetShipTypePriceDiff = function() {
 return (this.shipTypePrice - this.shipTypePriceOri);
};

InstaPrice.prototype.GetMailingPriceDiff = function() {
 return (this.mailingPrice - this.mailingPriceOri);
};

InstaPrice.prototype.GetUpdatedProductTotal = function() {
return (this.totalPriceOri -
 this.upgradeDiscountPrice -
 this.specialDiscountPrice -
 this.GetPFLProDiscountDiff() +
 (this.GetPrintingSubtotalPriceDiff() +
 this.GetShipTypePriceDiff() +
 this.GetTurnaroundPriceDiff() +
 this.GetMailingPriceDiff() +
 this.GetSecondSheetPriceDiff() +
 this.GetEnvelopePriceDiff()));
};

InstaPrice.prototype.GetInsidePrintingPriceDiff = function() {
 return (this.insideBasePrintingPrice - this.insideBasePrintingPriceOri);
};

InstaPrice.prototype.GetInsidePaperPriceDiff = function() {
 return (this.insidePaperUpgradePrice - this.insidePaperUpgradePriceOri);
};

InstaPrice.prototype.GetHighVolumeDiscountDiff = function() {
return (this.hiVolDiscount - this.hiVolDiscountOri);
};

InstaPrice.prototype.GetPFLProDiscountDiff = function() {
 this.AdjustPFLProDiscount();
 return (this.pflProDiscount - this.pflProDiscountOri);
};

InstaPrice.prototype.GetSecondSheetPriceDiff = function() {
 return (this.secondSheetPrice - this.secondSheetPriceOri);
};

InstaPrice.prototype.GetSealPriceDiff = function() {
 return (this.sealPrice - this.sealPriceOri);
};

InstaPrice.prototype.GetPaddingPriceDiff = function() {
 return (this.paddingPrice - this.paddingPriceOri);
};

InstaPrice.prototype.GetVariableDataPriceDiff = function() {
 return (this.variableDataPrice - this.variableDataPriceOri);
};

InstaPrice.prototype.GetCouponPriceDiff = function() {
 return (this.GetPrintingSubtotalPriceDiff() * (this.couponDiscountPercent * .01));
};

InstaPrice.prototype.ValidateQuantity = function(quantity, loc, confirmMessage) {
 var ret = this.IsValidQuantity(quantity, loc, confirmMessage);
 if (!ret.VALIDATE_RESULT) {
 if (ret.VALIDATE_MESSAGE) {
 if (typeof (loc) == 'undefined') {
 alert(ret.VALIDATE_MESSAGE);
 }
 else {
 var confirmation = confirm(ret.VALIDATE_MESSAGE);
 if (confirmation) {
 window.location = ret.VALIDATE_REDIRECT;
 }
 }
 }
 if (ret.VALIDATE_QUANTITY) {
 this.SetQuantity(ret.VALIDATE_QUANTITY);
 }
 }
 else {
 this.quantity = quantity;
 }
 return ret.VALIDATE_RESULT;
};

InstaPrice.prototype.IsValidQuantity = function(quantity, loc, confirmMessage) {
 //update quantity to be number of pads * sheetsPerUnit for notepads
 if (this.productPricingObj && this.productPricingObj.orderingPage == OrderingPageEnum.notepadprinting) {
 var sheetsPerUnitID = FinishingPricings[BindingPricings[this.productPricingObj.bindingPricingID].rblSheetsPerUnitID].finishingID;
 var sheetsPerPad = StripNonNumeric(AttributeValueNameEnum[sheetsPerUnitID]);
 var sheetsQuantity = quantity * sheetsPerPad;
 if (sheetsQuantity < this.minQuantity) {
 var numPads = Math.ceil(this.minQuantity / sheetsPerPad);
 var totalSheets = sheetsPerPad * numPads;
 return this.GetValidationObject(false, 'The minimum quantity for this size pad and number of sheets is ' + numPads + ' pads (for ' + totalSheets + ' total sheets)', numPads);

 }
 }
 //check quantity is divisible by padding for NCR Forms
 else if (this.productPricingObj && this.productPricingObj.orderingPage == OrderingPageEnum.carbonlessncrprinting
&& FinishingPricings[BindingPricings[this.productPricingObj.bindingPricingID].rblSheetsPerUnitID].finishingID != '') {
 var sheetsPerUnitID = FinishingPricings[BindingPricings[this.productPricingObj.bindingPricingID].rblSheetsPerUnitID].finishingID;
 var minQtyMsg = '';
 if (quantity < this.minQuantity) {
 quantity = this.minQuantity;
 minQtyMsg = ' and to meet the minimum quantity of ' + this.minQuantity;
 }
 var sheetsPerPad = StripNonNumeric(AttributeValueNameEnum[sheetsPerUnitID]);
 var padsOfRemainder = quantity % sheetsPerPad;
 if (padsOfRemainder != 0) {
 var newQuantity = Math.ceil(quantity / sheetsPerPad) * sheetsPerPad;
 var retMsg = 'Quantity will be rounded up to give you a full ' + AttributeValueNameEnum[sheetsPerUnitID] + ' NCR sets per pad or booklet ' + minQtyMsg;
 return this.GetValidationObject(false, retMsg, newQuantity);
 }
 else if (minQtyMsg != '') {
 return this.GetValidationObject(false, 'The minimum quantity for this product is ' + this.minQuantity + '.', this.minQuantity);
 }
 }
 else if (typeof (ChangeOptions) != 'undefined' && ChangeOptions && 'undefined' != typeof (IsMultiVersion) && IsMultiVersion[0]) {
 // Skip this validation for multi-version products; it is handled elsewhere.
 return this.GetValidationObject(true);
 }
 else if (quantity == '' || quantity < this.minQuantity) {
 return this.GetValidationObject(false, 'The minimum quantity for this product is ' + this.minQuantity + '.', this.minQuantity);
 }
 else if (this.maxQuantity && quantity > this.maxQuantity) {
 if (this.productPricingObj && this.productPricingObj.orderingPage == OrderingPageEnum.cardsbusinesscards) {
 return this.GetValidationObject(false, 'The maximum number of boxes you are allowed to order is ' + (this.maxQuantity / this.minQuantity) + '.', this.maxQuantity);
 }
 else {
 if (typeof (loc) == 'undefined') {
 return this.GetValidationObject(false, 'The maximum quantity you are allowed to order is ' + this.maxQuantity + '.', this.maxQuantity);
 }
 else {
 var message = 'This product has a maximum quantity of ' + this.maxQuantity + '. \nClick "OK" to choose a product that allows different quantities, \nor click "CANCEL" to change the quantity.';
 if (typeof (confirmMessage) != 'undefined') {
 message = confirmMessage.substring(0, confirmMessage.indexOf('[MAX]')) + this.maxQuantity + confirmMessage.substring(confirmMessage.indexOf('[MAX]') + 5, confirmMessage.length);
 }
 return this.GetValidationObject(false, message, this.maxQuantity, loc);
 }
 }
 }
 // This.minQuantity can't be used for the increment because PPSs may have different minimums.
 else if (this.productPricingObj && this.productPricingObj.orderingPage == OrderingPageEnum.cardsbusinesscards && quantity % 500 != 0) {
 return this.GetValidationObject(false, 'Business Cards must be ordered in increments of ' + 500 + '.', Math.ceil(quantity / 500) * 500);
 }
 return this.GetValidationObject(true);
};

InstaPrice.prototype.GetValidationObject = function(validateResult, validateMessage, quantity, loc) {
return {
VALIDATE_RESULT : validateResult,
VALIDATE_MESSAGE : validateMessage,
VALIDATE_QUANTITY : quantity,
VALIDATE_REDIRECT : loc
};
};

InstaPrice.prototype.IsChanged = function() {
 if (FormatNum(this.GetBasePrintingPriceDiff(), 2) != 0) { return true; }
 if (FormatNum(this.GetPrintingSubtotalPriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetPaperPriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetAqueousPriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetLanyardPriceDiff(), 2) != 0) { return true; }
 if (FormatNum(this.GetRoundCornerPriceDiff(), 2) != 0) { return true; }
 if (FormatNum(this.GetFoldPriceDiff(), 2) != 0) { return true; }
 if (FormatNum(this.GetEnvelopePriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetTurnaroundPriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetShipTypePriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetMailingPriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetTotalPriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetInsidePrintingPriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetInsidePaperPriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetHighVolumeDiscountDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetFoldPriceDiff(CoverInsideEnum.ForInside), 2) != 0) { return true;}
 if (FormatNum(this.GetSecondSheetPriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetSealPriceDiff(), 2) != 0) { return true;}
 if (FormatNum(this.GetCouponPriceDiff(), 2) != 0) { return true; }
 if (FormatNum(this.GetPaddingPriceDiff(), 2) != 0) { return true; }
 if (FormatNum(this.GetVariableDataPriceDiff(), 2) != 0) { return true; }
 return false;
};

InstaPrice.prototype.GetMarkupPercent = function() {
 if (typeof(this.additionalMarkupPercent) != 'undefined') {
 return 1.0 * this.GetStandardMarkupPercent() + 1.0 * this.additionalMarkupPercent;
 }
 else {
 return 1.0 * this.GetStandardMarkupPercent();
 }
};

InstaPrice.prototype.GetStandardMarkupPercent = function() {
if (typeof(channelMarkupArr) != 'undefined') {
var printingSubtotal = this.GetPrintingSubtotal();
for (var minOrderAmt in channelMarkupArr) {
if (printingSubtotal >= minOrderAmt) {
return channelMarkupArr[minOrderAmt];
}
}
}
return 0;
};

InstaPrice.prototype.StoreIPPrices = function() {
//capture IP prices for OfficeMax orders
var printingSubtotalIPElem = $('printingSubtotalIP');
if (printingSubtotalIPElem) {
printingSubtotalIPElem.value = this.printingSubtotal;
}

var shipPriceIPElem = $('shipPriceIP');
if (shipPriceIPElem) {
shipPriceIPElem.value = this.shipTypePrice;
}

var rushPriceIPElem = $('rushPriceIP');
if (rushPriceIPElem) {
rushPriceIPElem.value = this.turnaroundPrice;
}

var secondsheetsPriceIPElem = $('secondsheetsPriceIP');
if (secondsheetsPriceIPElem) {
secondsheetsPriceIPElem.value = this.secondSheetPrice;
}

var envelopePriceIPElem = $('envelopePriceIP');
if (envelopePriceIPElem) {
envelopePriceIPElem.value = this.envelopePrice;
}

var totalPriceIPElem = $('totalPriceIP');
if (totalPriceIPElem) {
totalPriceIPElem.value = this.totalPrice;
}

};
/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/NoValueEnum.js" />
var LanyardPricings;

function LanyardPricing(finishingPricingID, finishingID, rblName) {
this.finishingPricingObj = new FinishingPricing(finishingPricingID, finishingID, rblName);

this.InsertLanyardPricing();
}

LanyardPricing.prototype.InsertLanyardPricing = function() {
if (typeof (LanyardPricings) == 'undefined') {
LanyardPricings = new Object;
}
LanyardPricings[this.finishingPricingObj.finishingPricingID] = this;
};

LanyardPricing.prototype.ResetLanyard = function() {
SetRadioButtonListChecked(this.rblName, this.finishingPricingObj.finishingID);
};

LanyardPricing.prototype.SetLanyard = function(finishingID) {
LanyardPricing.finishingPricingObj.SetFinishingID(finishingID);
};

LanyardPricing.prototype.ChangeLanyard = function(finishingID) {
if (this.productPricingObj) {
this.ValidateLanyard(this.productPricingObj.productID, finishingID);

this.productPricingObj.HandleAttributePrices(AdjustTypeEnum.Lanyard);
}
};

LanyardPricing.prototype.GetLanyardPrice = function(finishingID, quantity, productID, percentCollection, signatures) {
return this.finishingPricingObj.GetFinishingPrice(finishingID, quantity, productID, percentCollection, signatures, this.productPricingObj.quantityList);
};

LanyardPricing.prototype.ValidateLanyard = function(productID, finishingID, forSizeChange) {
var ret = this.IsValidLanyard(productID, finishingID, forSizeChange);
if (!ret.VALIDATE_RESULT) {
if (ret.VALIDATE_MESSAGE) {
alert(ret.VALIDATE_MESSAGE);
}
this.finishingPricingObj.SetFinishingID(ret.VALIDATE_FINISHINGID);
}
else {
this.finishingPricingObj.finishingID = finishingID;
}
return ret.VALIDATE_RESULT;
};

LanyardPricing.prototype.IsValidLanyard = function(productID, finishingID, forSizeChange) {
if (productID == ProductIDEnum.plastic_cards_4x6 && finishingID != "") {
return this.finishingPricingObj.GetValidationObject(false, "Lanyard slot for 4 x 6 size is not available on this ordering page. Please call us for pricing.", (forSizeChange) ? finishingID : "");
}
return this.finishingPricingObj.GetValidationObject(true);
};
/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/ProductIDEnum.js" />
/// <reference path="Enums/NoValueEnum.js" />
/// <reference path="FinishingPricing.js" />

var MailingPricings;
var VALIDATE_MAILING_QUANTITY = 'MailingQuantity';
var VALIDATE_MAILING_METHOD = 'MailingMethod';

function MailingPricing(mailingPricingID, mailingQuantity, mailingMethod, mailingQuantityInputID, rblMailingMethodName) {
this.mailingPricingID = mailingPricingID;
this.mailingQuantity = mailingQuantity;
this.mailingQuantityOri = mailingQuantity;
this.mailingMethod = mailingMethod;
this.mailingMethodOri = mailingMethod;
this.mailingQuantityInputID = mailingQuantityInputID;
this.rblMailingMethodName = rblMailingMethodName;

this.InsertMailingPricing();
}

MailingPricing.prototype.InsertMailingPricing = function() {
if (typeof(MailingPricings) == 'undefined') {
MailingPricings = new Object;
}
MailingPricings[this.mailingPricingID] = this;
};

MailingPricing.prototype.ResetMailing = function() {
 SetRadioButtonListChecked(this.rblMailingMethodName, this.mailingMethod);
 SetValue(this.mailingQuantityInputID, this.mailingQuantity);
};

MailingPricing.prototype.ChangeMailingQuantity = function() {
this.ValidateMailing(this.GetMailingQuantity(), this.mailingMethod);

if (this.productPricingObj) {
this.productPricingObj.AdjustPrices(AdjustTypeEnum.Mailing);
this.productPricingObj.HandleShowSubmitChanges();
}
};

MailingPricing.prototype.SetMailingQuantity = function(mailingQuantity) {
 this.mailingQuantity = mailingQuantity;
var mqInput = $(this.mailingQuantityInputID);
if (mqInput != null && typeof (mqInput) != 'undefined') {
$(this.mailingQuantityInputID).value = this.mailingQuantity;
}
};

MailingPricing.prototype.ChangeMailingMethod = function(mailingMethod) {
 if (((this.productPricingObj.productID == 5) || (this.productPricingObj.productID == 57)) && (mailingMethod == "BM")) {
 alert("The product you selected may not be mailed using 'Bulk Mail' due to Postal Service restrictions.");
 this.SetMailingMethod("1C");
 }
this.ValidateMailing(this.GetMailingQuantity(), mailingMethod);

if (this.productPricingObj) {
this.productPricingObj.AdjustPrices(AdjustTypeEnum.Mailing);
this.productPricingObj.HandleShowSubmitChanges();
}
};

MailingPricing.prototype.SetMailingMethod = function(mailingMethod) {
this.mailingMethod = mailingMethod;
SetRadioButtonListChecked(this.rblMailingMethodName, mailingMethod);
};

MailingPricing.prototype.GetMailingQuantity = function() {
return ParseInt($(this.mailingQuantityInputID).value);
};

MailingPricing.prototype.GetMailingMethodDesc = function(mailingMethod) {
switch (mailingMethod) {
case ShipTypeEnum.BulkMailValue: return ShipTypeEnum.BulkMailText;
case ShipTypeEnum.FirstClassPresortedValue: return ShipTypeEnum.FirstClassPresortedText;
case ShipTypeEnum.FirstClassValue: return ShipTypeEnum.FirstClassText;
default: return '';
}
};

//add signatures to end as optional parameter for catalogs used to determine paperWeightID, foldID, forCoverPaper and partCount
MailingPricing.prototype.GetMailingPrice = function(productID, paperWeightID, foldID, forCoverPaper, partCount, percentCollection, envelopeID) {
 if (this.mailingQuantity == '' || this.mailingQuantity == 0 || this.mailingMethod == '') {
 return 0;
 }

 var mailingArrItem = mailingArr[productID][paperWeightID][partCount][this.mailingMethod];
 var surcharge = this.GetFoldSurchargeValue(foldID, mailingArr[productID][paperWeightID][partCount][this.mailingMethod], productID);

 if (forCoverPaper) {
 surcharge += mailingArrItem[MAILING_IDX_COVER_STOCK_SURCHARGE];
 }

 var mailingEach;
 if (this.mailingQuantity >= 10000) {
 mailingEach = mailingArrItem[MAILING_IDX_MUL_EACH_10000];
 }
 else if (this.mailingQuantity >= 5000) {
 mailingEach = mailingArrItem[MAILING_IDX_MUL_EACH_5000];
 }
 else {
 mailingEach = mailingArrItem[MAILING_IDX_MUL_EACH];
 }

 var price = 0;

 var isCatalogOrCalendar = (productID == ProductIDEnum.catalogs_5_5x8_5 ||
productID == ProductIDEnum.catalogs_8_5x11 ||
productID == ProductIDEnum.calendars_5_5x8_5 ||
productID == ProductIDEnum.calendars_8_5x11);
 var isGreetingOrNoteCard = (productID == ProductIDEnum.note_cards ||
productID == ProductIDEnum.holiday_deluxe_note_card ||
productID == ProductIDEnum.holiday_premium_note_card ||
productID == ProductIDEnum.greeting_cards ||
productID == ProductIDEnum.holiday_deluxe_greeting_card ||
productID == ProductIDEnum.holiday_premium_greeting_card);
 if (this.CanApplyTabbingPricing(productID, this.mailingMethod, foldID, envelopeID)) {
 var finishingObj = new FinishingPricing(0, AttributeValueIDEnum.tab_tab, "");
 price += finishingObj.GetFinishingPrice(AttributeValueIDEnum.tab_tab, this.mailingQuantity, productID, percentCollection);
 }

 percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.Mailing, ChannelID);
 return this.CalculateMailingPrice(price, this.mailingQuantity, mailingArrItem[MAILING_IDX_BASE], mailingEach, surcharge, percentCollection);
};

MailingPricing.prototype.CanApplyTabbingPricing = function(productID, mailingMethod, foldID, envelopeID) {
 // Exclude Not Mailed mailing
 if (mailingMethod == "NM")
 {
 return false;
 }
 // Catalogs & Calendars, 5.5 x 8.5, all fold types including fold-collate-stitch (which will not come in as a fold)
 else if (productID == ProductIDEnum.catalogs_5_5x8_5 || productID == ProductIDEnum.calendars_5_5x8_5)
 {
 return true;
 }
 // Exclude No Fold and Manually Priced Fold
 else if (foldID == "" || foldID == AttributeValueIDEnum.fold_manually_priced)
 {
 return false;
 }
 // Brochures & Newsletters, 8.5 x 11, all fold types
 else if (productID == ProductIDEnum.brochures_8_5x11 || productID == ProductIDEnum.newsletters_8_5x11)
 {
 return true;
 }
 // Brochures & Newsletters, 11 x 17, all fold types except Half Fold
 else if ((productID == ProductIDEnum.brochures_11x17 || productID == ProductIDEnum.newsletters_11x17) && foldID != AttributeValueIDEnum.fold_half_fold)
 {
 return true;
 }
 // Brochures & Newsletters, 11 x 25.5, all fold types except Tri Fold
 else if ((productID == ProductIDEnum.brochures_11x25_5 || productID == ProductIDEnum.newsletters_11x25_5) && foldID != AttributeValueIDEnum.fold_tri_fold)
 {
 return true;
 }
 // Postcards, all fold types
 else if (productID == ProductIDEnum.postcards_5_5x8_5 || productID == ProductIDEnum.postcards_6x9 || productID == ProductIDEnum.postcards_6x11)
 {
 return true;
 }
 // Greeting Cards and Note Cards, all fold types, if no envelopes
 else if ((productID == ProductIDEnum.greeting_cards || productID == ProductIDEnum.note_cards || productID == ProductIDEnum.holiday_deluxe_greeting_card || productID == ProductIDEnum.holiday_deluxe_note_card || productID == ProductIDEnum.holiday_premium_greeting_card || productID == ProductIDEnum.holiday_premium_note_card) && envelopeID == "")
 {
 return true;
 }
 // Catalogs & Calendars, 8.5 x 11, only Half fold and Half fold finished catalog (more than 12 pgs)
 else if ((productID == ProductIDEnum.catalogs_8_5x11 || productID == ProductIDEnum.calendars_8_5x11) && (foldID == AttributeValueIDEnum.fold_half_fold || foldID == AttributeValueIDEnum.fold_half_fold_finished_catalog_more_than_12_pgs))
 {
 return true;
 }
 else
 {
 return false;
 }
};

MailingPricing.prototype.CalculateMailingPrice = function(price, quantity, mailingBase, mailingEach, surcharge, percentCollection) {
price += (quantity * (mailingEach + surcharge)) + mailingBase;

if (typeof (percentCollection) != 'undefined') {
return percentCollection.ApplyPricingPercents(price);
}
else {
return FormatDollar(price);
}
};

MailingPricing.prototype.ValidateMailing = function(mailingQuantity, mailingMethod) {
var ret = this.IsValidMailing(mailingQuantity, mailingMethod);
if (!ret.VALIDATE_RESULT) {
if (ret.VALIDATE_MESSAGE) {
alert(ret.VALIDATE_MESSAGE);
}
this.SetMailingQuantity(ret.VALIDATE_MAILING_QUANTITY);
this.SetMailingMethod(ret.VALIDATE_MAILING_METHOD);
if (ret.VALIDATE_QUANTITY) {
if (this.productPricingObj) {
this.productPricingObj.SetQuantity(ret.VALIDATE_QUANTITY);
}
}
}
else {
this.mailingQuantity = mailingQuantity;
this.mailingMethod = mailingMethod;
}

if (this.productPricingObj) {
this.productPricingObj.HandleMailingBlankEnvelopes();

 this.productPricingObj.HandleMailingChange();

var allMailing = (this.mailingMethod && this.mailingQuantity == this.productPricingObj.GetQuantity());
this.productPricingObj.HandleAllMailing(allMailing);
}
return ret.VALIDATE_RESULT;
};

MailingPricing.prototype.IsValidMailing = function(mailingQuantity, mailingMethod) {
if (mailingQuantity < 0) {
return this.GetValidationObject(false, 'Mailing quantity cannot be negative.', '', mailingMethod);
}
else if (mailingQuantity == '' || mailingQuantity == 0) {
return this.GetValidationObject(false, '', '', '');
}
else if (this.productPricingObj) {
var quantity = this.productPricingObj.GetQuantity();
var minMailingQuantity = this.productPricingObj.GetMinMailingQuantity(mailingMethod);
if (minMailingQuantity != null && mailingQuantity < minMailingQuantity) {
var minMailingQuantityBulkMail = this.productPricingObj.GetMinMailingQuantity(ShipTypeEnum.BulkMailValue);
mailingMethod = (mailingMethod == ShipTypeEnum.FirstClassPresortedValue && mailingQuantity >= minMailingQuantityBulkMail && this.IsValidMailingMethod(this.productPricingObj.productID, ShipTypeEnum.BulkMailValue)) ? ShipTypeEnum.BulkMailValue : ShipTypeEnum.FirstClassValue;
return this.GetValidationObject(false, 'Mailing quantity cannot be less than ' + minMailingQuantity + ' for the given mailing method.', mailingQuantity, mailingMethod, null);
}
else if (quantity != null && quantity < mailingQuantity) {
if ((typeof(MailOnly) == 'undefined') || !MailOnly) {
return this.GetValidationObject(false, 'Mailing quantity cannot be greater than the order quantity.', mailingQuantity, mailingMethod, mailingQuantity);
}
}
}
return this.GetValidationObject(true);
};

MailingPricing.prototype.IsValidMailingMethod = function(productID, mailingMethod) {
 if ((productID == ProductIDEnum.postcards_4_25x5_5 || productID == ProductIDEnum.postcards_4x6) && mailingMethod == ShipTypeEnum.BulkMailValue) {
return false;
}
return true;
};

MailingPricing.prototype.GetValidationObject = function(validateResult, validateMessage, mailingQuantity, mailingMethod, quantity) {
return {
VALIDATE_RESULT : validateResult,
VALIDATE_MESSAGE : validateMessage,
VALIDATE_MAILING_QUANTITY : mailingQuantity,
VALIDATE_MAILING_METHOD : mailingMethod,
VALIDATE_QUANTITY : quantity
};
};

MailingPricing.prototype.HandleQuantityChange = function() {
this.ValidateMailing(this.mailingQuantity, this.mailingMethod);
};

MailingPricing.prototype.HandleSizeChange = function(productID) {
var coll = document.getElementsByName(this.rblMailingMethodName);
var isDisabled;
for (var i = 0, loopCnt = coll.length; i < loopCnt; i++) {
isDisabled = !this.IsValidMailingMethod(productID, coll[i].value);
SetRadioButtonDisabled(coll[i], isDisabled);
if (isDisabled && coll[i].checked) {
alert(this.GetMailingMethodDesc(coll[i].value) + ' is not available for this product.');
if (this.mailingQuantity > 0) {
this.SetMailingMethod(ShipTypeEnum.FirstClassValue);
}
}
}
};

MailingPricing.prototype.HasMailing = function() {
return (this.mailingQuantity > 0 && this.mailingMethod != '');
};

MailingPricing.prototype.IsChanged = function() {
 return (this.mailingQuantityOri != this.mailingQuantity || this.mailingMethodOri != this.mailingMethod);
};

MailingPricing.prototype.GetFoldSurchargeValue = function(fold, mailingArrItem, productID) {
switch(fold) {
case '':
return mailingArrItem[MAILING_IDX_NO_FOLD_SURCHARGE];
break;
case AttributeValueIDEnum.fold_half_fold:
return mailingArrItem[MAILING_IDX_HALF_FOLD_SURCHARGE];
break;
case AttributeValueIDEnum.fold_tri_fold:
return mailingArrItem[MAILING_IDX_TRI_FOLD_SURCHARGE];
break;
case AttributeValueIDEnum.fold_tri_then_half_fold:
return mailingArrItem[MAILING_IDX_TRI_THEN_HALF_FOLD_SURCHARGE];
break;
case AttributeValueIDEnum.fold_four_panel_fold:
return mailingArrItem[MAILING_IDX_FOUR_PANEL_FOLD_SURCHARGE];
break;
 case AttributeValueIDEnum.fold_open_gate_fold:
 return mailingArrItem[MAILING_IDX_OPEN_GATE_FOLD_SURCHARGE];
 case AttributeValueIDEnum.fold_gate_fold: //closed gate fold
 return mailingArrItem[MAILING_IDX_CLOSED_GATE_FOLD_SURCHARGE];
default:
return 0;
 }
};var NameQtyPricings;
var MAXIMUM_NAMES = 12;

function NameQtyPricing(nameQtyPricingID, nameQuantityObj, clientIDObj) {
this.nameQtyPricingID = nameQtyPricingID;
this.nameQuantityObj = nameQuantityObj;
this.clientIDObj = clientIDObj;
this.cardCnt = nameQuantityObj.length;

this.InsertNameQtyPricing();
}

NameQtyPricing.prototype.InsertNameQtyPricing = function() {
if (typeof(NameQtyPricings) == 'undefined') {
NameQtyPricings = new Object;
}
NameQtyPricings[this.nameQtyPricingID] = this;
};

NameQtyPricing.prototype.GetNameElement = function(cardIdx) {
 return this.clientIDObj[cardIdx - 1].nameID;
};

NameQtyPricing.prototype.GetQtyElement = function(cardIdx) {
 return this.clientIDObj[cardIdx - 1].qtyID;
};

NameQtyPricing.prototype.ResetNameQty = function() {
 for (var i = 1, loopCnt = this.cardCnt; i <= loopCnt; i++) {
 nameQtyElem = $(this.GetQtyElement(i));
 if (nameQtyElem) {
 nameQtyElem.value = (i == 1 ? '500' : '');
 }
 nameElem = $(this.GetNameElement(i));
 if (nameElem) {
 nameElem.value = (i == 1 ? 'Name 1' : '');
 }
 }
};

NameQtyPricing.prototype.FocusName = function(cardIdx, name) {
 var nameElem = $(this.GetNameElement(cardIdx));
 if (nameElem) {
 nameElem.select();
 }
};

NameQtyPricing.prototype.ChangeNameQty = function(cardIdx, name, qty) {
 var nameElem = $(this.GetNameElement(cardIdx));
 if (nameElem) {
 var nameQtyElem = $(this.GetQtyElement(cardIdx));
 if (cardIdx == 1 && !(nameElem.value && nameQtyElem.value)) {
 nameElem.value = 'Name 1';
 nameQtyElem.value = '500';
 nameElem.focus();
 }
 else if (nameElem.value && !nameQtyElem.value) {
 if (name != null) {
 nameQtyElem.value = '500';
 }
 else if (qty != null) {
 nameElem.value = '';
 }
 }
 else if (!nameElem.value && nameQtyElem.value) {
 if (name != null) {
 nameQtyElem.value = '';
 }
 else if (qty != null) {
 nameElem.value = 'Name ' + cardIdx;
 nameElem.focus();
 }
 }
 }
 this.HandleNameQuantityChange();
};

NameQtyPricing.prototype.HandleNameQuantityChange = function() {
 if (this.productPricingObj) {
 this.productPricingObj.HandleNameQuantityChange(this.GetSumNameQuantities());
 }
};

NameQtyPricing.prototype.GetSumNameQuantities = function() {
 var sumQty = 0;
 var nameQtyElem;
 for (var i = 1, loopCnt = this.cardCnt; i <= loopCnt; i++) {
 nameQtyElem = $(this.GetQtyElement(i));
 if (nameQtyElem && nameQtyElem.value != '') {
 sumQty += parseInt(nameQtyElem.value);
 }
 }
 return sumQty;
};

NameQtyPricing.prototype.IsChanged = function() {
 var changed = false;
 for (var i = 0; i < this.cardCnt; i++) {
 var nameElem = $(this.GetNameElement(i + 1));
 var nameQtyElem = $(this.GetQtyElement(i + 1));
 changed = changed
 || ((nameElem ? nameElem.value : '') != this.nameQuantityObj[i].Name)
 || ((nameQtyElem ? nameQtyElem.value : 0) != this.nameQuantityObj[i].Quantity);
 }
 return changed;
};

NameQtyPricing.prototype.GetVersionCount = function() {
var nameQtyElem; //use nameQtyElem because name can be blank
var versionCnt = 0;
for (var i = 1, loopCnt = this.cardCnt; i <= loopCnt; i++) {
 nameQtyElem = $(this.GetQtyElement(i));
if (nameQtyElem && nameQtyElem.value != '') {
versionCnt++;
}
}
if (versionCnt == 0) {
versionCnt++;
}
return versionCnt;
};

NameQtyPricing.prototype.QuantityList = function() {
var nameQtyElem; //use nameQtyElem because name can be blank
var quantityList = new Array();
var instaPriceObj = InstaPrices[this.productPricingObj.instaPriceID];
var boxQuantity = instaPriceObj.minQuantity;
// 3/10/09 DK - IMPORTANT NOTE: Multi version pricing functionality will be disabled for business cards until CQ Phase 2
/*for (var i = 1, loopCnt = this.cardCnt; i <= loopCnt; i++) {
nameQtyElem = $(this.GetQtyElement(i));
if (nameQtyElem && nameQtyElem.value != '' && nameQtyElem.value > 0) {
quantityList.push(nameQtyElem.value * boxQuantity);
}
}*/
if (quantityList.length == 0) {
quantityList.push(instaPriceObj.quantity);
}
return quantityList;
};

NameQtyPricing.prototype.ApplyBoxDiff = function(boxDiff) {
 for (var i = 1, loopCnt = this.cardCnt; i <= loopCnt && boxDiff > 0; i++) {
 nameQtyElem = $(this.GetQtyElement(i));
 if (nameQtyElem && nameQtyElem.value != '') {
 nameQtyElem.value = parseInt(nameQtyElem.value) + 500;
 }
 boxDiff--;
 if (i == loopCnt && boxDiff > 0) {
 i = 1;
 }
 }
 this.HandleNameQuantityChange();
};
var NumPagesPricings;

function NumPagesPricing(numPagesPricingID, numPages, numPagesDropdownID) {
this.numPagesPricingID = numPagesPricingID;
this.numPagesOri = numPages;
this.numPages = numPages;
this.numPagesDropdownID = numPagesDropdownID;

this.InsertNumPagesPricing();
}

NumPagesPricing.prototype.InsertNumPagesPricing = function() {
if (typeof(NumPagesPricings) == 'undefined') {
NumPagesPricings = new Object;
}
NumPagesPricings[this.numPagesPricingID] = this;
};

NumPagesPricing.prototype.ResetNumPages = function() {
 SetValue(this.numPagesDropdownID, this.numPages);
};

NumPagesPricing.prototype.ChangeNumPages = function(numPagesElem) {
this.SetNumPages(numPagesElem.options[numPagesElem.selectedIndex].text);

if (this.productPricingObj) {
this.productPricingObj.ValidateNumPages();
this.productPricingObj.AdjustPrices(AdjustTypeEnum.NumPages);
this.productPricingObj.HandleShowSubmitChanges();
this.productPricingObj.EnableCreateCQButtonOrNot();
}
};

NumPagesPricing.prototype.SetNumPages = function(numPages) {
this.numPages = numPages;
};

NumPagesPricing.prototype.IsChanged = function() {
 return (this.numPagesOri != this.numPages);
};
/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/NoValueEnum.js" />
var PaperPricings;
var VALIDATE_PAPER = 'Paper';


function PaperPricing(paperPricingID, paperID, coverInside, rblPaperName, imageID) {
this.paperPricingID = paperPricingID;
this.paperID = paperID;
this.paperOri = paperID;
this.coverInside = coverInside;
this.rblPaperName = rblPaperName;
this.imageID = imageID;
this.forCover = (this.coverInside == CoverInsideEnum.ForCover);
this.forInside = (this.coverInside == CoverInsideEnum.ForInside);

this.InsertPaperPricing();
}

PaperPricing.prototype.InsertPaperPricing = function() {
if (typeof(PaperPricings) == 'undefined') {
PaperPricings = new Object;
}
PaperPricings[this.paperPricingID] = this;
};

PaperPricing.prototype.ResetPaper = function() {
 SetRadioButtonListChecked(this.rblPaperName, this.paperID);
};

PaperPricing.prototype.ChangePaper = function(paperID) {
this.ValidatePaper(((this.productPricingObj) ? this.productPricingObj.productID : null), paperID, false);
if (this.productPricingObj) {
if (this.imageID != null) {
LoadImage(this.imageID, paperImageArr[this.productPricingObj.productID][this.paperID]);
}
this.productPricingObj.AdjustPrices(AdjustTypeEnum.Paper, this.paperPricingID);
this.productPricingObj.HandleShowSubmitChanges();
}
};

PaperPricing.prototype.SetPaper = function(paperID) {
this.paperID = paperID;
SetRadioButtonListChecked(this.rblPaperName, paperID);
};

PaperPricing.prototype.GetPaperUpgradePrice = function(productID, quantity, percentCollection, coverInside, signatures) {
 return this.GetPaperPrice(productID, quantity, percentCollection, signatures) - this.GetPaperBasePrice(productID, quantity, percentCollection, coverInside, signatures);
};

PaperPricing.prototype.GetPaperBasePrice = function(productID, quantity, percentCollection, coverInside, signatures) {
 var basePaperID = this.GetDefaultPaper(productID, coverInside);
 if (basePaperID != null) {
 return this.GetPaperPrice(productID, quantity, percentCollection, signatures, basePaperID);
 }
 return 0;
};

PaperPricing.prototype.GetDefaultPaper = function(productID, coverInside) {
 if (typeof (this.defaultPaperID) != 'undefined' && this.defaultPaperID) {
 return this.defaultPaperID;
 }
 else if (typeof (IsPPS) != 'undefined') {
 return this.paperOri;
 }
 else if (typeof (productInfoArr[productID][PRODUCTINFO_IDX_DEFAULT_PAPER]) != 'undefined' && productInfoArr[productID][PRODUCTINFO_IDX_DEFAULT_PAPER] != '') {
 var basePaperIDs = String(productInfoArr[productID][PRODUCTINFO_IDX_DEFAULT_PAPER]).split(',');
 if (coverInside == CoverInsideEnum.ForInside) {
 return basePaperIDs[1];
 }
 else {
 return basePaperIDs[0];
 }
 }
 return null;
};

PaperPricing.prototype.GetPaperPrice = function(productID, quantity, percentCollection, signatures, basePaperID) {
var price = 0;
var paperID = this.paperID;
if(typeof(basePaperID) != 'undefined') {
 paperID = basePaperID;
}
percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.Paper, ChannelID);
if (typeof (signatures) != 'undefined' && signatures != null) {
for (var s = 0, loopCnt = signatures.length; s < loopCnt; s++) {
 if(typeof(basePaperID) != 'undefined') {
 price += this.CalculatePaperPrice(quantity,
 this.GetPaperBase(productID, paperID),
 this.GetPaperEach(productID, paperID),
 percentCollection,
 signatures[s].TotalSignaturePricingPercent(), 
 this.GetPaperSetUpCharge(productID, paperID));
 }
 else {
 price += this.CalculatePaperPrice(quantity,
 this.GetPaperBase(productID, signatures[s].GetAttributeValueID(AttributeIDEnum.paper)),
 this.GetPaperEach(productID, signatures[s].GetAttributeValueID(AttributeIDEnum.paper)),
 percentCollection,
 signatures[s].TotalSignaturePricingPercent(), 
 this.GetPaperSetUpCharge(productID, signatures[s].GetAttributeValueID(AttributeIDEnum.paper)));
 }
}
}
else {
if (this.productPricingObj && this.productPricingObj.quantityList.length != 0) { //business cards
var quantityList = this.productPricingObj.quantityList;
for(var i = 0, loopCnt = quantityList.length; i < loopCnt; i++) { //loop through version quantities
price += this.CalculatePaperPrice(quantityList[i],
this.GetPaperBase(productID, paperID),
this.GetPaperEach(productID, paperID),
percentCollection,
null, 
this.GetPaperSetUpCharge(productID, paperID));
}
}
else { //one quantity products
price = this.CalculatePaperPrice(quantity,
this.GetPaperBase(productID, paperID),
this.GetPaperEach(productID, paperID),
percentCollection,
null, 
this.GetPaperSetUpCharge(productID, paperID));
}
}
return price;
};

PaperPricing.prototype.GetPaperBase = function(productID, paperID) {
 if (typeof (paperID) == 'undefined') {
 paperID = this.paperID;
 }
 if (typeof (paperArr[productID][paperID]) != 'undefined') { //get paperID override pricing
 return paperArr[productID][paperID][''][PAPER_IDX_BASE];
 }
 else { //get tier pricing
 return paperArr[productID][''][this.GetTierID(paperID)][PAPER_IDX_BASE];
 }
};

PaperPricing.prototype.GetPaperEach = function(productID, paperID) {
 if (typeof (paperID) == 'undefined') {
 paperID = this.paperID;
 }
 if (typeof (paperArr[productID][paperID]) != 'undefined') { //get paperID override pricing
 return paperArr[productID][paperID][''][PAPER_IDX_EACH];
 }
 else { //get tier pricing
 return paperArr[productID][''][this.GetTierID(paperID)][PAPER_IDX_EACH];
 }
};


PaperPricing.prototype.GetPaperSetUpCharge = function(productID, paperID) {
 if (typeof (paperID) == 'undefined') {
 paperID = this.paperID;
 }
 if (typeof (paperArr[productID][paperID]) != 'undefined') { //get paperID override pricing
 return paperArr[productID][paperID][''][PAPER_IDX_SET_UP_CHARGE];
 }
 else { //get tier pricing
 return paperArr[productID][''][this.GetTierID(paperID)][PAPER_IDX_SET_UP_CHARGE];
 }
}; 

PaperPricing.prototype.CalculatePaperPrice = function(quantity, paperBase, paperEach, percentCollection, signaturePricingPercent, setUpCharge) {
 var price = 0;
 if (typeof (signaturePricingPercent) == 'undefined' || signaturePricingPercent == null) {
 signaturePricingPercent = 1;
 }

 if (quantity > 0) { //check that the quantity is greater than zero
 price = (signaturePricingPercent * (paperBase + (quantity * paperEach))) + setUpCharge;
 }

 if (typeof (percentCollection) != 'undefined') {
 return percentCollection.ApplyPricingPercents(price);
 }
 else {
 return FormatDollar(price);
 }
};


PaperPricing.prototype.IsCoverPaper = function(paperID) {
if (typeof (paperInfoArr[paperID][PAPERINFO_IDX_TYPE]) != 'undefined') {
return (paperInfoArr[paperID][PAPERINFO_IDX_TYPE].toLowerCase() == 'cover');
}
return false;
};

PaperPricing.prototype.ValidateNumPages = function(isDisabled) {
 if (this.forInside) {
if (isDisabled) {
var rblPaperElem = $(this.rblPaperName);
if (rblPaperElem) {
var paperID = rblPaperElem.value;
if (this.paperID != paperID) {
this.ChangePaper(paperID);
}
}
}
SetRadioButtonListDisabled(this.rblPaperName, isDisabled, 0);
}
};

PaperPricing.prototype.GetPaperWeight = function() {
if (typeof (paperInfoArr[this.paperID][PAPERINFO_IDX_WEIGHT]) != 'undefined') {
return paperInfoArr[this.paperID][PAPERINFO_IDX_WEIGHT];
}
return 0;
};

PaperPricing.prototype.GetPaperWeightID = function(paperID) {
if (typeof (paperInfoArr[paperID][PAPERINFO_IDX_WEIGHTID]) != 'undefined') {
return paperInfoArr[paperID][PAPERINFO_IDX_WEIGHTID];
}
return null;
};

PaperPricing.prototype.ValidatePaper = function(productID, paperID, forSizeChange) {
var ret = this.IsValidPaper(productID, paperID, forSizeChange);
if (!ret.VALIDATE_RESULT) {
if (ret.VALIDATE_MESSAGE) {
alert(ret.VALIDATE_MESSAGE);
}
this.SetPaper(ret.VALIDATE_PAPER);
}
else {
this.paperID = paperID;
}
return ret.VALIDATE_RESULT;
};

PaperPricing.prototype.IsValidPaper = function(productID, paperID, forSizeChange) {
if (this.productPricingObj) {
if (productID == ProductIDEnum.envelopes_9_1_2x12_5_8 && paperID == AttributeValueIDEnum.paper_24lb_uncoated) {
return this.GetValidationObject(false, '9 1/2 x 12 5/8 envelopes are not available in 24 lb stock.', (forSizeChange) ? paperID : this.paperID);
}
else {
var retObj = this.productPricingObj.HandlePaperChange(paperID, this.forInside, productID, forSizeChange);
if (!retObj.success) {
if (typeof (retObj.VALIDATE_PAPER) != 'undefined') {
return this.GetValidationObject(false, retObj.VALIDATE_MESSAGE, retObj.VALIDATE_PAPER);
}
else {
return this.GetValidationObject(false, '', ((',' + retObj.errorType + ',').indexOf(',' + AdjustTypeEnum.Ink + ',') != -1) ? this.paperID : paperID);
}
}
}
}
return this.GetValidationObject(true);
};

PaperPricing.prototype.GetValidationObject = function(validateResult, validateMessage, paperID) {
return {
VALIDATE_RESULT : validateResult,
VALIDATE_MESSAGE : validateMessage,
VALIDATE_PAPER : paperID
};
};

PaperPricing.prototype.IsChanged = function() {
 return (this.paperOri != this.paperID);
};

PaperPricing.prototype.GetTierID = function(paperID) {
 if (typeof (paperInfoArr[paperID][PAPERINFO_IDX_TIERID]) != 'undefined') {
 return paperInfoArr[paperID][PAPERINFO_IDX_TIERID];
 }
 return null;
};

PaperPricing.prototype.GetPaperName = function(paperID) {
if (typeof (paperInfoArr[paperID][PAPERINFO_IDX_NAME]) != 'undefined') {
return paperInfoArr[paperID][PAPERINFO_IDX_NAME];
}
return '';
};

PaperPricing.prototype.SetDefaultPaperID = function(defaultPaperID) {
this.defaultPaperID = defaultPaperID;
};
/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/NoValueEnum.js" />
var PocketSlitPricings;
var VALIDATE_POCKET = 'Pocket';
var VALIDATE_SLIT = 'Slit';

function PocketSlitPricing(pocketSlitPricingID, pocketID, slitID, rblSlitName, rblPocketName) {
this.pocketSlitPricingID = pocketSlitPricingID;
this.pocketID = pocketID;
this.pocketIDOri = pocketID;
this.slitID = slitID;
this.slitIDOri = slitID;
this.rblSlitName = rblSlitName;
this.rblPocketName = rblPocketName;

this.InsertPocketSlitPricing();
}

PocketSlitPricing.prototype.InsertPocketSlitPricing = function() {
if (typeof(PocketSlitPricings) == 'undefined') {
PocketSlitPricings = new Object;
}
PocketSlitPricings[this.pocketSlitPricingID] = this;
};

PocketSlitPricing.prototype.ResetPocketSlit = function() {
 SetRadioButtonListChecked(this.rblSlitName, this.slitID);
 SetRadioButtonListChecked(this.rblPocketName, this.pocketID);
};

PocketSlitPricing.prototype.ChangePocket = function(pocketID) {
this.ValidatePocketSlit(pocketID, this.slitID);

if (this.productPricingObj) {
this.productPricingObj.HandleShowSubmitChanges();
}
};

PocketSlitPricing.prototype.SetPocket = function(pocketID) {
this.pocketID = pocketID;
};

PocketSlitPricing.prototype.ChangeSlit = function(slitID) {
this.ValidatePocketSlit(this.pocketID, slitID);

if (this.productPricingObj) {
this.productPricingObj.HandleShowSubmitChanges();
}
};

PocketSlitPricing.prototype.SetSlit = function(slitID) {
this.slitID = slitID;
SetRadioButtonListChecked(this.rblSlitName, slitID);
};

PocketSlitPricing.prototype.ValidatePocketSlit = function(pocketID, slitID) {
var ret = this.IsValidPocketSlit(pocketID, slitID);
if (!ret.VALIDATE_RESULT) {
if (ret.VALIDATE_MESSAGE) {
alert(ret.VALIDATE_MESSAGE);
}
this.SetPocket(ret.VALIDATE_POCKET);
this.SetSlit(ret.VALIDATE_SLIT);
}
else {
this.pocketID = pocketID;
this.slitID = slitID;
}
return ret.VALIDATE_RESULT;
};

PocketSlitPricing.prototype.IsValidPocketSlit = function(pocketID, slitID) {
var newSlitID = this.slitIDOri;
if ((pocketID == AttributeValueIDEnum.pockets_1_pocket_on_right && (slitID == AttributeValueIDEnum.slits_both_sides || slitID == AttributeValueIDEnum.slits_left_side)) ||
(pocketID == AttributeValueIDEnum.pockets_1_pocket_on_left && (slitID == AttributeValueIDEnum.slits_both_sides || slitID == AttributeValueIDEnum.slits_right_side))) {
//set newSlitID to match pocket choice
if (AttributeValueIDEnum.pockets_1_pocket_on_left == pocketID) {
newSlitID = AttributeValueIDEnum.slits_left_side
}
else if (AttributeValueIDEnum.pockets_1_pocket_on_right == pocketID) {
newSlitID = AttributeValueIDEnum.slits_right_side
}
return this.GetValidationObject(false, 'Please select a slit option to match your pocket choice.', pocketID, newSlitID);
}
return this.GetValidationObject(true);
};

PocketSlitPricing.prototype.GetValidationObject = function(validateResult, validateMessage, pocketID, slitID) {
return {
VALIDATE_RESULT : validateResult,
VALIDATE_MESSAGE : validateMessage,
VALIDATE_POCKET : pocketID,
VALIDATE_SLIT : slitID
};
};

PocketSlitPricing.prototype.IsChanged = function() {
 return (this.pocketIDOri != this.pocketID || this.slitIDOri != this.slitID);
};
if ('undefined' == typeof(inkImageArr)) {
var inkImageArr = new Array();
}
if ('undefined' == typeof(foldImageArr)) {
var foldImageArr = new Array();
}
if ('undefined' == typeof (paperImageArr)) {
var paperImageArr = new Array();
}
if ('undefined' == typeof(productArr)) {
var productArr = new Array();
}
if ('undefined' == typeof(paperArr)) {
var paperArr = new Array();
}
if ('undefined' == typeof(turnaroundArr)) {
var turnaroundArr = new Array();
}
if ('undefined' == typeof(shipTypeArr)) {
var shipTypeArr = new Array();
}
if ('undefined' == typeof(mailingArr)) {
var mailingArr = new Array();
}
if ('undefined' == typeof(blankEnvelopeArr)) {
var blankEnvelopeArr = new Array();
}
if ('undefined' == typeof(hardProofArr)) {
var hardProofArr = new Array();
}
if ('undefined' == typeof(finishingArr)) {
var finishingArr = new Array();
}
if ('undefined' == typeof(productPricingArr)) {
var productPricingArr = new Array();
}
if ('undefined' == typeof(paperInfoArr)) {
var paperInfoArr = new Array();
}
if ('undefined' == typeof(paperWeightInfoArr)) {
var paperWeightInfoArr = new Array();
}
if ('undefined' == typeof(productInfoArr)) {
var productInfoArr = new Array();
}
if ('undefined' == typeof(shippingWeightArr)) {
var shippingWeightArr = new Array();
}
if ('undefined' == typeof(multipleVersionPricingArr)) {
var multipleVersionPricingArr = new Array();
}
if ('undefined' == typeof (pricedPerSignatureArr)) {
 var pricedPerSignatureArr = new Array();
}
if ('undefined' == typeof (gridPricingArr)) {
 var gridPricingArr = new Array();
}

var PRODUCT_IDX_BASE = 0;
var PRODUCT_IDX_EACH = 1;
var PRODUCT_IDX_REPRINT_DISCOUNT = 2;

var PAPER_IDX_BASE = 0;
var PAPER_IDX_EACH = 1;
var PAPER_IDX_SECOND_SHEETS_BASE = 2;
var PAPER_IDX_SECOND_SHEETS_EACH = 3;
var PAPER_IDX_SET_UP_CHARGE = 4;

var MAILING_IDX_BASE = 0;
var MAILING_IDX_MUL_EACH = 1;
var MAILING_IDX_MUL_EACH_5000 = 2;
var MAILING_IDX_MUL_EACH_10000 = 3;
var MAILING_IDX_POSTAGE_COST = 4;
var MAILING_IDX_MIN_QTY = 5;
var MAILING_IDX_HALF_FOLD_SURCHARGE = 6;
var MAILING_IDX_NO_FOLD_SURCHARGE = 7;
var MAILING_IDX_TRI_FOLD_SURCHARGE = 8;
var MAILING_IDX_TRI_THEN_HALF_FOLD_SURCHARGE = 9;
var MAILING_IDX_FOUR_PANEL_FOLD_SURCHARGE = 10;
var MAILING_IDX_COVER_STOCK_SURCHARGE = 11;
var MAILING_IDX_OPEN_GATE_FOLD_SURCHARGE = 12;
var MAILING_IDX_CLOSED_GATE_FOLD_SURCHARGE = 13;

var BLANKENVELOPE_IDX_BASE = 0;
var BLANKENVELOPE_IDX_EACH = 1;

var FINISHING_IDX_BASE = 0;
var FINISHING_IDX_EACH = 1;
var FINISHING_IDX_SET_UP_CHARGE = 2;

var HARDPROOF_IDX_WIDTH = 1;
var HARDPROOF_IDX_HEIGHT = 2;
var HARDPROOF_IDX_FIRST_SHEET = 3;
var HARDPROOF_IDX_EACH_ADDITIONAL_SHEET = 4;

var PAPERINFO_IDX_NAME = 0;
var PAPERINFO_IDX_TYPE = 1;
var PAPERINFO_IDX_TIERID = 2;
var PAPERINFO_IDX_WEIGHTID = 4;
var PAPERINFO_IDX_WEIGHT = 5;
var PAPERINFO_IDX_BRAND = 6;
var PAPERINFO_IDX_FINISH2ID = 7;

var PAPERWEIGHTINFO_IDX_WEIGHT = 0;
var PAPERWEIGHTINFO_IDX_UNIT = 1;

var PRODUCTINFO_IDX_MINQUANTITY = 0;
var PRODUCTINFO_IDX_FLATWIDTH = 1;
var PRODUCTINFO_IDX_FLATHEIGHT = 2;
var PRODUCTINFO_IDX_DEFAULT_PAPER = 3;
var PRODUCTINFO_IDX_PARTSPERSIGNATURE = 4;

var SHIPPINGWEIGHT_IDX_BASE = 0;
var SHIPPINGWEIGHT_IDX_EACH = 1;

var SHIPTYPE_IDX_MULTIPLIER = 1;

var PRICEDPERSIGNATURE_IDX_BOOL = 0;

var VALIDATE_RESULT = 'Result';
var VALIDATE_MESSAGE = 'Message';
var VALIDATE_PRODUCT_ID = 'ProductID';
var VALIDATE_QUANTITY = 'Quantity';

var ChannelPricingPercent = 1.0;
var ChannelID = null;var PrintedEnvelopePricings;

function PrintedEnvelopePricing(finishingPricingID, finishingID, rblName, imageID) {
this.imageID = imageID;
this.finishingPricingObj = new FinishingPricing(finishingPricingID, finishingID, rblName);

this.InsertPrintedEnvelopePricing();
}

PrintedEnvelopePricing.prototype.InsertPrintedEnvelopePricing = function() {
if (typeof(PrintedEnvelopePricings) == 'undefined') {
PrintedEnvelopePricings = new Object;
}
PrintedEnvelopePricings[this.finishingPricingObj.finishingPricingID] = this;
};

PrintedEnvelopePricing.prototype.ResetPrintedEnvelope = function() {
 SetRadioButtonListChecked(this.rblName, this.finishingID);
};

PrintedEnvelopePricing.prototype.ChangePrintedEnvelope = function(finishingID) {
this.finishingPricingObj.SetFinishingID(finishingID);

if (this.productPricingObj) {
LoadImage(this.imageID, this.GetPrintedEnvelopeImageName());
this.productPricingObj.HandleMailingBlankEnvelopes();
this.productPricingObj.HandleAttributePrices(AdjustTypeEnum.Envelope);
}
};

PrintedEnvelopePricing.prototype.GetPrintedEnvelopeImageName = function() {
return (this.finishingPricingObj.finishingID == AttributeValueIDEnum.imprint_return_address_in_black || this.finishingPricingObj.finishingID == AttributeValueIDEnum.imprint_medium || this.finishingPricingObj.finishingID == AttributeValueIDEnum.imprint_large) ? EnvelopeTypeEnum.PrintedImageName : EnvelopeTypeEnum.YesImageName;
};/// <reference path="Signatures/Part.js" />
/// <reference path="Signatures/SignatureCollectionBuilder.js" />
/// <reference path="Enums/ProductIDEnum.js" />
var ProductPricings;

function ProductPricing(productPricingID, isChangeProductOptions, orderingPage, productID, instaPriceID, inkPricingID, insideInkPricingID, spotPricingID, insideSpotPricingID, numPagesPricingID, aqueousPricingID, paperPricingID, insidePaperPricingID, foldPricingID, sizePricingID, sealPricingID, roundCornerPricingID, blankEnvelopePricingID, secondSheetPricingID, turnaroundPricingID, shipTypePricingID, mailingPricingID, pocketSlitPricingID, nameQtyPricingID, txtCouponCodeID, hasChannelMarkupPercent, confirmAsIsID, blankEnvelopeImprintID, upgradeDiscountPricingID, conversionPricingID, bindingPricingID, variableDataPricingID, createCustomQuoteID, lanyardPricingID) {
this.productPricingID = productPricingID;
this.isChangeProductOptions = isChangeProductOptions;
this.orderingPage = orderingPage;
this.productID = productID;
this.instaPriceID = instaPriceID;
this.inkPricingID = inkPricingID;
this.insideInkPricingID = insideInkPricingID;
this.spotPricingID = spotPricingID;
this.insideSpotPricingID = insideSpotPricingID;
this.numPagesPricingID = numPagesPricingID;
this.aqueousPricingID = aqueousPricingID;
this.paperPricingID = paperPricingID;
this.insidePaperPricingID = insidePaperPricingID;
this.foldPricingID = foldPricingID;
this.sizePricingID = sizePricingID;
this.sealPricingID = sealPricingID;
this.lanyardPricingID = lanyardPricingID;
this.roundCornerPricingID = roundCornerPricingID;
this.blankEnvelopePricingID = blankEnvelopePricingID;
this.secondSheetPricingID = secondSheetPricingID;
this.turnaroundPricingID = turnaroundPricingID;
this.shipTypePricingID = shipTypePricingID;
this.mailingPricingID = mailingPricingID;
this.pocketSlitPricingID = pocketSlitPricingID;
this.nameQtyPricingID = nameQtyPricingID;
this.txtCouponCodeID = txtCouponCodeID;
this.hasChannelMarkupPercent = hasChannelMarkupPercent;
this.confirmAsIsID = confirmAsIsID;
this.blankEnvelopeImprintID = blankEnvelopeImprintID;
this.upgradeDiscountPricingID = upgradeDiscountPricingID;
this.conversionPricingID = conversionPricingID;
this.bindingPricingID = bindingPricingID;
this.variableDataPricingID = variableDataPricingID;
this.createCustomQuoteID = createCustomQuoteID;
this.quantityList = new Array();
this.TemplateProductID = null;
this.PricingType = null;

this.InsertProductPricing();
}

ProductPricing.prototype.InsertProductPricing = function() {
if (typeof(ProductPricings) == 'undefined') {
ProductPricings = new Object;
}
ProductPricings[this.productPricingID] = this;
};

// BEGIN - Associate collections
// AssociateCollections must be called after the page is loaded using AddEventHandler
ProductPricing.prototype.AssociateCollections = function(resetInputs) {
this.hasInstaPrice = (this.instaPriceID && typeof (InstaPrices) != 'undefined');
if (this.hasInstaPrice) {
this.AssociateProductPricing(InstaPrices, this.instaPriceID);
}
this.hasUpgradeDiscount = (this.upgradeDiscountPricingID && typeof (UpgradeDiscounts) != 'undefined');
if (this.hasUpgradeDiscount) {
this.AssociateProductPricing(UpgradeDiscounts, this.upgradeDiscountPricingID);
}
if (this.confirmAsIsID &&
 typeof (ConfirmAsIss) != 'undefined' &&
 typeof (ConfirmAsIss[this.confirmAsIsID]) != 'undefined') {
this.AssociateProductPricing(ConfirmAsIss, this.confirmAsIsID);
}
this.hasInkPricing = (this.inkPricingID && typeof (InkPricings) != 'undefined' &&
 'undefined' != typeof (InkPricings[this.inkPricingID]));
if (this.hasInkPricing) {
this.AssociateProductPricing(InkPricings, this.inkPricingID);
}
this.hasInsideInkPricing = (this.insideInkPricingID && typeof (InkPricings) != 'undefined' &&
'undefined' != typeof (InkPricings[this.insideInkPricingID]));
if (this.hasInsideInkPricing) {
this.AssociateProductPricing(InkPricings, this.insideInkPricingID);
}
this.hasSpotPricing = (this.spotPricingID && typeof (SpotPricings) != 'undefined' &&
'undefined' != typeof (SpotPricings[this.spotPricingID]));
if (this.hasSpotPricing) {
this.AssociateProductPricing(SpotPricings, this.spotPricingID);
}
this.hasInsideSpotPricing = (this.insideSpotPricingID && typeof (SpotPricings) != 'undefined' &&
'undefined' != typeof (SpotPricings[this.insideSpotPricingID]));
if (this.hasInsideSpotPricing) {
this.AssociateProductPricing(SpotPricings, this.insideSpotPricingID);
}
this.hasNumPagesPricing = (this.numPagesPricingID && typeof (NumPagesPricings) != 'undefined' &&
'undefined' != typeof (NumPagesPricings[this.numPagesPricingID]));
if (this.hasNumPagesPricing) {
this.AssociateProductPricing(NumPagesPricings, this.numPagesPricingID);
}
this.hasAqueousPricing = (this.aqueousPricingID && typeof (AqueousPricings) != 'undefined' &&
'undefined' != typeof (AqueousPricings[this.aqueousPricingID]));
if (this.hasAqueousPricing) {
this.AssociateProductPricing(AqueousPricings, this.aqueousPricingID);
}
this.hasPaperPricing = (this.paperPricingID && typeof (PaperPricings) != 'undefined' &&
'undefined' != typeof (PaperPricings[this.paperPricingID]));
if (this.hasPaperPricing) {
this.AssociateProductPricing(PaperPricings, this.paperPricingID);
}
this.hasInsidePaperPricing = (this.insidePaperPricingID && typeof (PaperPricings) != 'undefined' &&
'undefined' != typeof (PaperPricings[this.insidePaperPricingID]));
if (this.hasInsidePaperPricing) {
this.AssociateProductPricing(PaperPricings, this.insidePaperPricingID);
}
this.hasFoldPricing = (this.foldPricingID && typeof (FoldPricings) != 'undefined' &&
'undefined' != typeof (FoldPricings[this.foldPricingID]));
if (this.hasFoldPricing) {
this.AssociateProductPricing(FoldPricings, this.foldPricingID);
}
this.hasSizePricing = (this.sizePricingID && typeof (SizePricings) != 'undefined' &&
'undefined' != typeof (SizePricings[this.sizePricingID]));
if (this.hasSizePricing) {
this.AssociateProductPricing(SizePricings, this.sizePricingID);
}
this.hasSealPricing = (this.sealPricingID && typeof (SealPricings) != 'undefined' &&
'undefined' != typeof (SealPricings[this.sealPricingID]));
if (this.hasSealPricing) {
this.AssociateProductPricing(SealPricings, this.sealPricingID);
}
this.hasLanyardPricing = (this.lanyardPricingID && typeof (LanyardPricings) != 'undefined' &&
'undefined' != typeof (LanyardPricings[this.lanyardPricingID]));
if (this.hasLanyardPricing) {
this.AssociateProductPricing(LanyardPricings, this.lanyardPricingID);
}
this.hasRoundCornerPricing = (this.roundCornerPricingID && typeof (RoundCornerPricings) != 'undefined' &&
'undefined' != typeof (RoundCornerPricings[this.roundCornerPricingID]));
if (this.hasRoundCornerPricing) {
this.AssociateProductPricing(RoundCornerPricings, this.roundCornerPricingID);
}
this.hasBlankEnvelopePricing = (this.blankEnvelopePricingID && typeof (BlankEnvelopePricings) != 'undefined' &&
'undefined' != typeof (BlankEnvelopePricings[this.blankEnvelopePricingID]));
if (this.hasBlankEnvelopePricing) {
this.AssociateProductPricing(BlankEnvelopePricings, this.blankEnvelopePricingID);
}
this.hasEnvelopeImprintPricing = (this.blankEnvelopeImprintID && typeof (PrintedEnvelopePricings) != 'undefined' &&
'undefined' != typeof (PrintedEnvelopePricings[this.blankEnvelopeImprintID]));
if (this.hasEnvelopeImprintPricing) {
this.AssociateProductPricing(PrintedEnvelopePricings, this.blankEnvelopeImprintID);
}
this.hasSecondSheetPricing = (this.secondSheetPricingID && typeof (SecondSheetPricings) != 'undefined' &&
'undefined' != typeof (SecondSheetPricings[this.secondSheetPricingID]));
if (this.hasSecondSheetPricing) {
this.AssociateProductPricing(SecondSheetPricings, this.secondSheetPricingID);
}
this.hasTurnaroundPricing = (this.turnaroundPricingID && typeof (TurnaroundPricings) != 'undefined' &&
'undefined' != typeof (TurnaroundPricings[this.turnaroundPricingID]));
if (this.hasTurnaroundPricing) {
this.AssociateProductPricing(TurnaroundPricings, this.turnaroundPricingID);
}
this.hasShipTypePricing = (this.shipTypePricingID && typeof (ShipTypePricings) != 'undefined' &&
'undefined' != typeof (ShipTypePricings[this.shipTypePricingID]));
if (this.hasShipTypePricing) {
this.AssociateProductPricing(ShipTypePricings, this.shipTypePricingID);
}
this.hasMailingPricing = (this.mailingPricingID && typeof (MailingPricings) != 'undefined' &&
'undefined' != typeof (MailingPricings[this.mailingPricingID]));
if (this.hasMailingPricing) {
this.AssociateProductPricing(MailingPricings, this.mailingPricingID);
MailingPricings[this.mailingPricingID].HandleSizeChange(this.productID); //disable mailing methods onload
}
this.hasPocketSlitPricing = (this.pocketSlitPricingID && typeof (PocketSlitPricings) != 'undefined' &&
'undefined' != typeof (PocketSlitPricings[this.pocketSlitPricingID]));
if (this.hasPocketSlitPricing) {
this.AssociateProductPricing(PocketSlitPricings, this.pocketSlitPricingID);
}
this.hasNameQtyPricing = (this.nameQtyPricingID && typeof (NameQtyPricings) != 'undefined' &&
'undefined' != typeof (NameQtyPricings[this.nameQtyPricingID]));
if (this.hasNameQtyPricing) {
this.AssociateProductPricing(NameQtyPricings, this.nameQtyPricingID);
}
this.hasDieCutPricing = (this.orderingPage == OrderingPageEnum.cardsdoorhangers);
if (this.hasDieCutPricing) {
this.diecutPricingObj = new FinishingPricing('diecut', AttributeValueIDEnum.diecut_door_hanger_die_cut);
}
this.hasDrillholePricing = (this.orderingPage == OrderingPageEnum.calendars);
if (this.hasDrillholePricing) {
this.drillholePricingObj = new FinishingPricing('drillhole', AttributeValueIDEnum.drillholes_1_8_drill_hole);
}
this.hasConversionPricing = (this.conversionPricingID && typeof (ConversionPricings) != 'undefined' &&
'undefined' != typeof (ConversionPricings[this.conversionPricingID]));
if (this.hasConversionPricing) {
this.AssociateProductPricing(ConversionPricings, this.conversionPricingID);
}
this.hasBindingPricing = (this.bindingPricingID && typeof (BindingPricings) != 'undefined' &&
'undefined' != typeof (BindingPricings[this.bindingPricingID]));
if (this.hasBindingPricing) {
this.AssociateProductPricing(BindingPricings, this.bindingPricingID);
}
this.hasVariableDataPricing = (this.variableDataPricingID && typeof (VariableDataPricings) != 'undefined' &&
'undefined' != typeof (VariableDataPricings[this.variableDataPricingID]));
if (this.hasVariableDataPricing) {
this.AssociateProductPricing(VariableDataPricings, this.variableDataPricingID);
}

if (resetInputs) {
var productPricingID = this.productPricingID;
AddEventHandler(window, 'load', function() { ProductPricings[productPricingID].ResetInputs(); });
}
};

ProductPricing.prototype.ResetInputs = function() {
if (this.hasInstaPrice) {
InstaPrices[this.instaPriceID].ResetQuantity();
}
if (this.hasUpgradeDiscount) {
UpgradeDiscounts[this.upgradeDiscountPricingID].ResetUpgradeDiscounts();
}
if (this.hasInkPricing) {
InkPricings[this.inkPricingID].ResetInk(this.productID);
}
if (this.hasNumPagesPricing) {
NumPagesPricings[this.numPagesPricingID].ResetNumPages();
}
if (this.hasAqueousPricing) {
AqueousPricings[this.aqueousPricingID].ResetAqueous();
}
if (this.hasPaperPricing) {
PaperPricings[this.paperPricingID].ResetPaper();
}
if (this.hasInsidePaperPricing) {
PaperPricings[this.insidePaperPricingID].ResetPaper();
}
if (this.hasFoldPricing) {
FoldPricings[this.foldPricingID].ResetFold();
}
if (this.hasSizePricing) {
SizePricings[this.sizePricingID].ResetSize();
}
if (this.hasSealPricing) {
SealPricings[this.sealPricingID].ResetSeal();
}
if (this.hasLanyardPricing) {
LanyardPricings[this.lanyardPricingID].ResetLanyard();
}
if (this.hasRoundCornerPricing) {
RoundCornerPricings[this.roundCornerPricingID].ResetRoundCorner();
}
if (this.hasBlankEnvelopePricing) {
BlankEnvelopePricings[this.blankEnvelopePricingID].ResetBlankEnvelopeQuantity();
}
if (this.hasEnvelopeImprintPricing) {
PrintedEnvelopePricings[this.blankEnvelopeImprintID].ResetPrintedEnvelope();
}
if (this.hasSecondSheetPricing) {
SecondSheetPricings[this.secondSheetPricingID].ResetSecondSheetQuantity();
}
if (this.hasTurnaroundPricing) {
TurnaroundPricings[this.turnaroundPricingID].ResetTurnaround();
}
if (this.hasShipTypePricing) {
ShipTypePricings[this.shipTypePricingID].ResetShipType();
}
if (this.hasMailingPricing) {
MailingPricings[this.mailingPricingID].ResetMailing();
}
if (this.hasPocketSlitPricing) {
PocketSlitPricings[this.pocketSlitPricingID].ResetPocketSlit();
}
if (this.hasNameQtyPricing && (window.location.href.toUpperCase().indexOf('DOBCARDS') == -1)) {
NameQtyPricings[this.nameQtyPricingID].ResetNameQty();
}
if (this.hasConversionPricing) {
ConversionPricings[this.conversionPricingID].ResetConversion();
}
if (this.hasBindingPricing) {
BindingPricings[this.bindingPricingID].ResetPadding();
}
if (this.hasVariableDataPricing) {
VariableDataPricings[this.variableDataPricingID].Reset();
}
};

ProductPricing.prototype.AssociateProductPricing = function(coll, itemID) {
if (typeof(coll[itemID]) != 'undefined') {
coll[itemID].productPricingObj = this;
}
};
// END - Associate collections

// BEGIN - Return specific collections
ProductPricing.prototype.GetInkPricingObj = function(coverInside) {
 var inkPricingObj;
 if (typeof (InkPricings) != 'undefined') {
 for (var inkPricingID in InkPricings) {
 inkPricingObj = InkPricings[inkPricingID];
 if (inkPricingObj.productPricingObj == this && (typeof (coverInside) == 'undefined' || inkPricingObj.coverInside == coverInside)) {
 return inkPricingObj;
 }
 }
 }
 return null;
};

ProductPricing.prototype.GetSpotPricingObj = function(coverInside) {
 var spotPricingObj;
 if (typeof (SpotPricings) != 'undefined') {
 for (var spotPricingID in SpotPricings) {
 spotPricingObj = SpotPricings[spotPricingID];
 if (spotPricingObj.productPricingObj == this && (spotPricingObj.coverInside == coverInside || (typeof (coverInside) == 'undefined' && spotPricingObj.coverInside == CoverInsideEnum.ForCover))) {
 return spotPricingObj;
 }
 }
 }
 return null;
};

ProductPricing.prototype.GetPaperPricingObj = function(coverInside) {
 var paperPricingObj;
 if (typeof (PaperPricings) != 'undefined') {
 for (var paperPricingID in PaperPricings) {
 paperPricingObj = PaperPricings[paperPricingID];
 if (paperPricingObj.productPricingObj == this && (typeof (coverInside) == 'undefined' || paperPricingObj.coverInside == coverInside)) {
 return paperPricingObj;
 }
 }
 }
 return null;
};

ProductPricing.prototype.GetNumPagesPricingObj = function() {
 var numPagesPricingObj;
 if (typeof (NumPagesPricings) != 'undefined') {
 for (var numPagesPricingID in NumPagesPricings) {
 numPagesPricingObj = NumPagesPricings[numPagesPricingID];
 if (numPagesPricingObj.productPricingObj == this) {
 return numPagesPricingObj;
 }
 }
 }
 return null;
};
// END - Return specific collections

// BEGIN - Adjust Prices
ProductPricing.prototype.AdjustPrices = function(adjustType, pricingID) {

 var multiVersionCount = 1;
 if (this.hasNameQtyPricing) { //business cards
 var nameQtyPricingObj = NameQtyPricings[this.nameQtyPricingID];
 // 3/10/09 DK - IMPORTANT NOTE: Multi version pricing functionality will be disabled for business cards until CQ Phase 2
 this.quantityList = nameQtyPricingObj.QuantityList();
 }
 else if (this.hasNumPagesPricing) { //catalogs & calendars
 multiVersionCount = Math.round(NumPagesPricings[this.numPagesPricingID].numPages / 4 / this.GetPartsPerSignature());
 }
 var markupPercent = 0;
 var multiVersionPercent = this.GetMultipleVersionPricingPercent(multiVersionCount);
 var percentCollection = this.GetPercentCollection(markupPercent, multiVersionPercent);

 this.quantity = InstaPrices[this.instaPriceID].quantity;
 if (this.orderingPage == OrderingPageEnum.notepadprinting) {
 this.quantity = this.quantity * StripNonNumeric(AttributeValueNameEnum[FinishingPricings[BindingPricings[this.bindingPricingID].rblSheetsPerUnitID].finishingID])
 }

 if (this.PricingType != null && this.PricingType == "GP" && this.TemplateProductID != null) {
 this.GetGridPricing(percentCollection);
 }
 else if (adjustType != AdjustTypeEnum.Mailing && this.PricingType != null && this.PricingType == "BE" && this.TemplateProductID != null) {
 this.GetBaseEachPricing(percentCollection);
 }
 else {
 
 this.AdjustPricesCore(adjustType, pricingID, markupPercent, percentCollection);

 if (this.hasInstaPrice) {
 markupPercent = InstaPrices[this.instaPriceID].GetMarkupPercent();
 if (markupPercent != 0) {
 if (ChannelID == ChannelIDEnum.OfficeMax) {
 InstaPrices[this.instaPriceID].StoreIPPrices(); //store IP prices
 }
 this.AdjustPricesCore(adjustType, pricingID, markupPercent, percentCollection);
 }
 }
 }
};

ProductPricing.prototype.AdjustPricesCore = function(adjustType, pricingID, markupPercent, percentCollection) {
 var adjustTypeUndefined = (typeof (adjustType) == 'undefined' || ChannelID == ChannelIDEnum.OfficeMax); //recalculating all prices for OfficeMax to store the IP pricing 
 var adjustTypeAdditionalMarkupPercent = (adjustType == AdjustTypeEnum.AdditionalMarkupPercent);
 var adjustTypeAqueous = (adjustType == AdjustTypeEnum.Aqueous);
 var adjustTypeEnvelope = (adjustType == AdjustTypeEnum.Envelope);
 var adjustTypeFold = (adjustType == AdjustTypeEnum.Fold);
 var adjustTypeInk = (adjustType == AdjustTypeEnum.Ink);
 var adjustTypeSpot = (adjustType == AdjustTypeEnum.Spot);
 var adjustTypeMailing = (adjustType == AdjustTypeEnum.Mailing);
 var adjustTypeNumPages = (adjustType == AdjustTypeEnum.NumPages);
 var adjustTypePaper = (adjustType == AdjustTypeEnum.Paper);
 var adjustTypeQuantity = ((adjustType == AdjustTypeEnum.Quantity) || (adjustType == AdjustTypeEnum.Padding));
 var adjustTypeLanyard = (adjustType == AdjustTypeEnum.Lanyard);
 var adjustTypeRoundCorner = (adjustType == AdjustTypeEnum.RoundCorner);
 var adjustTypeSeal = (adjustType == AdjustTypeEnum.Seal);
 var adjustTypeSecondSheet = (adjustType == AdjustTypeEnum.SecondSheet);
 var adjustTypeShipType = (adjustType == AdjustTypeEnum.ShipType);
 var adjustTypeTurnaround = (adjustType == AdjustTypeEnum.Turnaround);
 var adjustTypeUpgradeDiscount = (adjustType == AdjustTypeEnum.UpgradeDiscount);
 var adjustTypeConversion = (adjustType == AdjustTypeEnum.Conversion);
 var adjustTypePadding = (adjustType == AdjustTypeEnum.Padding);
 var adjustTypeVariableData = (adjustType == AdjustTypeEnum.VariableData);
 var adjustTypePrintingSubtotal = (adjustTypeInk || adjustTypeSpot || adjustTypeNumPages || adjustTypeQuantity || adjustTypeAqueous || adjustTypePaper || adjustTypeFold || adjustTypeSeal || adjustTypeLanyard || adjustTypeRoundCorner || adjustTypeAdditionalMarkupPercent || adjustTypeConversion || adjustTypePadding || adjustTypeVariableData);

 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeQuantity || adjustTypeNumPages || adjustTypeAdditionalMarkupPercent) {
 this.AdjustBaseProductPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustBaseDieCutPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustBaseDrillholePrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeInk || adjustTypeNumPages || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustBaseInkPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeSpot || adjustTypeNumPages || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustBaseSpotPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypePaper || adjustTypeNumPages || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustPaperUpgradePrice((this.hasChannelMarkupPercent) ? null : pricingID, percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeAqueous || adjustTypeInk || adjustTypeSpot || adjustTypePaper || adjustTypeNumPages || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent || adjustTypeMailing) {
 this.AdjustAqueousPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeFold || adjustTypeMailing || adjustTypePaper || adjustTypeNumPages || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustFoldPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeConversion || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustConversionPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypePadding || adjustTypePaper || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustPaddingPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeVariableData || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustVariableDataPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeSeal || adjustTypeInk || adjustTypeSpot || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustSealPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeLanyard || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustLanyardPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeRoundCorner || adjustTypeInk || adjustTypeSpot || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustRoundCornerPrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeEnvelope || adjustTypeMailing || adjustTypeQuantity || adjustTypeAdditionalMarkupPercent) {
 this.AdjustEnvelopePrice(percentCollection);
 }
 if (this.hasChannelMarkupPercent || adjustTypeUndefined || adjustTypeSecondSheet || adjustTypePaper || adjustTypeAdditionalMarkupPercent) {
 this.AdjustSecondSheetPrice(percentCollection);
 }
 if (adjustTypeUndefined || adjustTypeTurnaround || adjustTypePrintingSubtotal || adjustTypeAdditionalMarkupPercent) {
 this.AdjustTurnaroundPrice(percentCollection);
 }
 if (adjustTypeUndefined || adjustTypeShipType || adjustTypeMailing || adjustTypeNumPages || adjustTypeSecondSheet || adjustTypePaper || adjustTypeQuantity) {
 this.AdjustShipTypePrice(percentCollection);
 }
 if (adjustTypeUndefined || adjustTypeShipType || adjustTypeMailing || adjustTypeNumPages || adjustTypePaper || adjustTypeFold || adjustTypeQuantity) {
 this.AdjustMailingPrice(percentCollection);
 }
 if (adjustTypeUpgradeDiscount) {
 this.AdjustUpgradeDiscount();
 }
 this.AdjustCouponPrices();
 this.AdjustPFLProDiscount();
};

ProductPricing.prototype.AdjustBaseProductPrice = function(percentCollection) {
if (this.hasInstaPrice) {
var instaPriceObj = InstaPrices[this.instaPriceID];
 instaPriceObj.AdjustBaseProductPrice(this.GetProductPrice(percentCollection));
}
};

ProductPricing.prototype.AdjustBaseDieCutPrice = function(percentCollection) {
if (this.hasInstaPrice && this.hasDieCutPricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
instaPriceObj.AdjustBaseDieCutPrice(this.diecutPricingObj.GetFinishingPrice(AttributeValueIDEnum.diecut_door_hanger_die_cut, this.quantity, this.productID, percentCollection, null, this.quantityList));
}
};

ProductPricing.prototype.AdjustBaseDrillholePrice = function(percentCollection) {
if (this.hasInstaPrice && this.hasDrillholePricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];

//hardcoded attribute for calendars
//cover price
 instaPriceObj.AdjustBaseDrillholePrice(this.drillholePricingObj.GetFinishingPrice(AttributeValueIDEnum.drillholes_1_8_drill_hole, this.quantity, this.productID, percentCollection, null, this.quantityList), CoverInsideEnum.ForCover);
//inside price
var signatures = this.CreateSignatures(null, null, null, AttributeValueIDEnum.drillholes_1_8_drill_hole, null, CoverInsideEnum.ForInside);
 instaPriceObj.AdjustBaseDrillholePrice(this.drillholePricingObj.GetFinishingPrice(AttributeValueIDEnum.drillholes_1_8_drill_hole, this.quantity, this.productID, percentCollection, signatures, this.quantityList), CoverInsideEnum.ForInside);
}
};

ProductPricing.prototype.AdjustBaseInkPrice = function(percentCollection) {
 if (this.hasInstaPrice && this.hasInkPricing) {
 var instaPriceObj = InstaPrices[this.instaPriceID];
 var inkPricingObj;
 for (var inkPricingID in InkPricings) {
 inkPricingObj = InkPricings[inkPricingID];
 if (inkPricingObj.productPricingObj == this && (typeof (pricingID) == 'undefined' || pricingID == null || inkPricingObj.inkPricingID == pricingID)) {
 var signatures = this.GetSignatures(inkPricingObj.coverInside, { inkFID: inkPricingObj.GetInk(AttributePlacementEnum.front), inkBID: inkPricingObj.GetInk(AttributePlacementEnum.back), paperID: null });
 if (inkPricingObj.coverInside != CoverInsideEnum.ForInside || this.HasInsidePages()) {
 instaPriceObj.AdjustBaseInkPrice(inkPricingObj.GetTotalInkPrice(this.productID, this.quantity, signatures, percentCollection), inkPricingObj.coverInside);
 }
 else { //price is zero for inside pages when there are no inside pages
 instaPriceObj.AdjustBaseInkPrice(0, inkPricingObj.coverInside);
 }
 }
 }
 }
};

ProductPricing.prototype.AdjustBaseSpotPrice = function(percentCollection) {
 if (this.hasInstaPrice && this.hasSpotPricing) {
 var instaPriceObj = InstaPrices[this.instaPriceID];
 var spotPricingObj;
 for (var spotPricingID in SpotPricings) {
 spotPricingObj = SpotPricings[spotPricingID];
 if (spotPricingObj.productPricingObj == this && (typeof (pricingID) == 'undefined' || pricingID == null || spotPricingObj.spotPricingID == pricingID)) {
 var signatures = this.GetSignatures(spotPricingObj.coverInside, { inkFID: null, inkBID: null, paperID: null, spotFID: spotPricingObj.GetSpot(AttributePlacementEnum.front), spotBID: spotPricingObj.GetSpot(AttributePlacementEnum.back) });
 if (spotPricingObj.coverInside != CoverInsideEnum.ForInside || this.HasInsidePages()) {
 var price = spotPricingObj.GetTotalSpotPrice(this.productID, spotPricingObj.spotFID, spotPricingObj.spotBID, this.quantity, signatures, percentCollection);
 if (typeof (FinishingPricings[spotPricingObj.spotPricingID]) != 'undefined') {
 price += FinishingPricings[spotPricingObj.spotPricingID].GetFinishingPrice(FinishingPricings[spotPricingObj.spotPricingID].finishingID, this.quantity, this.productID, percentCollection, null, this.quantityList);
 }
 instaPriceObj.AdjustBaseSpotPrice(price, spotPricingObj.coverInside);
 }
 else { //price is zero for inside pages when there are no inside pages
 instaPriceObj.AdjustBaseSpotPrice(0, spotPricingObj.coverInside);
 }
 }
 }
 }
};

ProductPricing.prototype.AdjustAqueousPrice = function(percentCollection) {
if (this.hasInstaPrice && (this.hasInkPricing || this.hasSpotPricing) && this.hasAqueousPricing && this.hasPaperPricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var inkFID = '';
var inkBID = '';
var spotFID = '';
var spotBID = '';
if (this.hasInkPricing) {
var inkPricingObj = this.GetInkPricingObj();
inkFID = inkPricingObj.GetInk(AttributePlacementEnum.front);
inkBID = inkPricingObj.GetInk(AttributePlacementEnum.back);
}
if (this.hasSpotPricing) {
var spotPricingObj = SpotPricings[this.spotPricingID];
spotFID = spotPricingObj.GetSpot(AttributePlacementEnum.front);
spotBID = spotPricingObj.GetSpot(AttributePlacementEnum.back);
}
var aqueousPricingObj = AqueousPricings[this.aqueousPricingID];
var paperPricingObj = this.GetPaperPricingObj();
instaPriceObj.AdjustAqueousPrice(aqueousPricingObj.GetTotalAqueousPrice(this.productID, inkFID, inkBID, spotFID, spotBID, this.quantity, null, paperPricingObj.paperID, percentCollection), aqueousPricingObj.coverInside);
}
};

ProductPricing.prototype.AdjustPaperUpgradePrice = function(pricingID, percentCollection) {
if (this.hasInstaPrice && this.hasPaperPricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var paperPricingObj;
for(var paperPricingID in PaperPricings) {
paperPricingObj = PaperPricings[paperPricingID];
if (paperPricingObj.productPricingObj == this && (typeof (pricingID) == 'undefined' || pricingID == null || paperPricingObj.paperPricingID == pricingID)) {
if(paperPricingObj.coverInside != CoverInsideEnum.ForInside || this.HasInsidePages()) { 
 if(paperPricingObj.coverInside == CoverInsideEnum.ForInside && this.HasInsidePages()) {
 var signatures = this.CreateSignatures(null, null, PaperPricings[paperPricingID].paperID, null, null, paperPricingObj.coverInside);
 }
 instaPriceObj.AdjustPaperUpgradePrice(paperPricingObj.GetPaperUpgradePrice(this.productID, this.quantity, percentCollection, paperPricingObj.coverInside, signatures), paperPricingObj.coverInside);
 instaPriceObj.AdjustPaperBasePrice(paperPricingObj.GetPaperBasePrice(this.productID, this.quantity, percentCollection, paperPricingObj.coverInside, signatures), paperPricingObj.coverInside);
}
else { //price is zero for inside pages when there are no inside pages
 instaPriceObj.AdjustPaperUpgradePrice(0, paperPricingObj.coverInside);
 instaPriceObj.AdjustPaperBasePrice(0, paperPricingObj.coverInside);
}
}
}
}
};

ProductPricing.prototype.GetSignatures = function(coverInside, attributeValueObj) {
if (coverInside == CoverInsideEnum.ForInside) { //checking if insidepaper object0
if (this.HasInsidePages()) {
 return this.CreateSignatures(attributeValueObj.inkFID, attributeValueObj.inkBID, attributeValueObj.paperID, null, null, coverInside, attributeValueObj.spotFID, attributeValueObj.spotBID);
}
}
return null;
};

ProductPricing.prototype.AdjustFoldPrice = function(percentCollection) {
if (this.hasInstaPrice && this.hasFoldPricing && this.hasPaperPricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var foldPricingObj = FoldPricings[this.foldPricingID];
var foldPrice = 0;
if (foldPricingObj.coverInside == CoverInsideEnum.ForInside && this.HasInsidePages()) {
var signatures = this.CreateSignatures(null, null, null, null, AttributeValueIDEnum.foldcollatestaple_fold_collate_stitch, foldPricingObj.coverInside);
for (var paperPricingID in PaperPricings) {
paperPricingObj = PaperPricings[paperPricingID];
if (paperPricingObj.productPricingObj == this && paperPricingObj.coverInside == CoverInsideEnum.ForInside && this.HasInsidePages()) {
var paperInsideID = paperPricingObj.paperID;
}
}

foldPrice += foldPricingObj.GetFoldPrice(AttributeValueIDEnum.foldcollatestaple_fold_collate_stitch, this.quantity, this.IsCoverPaper(paperInsideID), this.productID, percentCollection, signatures);
//get fold price for cover
foldPrice += foldPricingObj.GetFoldPrice(AttributeValueIDEnum.foldcollatestaple_fold_collate_stitch, this.quantity, this.IsCoverPaper(), this.productID, percentCollection, null);
}
else {
foldPrice = foldPricingObj.GetFoldPrice(foldPricingObj.finishingPricingObj.finishingID, this.quantity, this.IsCoverPaper(), this.productID, percentCollection, null);
}
instaPriceObj.AdjustFoldPrice(foldPrice, foldPricingObj.coverInside);
}
};

ProductPricing.prototype.AdjustConversionPrice = function(percentCollection) {

if (this.hasInstaPrice && this.hasConversionPricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var conversionPricingObj = ConversionPricings[this.conversionPricingID];
instaPriceObj.AdjustConversionPrice(conversionPricingObj.finishingPricingObj.GetFinishingPrice(conversionPricingObj.finishingPricingObj.finishingID, this.quantity, this.productID, percentCollection, null, this.quantityList));
}
};

ProductPricing.prototype.AdjustPaddingPrice = function(percentCollection) {
if (this.hasInstaPrice && this.hasBindingPricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var bindingPricingObj = BindingPricings[this.bindingPricingID];
if (FinishingPricings[bindingPricingObj.rblSheetsPerUnitID] && FinishingPricings[bindingPricingObj.rblSheetsPerUnitID].finishingID != '') {
var padsOf = this.quantity / StripNonNumeric(AttributeValueNameEnum[FinishingPricings[bindingPricingObj.rblSheetsPerUnitID].finishingID]);
instaPriceObj.AdjustSheetsPerUnitPrice(FinishingPricings[bindingPricingObj.rblSheetsPerUnitID].GetFinishingPrice(FinishingPricings[bindingPricingObj.rblSheetsPerUnitID].finishingID, this.quantity, this.productID, percentCollection, null, this.quantityList));
instaPriceObj.AdjustCollatePrice(FinishingPricings['Collate'].GetFinishingPrice(FinishingPricings['Collate'].finishingID, padsOf, this.productID, percentCollection, null, this.quantityList));
instaPriceObj.AdjustBackingPrice(FinishingPricings['Backing'].GetFinishingPrice(FinishingPricings['Backing'].finishingID, padsOf, this.productID, percentCollection, null, this.quantityList));
instaPriceObj.AdjustCoverPrice(FinishingPricings['Cover'].GetFinishingPrice(FinishingPricings['Cover'].finishingID, padsOf, this.productID, percentCollection, null, this.quantityList));
instaPriceObj.AdjustBindingPrice(FinishingPricings[bindingPricingObj.bindingObjID].GetFinishingPrice(FinishingPricings[bindingPricingObj.bindingObjID].finishingID, padsOf, this.productID, percentCollection, null, this.quantityList));
}
else {
instaPriceObj.AdjustSheetsPerUnitPrice(0);
instaPriceObj.AdjustCollatePrice(0);
instaPriceObj.AdjustBackingPrice(0);
instaPriceObj.AdjustCoverPrice(0);
instaPriceObj.AdjustBindingPrice(0);
}
}
};

ProductPricing.prototype.AdjustVariableDataPrice = function(percentCollection) {
 if (this.hasInstaPrice && this.hasVariableDataPricing) {
 var instaPriceObj = InstaPrices[this.instaPriceID];
 var variableDataPricingObj = VariableDataPricings[this.variableDataPricingID];
 var price = 0;
 instaPriceObj.AdjustImprintPrice(FinishingPricings[variableDataPricingObj.rblImprintID].GetFinishingPrice(FinishingPricings[variableDataPricingObj.rblImprintID].finishingID, this.quantity, this.productID, percentCollection, null, this.quantityList));
 if (FinishingPricings[variableDataPricingObj.rblImprintID].finishingID != "") {
 instaPriceObj.AdjustImprintColorPrice(FinishingPricings[variableDataPricingObj.ddImprintColorID].GetFinishingPrice(FinishingPricings[variableDataPricingObj.ddImprintColorID].finishingID, this.quantity, this.productID, percentCollection, null, this.quantityList));
 } else {
 instaPriceObj.AdjustImprintColorPrice(0);
 }
 }
};

ProductPricing.prototype.AdjustSealPrice = function(percentCollection) {
 
 if (this.hasInstaPrice && this.hasSealPricing && this.hasInkPricing) {
 var instaPriceObj = InstaPrices[this.instaPriceID];
 var sealPricingObj = SealPricings[this.sealPricingID];
 instaPriceObj.AdjustSealPrice(sealPricingObj.finishingPricingObj.GetFinishingPrice(sealPricingObj.finishingPricingObj.finishingID, this.quantity, this.productID, percentCollection, null, this.quantityList));
 }
};

ProductPricing.prototype.AdjustLanyardPrice = function(percentCollection) {
if (this.hasInstaPrice && this.hasLanyardPricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var lanyardPricingObj = LanyardPricings[this.lanyardPricingID];
instaPriceObj.AdjustLanyardPrice(lanyardPricingObj.finishingPricingObj.GetFinishingPrice(lanyardPricingObj.finishingPricingObj.finishingID, this.quantity, this.productID, percentCollection, null, this.quantityList));
}
};

ProductPricing.prototype.AdjustRoundCornerPrice = function(percentCollection) {
if (this.hasInstaPrice && this.hasRoundCornerPricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var roundcornerPricingObj = RoundCornerPricings[this.roundCornerPricingID];
instaPriceObj.AdjustRoundCornerPrice(roundcornerPricingObj.finishingPricingObj.GetFinishingPrice(roundcornerPricingObj.finishingPricingObj.finishingID, this.quantity, this.productID, percentCollection, null, this.quantityList));
}
};

ProductPricing.prototype.AdjustEnvelopePrice = function(percentCollection) {
if (this.hasInstaPrice && this.hasBlankEnvelopePricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var blankEnvelopePricingObj = BlankEnvelopePricings[this.blankEnvelopePricingID];
var price = 0;
price = blankEnvelopePricingObj.GetBlankEnvelopePrice(percentCollection);
if (this.hasEnvelopeImprintPricing) {
var printedEnvelopePricingObj = PrintedEnvelopePricings[this.blankEnvelopeImprintID];
price += printedEnvelopePricingObj.finishingPricingObj.GetFinishingPrice(printedEnvelopePricingObj.finishingPricingObj.finishingID, blankEnvelopePricingObj.blankEnvelopeQuantity, this.productID, percentCollection);
}
instaPriceObj.AdjustEnvelopePrice(price);
}
};

ProductPricing.prototype.AdjustSecondSheetPrice = function(percentCollection) {
if (this.hasInstaPrice && this.hasSecondSheetPricing && this.hasPaperPricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var secondSheetPricingObj = SecondSheetPricings[this.secondSheetPricingID];
var paperPricingObj = this.GetPaperPricingObj();
instaPriceObj.AdjustSecondSheetPrice(secondSheetPricingObj.GetSecondSheetPrice(this.productID, paperPricingObj.paperID, percentCollection));
}
};

ProductPricing.prototype.AdjustTurnaroundPrice = function(percentCollection) {
 if (this.hasInstaPrice && this.hasTurnaroundPricing) {
 var instaPriceObj = InstaPrices[this.instaPriceID];
 var turnaroundPricingObj = TurnaroundPricings[this.turnaroundPricingID];
 var ipTurnaroundPrice = null;
 if (typeof (instaPriceObj.PFLProSettings) != 'undefined' && instaPriceObj.PFLProSettings != null) {
 ipTurnaroundPrice = turnaroundPricingObj.GetTurnaroundPrice(this.productID, instaPriceObj.printingSubtotal, percentCollection, null);
 }
 instaPriceObj.AdjustTurnaroundPrice(turnaroundPricingObj.GetTurnaroundPrice(this.productID, instaPriceObj.printingSubtotal, percentCollection, instaPriceObj.PFLProSettings), ipTurnaroundPrice);
 }
};

ProductPricing.prototype.AdjustShipTypePrice = function(percentCollection) {
if (this.hasInstaPrice && this.hasShipTypePricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var mailingPricingObj = (this.hasMailingPricing) ? MailingPricings[this.mailingPricingID] : null;
var quantity = this.quantity - ((mailingPricingObj && mailingPricingObj.mailingMethod) ? mailingPricingObj.mailingQuantity : 0);
var shipTypePricingObj = ShipTypePricings[this.shipTypePricingID];
var secondSheetQuantity = (this.hasSecondSheetPricing) ? SecondSheetPricings[this.secondSheetPricingID].secondSheetQuantity : 0;
quantity += secondSheetQuantity;

var price = 0;

var paperPricingObj;
for (var paperPricingID in PaperPricings) {
paperPricingObj = PaperPricings[paperPricingID];
// Create signatures object for catalogs/calendars regardless of inside pages, otherwise, the weight per piece price won't be calculated properly
if ((paperPricingObj.paperPricingID == this.paperPricingID || paperPricingObj.paperPricingID == this.insidePaperPricingID) && paperPricingObj.paperID != '' &&
(this.productID == ProductIDEnum.catalogs_5_5x8_5 ||
this.productID == ProductIDEnum.catalogs_8_5x11 ||
this.productID == ProductIDEnum.calendars_5_5x8_5 ||
this.productID == ProductIDEnum.calendars_8_5x11)
) {
if (typeof (signatures) == 'undefined') {
var signatures = new Array();
}
signatures = signatures.concat(this.CreateSignatures(null, null, PaperPricings[paperPricingID].paperID, null, null, paperPricingObj.coverInside));
}
}

for (var paperPricingID in PaperPricings) {
paperPricingObj = PaperPricings[paperPricingID];
if (paperPricingObj.paperPricingID == this.paperPricingID && paperPricingObj.paperID != '') {
price += shipTypePricingObj.GetShipTypePrice(this.productID, quantity, paperPricingObj.paperID, signatures, percentCollection);
}
}
instaPriceObj.AdjustShipTypePrice(price);
}
};

ProductPricing.prototype.AdjustMailingPrice = function(percentCollection) {
if (this.hasInstaPrice && this.hasMailingPricing) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var mailingPricingObj = MailingPricings[this.mailingPricingID];
var partCount = (this.hasNumPagesPricing) ? this.GetPartCount() : '';
var paperPricingObj = this.GetPaperPricingObj(CoverInsideEnum.ForInside);
var paperWeightID = (partCount != '' && paperPricingObj) ? paperPricingObj.GetPaperWeightID(paperPricingObj.paperID) : '';
var foldID = (this.hasFoldPricing) ? FoldPricings[this.foldPricingID].finishingPricingObj.finishingID : '';
if (foldID == AttributeValueIDEnum.foldcollatestaple_fold_collate_stitch || foldID == AttributeValueIDEnum.foldcollatestaple_manually_priced) {
 foldID = '';
}
var envelopeID = (this.hasBlankEnvelopePricing) ? BlankEnvelopePricings[this.blankEnvelopePricingID].blankEnvelopeSizeID : '';
var coverStock = this.IsCoverPaper();

instaPriceObj.AdjustMailingPrice(mailingPricingObj.GetMailingPrice(this.productID, paperWeightID, foldID, coverStock, partCount, percentCollection, envelopeID));
}
};

ProductPricing.prototype.AdjustCouponPrices = function() {
if (this.hasInstaPrice) {
var instaPriceObj = InstaPrices[this.instaPriceID];
instaPriceObj.AdjustCouponPrices();
}
};

ProductPricing.prototype.AdjustPFLProDiscount = function() {
 if (this.hasInstaPrice) {
 var instaPriceObj = InstaPrices[this.instaPriceID];
 instaPriceObj.AdjustPFLProDiscount();
 }
};

ProductPricing.prototype.AdjustUpgradeDiscount = function() {
if (this.hasInstaPrice && this.hasUpgradeDiscount) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var upgradeDiscountObj = UpgradeDiscounts[this.upgradeDiscountPricingID];
instaPriceObj.AdjustUpgradeDiscount(upgradeDiscountObj.GetUpgradeDiscountTotal());
}
};

ProductPricing.prototype.GetGridPricing = function(percentCollection) {
 var gridQuantity = this.quantity;
 //price business cards as total quantity for grid pricing
 if (typeof (this.quantityList) != 'undefined' && this.quantityList.length != 0) { //business cards
 gridQuantity = 0;
 for (var i = 0, loopCnt = this.quantityList.length; i < loopCnt; i++) {
 gridQuantity += this.quantityList[i];
 }
 }

 var RetailPrintPrice = null;
 var RetailShippingPrice = null;
 var WholesalePrintPrice = 0;
 var WholesaleShippingPrice = 0;
 if (typeof (gridPricingArr[this.TemplateProductID][gridQuantity]) != 'undefined') {
 if (typeof (gridPricingArr[this.TemplateProductID][gridQuantity][GridPriceTypeEnum.retailprintprice]) != 'undefined') {
 RetailPrintPrice = gridPricingArr[this.TemplateProductID][gridQuantity][GridPriceTypeEnum.retailprintprice];
 }
 if (typeof (gridPricingArr[this.TemplateProductID][gridQuantity][GridPriceTypeEnum.retailshippingprice]) != 'undefined') {
 RetailShippingPrice = gridPricingArr[this.TemplateProductID][gridQuantity][GridPriceTypeEnum.retailshippingprice];
 }
 if (typeof (gridPricingArr[this.TemplateProductID][gridQuantity][GridPriceTypeEnum.wholesaleprintprice]) != 'undefined') {
 WholesalePrintPrice = gridPricingArr[this.TemplateProductID][gridQuantity][GridPriceTypeEnum.wholesaleprintprice];
 }
 if (typeof (gridPricingArr[this.TemplateProductID][gridQuantity][GridPriceTypeEnum.wholesaleshippingprice]) != 'undefined') {
 WholesaleShippingPrice = gridPricingArr[this.TemplateProductID][gridQuantity][GridPriceTypeEnum.wholesaleshippingprice];
 }
 }
 
 if (this.hasInstaPrice) {
 var instaPriceObj = InstaPrices[this.instaPriceID];
 instaPriceObj.AdjustBaseProductPrice((RetailPrintPrice == null) ? WholesalePrintPrice : RetailPrintPrice);

 var shipTypePricingObj = ShipTypePricings[this.shipTypePricingID];
 var shippingMuliplier = shipTypePricingObj.GetShippingPriceMultiplier(this.productID);
 instaPriceObj.AdjustShipTypePrice(((RetailShippingPrice == null) ? WholesaleShippingPrice : RetailShippingPrice) * shippingMuliplier);
 
 this.AdjustTurnaroundPrice(percentCollection);
 }
}

ProductPricing.prototype.GetBaseEachPricing = function(percentCollection) {
 var totalQuantity = this.quantity;
 //price business cards as total quantity for base/each pricing
 if (typeof (this.quantityList) != 'undefined' && this.quantityList.length != 0) { //business cards
 totalQuantity = 0;
 for (var i = 0, loopCnt = this.quantityList.length; i < loopCnt; i++) {
 totalQuantity += this.quantityList[i];
 }
 }

 var wholesalePrintBase = null;
 var wholesalePrintEach = null;
 var wholesaleShipBase = null;
 var wholesaleShipEach = null;
 var retailPrintBase = null;
 var retailPrintEach = null;
 var retailShipBase = null;
 var retailShipEach = null;
 var quantityBreak = this.GetBaseEachQuantityBreak(totalQuantity);

 //get different quantity for shipping if there is mailing
 var shippingQuantityBreak = quantityBreak;
 var shippingTotalQuantity = totalQuantity;
 if (this.HasMailing()) {
 shippingTotalQuantity = totalQuantity - MailingPricings[this.mailingPricingID].mailingQuantity;
 shippingQuantityBreak = this.GetBaseEachQuantityBreak(shippingTotalQuantity);
 }

 if (typeof (gridPricingArr[this.TemplateProductID][quantityBreak]) != 'undefined') {
 if (typeof (gridPricingArr[this.TemplateProductID][quantityBreak][GridPriceTypeEnum.wholesaleprintbase]) != 'undefined') {
 wholesalePrintBase = gridPricingArr[this.TemplateProductID][quantityBreak][GridPriceTypeEnum.wholesaleprintbase];
 }
 if (typeof (gridPricingArr[this.TemplateProductID][quantityBreak][GridPriceTypeEnum.wholesaleprinteach]) != 'undefined') {
 wholesalePrintEach = gridPricingArr[this.TemplateProductID][quantityBreak][GridPriceTypeEnum.wholesaleprinteach];
 }
 if (typeof (gridPricingArr[this.TemplateProductID][quantityBreak][GridPriceTypeEnum.retailprintbase]) != 'undefined') {
 retailPrintBase = gridPricingArr[this.TemplateProductID][quantityBreak][GridPriceTypeEnum.retailprintbase];
 }
 if (typeof (gridPricingArr[this.TemplateProductID][quantityBreak][GridPriceTypeEnum.retailprinteach]) != 'undefined') {
 retailPrintEach = gridPricingArr[this.TemplateProductID][quantityBreak][GridPriceTypeEnum.retailprinteach];
 }
 }

 if (typeof (gridPricingArr[this.TemplateProductID][shippingQuantityBreak]) != 'undefined') {
 if (typeof (gridPricingArr[this.TemplateProductID][shippingQuantityBreak][GridPriceTypeEnum.wholesaleshipbase]) != 'undefined') {
 wholesaleShipBase = gridPricingArr[this.TemplateProductID][shippingQuantityBreak][GridPriceTypeEnum.wholesaleshipbase];
 }
 if (typeof (gridPricingArr[this.TemplateProductID][shippingQuantityBreak][GridPriceTypeEnum.wholesaleshipeach]) != 'undefined') {
 wholesaleShipEach = gridPricingArr[this.TemplateProductID][shippingQuantityBreak][GridPriceTypeEnum.wholesaleshipeach];
 }
 if (typeof (gridPricingArr[this.TemplateProductID][shippingQuantityBreak][GridPriceTypeEnum.retailshipbase]) != 'undefined') {
 retailShipBase = gridPricingArr[this.TemplateProductID][shippingQuantityBreak][GridPriceTypeEnum.retailshipbase];
 }
 if (typeof (gridPricingArr[this.TemplateProductID][shippingQuantityBreak][GridPriceTypeEnum.retailshipeach]) != 'undefined') {
 retailShipEach = gridPricingArr[this.TemplateProductID][shippingQuantityBreak][GridPriceTypeEnum.retailshipeach];
 }
 }

 var RetailPrintPrice = null;
 var RetailShippingPrice = null;
 var WholesalePrintPrice = 0;
 var WholesaleShippingPrice = 0;
 if (wholesalePrintBase != null && wholesalePrintEach != null) {
 WholesalePrintPrice = FormatDollar(wholesalePrintBase + (totalQuantity * wholesalePrintEach));
 }
 if (wholesaleShipBase != null && wholesaleShipEach != null) {
 if (shippingTotalQuantity == 0) {
 WholesaleShippingPrice = FormatDollar(0);
 }
 else {
 WholesaleShippingPrice = FormatDollar(wholesaleShipBase + (shippingTotalQuantity * wholesaleShipEach));
 }
 }
 if (retailPrintBase != null && retailPrintEach != null) {
 RetailPrintPrice = FormatDollar(retailPrintBase + (totalQuantity * retailPrintEach));
 }
 if (retailShipBase != null && retailShipEach != null) {
 if (shippingTotalQuantity == 0) {
 RetailShippingPrice = FormatDollar(0);
 }
 else {
 RetailShippingPrice = FormatDollar(retailShipBase + (shippingTotalQuantity * retailShipEach));
 }
 }

 if (this.hasInstaPrice) {
 var instaPriceObj = InstaPrices[this.instaPriceID];
 instaPriceObj.AdjustBaseProductPrice((RetailPrintPrice == null) ? WholesalePrintPrice : RetailPrintPrice);

 var shipTypePricingObj = ShipTypePricings[this.shipTypePricingID];
 var shippingMuliplier = shipTypePricingObj.GetShippingPriceMultiplier(this.productID);
 instaPriceObj.AdjustShipTypePrice(((RetailShippingPrice == null) ? WholesaleShippingPrice : RetailShippingPrice) * shippingMuliplier);

 this.AdjustTurnaroundPrice(percentCollection);
 }
}

ProductPricing.prototype.GetBaseEachQuantityBreak = function(totalQuantity) {
 var quantityBreak = 0;

 // Find the biggest quantity break that is less than or equal to the given quantity
 for (var arrQty in gridPricingArr[this.TemplateProductID]) {
 if (!isNaN(arrQty)) {
 var arrQtyNum = parseInt(arrQty);
 for (var pricingType in gridPricingArr[this.TemplateProductID][arrQty]) {
 //limit to base/each pricing types
 if (pricingType == GridPriceTypeEnum.retailprintbase
 || pricingType == GridPriceTypeEnum.retailprinteach
 || pricingType == GridPriceTypeEnum.retailshipbase
 || pricingType == GridPriceTypeEnum.retailshipeach
 || pricingType == GridPriceTypeEnum.wholesaleprintbase
 || pricingType == GridPriceTypeEnum.wholesaleprinteach
 || pricingType == GridPriceTypeEnum.wholesaleshipbase
 || pricingType == GridPriceTypeEnum.wholesaleshipeach) {

 if (totalQuantity >= arrQtyNum && quantityBreak < arrQtyNum) {
 quantityBreak = arrQtyNum;
 }
 }
 }
 }
 }
 return quantityBreak;
};
// END - Adjust Prices

// BEGIN - Get/set collection properties
ProductPricing.prototype.GetQuantity = function() {
return (this.hasInstaPrice) ? InstaPrices[this.instaPriceID].quantity : null;
};

ProductPricing.prototype.SetQuantity = function(quantity) {
this.SetEnvelopeQuantity(quantity);

if (this.hasInstaPrice) {
var instaPriceObj = InstaPrices[this.instaPriceID];
instaPriceObj.SetQuantity(quantity);
this.AdjustPrices(AdjustTypeEnum.Quantity);
}
};

ProductPricing.prototype.GetNumPages = function() {
 return (this.productID == ProductIDEnum.calendars_5_5x8_5) ? 28 : (this.hasNumPagesPricing) ? NumPagesPricings[this.numPagesPricingID].numPages : 1;
};

ProductPricing.prototype.GetPaperID = function() {
return (this.hasPaperPricing) ? this.GetPaperPricingObj().paperID : null;
};

ProductPricing.prototype.GetFold = function() {
return (this.hasFoldPricing) ? FoldPricings[this.foldPricingID].finishingPricingObj.finishingID : null;
};

ProductPricing.prototype.SetFold = function(foldID) {
if (this.hasFoldPricing) {
FoldPricings[this.foldPricingID].finishingPricingObj.SetFinishingID(foldID);
}
};

ProductPricing.prototype.SetConversion = function(conversionID) {
if (this.hasConversionPricing) {
ConversionPricings[this.conversionPricingID].finishingPricingObj.SetConversionID(conversionID);
}
};

ProductPricing.prototype.SetPadding = function(paddingID) {
if (this.hasBindingPricing) {
BindingPricings[this.bindingPricingID].finishingPricingObj.SetPaddingID(paddingID);
}
};

ProductPricing.prototype.SetVariableData = function(variableDataID) {
if (this.hasVariableDataPricing) {
VariableDataPricings[this.variableDataPricingID].finishingPricingObj.SetVariableDataID(variableDataID);
}
};

ProductPricing.prototype.SetPrintedEnvelope = function(finishingID) {
 if (this.hasEnvelopeImprintPricing) {
 PrintedEnvelopePricings[this.blankEnvelopeImprintID].finishingPricingObj.SetFinishingID(finishingID);
 }
};

ProductPricing.prototype.SetAqueous = function(coatingFID, coatingBID) {
if (this.hasAqueousPricing) {
AqueousPricings[this.aqueousPricingID].SetAqueous(coatingFID, coatingBID);
}
};

ProductPricing.prototype.SetRoundCorner = function(roundCorner) {
 if (this.hasRoundCornerPricing) {
 RoundCornerPricings[this.roundCornerPricingID].finishingPricingObj.SetFinishingID(roundCorner);
 }
};

ProductPricing.prototype.SetSealID = function(SealID) {
 if (this.hasSealPricing) {
 SealPricings[this.sealPricingID].ChangeSeal(SealID);
 }
};

ProductPricing.prototype.SetMailing = function(mailingMethod, mailingQty) {
if (this.hasMailingPricing) {
MailingPricings[this.mailingPricingID].SetMailingMethod(mailingMethod);
MailingPricings[this.mailingPricingID].SetMailingQuantity(mailingQty);
}
};

ProductPricing.prototype.SetSecondSheetQuantity = function(secondsQty) {
if (this.hasSecondSheetPricing) {
SecondSheetPricings[this.secondSheetPricingID].SetSecondSheetQuantity(secondsQty);
}
};

ProductPricing.prototype.SetTurnaround = function(turnaround) {
if (this.hasTurnaroundPricing) {
TurnaroundPricings[this.turnaroundPricingID].SetTurnaround(turnaround);
}
};

ProductPricing.prototype.GetShipType = function() {
return (this.hasShipTypePricing) ? ShipTypePricings[this.shipTypePricingID].shipType : null;
};

ProductPricing.prototype.SetShipType = function(shipType) {
if (this.hasShipTypePricing) {
ShipTypePricings[this.shipTypePricingID].SetShipType(shipType);
}
};

ProductPricing.prototype.GetMinMailingQuantity = function(mailingMethod) {
if (this.hasMailingPricing && mailingMethod) {
var paperPricingObj = this.GetPaperPricingObj(CoverInsideEnum.ForInside);
var partCount = (this.hasNumPagesPricing) ? this.GetPartCount() : '';
var paperWeightID = (partCount != '' && paperPricingObj) ? paperPricingObj.GetPaperWeightID(paperPricingObj.paperID) : '';

return mailingArr[this.productID][paperWeightID][partCount][mailingMethod][MAILING_IDX_MIN_QTY];
}
return null;
};

ProductPricing.prototype.GetVersionCount = function() {
if (this.hasNameQtyPricing) {
var nameQtyPricingObj = NameQtyPricings[this.nameQtyPricingID];
nameQtyPricingObj.GetVersionCount();
}
return null;
};
// END - Get/set collection properties

// BEGIN - Validation
ProductPricing.prototype.HandleQuantityChange = function(quantity, versionCt) {
if (this.hasNameQtyPricing && typeof(IsPPSEnterQuantity) != 'undefined' && !IsPPSEnterQuantity) {
var nameQtyPricingObj = NameQtyPricings[this.nameQtyPricingID];
nameQtyPricingObj.HandleNameQuantityChange();
}
this.SetEnvelopeQuantity(quantity);
if (this.hasMailingPricing) {
var mailingPricingObj = MailingPricings[this.mailingPricingID];
mailingPricingObj.HandleQuantityChange();
}

this.AdjustPrices(AdjustTypeEnum.Quantity);
};

ProductPricing.prototype.HandleAdditionalMarkupPercentChange = function(additionalMarkupPercent) {
this.AdjustPrices(AdjustTypeEnum.AdditionalMarkupPercent);
};

ProductPricing.prototype.HandleNameQuantityChange = function(sumNameQuantities) {
if (this.hasInstaPrice) {
if (sumNameQuantities > 0) {
var instaPriceObj = InstaPrices[this.instaPriceID];
instaPriceObj.SetQuantity(sumNameQuantities);
instaPriceObj.SetVersionCt(NameQtyPricings[this.nameQtyPricingID].GetVersionCount());
this.AdjustPrices(AdjustTypeEnum.Quantity);
this.HandleShowSubmitChanges();
}
}
};

ProductPricing.prototype.SetEnvelopeQuantity = function(envelopeQuantity) {
if (this.hasBlankEnvelopePricing) {
 var blankEnvelopePricingObj = BlankEnvelopePricings[this.blankEnvelopePricingID];
 if (blankEnvelopePricingObj.blankEnvelopeQuantity) {
 blankEnvelopePricingObj.SetEnvelopeQuantity(envelopeQuantity);
}
}
};

ProductPricing.prototype.ValidateNumPages = function() {
 if (this.hasInsideInkPricing) {
 InkPricings[this.insideInkPricingID].ValidateNumPages(!this.HasInsidePages());
 }
 if (this.hasInsidePaperPricing) {
 PaperPricings[this.insidePaperPricingID].ValidateNumPages(!this.HasInsidePages());
 }
 if (this.hasFoldPricing && this.hasNumPagesPricing) {
 FoldPricings[this.foldPricingID].ValidateNumPages(this.productID, NumPagesPricings[this.numPagesPricingID].numPages);
 }
};

ProductPricing.prototype.EnableCreateCQButtonOrNot = function() {
if (typeof(this.createCustomQuoteID) != "undefined") {
var element = $(this.createCustomQuoteID);
if (element && (element.disabled != true || element.title != "")) {
if (this.productID == ProductIDEnum.catalogs_8_5x11 && NumPagesPricings[this.numPagesPricingID].numPages < 5) {
element.disabled = true;
element.title = "Please quote using half fold 11 x 17 Brochure";
}
else {
element.disabled = false;
element.title = "";
}
}
}
};

ProductPricing.prototype.HandleSizeChange = function(productID) {
 var ret = true;
 if (this.hasPaperPricing) {
 var paperPricingObj = this.GetPaperPricingObj();
 ret = ret && paperPricingObj.ValidatePaper(productID, paperPricingObj.paperID, true);
 }
 if (this.hasFoldPricing) {
 var foldPricingObj = FoldPricings[this.foldPricingID];
 ret = ret && foldPricingObj.ValidateFold(productID, foldPricingObj.finishingPricingObj.finishingID, this.IsCoverPaper(), true, false);
 }
 if (this.hasLanyardPricing) {
 var lanyardPricingObj = LanyardPricings[this.lanyardPricingID];
 ret = ret && lanyardPricingObj.ValidateLanyard(productID, lanyardPricingObj.finishingPricingObj.finishingID, true);
 }
 var instaPriceObj = InstaPrices[this.instaPriceID];
 instaPriceObj.minQuantity = productInfoArr[productID][PRODUCTINFO_IDX_MINQUANTITY];
 instaPriceObj.ValidateQuantity(instaPriceObj.quantity);

 //blank envelopes settings
 this.SetBlankEnvelopeSize(productID);

 return ret;
};

ProductPricing.prototype.HandleSheetsPerUnitChange = function() {
var instaPriceObj = InstaPrices[this.instaPriceID];
instaPriceObj.ValidateQuantity(instaPriceObj.quantity);
};

ProductPricing.prototype.SetBlankEnvelopeSize = function(productID) {
if (productID == null || productID == '') {
productID = this.productID;
}
//blank envelopes settings
if (this.hasBlankEnvelopePricing) {
var blankEnvelopePricingObj = BlankEnvelopePricings[this.blankEnvelopePricingID];
if (productID == ProductIDEnum.greeting_cards) { //greeting cards envelope size
blankEnvelopePricingObj.blankEnvelopeSizeID = AttributeValueIDEnum.envelopes_a7;
}
else { //notecards envelope size
blankEnvelopePricingObj.blankEnvelopeSizeID = AttributeValueIDEnum.envelopes_a2;
}
}
};

ProductPricing.prototype.SetSize = function(productID) {
this.productID = productID;

if (this.orderingPage == OrderingPageEnum.calendars && this.hasNumPagesPricing) {
NumPagesPricings[this.numPagesPricingID].numPages = this.GetNumPages();
}
else if (this.orderingPage == OrderingPageEnum.cardspostcards && this.hasMailingPricing) {
MailingPricings[this.mailingPricingID].HandleSizeChange(this.productID);
}
};

ProductPricing.prototype.HandlePaperChange = function(paperID, forInside, productID, forSizeChange) {
var retObj = new Object;
retObj.success = true;
retObj.errorType = '';
if (!forInside && this.hasAqueousPricing) {
var aqueousPricingObj = AqueousPricings[this.aqueousPricingID];
if (!aqueousPricingObj.ValidateAqueous(paperID, aqueousPricingObj.coatingFID, aqueousPricingObj.mustNotCoat, true)) {
retObj.success = false;
this.ConcErrorMsg(retObj, AdjustTypeEnum.Aqueous);
}
}
if (this.hasFoldPricing) {
var foldPricingObj = FoldPricings[this.foldPricingID];
if (!foldPricingObj.ValidateFold(this.productID, foldPricingObj.finishingPricingObj.finishingID, this.IsCoverPaper(paperID), false, true)) {
retObj.success = false;
this.ConcErrorMsg(retObj, AdjustTypeEnum.Fold);
}
}
if (this.hasSealPricing) {
var sealPricingObj = SealPricings[this.sealPricingID];
if (!sealPricingObj.ValidateSeal(paperID, sealPricingObj.finishingPricingObj.finishingID, true)) {
retObj.success = false;
this.ConcErrorMsg(retObj, AdjustTypeEnum.Seal);
}
}
if (this.hasInkPricing) {
var inkPricingObj = this.GetInkPricingObj();
if (!this.IsValidInkPaper(inkPricingObj.inkFID, inkPricingObj.inkBID, paperID)) {
retObj.success = false;
this.ConcErrorMsg(retObj, AdjustTypeEnum.Ink);
}
}
if (this.hasBindingPricing) {
var bindingPricingObj = BindingPricings[this.bindingPricingID];
if (!bindingPricingObj.Validate(FinishingPricings[bindingPricingObj.rblSheetsPerUnitID].finishingID, FinishingPricings['Backing'].finishingID, FinishingPricings['Cover'].finishingID, paperID, productID, forSizeChange)) {
retObj.success = false;
this.ConcErrorMsg(retObj, AdjustTypeEnum.Padding);
}
}
var retObjFoldPaperMailing = this.ValidateFoldPaperMailing(paperID);
if (!retObjFoldPaperMailing.VALIDATE_RESULT) {
retObj.success = retObjFoldPaperMailing.VALIDATE_RESULT;
retObj.VALIDATE_MESSAGE = retObjFoldPaperMailing.VALIDATE_MESSAGE;
retObj.VALIDATE_PAPER = retObjFoldPaperMailing.VALIDATE_PAPER;
this.ConcErrorMsg(retObj, AdjustTypeEnum.Paper);
}
return retObj;
};

ProductPricing.prototype.ValidateFoldPaperMailing = function(paperID, foldID) {
var retObj = new Object();
retObj.VALIDATE_RESULT = true;
// Brochures and newsletters
if (this.productID == ProductIDEnum.brochures_8_5x11 || this.productID == ProductIDEnum.brochures_8_5x14 || this.productID == ProductIDEnum.brochures_11x17 || this.productID == ProductIDEnum.brochures_11x25_5 || this.productID == ProductIDEnum.newsletters_8_5x11 || this.productID == ProductIDEnum.newsletters_11x17 || this.productID == ProductIDEnum.newsletters_11x25_5) {
if (this.hasFoldPricing && this.hasPaperPricing && this.hasMailingPricing) {
if (this.HasMailing()) {
var foldPricingObj = FoldPricings[this.foldPricingID];
if (typeof (foldID) == 'undefined' || foldID == null) {
foldID = foldPricingObj.finishingPricingObj.finishingID;
}
if (foldID == AttributeValueIDEnum.fold_half_fold) {
if (typeof (paperID) == 'undefined' || paperID == null) {
var paperPricingObj = this.GetPaperPricingObj();
paperID = paperPricingObj.paperID;
}
// 70# or 80# text
if (paperID == AttributeValueIDEnum.paper_70lb_uncoated_text || paperID == AttributeValueIDEnum.paper_80lb_gloss_text || paperID == AttributeValueIDEnum.paper_80lb_matte_text) {
retObj.VALIDATE_RESULT = false;
retObj.VALIDATE_MESSAGE = "70# or 80# text is not thick enough to be mailed with a Half Fold, paper will be upgraded.";
retObj.VALIDATE_PAPER = (paperID == AttributeValueIDEnum.paper_70lb_uncoated_text || paperID == AttributeValueIDEnum.paper_80lb_matte_text) ? AttributeValueIDEnum.paper_100lb_dull_matte_text : AttributeValueIDEnum.paper_100lb_gloss_text;
}
}
}
}
}
return retObj;
};

ProductPricing.prototype.ConcErrorMsg = function(retObj, type) {
if (!retObj.success) {
retObj.errorType += ((retObj.errorType) ? ',' : '') + type;
}
};

ProductPricing.prototype.HandleInkChange = function(inkFID, inkBID) {
var retObj = new Object;
retObj.success = true;
retObj.errorType = '';
if (this.hasPaperPricing) {
var paperPricingObj = this.GetPaperPricingObj();
retObj.success = this.IsValidInkPaper(inkFID, inkBID, paperPricingObj.paperID);
this.ConcErrorMsg(retObj, AdjustTypeEnum.Ink);
}
return retObj;
};

ProductPricing.prototype.HandleMailingBlankEnvelopes = function() {
 if (this.hasMailingPricing && this.hasBlankEnvelopePricing) {
 var mailingPricingObj = MailingPricings[this.mailingPricingID];
 var blackImprinting;
 if (this.productID == ProductIDEnum.greeting_cards ||
 this.productID == ProductIDEnum.holiday_deluxe_greeting_card ||
 this.productID == ProductIDEnum.holiday_premium_greeting_card ||
 this.productID == ProductIDEnum.note_cards ||
 this.productID == ProductIDEnum.holiday_deluxe_note_card ||
 this.productID == ProductIDEnum.holiday_premium_note_card) {

 blackImprinting = AttributeValueIDEnum.imprint_return_address_in_black;
 }

 if (mailingPricingObj.mailingQuantity && mailingPricingObj.mailingMethod) {
 var msg = '';
 var isValidFold = true;
 var isValidEnvelopes = true;
 var isValidMailingQuantity = true;

 var fold = this.GetFold();
 if (fold != AttributeValueIDEnum.fold_half_fold) {
 msg += 'Half fold is required for mailing.\n';
 isValidFold = false;
 }

 if (this.hasEnvelopeImprintPricing) {
 var printedEnvelopePricingObj = PrintedEnvelopePricings[this.blankEnvelopeImprintID];
 if (printedEnvelopePricingObj.finishingPricingObj.finishingID != blackImprinting) {
 printedEnvelopePricingObj.finishingPricingObj.finishingID = blackImprinting;
 msg += 'Printed Envelopes are required for mailing.\n';
 isValidEnvelopes = false;
 }
 }

 if (this.hasBlankEnvelopePricing) {
 var blankEnvelopPricingObj = BlankEnvelopePricings[this.blankEnvelopePricingID];
 if (blankEnvelopPricingObj.blankEnvelopeQuantity == '' || blankEnvelopPricingObj.blankEnvelopeQuantity < mailingPricingObj.mailingQuantity) {
 msg += 'Mailing quantity cannot be greater than the envelope quantity.\n';
 isValidMailingQuantity = false;
 }
 }

 if (msg != "") {
 alert(msg);
 }

 if (!isValidFold) {
 this.SetFold(AttributeValueIDEnum.fold_half_fold);
 }

 if (!isValidEnvelopes) {
 this.SetPrintedEnvelope(blackImprinting);
 }

 if (!isValidMailingQuantity) {
 blankEnvelopPricingObj.SetEnvelopeQuantity(mailingPricingObj.mailingQuantity);
 }
 }
 }
};

ProductPricing.prototype.HandleAllMailing = function(allMailing) {
if (this.hasShipTypePricing) {
ShipTypePricings[this.shipTypePricingID].HandleAllMailing(allMailing);
}
};

ProductPricing.prototype.HandleMailingChange = function() {
 var ret = true;
 if (this.hasAqueousPricing) {
 var aqueousPricingObj = AqueousPricings[this.aqueousPricingID];
 var paperPricingObj = this.GetPaperPricingObj();
 ret = ret && aqueousPricingObj.ValidateAqueous(paperPricingObj.paperID, aqueousPricingObj.coatingFID, aqueousPricingObj.mustNotCoat, false)
 }
if (this.hasFoldPricing) {
var foldPricingObj = FoldPricings[this.foldPricingID];
ret = ret && foldPricingObj.ValidateFold(this.productID, foldPricingObj.finishingPricingObj.finishingID, this.IsCoverPaper(), false, false);
}
return ret;
};

ProductPricing.prototype.HasMailing = function() {
return (this.hasMailingPricing && MailingPricings[this.mailingPricingID].HasMailing());
};

ProductPricing.prototype.IsCoverPaper = function(paperID) {
var paperPricingObj = this.GetPaperPricingObj();
 if(typeof(paperID) == 'undefined') {
 paperID = paperPricingObj.paperID;
}
return (paperPricingObj && paperPricingObj.IsCoverPaper(paperID));
};

ProductPricing.prototype.GetPaperWeightID = function(paperID) {
var paperPricingObj = this.GetPaperPricingObj();
return (paperPricingObj && paperPricingObj.GetPaperWeightID((typeof(paperID) != 'undefined') ? paperID : paperPricingObj.paperID));
};

ProductPricing.prototype.GetTierID = function(paperID) {
var paperPricingObj = this.GetPaperPricingObj();
return (paperPricingObj && paperPricingObj.GetTierID((typeof(paperID) != 'undefined') ? paperID : paperPricingObj.paperID));
};

ProductPricing.prototype.IsValidInkPaper = function(inkFID, inkBID, paperID) {
 var paperPricingObj = this.GetPaperPricingObj();
 // IMPORTANT: Replace the following hard-coded value by generating a JS Enum file from InkEnum.cs
 if (inkBID != '' && paperID == AttributeValueIDEnum.paper_13_pt_magnet_stock) {
 alert(paperPricingObj.GetPaperName(paperID) + ' cannot be printed on the back side.');
 return false;
 }
 else if (inkBID == '' && this.productID == ProductIDEnum.business_cards) {
 if (this.hasInkPricing) {
 for (var inkPricingID in InkPricings) {
 inkPricingObj = InkPricings[inkPricingID];
 if (inkPricingObj.productPricingObj == this && (typeof (coverInside) == 'undefined')) {
 inkPricingObj.ChangeInkImage(AttributePlacementEnum.back, inkBID, paperID);
 }
 }
 }
 return true;
 }
 return true;
};

ProductPricing.prototype.HandleShowSubmitChanges = function() {
 if (this.isChangeProductOptions) {
 var anyChangesMade = (
(this.hasInstaPrice && typeof (InstaPrices) != 'undefined' && InstaPrices[this.instaPriceID].IsChanged()) ||
(this.hasInkPricing && typeof (InkPricings) != 'undefined' && InkPricings[this.inkPricingID].IsChanged()) ||
(this.hasSpotPricing && typeof (SpotPricings) != 'undefined' && SpotPricings[this.spotPricingID].IsChanged()) ||
(this.hasInsideInkPricing && typeof (InkPricings) != 'undefined' && InkPricings[this.insideInkPricingID] && InkPricings[this.insideInkPricingID].IsChanged()) ||
(this.hasNumPagesPricing && typeof (NumPagesPricings) != 'undefined' && NumPagesPricings[this.numPagesPricingID].IsChanged()) ||
(this.hasAqueousPricing && typeof (AqueousPricings) != 'undefined' && AqueousPricings[this.aqueousPricingID].IsChanged()) ||
(this.hasPaperPricing && typeof (PaperPricings) != 'undefined' && PaperPricings[this.paperPricingID].IsChanged()) ||
(this.hasInsidePaperPricing && typeof (PaperPricings) != 'undefined' && PaperPricings[this.insidePaperPricingID] && PaperPricings[this.insidePaperPricingID].IsChanged()) ||
(this.hasFoldPricing && typeof (FoldPricings) != 'undefined' && FoldPricings[this.foldPricingID].finishingPricingObj.IsChanged()) ||
(this.hasSizePricing && typeof (SizePricings) != 'undefined' && SizePricings[this.sizePricingID].IsChanged()) ||
(this.hasSealPricing && typeof (SealPricings) != 'undefined' && SealPricings[this.sealPricingID].finishingPricingObj.IsChanged()) ||
(this.hasLanyardPricing && typeof (LanyardPricings) != 'undefined' && LanyardPricings[this.lanyardPricingID].finishingPricingObj.IsChanged()) ||
(this.hasRoundCornerPricing && typeof (RoundCornerPricings) != 'undefined' && (RoundCornerPricings[this.roundCornerPricingID].finishingPricingObj.IsChanged() || RoundCornerPricings[this.roundCornerPricingID].IsChanged())) ||
(this.hasBlankEnvelopePricing && typeof (BlankEnvelopePricings) != 'undefined' && BlankEnvelopePricings[this.blankEnvelopePricingID].IsChanged()) ||
(this.hasSecondSheetPricing && typeof (SecondSheetPricings) != 'undefined' && SecondSheetPricings[this.secondSheetPricingID].IsChanged()) ||
(this.hasTurnaroundPricing && typeof (TurnaroundPricings) != 'undefined' && TurnaroundPricings[this.turnaroundPricingID].IsChanged()) ||
(this.hasShipTypePricing && typeof (ShipTypePricings) != 'undefined' && ShipTypePricings[this.shipTypePricingID].IsChanged()) ||
(this.hasMailingPricing && typeof (MailingPricings) != 'undefined' && MailingPricings[this.mailingPricingID].IsChanged()) ||
(this.hasPocketSlitPricing && typeof (PocketSlitPricings) != 'undefined' && PocketSlitPricings[this.pocketSlitPricingID].IsChanged()) ||
(this.hasNameQtyPricing && typeof (NameQtyPricings) != 'undefined' && NameQtyPricings[this.nameQtyPricingID].IsChanged()) ||
(this.hasConversionPricing && typeof (ConversionPricings) != 'undefined' && ConversionPricings[this.conversionPricingID].finishingPricingObj.IsChanged()) ||
(this.hasBindingPricing && typeof (BindingPricings) != 'undefined' && (FinishingPricings[BindingPricings[this.bindingPricingID].rblSheetsPerUnitID].IsChanged() || FinishingPricings['Cover'].IsChanged() || FinishingPricings['Backing'].IsChanged())) ||
(this.hasVariableDataPricing && typeof (VariableDataPricings) != 'undefined' && FinishingPricings[VariableDataPricings[this.variableDataPricingID].rblImprintID].IsChanged()) ||
(this.hasVariableDataPricing && typeof (VariableDataPricings) != 'undefined' && FinishingPricings[VariableDataPricings[this.variableDataPricingID].ddImprintColorID].IsChanged()) ||
(this.hasNameQtyPricing && typeof (NameQtyPricings) != 'undefined' && NameQtyPricings[this.nameQtyPricingID].IsChanged())
);
 if (ConfirmAsIss[this.confirmAsIsID]) {
 ConfirmAsIss[this.confirmAsIsID].ConfirmChanges(anyChangesMade);
 }
 }
};

ProductPricing.prototype.HasInsidePages = function() {
 var numPages = this.GetNumPages();
 return (this.productID == ProductIDEnum.catalogs_5_5x8_5 && numPages > 8) || (this.productID == ProductIDEnum.catalogs_8_5x11 && numPages > 4) || this.productID == ProductIDEnum.calendars_5_5x8_5 || this.productID == ProductIDEnum.calendars_8_5x11;
};

ProductPricing.prototype.GetPartsPerSignature = function() {
return productInfoArr[this.productID][PRODUCTINFO_IDX_PARTSPERSIGNATURE];
};

// returns inside signature count when true, otherwise total signature count.
ProductPricing.prototype.GetPartCount = function(inside) {
 if(typeof(inside) == 'undefined') {
 inside = false;
 }
 return inside ? (this.GetNumPages() / 4) - this.GetPartsPerSignature() : (this.GetNumPages() / 4);
};

ProductPricing.prototype.CreateSignatures = function(inkFID, inkBID, paperID, drillholeID, foldCollateStapleID, coverInside, spotFID, spotBID) {
 var partAttributes = new Array();
 this.AddPartAttribute(partAttributes, AttributeIDEnum.ink, inkFID, AttributePlacementEnum.front);
 this.AddPartAttribute(partAttributes, AttributeIDEnum.ink, inkBID, AttributePlacementEnum.back);
 this.AddPartAttribute(partAttributes, AttributeIDEnum.spot, spotFID, AttributePlacementEnum.front);
 this.AddPartAttribute(partAttributes, AttributeIDEnum.spot, spotBID, AttributePlacementEnum.back);
 this.AddPartAttribute(partAttributes, AttributeIDEnum.paper, paperID, null);
 if (drillholeID != null && typeof(pricedPerSignatureArr[drillholeID]) != 'undefined' && pricedPerSignatureArr[drillholeID][PRICEDPERSIGNATURE_IDX_BOOL] == true) {
 this.AddPartAttribute(partAttributes, AttributeIDEnum.drillholes, drillholeID, null);
 }
 if (foldCollateStapleID != null && typeof(pricedPerSignatureArr[foldCollateStapleID]) != 'undefined' && pricedPerSignatureArr[foldCollateStapleID][PRICEDPERSIGNATURE_IDX_BOOL] == true) {
 this.AddPartAttribute(partAttributes, AttributeIDEnum.foldcollatestaple, foldCollateStapleID, null);
 }

 var partsPerSignature = this.GetPartsPerSignature();

 var numParts = partsPerSignature; // we will be creating at least one compelete signature (the cover) for IP.
 if (typeof (coverInside) != 'undefined') {
 numParts = (this.GetNumPages() / 4); // if coverInside is defined, we will be creating all signatures or just inside.
 if (coverInside == CoverInsideEnum.ForInside) {
 numParts -= partsPerSignature; // remove the cover parts (one whole signature 11x17 sheet).
 }
 else if (coverInside == CoverInsideEnum.ForCover) {
 numParts = partsPerSignature;
 }
 }

 var parts = new Array();

 for (var i = 0; i < numParts; i++) {
 parts.push(new Part(i, partAttributes));
 }

 return CreateSignatureCollection(parts, partsPerSignature);
};

ProductPricing.prototype.AddPartAttribute = function(partAttributes, attributeID, attributeValueID, attributePlacement) {
if (attributeValueID != null) {
partAttributes.push(new PartAttribute(attributeID, attributeValueID, attributePlacement));
}
};

ProductPricing.prototype.HandleAttributePrices = function(adjustType) {
this.AdjustPrices(adjustType);
this.HandleShowSubmitChanges();
};

ProductPricing.prototype.GetPercentCollection = function(markupPercent, multiVersionPercent) {
var percentList = new Array();
if (ChannelPricingPercent != 1) {
 percentList.push(new PricingPercent(PricingPercentTypeEnum.Channel, ChannelPricingPercent));
}
if (markupPercent != 0)
{
 percentList.push(new PricingPercent(PricingPercentTypeEnum.Markup, markupPercent));
}
if (multiVersionPercent != 1)
{
 percentList.push(new PricingPercent(PricingPercentTypeEnum.MultiVersion, multiVersionPercent));
}
var percentCollection = new PricingPercentCollection(percentList);
return percentCollection;
};
// END - Validation


//Product Pricing PD_Pricing
ProductPricing.prototype.GetProductPrice = function(percentCollection) {
var instaPriceObj = InstaPrices[this.instaPriceID];
percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.Product, ChannelID);

var price = 0;
// Calculate product price
if (this.quantityList.length != 0) { //business cards
for(var i = 0, loopCnt = this.quantityList.length; i < loopCnt; i++) { //loop through version quantities
price += this.CalculateProductPrice(this.quantityList[i], productPricingArr[this.productID][PRODUCT_IDX_BASE], productPricingArr[this.productID][PRODUCT_IDX_EACH], percentCollection);
}
}
else { //one quantity products
price = this.CalculateProductPrice(this.quantity, productPricingArr[this.productID][PRODUCT_IDX_BASE], productPricingArr[this.productID][PRODUCT_IDX_EACH], percentCollection);
}
return price;
};

ProductPricing.prototype.CalculateProductPrice = function(quantity, productBase, productEach, percentCollection) {
var price = 0;

if (quantity > 0) //check that the quantity is greater than zero
{
price = productBase + (quantity * productEach);
}

if (typeof(percentCollection) != 'undefined') {
return percentCollection.ApplyPricingPercents(price);
}
else {
return FormatDollar(price);
}
};
//END - PD_Pricing


ProductPricing.prototype.GetMultipleVersionPricingPercent = function(versionNo) {
//check for NO value in versionNo or No multiversion array for given product
var multipleVersionPricingPercent = 1;
if (versionNo != '' && versionNo != null && versionNo > 0 && typeof(multipleVersionPricingArr[this.productID]) != 'undefined') {
for(var i = multipleVersionPricingArr[this.productID].length-1; i >= 0; i--) {
if (i <= versionNo && typeof(multipleVersionPricingArr[this.productID][i]) != 'undefined') {
multipleVersionPricingPercent = multipleVersionPricingArr[this.productID][i];
break;
}
}
}
return multipleVersionPricingPercent;
};

ProductPricing.prototype.GetChangePaperPrice = function() {
if (this.hasInstaPrice) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var paperElem = $(instaPriceObj.lblChangePaperID);
if (typeof (paperElem) != 'undefined') {
return paperElem.innerHTML;
}
}
return 0;
};

ProductPricing.prototype.GetChangeCoatingPrice = function() {
if (this.hasInstaPrice) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var coatingElem = $(instaPriceObj.lblChangeAqueousID);
if (typeof (coatingElem) != 'undefined') {
return coatingElem.innerHTML;
}
}
return 0;
};

ProductPricing.prototype.GetChangeInsidePaperPrice = function() {
if (this.hasInstaPrice) {
var instaPriceObj = InstaPrices[this.instaPriceID];
var insidePaperElem = $(instaPriceObj.lblChangeInsidePaper);
if (typeof (insidePaperElem) != 'undefined') {
return insidePaperElem.innerHTML;
}
}
return 0;
};

ProductPricing.prototype.SetPaper = function(paperID) {
if (this.hasPaperPricing) {
var paperPricingObj = this.GetPaperPricingObj();
paperPricingObj.SetPaper(paperID);
}
};

ProductPricing.prototype.SetTemplateInfo = function(templateProductID, pricingType) {
 this.TemplateProductID = templateProductID;
 this.PricingType = pricingType;
};var ProofTypePricings;

function ProofTypePricing(proofTypePricingID, discountID, proofType) {

 for (var prop in ProductPricings) {
 if (ProductPricings[prop].orderingPage != "undefined") {
 this.proofTypePricingID = proofTypePricingID
 this.discountID = discountID

 this.InsertProofTypePricing();

 this.ChangeProofType(proofType); //set prices onload
 break;
 }
 }
}

ProofTypePricing.prototype.InsertProofTypePricing = function() {
 if (typeof (ProofTypePricings) == 'undefined') {
 ProofTypePricings = new Object;
 }
 ProofTypePricings[this.proofTypePricingID] = this;
};

ProofTypePricing.prototype.ChangeProofType = function(proofType) {
var discount = 0;
var discountElem = $(this.discountID);
if (discountElem) {
discount = parseFloat(discountElem.value);
}
this.proofSavings = this.GetProofSavings(proofType);
return true;
};

ProofTypePricing.prototype.GetProofSavings = function(proofType) {
 var savings;
 switch (proofType) {
 case ProofTypeEnum.PPValue: savings = 100; break;
 case ProofTypeEnum.DHPValue: savings = 30; break;
 default: savings = 0; break;
 }
 return savings;
};

ProofTypePricing.prototype.RenderPrice = function(lblID, price) {
 var lblElem = $(lblID);
 if (lblElem) {
 lblElem.innerHTML = FormatPrice(price);
 }
 return true;
};var RoundCornerPricings;

function RoundCornerPricing(finishingPricingID, finishingID, txtRoundCornerCommentsID, rblName) {
this.finishingPricingID = finishingPricingID;
this.txtRoundCornerCommentsID = txtRoundCornerCommentsID;
var roundCornerElem = $(this.txtRoundCornerCommentsID);
 if (roundCornerElem != null && typeof (roundCornerElem) != 'undefined') {
 this.txtRoundCornerCommentsOri = roundCornerElem.value;
}
this.finishingPricingObj = new FinishingPricing(finishingPricingID, finishingID, '');
this.rblName = rblName;

this.InsertRoundCornerPricing();
}

RoundCornerPricing.prototype.InsertRoundCornerPricing = function() {
if (typeof (RoundCornerPricings) == 'undefined') {
RoundCornerPricings = new Object;
}
RoundCornerPricings[this.finishingPricingObj.finishingPricingID] = this;
};

RoundCornerPricing.prototype.ResetRoundCorner = function() {
SetRadioButtonListChecked(this.rblName, this.finishingPricingObj.finishingID);
};

RoundCornerPricing.prototype.IsChanged = function() {
var roundCornerElem = $(this.txtRoundCornerCommentsID);
if (roundCornerElem != null && typeof (roundCornerElem) != 'undefined' && roundCornerElem.value != this.txtRoundCornerCommentsOri) {
return true;
}
return false;
};

RoundCornerPricing.prototype.ChangeRoundCorner = function(finishingID) {
this.finishingPricingObj.SetFinishingID(finishingID);
this.SetRoundCornerComments();

if (this.productPricingObj) {
this.productPricingObj.HandleAttributePrices(AdjustTypeEnum.RoundCorner);
}
};

RoundCornerPricing.prototype.ChangeRoundCornerComments = function() {
if (this.IsChanged() && this.productPricingObj) {
this.productPricingObj.HandleShowSubmitChanges();
}
};

RoundCornerPricing.prototype.SetRoundCornerComments = function() {
var roundCornerElem = $(this.txtRoundCornerCommentsID);
if (roundCornerElem != null && typeof (roundCornerElem) != 'undefined') {
var roundCornerComments = roundCornerElem.value;
if (this.finishingPricingObj.finishingID != "" && roundCornerComments == "") {
roundCornerElem.value = "All four corners";
}
else if (this.finishingPricingObj.finishingID == "") {
roundCornerElem.value = "";
}
}
};/// <reference path="Enums/AttributeValueIDEnum.js" />
var SealPricings;
var VALIDATE_SEAL = 'Seal';

function SealPricing(finishingPricingID, finishingID, rblName) {
this.finishingPricingObj = new FinishingPricing(finishingPricingID, finishingID, rblName);

this.InsertSealPricing();
}

SealPricing.prototype.InsertSealPricing = function() {
if (typeof(SealPricings) == 'undefined') {
SealPricings = new Object;
}
SealPricings[this.finishingPricingObj.finishingPricingID] = this;
};

SealPricing.prototype.ResetSeal = function() {
 SetRadioButtonListChecked(this.rblName, this.finishingID);
};

SealPricing.prototype.ChangeSeal = function(finishingID) {
this.ValidateSeal(((this.productPricingObj) ? this.productPricingObj.GetPaperID() : null), finishingID, false);

if (this.productPricingObj) {
this.productPricingObj.AdjustPrices(AdjustTypeEnum.Seal);
this.productPricingObj.HandleShowSubmitChanges();
}
};

SealPricing.prototype.ValidateSeal = function(paper, finishingID, forPaperChange) {
var ret = this.IsValidSeal(paper, finishingID, forPaperChange);
if (!ret.VALIDATE_RESULT) {
if (ret.VALIDATE_MESSAGE) {
alert(ret.VALIDATE_MESSAGE);
}
this.finishingPricingObj.SetFinishingID(ret.VALIDATE_FINISHINGID);
}
else {
this.finishingPricingObj.finishingID = finishingID;
}
return ret.VALIDATE_RESULT;
};

SealPricing.prototype.IsValidSeal = function(paper, finishingID, forPaperChange) {
if (paper == AttributeValueIDEnum.paper_24lb_uncoated && finishingID == AttributeValueIDEnum.seal_peel_seel) {
return this.finishingPricingObj.GetValidationObject(false, 'Peel & Seel is not available on 24 lb stock.', (forPaperChange) ? AttributeValueIDEnum.seal_glue : this.finishingPricingObj.finishingID);
}
return this.finishingPricingObj.GetValidationObject(true);
};var SecondSheetPricings;

function SecondSheetPricing(secondSheetPricingID, secondSheetQuantity, secondSheetQuantityInputID) {
this.secondSheetPricingID = secondSheetPricingID;
this.secondSheetQuantity = secondSheetQuantity;
this.secondSheetQuantityOri = secondSheetQuantity;

this.InsertSecondSheetPricing();
}

SecondSheetPricing.prototype.InsertSecondSheetPricing = function() {
if (typeof(SecondSheetPricings) == 'undefined') {
SecondSheetPricings = new Object;
}
SecondSheetPricings[this.secondSheetPricingID] = this;
};

SecondSheetPricing.prototype.ResetSecondSheetQuantity = function() {
 SetValue(this.secondSheetQuantityInputID, this.secondSheetQuantity);
};

SecondSheetPricing.prototype.ChangeSecondSheetQuantity = function(secondSheetQuantity) {
this.secondSheetQuantity = ParseInt(secondSheetQuantity);

if (this.productPricingObj) {
this.productPricingObj.AdjustPrices(AdjustTypeEnum.SecondSheet);
this.productPricingObj.HandleShowSubmitChanges();
}
};

SecondSheetPricing.prototype.SetSecondSheetQuantity = function(secondSheetQuantity) {
this.secondSheetQuantity = secondSheetQuantity;
};

SecondSheetPricing.prototype.GetSecondSheetPrice = function(productID, paperID, percentCollection) {
if (this.secondSheetQuantity == '' || this.secondSheetQuantity <= 0)
return 0;

var secondSheetPrice;
secondSheetPrice = this.GetSecondSheetBase(productID, paperID) + (this.secondSheetQuantity * this.GetSecondSheetEach(productID, paperID));

percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.SecondSheet, ChannelID);
return this.CalculateSecondSheetPrice(this.secondSheetQuantity, this.GetSecondSheetBase(productID, paperID), this.GetSecondSheetEach(productID, paperID), percentCollection);
};

SecondSheetPricing.prototype.CalculateSecondSheetPrice = function(quantity, secondSheetBase, secondSheetEach, percentCollection) {
var price = 0;

if (quantity > 0) { //check that the quantity is greater than zero
price = (secondSheetBase + (quantity * secondSheetEach));
}

if (typeof(percentCollection) != 'undefined') {
return percentCollection.ApplyPricingPercents(price);
}
else {
return FormatDollar(price);
}
};

SecondSheetPricing.prototype.GetSecondSheetBase = function(productID, paperID) {
 if(typeof(paperID) == 'undefined') {
 paperID = this.paperID;
 }
if (typeof(paperArr[productID][paperID]) != 'undefined') { //get paperID override pricing
return paperArr[productID][paperID][''][PAPER_IDX_SECOND_SHEETS_BASE];
}
else { //get tier pricing
return paperArr[productID][''][this.productPricingObj.GetTierID(paperID)][PAPER_IDX_SECOND_SHEETS_BASE];
}
};

SecondSheetPricing.prototype.GetSecondSheetEach = function(productID, paperID) {
 if(typeof(paperID) == 'undefined') {
 paperID = this.paperID;
 }
if (typeof(paperArr[productID][paperID]) != 'undefined') { //get paperID override pricing
return paperArr[productID][paperID][''][PAPER_IDX_SECOND_SHEETS_EACH];
}
else { //get tier pricing
return paperArr[productID][''][this.productPricingObj.GetTierID(paperID)][PAPER_IDX_SECOND_SHEETS_EACH];
}
};

SecondSheetPricing.prototype.IsChanged = function() {
 return (this.secondSheetQuantityOri != this.secondSheetQuantity);
};
/// <reference path="Enums/AttributeIDEnum.js" />
/// <reference path="Enums/AttributeValueIDEnum.js" />
/// <reference path="Enums/AttributeValueNameEnum.js" />
/// <reference path="Enums/NoValueEnum.js" />
var SheetsPerUnitPricings;

function SheetsPerUnitPricing(finishingPricingID, finishingID, rblName, imageID) {
this.imageID = imageID;
this.finishingPricingObj = new FinishingPricing(finishingPricingID, finishingID, rblName);

this.InsertSheetsPerUnitPricing();
}

SheetsPerUnitPricing.prototype.InsertSheetsPerUnitPricing = function() {
if (typeof (SheetsPerUnitPricings) == 'undefined') {
SheetsPerUnitPricings = new Object;
}
SheetsPerUnitPricings[this.finishingPricingObj.finishingPricingID] = this;
};

SheetsPerUnitPricing.prototype.ResetSheetsPerUnit = function() {
SetRadioButtonListChecked(this.rblName, this.finishingID);
};

SheetsPerUnitPricing.prototype.ChangeSheetsPerUnit = function(finishingID) {
this.finishingPricingObj.finishingID = finishingID;
if (this.productPricingObj) {
this.productPricingObj.HandleAttributePrices(AdjustTypeEnum.SheetsPerUnit);
}
};

SheetsPerUnitPricing.prototype.GetSheetsPerUnitPrice = function(finishingID, quantity, isCoverStock, productID, percentCollection, signatures) {
return this.finishingPricingObj.GetFinishingPrice(finishingID, quantity, productID, percentCollection, signatures, this.productPricingObj.quantityList);
};var ShipTypePricings;

function ShipTypePricing(shipTypePricingID, shipType, rblShipTypeName) {
this.shipTypePricingID = shipTypePricingID;
this.shipType = shipType;
this.shipTypeOri = shipType;
this.rblShipTypeName = rblShipTypeName;

this.InsertShipTypePricing();
}

ShipTypePricing.prototype.InsertShipTypePricing = function() {
if (typeof(ShipTypePricings) == 'undefined') {
ShipTypePricings = new Object;
}
ShipTypePricings[this.shipTypePricingID] = this;
};

ShipTypePricing.prototype.ResetShipType = function() {
 SetRadioButtonListChecked(this.rblShipTypeName, this.shipType);
};

ShipTypePricing.prototype.ChangeShipType = function(shipType) {
this.SetShipType(shipType);

if (this.productPricingObj) {
this.productPricingObj.AdjustPrices(AdjustTypeEnum.ShipType);
this.productPricingObj.HandleShowSubmitChanges();
}
};

ShipTypePricing.prototype.SetShipType = function(shipType) {
this.shipType = shipType;
};

ShipTypePricing.prototype.GetShipTypePrice = function(productID, quantity, paperID, signatures, percentCollection) {
 if (this.shipType == '' || quantity <= 0) {
 return 0;
 }

 // Get paper weight per square inch.
 var weightPerSquareInch = 0;
 if (typeof (signatures) != 'undefined') {
 for (var s = 0, loopCnt = signatures.length; s < loopCnt; s++) {
 weightPerSquareInch += signatures[s].parts.length * paperInfoArr[signatures[s].GetAttributeValueID(AttributeIDEnum.paper)][PAPERINFO_IDX_WEIGHT];
 }
 }
 else {
 if (typeof (paperInfoArr[paperID][PAPERINFO_IDX_WEIGHT]) != 'undefined') {
 weightPerSquareInch = paperInfoArr[paperID][PAPERINFO_IDX_WEIGHT];
 }
 else {
 weightPerSquareInch = 0;
 }
 }

 // Calculate weight per piece.
 var weightPerPiece = weightPerSquareInch * productInfoArr[productID][PRODUCTINFO_IDX_FLATWIDTH] * productInfoArr[productID][PRODUCTINFO_IDX_FLATHEIGHT];

 // Get shipping base and each base on weight per piece.
 for (var weight in shippingWeightArr) {
 if (weightPerPiece <= parseFloat(weight)) {
 break;
 }
 }

 var shipBase = shippingWeightArr[weight][SHIPPINGWEIGHT_IDX_BASE];
 var shipEach = shippingWeightArr[weight][SHIPPINGWEIGHT_IDX_EACH];
 var shippingMuliplier = this.GetShippingPriceMultiplier(productID);

 percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.Shipping, ChannelID);
 return this.CalculateShippingPrice(quantity, shipBase, shipEach, shippingMuliplier, percentCollection);
};

ShipTypePricing.prototype.GetShippingPriceMultiplier = function(productID) {
 var shippingMuliplier = 1;
 if (typeof (shipTypeArr[this.shipType][productID]) != 'undefined') {
 shippingMuliplier = shipTypeArr[this.shipType][productID][SHIPTYPE_IDX_MULTIPLIER];
 }
 else {
 shippingMuliplier = shipTypeArr[this.shipType][''][SHIPTYPE_IDX_MULTIPLIER];
 }
 return shippingMuliplier;
}

ShipTypePricing.prototype.CalculateShippingPrice = function(quantity, shipBase, shipEach, shippingMultiplier, percentCollection) {
var price = 0;
 price = ((shipBase * 1.0) + (shipEach * quantity)) * shippingMultiplier;

if (typeof(percentCollection) != 'undefined') {
return percentCollection.ApplyPricingPercents(price);
}
else {
return FormatDollar(price);
}
};

ShipTypePricing.prototype.HandleAllMailing = function(allMailing) {
SetRadioButtonListDisabled(this.rblShipTypeName, allMailing, 0);
};

ShipTypePricing.prototype.IsChanged = function() {
 return (this.shipTypeOri != this.shipType);
};
var SizePricings;

function SizePricing(sizePricingID, productID, rblSizeName, rblSheetsPerPadName) {
this.sizePricingID = sizePricingID;
this.productID = productID;
this.productIDOri = productID;
this.rblSizeName = rblSizeName;
this.rblSheetsPerPadName = rblSheetsPerPadName;
this.canShowSheetsPerPad = (typeof (rblSheetsPerPadName) != "undefined" && rblSheetsPerPadName != "");

this.InsertSizePricing();
}

SizePricing.prototype.InsertSizePricing = function() {
if (typeof(SizePricings) == 'undefined') {
SizePricings = new Object;
}
SizePricings[this.sizePricingID] = this;
};

SizePricing.prototype.ResetSize = function() {
this.SelectSizeOptions(this.productID);
};

SizePricing.prototype.SelectSizeOptions = function(productID) {
if (this.canShowSheetsPerPad) {
switch (parseIntNull(productID)) {
case ProductIDEnum.post_it_2_75x3_25_sheets:
SetRadioButtonListChecked(this.rblSizeName, ProductIDEnum.post_it_2_75x3_25_sheets);
SetRadioButtonListChecked(this.rblSheetsPerPadName, AttributeValueIDEnum.sheetsperunit_25);
break;
case ProductIDEnum.post_it_2_75x3_50_sheets:
SetRadioButtonListChecked(this.rblSizeName, ProductIDEnum.post_it_2_75x3_25_sheets);
SetRadioButtonListChecked(this.rblSheetsPerPadName, AttributeValueIDEnum.sheetsperunit_50);
break;
case ProductIDEnum.post_it_3x4_25_sheets:
SetRadioButtonListChecked(this.rblSizeName, ProductIDEnum.post_it_3x4_25_sheets);
SetRadioButtonListChecked(this.rblSheetsPerPadName, AttributeValueIDEnum.sheetsperunit_25);
break;
case ProductIDEnum.post_it_3x4_50_sheets:
SetRadioButtonListChecked(this.rblSizeName, ProductIDEnum.post_it_3x4_25_sheets);
SetRadioButtonListChecked(this.rblSheetsPerPadName, AttributeValueIDEnum.sheetsperunit_50);
break;
case ProductIDEnum.post_it_4x6_25_sheets:
SetRadioButtonListChecked(this.rblSizeName, ProductIDEnum.post_it_4x6_25_sheets);
SetRadioButtonListChecked(this.rblSheetsPerPadName, AttributeValueIDEnum.sheetsperunit_25);
break;
case ProductIDEnum.post_it_4x6_50_sheets:
SetRadioButtonListChecked(this.rblSizeName, ProductIDEnum.post_it_4x6_25_sheets);
SetRadioButtonListChecked(this.rblSheetsPerPadName, AttributeValueIDEnum.sheetsperunit_50);
break;
}
}
else {
SetRadioButtonListChecked(this.rblSizeName, productID);
}
};

SizePricing.prototype.ChangeSize = function() {
this.ValidateSize(this.GetSelectedProductID());

if (this.productPricingObj) {
this.productPricingObj.SetSize(this.productID);
this.productPricingObj.AdjustPrices();
this.productPricingObj.HandleShowSubmitChanges();
}

//Update template selection images if a new size is selected!
if (typeof TemplateSelectionArr != "undefined") {
TemplateSelections.initSizeChange();
}
};

SizePricing.prototype.GetSelectedProductID = function() {
var rblSizeVal = parseIntNull(GetRadioCheckedValueByName(this.rblSizeName));
if (this.canShowSheetsPerPad) {
var rblSheetsPerPadVal = GetRadioCheckedValueByName(this.rblSheetsPerPadName);
switch (rblSizeVal) {
case ProductIDEnum.post_it_2_75x3_25_sheets:
switch (rblSheetsPerPadVal) {
case AttributeValueIDEnum.sheetsperunit_50:
return ProductIDEnum.post_it_2_75x3_50_sheets;
default:
return ProductIDEnum.post_it_2_75x3_25_sheets;
}
break;
case ProductIDEnum.post_it_3x4_25_sheets:
switch (rblSheetsPerPadVal) {
case AttributeValueIDEnum.sheetsperunit_50:
return ProductIDEnum.post_it_3x4_50_sheets;
default:
return ProductIDEnum.post_it_3x4_25_sheets;
}
break;
case ProductIDEnum.post_it_4x6_25_sheets:
switch (rblSheetsPerPadVal) {
case AttributeValueIDEnum.sheetsperunit_50:
return ProductIDEnum.post_it_4x6_50_sheets;
default:
return ProductIDEnum.post_it_4x6_25_sheets;
}
break;
}
}
else {
return rblSizeVal;
}
};

SizePricing.prototype.SetSize = function(productID) {
this.productID = productID;
this.SelectSizeOptions(this.productID);
};

SizePricing.prototype.ValidateSize = function(productID) {
var ret = this.IsValidSize(productID);
if (!ret.VALIDATE_RESULT) {
if (ret.VALIDATE_MESSAGE) {
alert(ret.VALIDATE_MESSAGE);
}
this.SetSize(ret.VALIDATE_PRODUCT_ID);
}
else {
this.productID = productID;
}
return ret.VALIDATE_RESULT;
};

SizePricing.prototype.IsValidSize = function(productID) {
if (this.productPricingObj) {
if (!this.productPricingObj.HandleSizeChange(productID)) {
return this.GetValidationObject(false, '', this.productID);
}
}
return this.GetValidationObject(true);
};

SizePricing.prototype.GetValidationObject = function(validateResult, validateMessage, productID) {
return {
VALIDATE_RESULT : validateResult,
VALIDATE_MESSAGE : validateMessage,
VALIDATE_PRODUCT_ID : productID
};
};

SizePricing.prototype.IsChanged = function() {
 return (this.productIDOri != this.productID);
};
var SpotPricings;
var VALIDATE_SPOT = 'Spot';

function SpotPricing(spotPricingID, spotFID, spotBID, coverInside) {
this.spotPricingID = spotPricingID;
this.spotFID = spotFID;
this.spotBID = spotBID;
this.spotFIDOri = spotFID;
this.spotBIDOri = spotBID;
this.coverInside = coverInside;
new FinishingPricing(this.spotPricingID, this.GetWashUpID(), '');
this.InsertSpotPricing();
}

SpotPricing.prototype.InsertSpotPricing = function() {
if (typeof(SpotPricings) == 'undefined') {
SpotPricings = new Object;
}
SpotPricings[this.spotPricingID] = this;
};

SpotPricing.prototype.ChangeSpot = function(side, spotID, coverInside) {
this.ValidateSpot(side, spotID, coverInside);

if (this.productPricingObj) {
this.productPricingObj.AdjustPrices(AdjustTypeEnum.Spot, this.spotPricingID);
this.productPricingObj.HandleShowSubmitChanges();
}
};

SpotPricing.prototype.GetSpot = function(side) {
 if (typeof (side) != 'undefined') {
 return (side == AttributePlacementEnum.front) ? this.spotFID : (side == AttributePlacementEnum.back) ? this.spotBID : (side == AttributePlacementEnum.inside) ? this.spotFID : this.spotFID + '/' + this.spotBID;
 }
};

SpotPricing.prototype.SetSpot = function(side, spotID) {
if (side == AttributePlacementEnum.front) {
this.spotFID = spotID;
}
else if (side == AttributePlacementEnum.back) {
this.spotBID = spotID;
}
if (typeof (FinishingPricings[this.spotPricingID]) != 'undefined') {
FinishingPricings[this.spotPricingID].finishingID = this.GetWashUpID();
}
};

SpotPricing.prototype.GetTotalSpotPrice = function(productID, spotFID, spotBID, quantity, signatures, percentCollection) {
var price = 0;
if (typeof (signatures) != 'undefined' && signatures != null) {
for (var s = 0, loopCnt = signatures.length; s < loopCnt; s++) {
price += this.GetSpotPrice(productID, signatures[s].GetAttributeValueID(AttributeIDEnum.spot, AttributePlacementEnum.front), quantity, signatures[s].TotalSignaturePricingPercent(), percentCollection) +
this.GetSpotPrice(productID, signatures[s].GetAttributeValueID(AttributeIDEnum.spot, AttributePlacementEnum.back), quantity, signatures[s].TotalSignaturePricingPercent(), percentCollection);
}
}
else {
price = this.GetSpotPrice(productID, spotFID, quantity, 1, percentCollection) +
this.GetSpotPrice(productID, spotBID, quantity, 1, percentCollection);
}
return price;
};

SpotPricing.prototype.GetSpotPrice = function(productID, spotID, quantity, signaturePricingPercent, percentCollection) {
 var price = 0;
 if (spotID == '') {
 return price;
 }

 var quantityBreak = 0;
 var productIndex;
 if (typeof (finishingArr[spotID][productID]) != 'undefined') {
 productIndex = productID;
 }
 else { //no product override
 productIndex = '';
 }

 // Find the biggest quantity break that is less than or equal to the given quantity
 for (var arrQty in finishingArr[spotID][productIndex]) {
 if (!isNaN(arrQty)) {
 var arrQtyNum = parseInt(arrQty);
 if (quantity >= arrQtyNum && quantityBreak < arrQtyNum) {
 quantityBreak = arrQtyNum;
 }
 }
 }

 var spotBase = finishingArr[spotID][productIndex][quantityBreak][FINISHING_IDX_BASE];
 var spotEach = finishingArr[spotID][productIndex][quantityBreak][FINISHING_IDX_EACH];
 var setupCharge = finishingArr[spotID][productIndex][quantityBreak][FINISHING_IDX_SET_UP_CHARGE];

percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.Spot, ChannelID);

// Calculate spot price
if (this.productPricingObj && this.productPricingObj.quantityList.length != 0) { //business cards
var quantityList = this.productPricingObj.quantityList;
for(var i = 0, loopCnt = quantityList.length; i < loopCnt; i++) { //loop through version quantities
price += this.CalculateSpotPrice(quantityList[i], signaturePricingPercent, spotBase, spotEach, percentCollection, setupCharge);
}
}
else { //one quantity products
price = this.CalculateSpotPrice(quantity, signaturePricingPercent, spotBase, spotEach, percentCollection, setupCharge);
}
return price;
};

SpotPricing.prototype.GetSpotName = function(spotID) {
switch (spotID) {
case AttributeValueIDEnum.spot_spot_1:
return 1;
case AttributeValueIDEnum.spot_spot_2:
return 2;
case AttributeValueIDEnum.spot_spot_3:
return 3;
case AttributeValueIDEnum.spot_spot_4:
return 4;
case AttributeValueIDEnum.spot_spot_5:
return 5;
default:
return null;
}
};

SpotPricing.prototype.GetWashUpID = function() {
 var spotNumber = 0;
 var FrontSpotNumber = this.GetSpotName(this.spotFID);
 var BackSpotNumber = this.GetSpotName(this.spotBID);
 if (!(FrontSpotNumber == null) && !(BackSpotNumber == null)) {
 if (FrontSpotNumber >= BackSpotNumber) {
 spotNumber = FrontSpotNumber;
 } else {
 spotNumber = BackSpotNumber;
 }
 } else if (!(FrontSpotNumber == null)) {
 spotNumber = FrontSpotNumber;
 } else if (!(BackSpotNumber == null)) {
 spotNumber = BackSpotNumber;
 }
 switch (spotNumber) {
 case 1:
 return AttributeValueIDEnum.washup_wash_up_charge_1;
 break;
 case 2:
 return AttributeValueIDEnum.washup_wash_up_charge_2;
 break;
 case 3:
 return AttributeValueIDEnum.washup_wash_up_charge_3;
 break;
 case 4:
 return AttributeValueIDEnum.washup_wash_up_charge_4;
 break;
 case 5:
 return AttributeValueIDEnum.washup_wash_up_charge_5;
 break;
 default:
 return null;
 }
};

SpotPricing.prototype.CalculateSpotPrice = function(quantity, signaturePricingPercent, spotBase, spotEach, percentCollection, setupCharge) {
var price;

price = signaturePricingPercent * (spotBase + (quantity * spotEach)) + setupCharge;

if (typeof(percentCollection) != 'undefined') {
return percentCollection.ApplyPricingPercents(price);
}
else {
return FormatDollar(price);
}
};

SpotPricing.prototype.ValidateSpot = function(side, spotID, coverInside) {
var ret = this.IsValidSpot(side, spotID, coverInside);
if (!ret.VALIDATE_RESULT) {
if (ret.VALIDATE_MESSAGE) {
alert(ret.VALIDATE_MESSAGE);
}
this.SetSpot(side, ret.VALIDATE_SPOT);
}
else {
this.SetSpot(side, spotID, coverInside);
}
return ret.VALIDATE_RESULT;
};

SpotPricing.prototype.IsValidSpot = function(side, spotID, coverInside) {
return this.GetValidationObject(true);
};

SpotPricing.prototype.GetValidationObject = function(validateResult, validateMessage, spotID) {
return {
VALIDATE_RESULT : validateResult,
VALIDATE_MESSAGE : validateMessage,
VALIDATE_SPOT : spotID
};
};

SpotPricing.prototype.IsChanged = function() {
 return (this.spotFIDOri != this.spotFID || this.spotBIDOri != this.spotBID);
};
var TurnaroundPricings;

function TurnaroundPricing(turnaroundPricingID, turnaround, rblName, turnaroundDaysNormal) {
this.turnaroundPricingID = turnaroundPricingID;
this.turnaround = turnaround;
this.turnaroundOri = turnaround;
this.rblName = rblName;
this.turnaroundDaysNormal = turnaroundDaysNormal;

this.InsertTurnaroundPricing();
}

TurnaroundPricing.prototype.InsertTurnaroundPricing = function() {
if (typeof(TurnaroundPricings) == 'undefined') {
TurnaroundPricings = new Object;
}
TurnaroundPricings[this.turnaroundPricingID] = this;
};

TurnaroundPricing.prototype.ResetTurnaround = function() {
 SetRadioButtonListChecked(this.rblName, this.turnaround);
};

TurnaroundPricing.prototype.ChangeTurnaround = function(turnaround) {
this.SetTurnaround(turnaround);

if (this.productPricingObj) {
this.productPricingObj.AdjustPrices(AdjustTypeEnum.Turnaround);
this.productPricingObj.HandleShowSubmitChanges();
}
};

TurnaroundPricing.prototype.SetTurnaround = function(turnaround) {
this.turnaround = turnaround;
};

TurnaroundPricing.prototype.GetTurnaroundPrice = function(productID, printingSubtotal, percentCollection, pflProSettings, turnaroundCode) {
 if (typeof (turnaroundCode) == 'undefined') {
 var turnaroundCode = this.turnaround;
 }
 if (turnaroundCode == '') {
 return 0;
 }
 percentCollection.SetCanApplyPercentVariables(AdjustTypeEnum.Turnaround, ChannelID);

 // Standard Turnaround Price
 var price = this.CalculateTurnaroundPrice(printingSubtotal, turnaroundArr[productID][turnaroundCode], percentCollection);
 if (typeof (pflProSettings) != 'undefined' && pflProSettings != null) {
 var AdditionalDays = Math.max(0, this.GetTurnaroundLevel(turnaroundCode) - pflProSettings.FreeDaysRush);
 var proPrice = 0;
 var fastPrice = this.GetTurnaroundPrice(productID, printingSubtotal, percentCollection, null, this.GetTurnaroundCode(productID, "F"));
 var rushPrice = this.GetTurnaroundPrice(productID, printingSubtotal, percentCollection, null, this.GetTurnaroundCode(productID, "R"));
 switch (AdditionalDays) {
 case 0:
 break;
 case 1:
 if (this.GetAdditionalDays(pflProSettings).length >= 1) {
 proPrice += Math.min(fastPrice, this.GetAdditionalDays(pflProSettings)[0]);
 }
 else {
 proPrice += fastPrice;
 }
 break;
 case 2:
 switch (this.GetAdditionalDays(pflProSettings).length) {
 case 1:
 proPrice += Math.min(rushPrice, (this.GetAdditionalDays(pflProSettings)[0] + fastPrice));
 break;
 case 2:
 proPrice += Math.min(rushPrice, (this.GetAdditionalDays(pflProSettings)[0] + this.GetAdditionalDays(pflProSettings)[1]));
 break;
 default:
 proPrice += rushPrice;
 break;
 }
 break;
 case 3:
 var superPrice = this.GetTurnaroundPrice(productID, printingSubtotal, percentCollection, null, this.GetTurnaroundCode(productID, "SR"));
 switch (this.GetAdditionalDays(pflProSettings).length)
 {
 case 1:
 proPrice += Math.min(superPrice, (this.GetAdditionalDays(pflProSettings)[0] + rushPrice));
 break;
 case 2:
 proPrice += Math.min(
 Math.min(superPrice, (this.GetAdditionalDays(pflProSettings)[0] + this.GetAdditionalDays(pflProSettings)[1] + fastPrice)),
 (this.GetAdditionalDays(pflProSettings)[0] + fastPrice + rushPrice));
 break;
 default:
 proPrice += superPrice;
 break;
 }
 break;
 default:
 proPrice = price;
 break;
 }

 return Math.min(proPrice, price);
 }
 else {
 return price;
 }
};

TurnaroundPricing.prototype.GetAdditionalDays = function(pflProSettings) {
 var _additionalDays = new Array;
 if (pflProSettings.CostAddlDays1 != null && pflProSettings.CostAddlDays1 > 0) {
 if (pflProSettings.CostAddlDays2 != null && pflProSettings.CostAddlDays2 > 0) {
 _additionalDays[0] = pflProSettings.CostAddlDays1;
 _additionalDays[1] = pflProSettings.CostAddlDays2;
 }
 else {
 _additionalDays[0] = pflProSettings.CostAddlDays1;
 }
 }
 return _additionalDays;
}

TurnaroundPricing.prototype.GetTurnaroundCode = function(productID, type) {
var CurrentTurnaround;
var TurnaroundCode;
for (CurrentTurnaround in turnaroundArr[productID]) {
if (CurrentTurnaround.indexOf(type) >= 0) {
TurnaroundCode = CurrentTurnaround;
break;
}
}
return TurnaroundCode;
}

TurnaroundPricing.prototype.GetTurnaroundDays = function(TurnaroundCode, FreeDaysRush) {
 return Math.max(0, StripNonNumeric(TurnaroundCode) - FreeDaysRush);
}

TurnaroundPricing.prototype.GetTurnaroundLevel = function(TurnaroundCode) {
 var turnaroundSpeeds = "NFRS";
 return Math.max(0, turnaroundSpeeds.indexOf(TurnaroundCode.substring(0, 1)));
}

TurnaroundPricing.prototype.CalculateTurnaroundPrice = function(printingSubTotal, priceMultiplier, percentCollection) {
// NOTE that pricing percent and markup percent are already included in printingSubtotal so do not multiply here
// Added percentCollection for other possible percents in the future
var price = 0;
price = FormatDollar(printingSubTotal * priceMultiplier);

if (typeof (percentCollection) != 'undefined') {
return percentCollection.ApplyPricingPercents(price);
}
else {
return FormatDollar(price);
}
};

TurnaroundPricing.prototype.IsChanged = function() {
 return (this.turnaroundOri != this.turnaround);
};
var UpgradeDiscounts;

function UpgradeDiscount(upgradeDiscountID, paperUpgradeDiscountID, coatingUpgradeDiscountID, insidePaperUpgradeDiscountID) {
this.upgradeDiscountID = upgradeDiscountID;
this.paperUpgradeDiscountID = paperUpgradeDiscountID;
this.coatingUpgradeDiscountID = coatingUpgradeDiscountID;
this.insidePaperUpgradeDiscountID = insidePaperUpgradeDiscountID;

this.InsertUpgradeDiscount();
}

UpgradeDiscount.prototype.InsertUpgradeDiscount = function() {
if (typeof (UpgradeDiscounts) == 'undefined') {
UpgradeDiscounts = new Object;
}
UpgradeDiscounts[this.upgradeDiscountID] = this;
};

UpgradeDiscount.prototype.ResetUpgradeDiscounts = function() {
this.paperUpgradeDiscountID.value = 0;
this.coatingUpgradeDiscountID.value = 0;
this.insidePaperUpgradeDiscountID.value = 0;
};

UpgradeDiscount.prototype.ChangeUpgradeDiscount = function(txtObj) {
if (this.CheckUpgradeDiscountValidity(txtObj)) {
if (this.productPricingObj) {
this.productPricingObj.AdjustPrices(AdjustTypeEnum.UpgradeDiscount);
this.productPricingObj.HandleShowSubmitChanges();
}
}
};

UpgradeDiscount.prototype.GetUpgradeDiscountTotal = function() {
var paperUpgradeDiscountElem = $(this.paperUpgradeDiscountID);
var coatingUpgradeDiscountElem = $(this.coatingUpgradeDiscountID);
var insidePaperUpgradeDiscountElem = $(this.insidePaperUpgradeDiscountID);
var upgradeDiscount = 0;
if (typeof (paperUpgradeDiscountElem) != 'undefined' && paperUpgradeDiscountElem.value != '') {
upgradeDiscount += FormatDollar(StripNonNumeric(paperUpgradeDiscountElem.value, '.', false));
}
if (typeof (coatingUpgradeDiscountElem) != 'undefined' && coatingUpgradeDiscountElem.value != '') {
upgradeDiscount += FormatDollar(StripNonNumeric(coatingUpgradeDiscountElem.value, '.', false));
}
if (typeof (insidePaperUpgradeDiscountElem) != 'undefined' && insidePaperUpgradeDiscountElem.value != '') {
upgradeDiscount += FormatDollar(StripNonNumeric(insidePaperUpgradeDiscountElem.value, '.', false));
}
return upgradeDiscount;
};

UpgradeDiscount.prototype.CheckUpgradeDiscountValidity = function(txtObj) {
if (txtObj.value != "") {
var alertAttrib = "";
var priceDiff = "";
if (txtObj.id == this.paperUpgradeDiscountID) {
priceDiff = this.productPricingObj.GetChangePaperPrice();
alertAttrib = (priceDiff <= 0) ? "Paper" : "";
}
else if (txtObj.id == this.insidePaperUpgradeDiscountID) {
priceDiff = this.productPricingObj.GetChangeInsidePaperPrice();
alertAttrib = (priceDiff <= 0) ? "Inside Paper" : "";
}
else if (txtObj.id == this.coatingUpgradeDiscountID) {
 priceDiff = this.productPricingObj.GetChangeCoatingPrice();
alertAttrib = (priceDiff <= 0) ? "Aqueous" : "";
}
priceDiff = FormatDollar(priceDiff.replace('$', ''));

if (alertAttrib != "") {
alert("You must select " + alertAttrib + " before entering " + alertAttrib + " Upgrade Discount.");
txtObj.value = "";
return false;
}
else if (FormatDollar(txtObj.value) > priceDiff) {
alert("You cannot enter a discount greater than the upgrade amount.");
txtObj.value = "";
return false;
}
}
return true;
};var VariableDataPricings;

function VariableDataPricing(userControlID, imprintID, imprintColorID, txtVariableDataCommentsID, rblImprintID, ddImprintColorID) {
 this.userControlID = userControlID;
 this.txtVariableDataCommentsID = txtVariableDataCommentsID;
 this.rblImprintID = rblImprintID;
 this.ddImprintColorID = ddImprintColorID;
 new FinishingPricing(rblImprintID, imprintID, '');
 new FinishingPricing(ddImprintColorID, imprintColorID, '');

 this.InsertVariableDataPricing();
}

VariableDataPricing.prototype.InsertVariableDataPricing = function() {
 if (typeof (VariableDataPricings) == 'undefined') {
 VariableDataPricings = new Object;
 }
 VariableDataPricings[this.userControlID] = this;
};

VariableDataPricing.prototype.Reset = function() {
 SetRadioButtonListChecked(this.rblImprintID, this.imprintID);
 SetRadioButtonListChecked(this.ddImprintColorID, this.imprintColorID);
};

VariableDataPricing.prototype.Change = function(control, value) {
 var controlID = control[0].name;
 if (typeof (controlID) == 'undefined') { //for dropdowns
 controlID = control.name;
 }

 if (controlID == this.rblImprintID) { //show or hide start number and color
 var elem = document.getElementsByTagName("div");
 if (value != '') {
 for (var i = 0; i < elem.length; i++) {
 if (elem[i].name == "VariableDataDetails") {
 elem[i].style.display = 'block';
 }
 }
 if ($(this.txtVariableDataCommentsID).value == '') {
 //alert('Please provide a Starting #.');
 $(this.txtVariableDataCommentsID).focus();
 }
 }
 else {
 if ($(this.txtVariableDataCommentsID).value != '') {
 $(this.txtVariableDataCommentsID).value = '';
 }
 for (var i = 0; i < elem.length; i++) {
 if (elem[i].name == "VariableDataDetails") {
 elem[i].style.display = 'none';
 }
 }
 }
 }

 FinishingPricings[controlID].SetFinishingID(value)
 if (this.productPricingObj) {
 this.productPricingObj.HandleAttributePrices(AdjustTypeEnum.VariableData);
 }
};


if(typeof(blankEnvelopeArr[220]) == 'undefined') blankEnvelopeArr[220] = new Array();
blankEnvelopeArr[220][35] = new Array(0, 0.175);
blankEnvelopeArr[220][39] = new Array(0, 0.19);
blankEnvelopeArr[220][50] = new Array(0, 0.18);
blankEnvelopeArr[220][52] = new Array(0, 0.18);
blankEnvelopeArr[220][277] = new Array(0, 0.08);
if(typeof(blankEnvelopeArr[221]) == 'undefined') blankEnvelopeArr[221] = new Array();
blankEnvelopeArr[221][35] = new Array(0, 0.2);
blankEnvelopeArr[221][39] = new Array(0, 0.22);
blankEnvelopeArr[221][50] = new Array(0, 0.19);
blankEnvelopeArr[221][52] = new Array(0, 0.2);
blankEnvelopeArr[221][277] = new Array(0, 0.11);
if(typeof(blankEnvelopeArr[222]) == 'undefined') blankEnvelopeArr[222] = new Array();
blankEnvelopeArr[222][35] = new Array(0, 0.225);
blankEnvelopeArr[222][39] = new Array(0, 0.255);
blankEnvelopeArr[222][50] = new Array(0, 0.23);
blankEnvelopeArr[222][52] = new Array(0, 0.23);
blankEnvelopeArr[222][277] = new Array(0, 0.09);
if(typeof(blankEnvelopeArr[223]) == 'undefined') blankEnvelopeArr[223] = new Array();
blankEnvelopeArr[223][277] = new Array(0, 0.14);
if(typeof(blankEnvelopeArr[224]) == 'undefined') blankEnvelopeArr[224] = new Array();
blankEnvelopeArr[224][277] = new Array(0, 0.15);
if(typeof(blankEnvelopeArr[228]) == 'undefined') blankEnvelopeArr[228] = new Array();
blankEnvelopeArr[228][277] = new Array(0, 0.1);
if(typeof(blankEnvelopeArr[229]) == 'undefined') blankEnvelopeArr[229] = new Array();
blankEnvelopeArr[229][277] = new Array(0, 0.105);
if(typeof(blankEnvelopeArr[230]) == 'undefined') blankEnvelopeArr[230] = new Array();
blankEnvelopeArr[230][277] = new Array(0, 0.22);
if(typeof(blankEnvelopeArr[231]) == 'undefined') blankEnvelopeArr[231] = new Array();
blankEnvelopeArr[231][277] = new Array(0, 0.075);
if(typeof(blankEnvelopeArr[232]) == 'undefined') blankEnvelopeArr[232] = new Array();
blankEnvelopeArr[232][277] = new Array(0, 0.04);
if(typeof(blankEnvelopeArr[236]) == 'undefined') blankEnvelopeArr[236] = new Array();
blankEnvelopeArr[236][277] = new Array(0, 0.055);
if(typeof(blankEnvelopeArr[237]) == 'undefined') blankEnvelopeArr[237] = new Array();
blankEnvelopeArr[237][27] = new Array(0, 0.16);
blankEnvelopeArr[237][28] = new Array(0, 0.2);
blankEnvelopeArr[237][35] = new Array(0, 0.175);
blankEnvelopeArr[237][36] = new Array(0, 0.26);
blankEnvelopeArr[237][37] = new Array(0, 0.18);
blankEnvelopeArr[237][50] = new Array(0, 0.21);
blankEnvelopeArr[237][277] = new Array(0, 0.05);
blankEnvelopeArr[237][423] = new Array(0, 0.175);
blankEnvelopeArr[237][424] = new Array(0, 0.165);
if(typeof(blankEnvelopeArr[244]) == 'undefined') blankEnvelopeArr[244] = new Array();
blankEnvelopeArr[244][277] = new Array(0, 0.075);
if(typeof(blankEnvelopeArr[250]) == 'undefined') blankEnvelopeArr[250] = new Array();
blankEnvelopeArr[250][277] = new Array(0, 0.13);
blankEnvelopeArr[250][278] = new Array(0, 0.135);
if(typeof(blankEnvelopeArr[251]) == 'undefined') blankEnvelopeArr[251] = new Array();
blankEnvelopeArr[251][278] = new Array(0, 0.14);
if(typeof(blankEnvelopeArr[252]) == 'undefined') blankEnvelopeArr[252] = new Array();
blankEnvelopeArr[252][278] = new Array(0, 0.16);
if(typeof(blankEnvelopeArr[258]) == 'undefined') blankEnvelopeArr[258] = new Array();
blankEnvelopeArr[258][278] = new Array(0, 0.135);
if(typeof(blankEnvelopeArr[259]) == 'undefined') blankEnvelopeArr[259] = new Array();
blankEnvelopeArr[259][277] = new Array(0, 0.08);
blankEnvelopeArr[259][278] = new Array(0, 0.15);
if(typeof(blankEnvelopeArr[260]) == 'undefined') blankEnvelopeArr[260] = new Array();
blankEnvelopeArr[260][278] = new Array(0, 0.17);
if(typeof(blankEnvelopeArr[461]) == 'undefined') blankEnvelopeArr[461] = new Array();
blankEnvelopeArr[461][277] = new Array(0, 0.06);
if(typeof(blankEnvelopeArr[462]) == 'undefined') blankEnvelopeArr[462] = new Array();
blankEnvelopeArr[462][27] = new Array(0, 0.18);
blankEnvelopeArr[462][277] = new Array(0, 0.06);
if(typeof(blankEnvelopeArr[463]) == 'undefined') blankEnvelopeArr[463] = new Array();
blankEnvelopeArr[463][277] = new Array(0, 0.06);
if(typeof(blankEnvelopeArr[464]) == 'undefined') blankEnvelopeArr[464] = new Array();
blankEnvelopeArr[464][277] = new Array(0, 0.065);
if(typeof(blankEnvelopeArr[740]) == 'undefined') blankEnvelopeArr[740] = new Array();
blankEnvelopeArr[740][278] = new Array(0, 0.216);
if(typeof(blankEnvelopeArr[741]) == 'undefined') blankEnvelopeArr[741] = new Array();
blankEnvelopeArr[741][278] = new Array(0, 0.236);
if(typeof(finishingArr[83]) == 'undefined') finishingArr[83] = new Array();
if(typeof(finishingArr[83][3]) == 'undefined') finishingArr[83][3] = new Array();
finishingArr[83][3][0] = new Array(140, 0.02, 0);
if(typeof(finishingArr[83][4]) == 'undefined') finishingArr[83][4] = new Array();
finishingArr[83][4][0] = new Array(140, 0.02, 0);
if(typeof(finishingArr[83][5]) == 'undefined') finishingArr[83][5] = new Array();
finishingArr[83][5][0] = new Array(59.5, 0.008, 0);
if(typeof(finishingArr[83][6]) == 'undefined') finishingArr[83][6] = new Array();
finishingArr[83][6][0] = new Array(140, 0.02, 0);
if(typeof(finishingArr[83][7]) == 'undefined') finishingArr[83][7] = new Array();
finishingArr[83][7][0] = new Array(111, 0.0082, 0);
if(typeof(finishingArr[83][8]) == 'undefined') finishingArr[83][8] = new Array();
finishingArr[83][8][0] = new Array(88, 0.008, 0);
if(typeof(finishingArr[83][9]) == 'undefined') finishingArr[83][9] = new Array();
finishingArr[83][9][0] = new Array(100, 0.01, 0);
if(typeof(finishingArr[83][10]) == 'undefined') finishingArr[83][10] = new Array();
finishingArr[83][10][0] = new Array(130, 0.025, 0);
if(typeof(finishingArr[83][11]) == 'undefined') finishingArr[83][11] = new Array();
finishingArr[83][11][0] = new Array(140, 0.02, 0);
if(typeof(finishingArr[83][12]) == 'undefined') finishingArr[83][12] = new Array();
finishingArr[83][12][0] = new Array(100, 0.01, 0);
if(typeof(finishingArr[83][13]) == 'undefined') finishingArr[83][13] = new Array();
finishingArr[83][13][0] = new Array(17.95, 0.022, 0);
if(typeof(finishingArr[83][14]) == 'undefined') finishingArr[83][14] = new Array();
finishingArr[83][14][0] = new Array(150.5, 0.02, 0);
if(typeof(finishingArr[83][15]) == 'undefined') finishingArr[83][15] = new Array();
finishingArr[83][15][0] = new Array(87.5, 0.04, 0);
if(typeof(finishingArr[83][16]) == 'undefined') finishingArr[83][16] = new Array();
finishingArr[83][16][0] = new Array(425, 0.08, 0);
if(typeof(finishingArr[83][17]) == 'undefined') finishingArr[83][17] = new Array();
finishingArr[83][17][0] = new Array(100, 0.01, 0);
if(typeof(finishingArr[83][18]) == 'undefined') finishingArr[83][18] = new Array();
finishingArr[83][18][0] = new Array(140, 0.03, 0);
if(typeof(finishingArr[83][19]) == 'undefined') finishingArr[83][19] = new Array();
finishingArr[83][19][0] = new Array(94.5, 0.008, 0);
if(typeof(finishingArr[83][20]) == 'undefined') finishingArr[83][20] = new Array();
finishingArr[83][20][0] = new Array(222, 0.014, 0);
if(typeof(finishingArr[83][43]) == 'undefined') finishingArr[83][43] = new Array();
finishingArr[83][43][0] = new Array(100, 0.01, 0);
if(typeof(finishingArr[83][52]) == 'undefined') finishingArr[83][52] = new Array();
finishingArr[83][52][0] = new Array(640, 0.09, 0);
if(typeof(finishingArr[83][56]) == 'undefined') finishingArr[83][56] = new Array();
finishingArr[83][56][0] = new Array(265, 0.0271, 0);
if(typeof(finishingArr[83][57]) == 'undefined') finishingArr[83][57] = new Array();
finishingArr[83][57][0] = new Array(59.5, 0.008, 0);
if(typeof(finishingArr[83][59]) == 'undefined') finishingArr[83][59] = new Array();
finishingArr[83][59][0] = new Array(47, 0.007, 0);
if(typeof(finishingArr[83][60]) == 'undefined') finishingArr[83][60] = new Array();
finishingArr[83][60][0] = new Array(50, 0.0075, 0);
if(typeof(finishingArr[83][61]) == 'undefined') finishingArr[83][61] = new Array();
finishingArr[83][61][0] = new Array(225, 0.01, 0);
if(typeof(finishingArr[83][62]) == 'undefined') finishingArr[83][62] = new Array();
finishingArr[83][62][0] = new Array(225, 0.015, 0);
if(typeof(finishingArr[83][65]) == 'undefined') finishingArr[83][65] = new Array();
finishingArr[83][65][0] = new Array(140, 0.02, 0);
if(typeof(finishingArr[83][66]) == 'undefined') finishingArr[83][66] = new Array();
finishingArr[83][66][0] = new Array(140, 0.02, 0);
if(typeof(finishingArr[83][67]) == 'undefined') finishingArr[83][67] = new Array();
finishingArr[83][67][0] = new Array(405, 0.09, 0);
if(typeof(finishingArr[83][68]) == 'undefined') finishingArr[83][68] = new Array();
finishingArr[83][68][0] = new Array(101, 0.009, 0);
if(typeof(finishingArr[83][69]) == 'undefined') finishingArr[83][69] = new Array();
finishingArr[83][69][0] = new Array(70, 0.008, 0);
if(typeof(finishingArr[83][70]) == 'undefined') finishingArr[83][70] = new Array();
finishingArr[83][70][0] = new Array(125, 0.0085, 0);
if(typeof(finishingArr[83][71]) == 'undefined') finishingArr[83][71] = new Array();
finishingArr[83][71][0] = new Array(55, 0.055, 0);
if(typeof(finishingArr[83][72]) == 'undefined') finishingArr[83][72] = new Array();
finishingArr[83][72][0] = new Array(80, 0.007, 0);
if(typeof(finishingArr[83][73]) == 'undefined') finishingArr[83][73] = new Array();
finishingArr[83][73][0] = new Array(96, 0.009, 0);
if(typeof(finishingArr[83][74]) == 'undefined') finishingArr[83][74] = new Array();
finishingArr[83][74][0] = new Array(100, 0.01, 0);
if(typeof(finishingArr[83][75]) == 'undefined') finishingArr[83][75] = new Array();
finishingArr[83][75][0] = new Array(85, 0.008, 0);
if(typeof(finishingArr[83][76]) == 'undefined') finishingArr[83][76] = new Array();
finishingArr[83][76][0] = new Array(75, 0.007, 0);
if(typeof(finishingArr[83][77]) == 'undefined') finishingArr[83][77] = new Array();
finishingArr[83][77][0] = new Array(92, 0.009, 0);
if(typeof(finishingArr[83][78]) == 'undefined') finishingArr[83][78] = new Array();
finishingArr[83][78][0] = new Array(98, 0.01, 0);
if(typeof(finishingArr[83][81]) == 'undefined') finishingArr[83][81] = new Array();
finishingArr[83][81][0] = new Array(140, 0.009, 0);
if(typeof(finishingArr[83][89]) == 'undefined') finishingArr[83][89] = new Array();
finishingArr[83][89][0] = new Array(150.5, 0.01, 0);
if(typeof(finishingArr[83][90]) == 'undefined') finishingArr[83][90] = new Array();
finishingArr[83][90][0] = new Array(87.5, 0.04, 0);
if(typeof(finishingArr[83][91]) == 'undefined') finishingArr[83][91] = new Array();
finishingArr[83][91][0] = new Array(55, 0.055, 0);
if(typeof(finishingArr[83][92]) == 'undefined') finishingArr[83][92] = new Array();
finishingArr[83][92][0] = new Array(95, 0.025, 0);
if(typeof(finishingArr[83][93]) == 'undefined') finishingArr[83][93] = new Array();
finishingArr[83][93][0] = new Array(65, 0.025, 0);
if(typeof(finishingArr[83][94]) == 'undefined') finishingArr[83][94] = new Array();
finishingArr[83][94][0] = new Array(265, 0.0271, 0);
if(typeof(finishingArr[83][96]) == 'undefined') finishingArr[83][96] = new Array();
finishingArr[83][96][0] = new Array(100, 0.0078, 0);
if(typeof(finishingArr[83][97]) == 'undefined') finishingArr[83][97] = new Array();
finishingArr[83][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[83][98]) == 'undefined') finishingArr[83][98] = new Array();
finishingArr[83][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[83][99]) == 'undefined') finishingArr[83][99] = new Array();
finishingArr[83][99][0] = new Array(3.5, 0.0563, 0);
if(typeof(finishingArr[83][100]) == 'undefined') finishingArr[83][100] = new Array();
finishingArr[83][100][0] = new Array(17.95, 0.022, 0);
if(typeof(finishingArr[83][101]) == 'undefined') finishingArr[83][101] = new Array();
finishingArr[83][101][0] = new Array(59.5, 0.008, 0);
if(typeof(finishingArr[83][102]) == 'undefined') finishingArr[83][102] = new Array();
finishingArr[83][102][0] = new Array(88, 0.008, 0);
if(typeof(finishingArr[83][103]) == 'undefined') finishingArr[83][103] = new Array();
finishingArr[83][103][0] = new Array(55, 0.055, 0);
if(typeof(finishingArr[83][104]) == 'undefined') finishingArr[83][104] = new Array();
finishingArr[83][104][0] = new Array(87.5, 0.04, 0);
if(typeof(finishingArr[83][105]) == 'undefined') finishingArr[83][105] = new Array();
finishingArr[83][105][0] = new Array(100, 0.01, 0);
if(typeof(finishingArr[83][106]) == 'undefined') finishingArr[83][106] = new Array();
finishingArr[83][106][0] = new Array(140, 0.03, 0);
if(typeof(finishingArr[83][107]) == 'undefined') finishingArr[83][107] = new Array();
finishingArr[83][107][0] = new Array(225, 0.01, 0);
if(typeof(finishingArr[83][108]) == 'undefined') finishingArr[83][108] = new Array();
finishingArr[83][108][0] = new Array(105, 0.7, 0);
if(typeof(finishingArr[83][109]) == 'undefined') finishingArr[83][109] = new Array();
finishingArr[83][109][0] = new Array(130, 0.75, 0);
if(typeof(finishingArr[83][116]) == 'undefined') finishingArr[83][116] = new Array();
finishingArr[83][116][0] = new Array(37, 0.03, 0);
if(typeof(finishingArr[83][117]) == 'undefined') finishingArr[83][117] = new Array();
finishingArr[83][117][0] = new Array(270, 0.04, 0);
if(typeof(finishingArr[83][118]) == 'undefined') finishingArr[83][118] = new Array();
finishingArr[83][118][0] = new Array(300, 0.08, 0);
if(typeof(finishingArr[83][119]) == 'undefined') finishingArr[83][119] = new Array();
finishingArr[83][119][0] = new Array(340, 0.13, 0);
if(typeof(finishingArr[83][120]) == 'undefined') finishingArr[83][120] = new Array();
finishingArr[83][120][0] = new Array(60, 0.004, 0);
if(typeof(finishingArr[83][121]) == 'undefined') finishingArr[83][121] = new Array();
finishingArr[83][121][0] = new Array(85, 0.005, 0);
if(typeof(finishingArr[83][135]) == 'undefined') finishingArr[83][135] = new Array();
finishingArr[83][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[83][136]) == 'undefined') finishingArr[83][136] = new Array();
finishingArr[83][136][0] = new Array(0, 0.2, 0);
if(typeof(finishingArr[83][137]) == 'undefined') finishingArr[83][137] = new Array();
finishingArr[83][137][0] = new Array(0, 0.22, 0);
if(typeof(finishingArr[83][138]) == 'undefined') finishingArr[83][138] = new Array();
finishingArr[83][138][0] = new Array(0, 0.22, 0);
if(typeof(finishingArr[83][139]) == 'undefined') finishingArr[83][139] = new Array();
finishingArr[83][139][0] = new Array(0, 0.28, 0);
if(typeof(finishingArr[83][140]) == 'undefined') finishingArr[83][140] = new Array();
finishingArr[83][140][0] = new Array(0, 0.28, 0);
if(typeof(finishingArr[83][141]) == 'undefined') finishingArr[83][141] = new Array();
finishingArr[83][141][0] = new Array(0, 0.36, 0);
if(typeof(finishingArr[83][142]) == 'undefined') finishingArr[83][142] = new Array();
finishingArr[83][142][0] = new Array(5, 0.02, 0);
if(typeof(finishingArr[83][143]) == 'undefined') finishingArr[83][143] = new Array();
finishingArr[83][143][0] = new Array(5, 0.02, 0);
if(typeof(finishingArr[83][144]) == 'undefined') finishingArr[83][144] = new Array();
finishingArr[83][144][0] = new Array(15, 0.04, 0);
if(typeof(finishingArr[83][145]) == 'undefined') finishingArr[83][145] = new Array();
finishingArr[83][145][0] = new Array(20, 0.074, 0);
if(typeof(finishingArr[83][149]) == 'undefined') finishingArr[83][149] = new Array();
finishingArr[83][149][0] = new Array(0, 0, 0);
if(typeof(finishingArr[85]) == 'undefined') finishingArr[85] = new Array();
if(typeof(finishingArr[85][3]) == 'undefined') finishingArr[85][3] = new Array();
finishingArr[85][3][0] = new Array(55, 0.01, 0);
if(typeof(finishingArr[85][4]) == 'undefined') finishingArr[85][4] = new Array();
finishingArr[85][4][0] = new Array(55, 0.01, 0);
if(typeof(finishingArr[85][5]) == 'undefined') finishingArr[85][5] = new Array();
finishingArr[85][5][0] = new Array(17, 0.005, 0);
if(typeof(finishingArr[85][6]) == 'undefined') finishingArr[85][6] = new Array();
finishingArr[85][6][0] = new Array(55, 0.01, 0);
if(typeof(finishingArr[85][7]) == 'undefined') finishingArr[85][7] = new Array();
finishingArr[85][7][0] = new Array(44, 0.0062, 0);
if(typeof(finishingArr[85][8]) == 'undefined') finishingArr[85][8] = new Array();
finishingArr[85][8][0] = new Array(35, 0.006, 0);
if(typeof(finishingArr[85][9]) == 'undefined') finishingArr[85][9] = new Array();
finishingArr[85][9][0] = new Array(35, 0.009, 0);
if(typeof(finishingArr[85][10]) == 'undefined') finishingArr[85][10] = new Array();
finishingArr[85][10][0] = new Array(45, 0.017, 0);
if(typeof(finishingArr[85][11]) == 'undefined') finishingArr[85][11] = new Array();
finishingArr[85][11][0] = new Array(55, 0.01, 0);
if(typeof(finishingArr[85][12]) == 'undefined') finishingArr[85][12] = new Array();
finishingArr[85][12][0] = new Array(35, 0.009, 0);
if(typeof(finishingArr[85][13]) == 'undefined') finishingArr[85][13] = new Array();
finishingArr[85][13][0] = new Array(15, 0.01, 0);
if(typeof(finishingArr[85][14]) == 'undefined') finishingArr[85][14] = new Array();
finishingArr[85][14][0] = new Array(92.5, 0.016, 0);
if(typeof(finishingArr[85][15]) == 'undefined') finishingArr[85][15] = new Array();
finishingArr[85][15][0] = new Array(30, 0.03, 0);
if(typeof(finishingArr[85][16]) == 'undefined') finishingArr[85][16] = new Array();
finishingArr[85][16][0] = new Array(275, 0.07, 0);
if(typeof(finishingArr[85][17]) == 'undefined') finishingArr[85][17] = new Array();
finishingArr[85][17][0] = new Array(35, 0.009, 0);
if(typeof(finishingArr[85][18]) == 'undefined') finishingArr[85][18] = new Array();
finishingArr[85][18][0] = new Array(55, 0.02, 0);
if(typeof(finishingArr[85][19]) == 'undefined') finishingArr[85][19] = new Array();
finishingArr[85][19][0] = new Array(38, 0.006, 0);
if(typeof(finishingArr[85][20]) == 'undefined') finishingArr[85][20] = new Array();
finishingArr[85][20][0] = new Array(112.5, 0.03, 0);
if(typeof(finishingArr[85][43]) == 'undefined') finishingArr[85][43] = new Array();
finishingArr[85][43][0] = new Array(35, 0.009, 0);
if(typeof(finishingArr[85][52]) == 'undefined') finishingArr[85][52] = new Array();
finishingArr[85][52][0] = new Array(275, 0.05, 0);
if(typeof(finishingArr[85][56]) == 'undefined') finishingArr[85][56] = new Array();
finishingArr[85][56][0] = new Array(102.5, 0.03, 0);
if(typeof(finishingArr[85][57]) == 'undefined') finishingArr[85][57] = new Array();
finishingArr[85][57][0] = new Array(17, 0.005, 0);
if(typeof(finishingArr[85][59]) == 'undefined') finishingArr[85][59] = new Array();
finishingArr[85][59][0] = new Array(7.5, 0.0045, 0);
if(typeof(finishingArr[85][60]) == 'undefined') finishingArr[85][60] = new Array();
finishingArr[85][60][0] = new Array(8.5, 0.005, 0);
if(typeof(finishingArr[85][61]) == 'undefined') finishingArr[85][61] = new Array();
finishingArr[85][61][0] = new Array(110, 0.01, 0);
if(typeof(finishingArr[85][62]) == 'undefined') finishingArr[85][62] = new Array();
finishingArr[85][62][0] = new Array(150, 0.01, 0);
if(typeof(finishingArr[85][65]) == 'undefined') finishingArr[85][65] = new Array();
finishingArr[85][65][0] = new Array(55, 0.01, 0);
if(typeof(finishingArr[85][66]) == 'undefined') finishingArr[85][66] = new Array();
finishingArr[85][66][0] = new Array(55, 0.01, 0);
if(typeof(finishingArr[85][67]) == 'undefined') finishingArr[85][67] = new Array();
finishingArr[85][67][0] = new Array(185, 0.05, 0);
if(typeof(finishingArr[85][68]) == 'undefined') finishingArr[85][68] = new Array();
finishingArr[85][68][0] = new Array(36, 0.007, 0);
if(typeof(finishingArr[85][69]) == 'undefined') finishingArr[85][69] = new Array();
finishingArr[85][69][0] = new Array(22, 0.005, 0);
if(typeof(finishingArr[85][70]) == 'undefined') finishingArr[85][70] = new Array();
finishingArr[85][70][0] = new Array(46, 0.0065, 0);
if(typeof(finishingArr[85][71]) == 'undefined') finishingArr[85][71] = new Array();
finishingArr[85][71][0] = new Array(35.25, 0.03, 0);
if(typeof(finishingArr[85][72]) == 'undefined') finishingArr[85][72] = new Array();
finishingArr[85][72][0] = new Array(24, 0.006, 0);
if(typeof(finishingArr[85][73]) == 'undefined') finishingArr[85][73] = new Array();
finishingArr[85][73][0] = new Array(32, 0.008, 0);
if(typeof(finishingArr[85][74]) == 'undefined') finishingArr[85][74] = new Array();
finishingArr[85][74][0] = new Array(35, 0.009, 0);
if(typeof(finishingArr[85][75]) == 'undefined') finishingArr[85][75] = new Array();
finishingArr[85][75][0] = new Array(25, 0.006, 0);
if(typeof(finishingArr[85][76]) == 'undefined') finishingArr[85][76] = new Array();
finishingArr[85][76][0] = new Array(23, 0.006, 0);
if(typeof(finishingArr[85][77]) == 'undefined') finishingArr[85][77] = new Array();
finishingArr[85][77][0] = new Array(30, 0.008, 0);
if(typeof(finishingArr[85][78]) == 'undefined') finishingArr[85][78] = new Array();
finishingArr[85][78][0] = new Array(33, 0.009, 0);
if(typeof(finishingArr[85][81]) == 'undefined') finishingArr[85][81] = new Array();
finishingArr[85][81][0] = new Array(51, 0.007, 0);
if(typeof(finishingArr[85][89]) == 'undefined') finishingArr[85][89] = new Array();
finishingArr[85][89][0] = new Array(95.75, 0.009, 0);
if(typeof(finishingArr[85][90]) == 'undefined') finishingArr[85][90] = new Array();
finishingArr[85][90][0] = new Array(30, 0.03, 0);
if(typeof(finishingArr[85][91]) == 'undefined') finishingArr[85][91] = new Array();
finishingArr[85][91][0] = new Array(35.25, 0.03, 0);
if(typeof(finishingArr[85][92]) == 'undefined') finishingArr[85][92] = new Array();
finishingArr[85][92][0] = new Array(44.5, 0.02, 0);
if(typeof(finishingArr[85][93]) == 'undefined') finishingArr[85][93] = new Array();
finishingArr[85][93][0] = new Array(39.75, 0.017, 0);
if(typeof(finishingArr[85][94]) == 'undefined') finishingArr[85][94] = new Array();
finishingArr[85][94][0] = new Array(102.5, 0.03, 0);
if(typeof(finishingArr[85][96]) == 'undefined') finishingArr[85][96] = new Array();
finishingArr[85][96][0] = new Array(30, 0.0012, 0);
if(typeof(finishingArr[85][97]) == 'undefined') finishingArr[85][97] = new Array();
finishingArr[85][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[85][98]) == 'undefined') finishingArr[85][98] = new Array();
finishingArr[85][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[85][99]) == 'undefined') finishingArr[85][99] = new Array();
finishingArr[85][99][0] = new Array(7, 0.02, 0);
if(typeof(finishingArr[85][100]) == 'undefined') finishingArr[85][100] = new Array();
finishingArr[85][100][0] = new Array(15, 0.01, 0);
if(typeof(finishingArr[85][101]) == 'undefined') finishingArr[85][101] = new Array();
finishingArr[85][101][0] = new Array(17, 0.005, 0);
if(typeof(finishingArr[85][102]) == 'undefined') finishingArr[85][102] = new Array();
finishingArr[85][102][0] = new Array(35, 0.006, 0);
if(typeof(finishingArr[85][103]) == 'undefined') finishingArr[85][103] = new Array();
finishingArr[85][103][0] = new Array(35.25, 0.03, 0);
if(typeof(finishingArr[85][104]) == 'undefined') finishingArr[85][104] = new Array();
finishingArr[85][104][0] = new Array(30, 0.03, 0);
if(typeof(finishingArr[85][105]) == 'undefined') finishingArr[85][105] = new Array();
finishingArr[85][105][0] = new Array(35, 0.009, 0);
if(typeof(finishingArr[85][106]) == 'undefined') finishingArr[85][106] = new Array();
finishingArr[85][106][0] = new Array(55, 0.02, 0);
if(typeof(finishingArr[85][107]) == 'undefined') finishingArr[85][107] = new Array();
finishingArr[85][107][0] = new Array(110, 0.01, 0);
if(typeof(finishingArr[85][108]) == 'undefined') finishingArr[85][108] = new Array();
finishingArr[85][108][0] = new Array(55, 0.5, 0);
if(typeof(finishingArr[85][109]) == 'undefined') finishingArr[85][109] = new Array();
finishingArr[85][109][0] = new Array(75, 0.6, 0);
if(typeof(finishingArr[85][116]) == 'undefined') finishingArr[85][116] = new Array();
finishingArr[85][116][0] = new Array(20, 0.02, 0);
if(typeof(finishingArr[85][117]) == 'undefined') finishingArr[85][117] = new Array();
finishingArr[85][117][0] = new Array(45, 0.03, 0);
if(typeof(finishingArr[85][118]) == 'undefined') finishingArr[85][118] = new Array();
finishingArr[85][118][0] = new Array(45, 0.07, 0);
if(typeof(finishingArr[85][119]) == 'undefined') finishingArr[85][119] = new Array();
finishingArr[85][119][0] = new Array(55, 0.12, 0);
if(typeof(finishingArr[85][120]) == 'undefined') finishingArr[85][120] = new Array();
finishingArr[85][120][0] = new Array(20, 0.0005, 0);
if(typeof(finishingArr[85][121]) == 'undefined') finishingArr[85][121] = new Array();
finishingArr[85][121][0] = new Array(30, 0.0008, 0);
if(typeof(finishingArr[85][135]) == 'undefined') finishingArr[85][135] = new Array();
finishingArr[85][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[85][136]) == 'undefined') finishingArr[85][136] = new Array();
finishingArr[85][136][0] = new Array(0, 0.2, 0);
if(typeof(finishingArr[85][137]) == 'undefined') finishingArr[85][137] = new Array();
finishingArr[85][137][0] = new Array(0, 0.22, 0);
if(typeof(finishingArr[85][138]) == 'undefined') finishingArr[85][138] = new Array();
finishingArr[85][138][0] = new Array(0, 0.22, 0);
if(typeof(finishingArr[85][139]) == 'undefined') finishingArr[85][139] = new Array();
finishingArr[85][139][0] = new Array(0, 0.28, 0);
if(typeof(finishingArr[85][140]) == 'undefined') finishingArr[85][140] = new Array();
finishingArr[85][140][0] = new Array(0, 0.28, 0);
if(typeof(finishingArr[85][141]) == 'undefined') finishingArr[85][141] = new Array();
finishingArr[85][141][0] = new Array(0, 0.36, 0);
if(typeof(finishingArr[85][142]) == 'undefined') finishingArr[85][142] = new Array();
finishingArr[85][142][0] = new Array(5, 0.02, 0);
if(typeof(finishingArr[85][143]) == 'undefined') finishingArr[85][143] = new Array();
finishingArr[85][143][0] = new Array(5, 0.02, 0);
if(typeof(finishingArr[85][144]) == 'undefined') finishingArr[85][144] = new Array();
finishingArr[85][144][0] = new Array(15, 0.04, 0);
if(typeof(finishingArr[85][145]) == 'undefined') finishingArr[85][145] = new Array();
finishingArr[85][145][0] = new Array(20, 0.074, 0);
if(typeof(finishingArr[85][149]) == 'undefined') finishingArr[85][149] = new Array();
finishingArr[85][149][0] = new Array(0, 0, 0);
if(typeof(finishingArr[97]) == 'undefined') finishingArr[97] = new Array();
if(typeof(finishingArr[97]['']) == 'undefined') finishingArr[97][''] = new Array();
finishingArr[97][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[98]) == 'undefined') finishingArr[98] = new Array();
if(typeof(finishingArr[98]['']) == 'undefined') finishingArr[98][''] = new Array();
finishingArr[98][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[99]) == 'undefined') finishingArr[99] = new Array();
if(typeof(finishingArr[99]['']) == 'undefined') finishingArr[99][''] = new Array();
finishingArr[99][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[101]) == 'undefined') finishingArr[101] = new Array();
if(typeof(finishingArr[101]['']) == 'undefined') finishingArr[101][''] = new Array();
finishingArr[101][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[103]) == 'undefined') finishingArr[103] = new Array();
if(typeof(finishingArr[103]['']) == 'undefined') finishingArr[103][''] = new Array();
finishingArr[103][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[103][6]) == 'undefined') finishingArr[103][6] = new Array();
finishingArr[103][6][0] = new Array(0, 0.02, 0);
if(typeof(finishingArr[103][11]) == 'undefined') finishingArr[103][11] = new Array();
finishingArr[103][11][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[103][65]) == 'undefined') finishingArr[103][65] = new Array();
finishingArr[103][65][0] = new Array(0, 0.02, 0);
if(typeof(finishingArr[103][66]) == 'undefined') finishingArr[103][66] = new Array();
finishingArr[103][66][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[104]) == 'undefined') finishingArr[104] = new Array();
if(typeof(finishingArr[104]['']) == 'undefined') finishingArr[104][''] = new Array();
finishingArr[104][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[105]) == 'undefined') finishingArr[105] = new Array();
if(typeof(finishingArr[105]['']) == 'undefined') finishingArr[105][''] = new Array();
finishingArr[105][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[106]) == 'undefined') finishingArr[106] = new Array();
if(typeof(finishingArr[106]['']) == 'undefined') finishingArr[106][''] = new Array();
finishingArr[106][''][0] = new Array(0, 0.035, 0);
if(typeof(finishingArr[107]) == 'undefined') finishingArr[107] = new Array();
if(typeof(finishingArr[107]['']) == 'undefined') finishingArr[107][''] = new Array();
finishingArr[107][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[108]) == 'undefined') finishingArr[108] = new Array();
if(typeof(finishingArr[108]['']) == 'undefined') finishingArr[108][''] = new Array();
finishingArr[108][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[109]) == 'undefined') finishingArr[109] = new Array();
if(typeof(finishingArr[109]['']) == 'undefined') finishingArr[109][''] = new Array();
finishingArr[109][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[110]) == 'undefined') finishingArr[110] = new Array();
if(typeof(finishingArr[110]['']) == 'undefined') finishingArr[110][''] = new Array();
finishingArr[110][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[112]) == 'undefined') finishingArr[112] = new Array();
if(typeof(finishingArr[112]['']) == 'undefined') finishingArr[112][''] = new Array();
finishingArr[112][''][0] = new Array(14.4, 0.07, 129.6);
if(typeof(finishingArr[113]) == 'undefined') finishingArr[113] = new Array();
if(typeof(finishingArr[113]['']) == 'undefined') finishingArr[113][''] = new Array();
finishingArr[113][''][0] = new Array(19, 0.07, 171);
if(typeof(finishingArr[114]) == 'undefined') finishingArr[114] = new Array();
if(typeof(finishingArr[114]['']) == 'undefined') finishingArr[114][''] = new Array();
finishingArr[114][''][0] = new Array(23.3, 0.07, 209.7);
if(typeof(finishingArr[115]) == 'undefined') finishingArr[115] = new Array();
if(typeof(finishingArr[115]['']) == 'undefined') finishingArr[115][''] = new Array();
finishingArr[115][''][0] = new Array(31.2, 0.07, 280.8);
if(typeof(finishingArr[116]) == 'undefined') finishingArr[116] = new Array();
if(typeof(finishingArr[116]['']) == 'undefined') finishingArr[116][''] = new Array();
finishingArr[116][''][0] = new Array(45.4, 0.07, 408.6);
if(typeof(finishingArr[118]) == 'undefined') finishingArr[118] = new Array();
if(typeof(finishingArr[118]['']) == 'undefined') finishingArr[118][''] = new Array();
finishingArr[118][''][0] = new Array(14.7, 0.07, 132.3);
if(typeof(finishingArr[119]) == 'undefined') finishingArr[119] = new Array();
if(typeof(finishingArr[119]['']) == 'undefined') finishingArr[119][''] = new Array();
finishingArr[119][''][0] = new Array(15.5, 0.07, 139.5);
if(typeof(finishingArr[120]) == 'undefined') finishingArr[120] = new Array();
if(typeof(finishingArr[120]['']) == 'undefined') finishingArr[120][''] = new Array();
finishingArr[120][''][0] = new Array(16.2, 0.07, 145.8);
if(typeof(finishingArr[121]) == 'undefined') finishingArr[121] = new Array();
if(typeof(finishingArr[121]['']) == 'undefined') finishingArr[121][''] = new Array();
finishingArr[121][''][0] = new Array(18.5, 0.07, 166.5);
if(typeof(finishingArr[122]) == 'undefined') finishingArr[122] = new Array();
if(typeof(finishingArr[122]['']) == 'undefined') finishingArr[122][''] = new Array();
finishingArr[122][''][0] = new Array(21, 0.07, 189);
if(typeof(finishingArr[124]) == 'undefined') finishingArr[124] = new Array();
if(typeof(finishingArr[124]['']) == 'undefined') finishingArr[124][''] = new Array();
finishingArr[124][''][0] = new Array(0, 0.01, 20);
if(typeof(finishingArr[128]) == 'undefined') finishingArr[128] = new Array();
if(typeof(finishingArr[128]['']) == 'undefined') finishingArr[128][''] = new Array();
finishingArr[128][''][0] = new Array(14.4, 0.07, 129.6);
if(typeof(finishingArr[129]) == 'undefined') finishingArr[129] = new Array();
if(typeof(finishingArr[129]['']) == 'undefined') finishingArr[129][''] = new Array();
finishingArr[129][''][0] = new Array(19, 0.07, 171);
if(typeof(finishingArr[130]) == 'undefined') finishingArr[130] = new Array();
if(typeof(finishingArr[130]['']) == 'undefined') finishingArr[130][''] = new Array();
finishingArr[130][''][0] = new Array(23.3, 0.07, 209.7);
if(typeof(finishingArr[131]) == 'undefined') finishingArr[131] = new Array();
if(typeof(finishingArr[131]['']) == 'undefined') finishingArr[131][''] = new Array();
finishingArr[131][''][0] = new Array(31.2, 0.07, 280.8);
if(typeof(finishingArr[132]) == 'undefined') finishingArr[132] = new Array();
if(typeof(finishingArr[132]['']) == 'undefined') finishingArr[132][''] = new Array();
finishingArr[132][''][0] = new Array(45.4, 0.07, 408.6);
if(typeof(finishingArr[136]) == 'undefined') finishingArr[136] = new Array();
if(typeof(finishingArr[136]['']) == 'undefined') finishingArr[136][''] = new Array();
finishingArr[136][''][0] = new Array(0, 0.02, 0);
if(typeof(finishingArr[137]) == 'undefined') finishingArr[137] = new Array();
if(typeof(finishingArr[137]['']) == 'undefined') finishingArr[137][''] = new Array();
finishingArr[137][''][0] = new Array(75, 0.02, 0);
if(typeof(finishingArr[138]) == 'undefined') finishingArr[138] = new Array();
if(typeof(finishingArr[138]['']) == 'undefined') finishingArr[138][''] = new Array();
finishingArr[138][''][0] = new Array(10.9, 0.08, 98.1);
if(typeof(finishingArr[139]) == 'undefined') finishingArr[139] = new Array();
if(typeof(finishingArr[139]['']) == 'undefined') finishingArr[139][''] = new Array();
finishingArr[139][''][0] = new Array(13.3, 0.08, 119.7);
if(typeof(finishingArr[140]) == 'undefined') finishingArr[140] = new Array();
if(typeof(finishingArr[140]['']) == 'undefined') finishingArr[140][''] = new Array();
finishingArr[140][''][0] = new Array(15.4, 0.08, 138.6);
if(typeof(finishingArr[141]) == 'undefined') finishingArr[141] = new Array();
if(typeof(finishingArr[141]['']) == 'undefined') finishingArr[141][''] = new Array();
finishingArr[141][''][0] = new Array(19.3, 0.08, 173.7);
if(typeof(finishingArr[142]) == 'undefined') finishingArr[142] = new Array();
if(typeof(finishingArr[142]['']) == 'undefined') finishingArr[142][''] = new Array();
finishingArr[142][''][0] = new Array(26.5, 0.08, 238.5);
if(typeof(finishingArr[150]) == 'undefined') finishingArr[150] = new Array();
if(typeof(finishingArr[150]['']) == 'undefined') finishingArr[150][''] = new Array();
finishingArr[150][''][0] = new Array(5, 0.01, 15);
if(typeof(finishingArr[150][14]) == 'undefined') finishingArr[150][14] = new Array();
finishingArr[150][14][0] = new Array(5, 0.01, 15);
if(typeof(finishingArr[152]) == 'undefined') finishingArr[152] = new Array();
if(typeof(finishingArr[152][52]) == 'undefined') finishingArr[152][52] = new Array();
finishingArr[152][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[153]) == 'undefined') finishingArr[153] = new Array();
if(typeof(finishingArr[153][52]) == 'undefined') finishingArr[153][52] = new Array();
finishingArr[153][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[154]) == 'undefined') finishingArr[154] = new Array();
if(typeof(finishingArr[154][52]) == 'undefined') finishingArr[154][52] = new Array();
finishingArr[154][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[156]) == 'undefined') finishingArr[156] = new Array();
if(typeof(finishingArr[156]['']) == 'undefined') finishingArr[156][''] = new Array();
finishingArr[156][''][0] = new Array(85, 0.022, 0);
if(typeof(finishingArr[158]) == 'undefined') finishingArr[158] = new Array();
if(typeof(finishingArr[158]['']) == 'undefined') finishingArr[158][''] = new Array();
finishingArr[158][''][0] = new Array(0, 0.02, 0);
if(typeof(finishingArr[159]) == 'undefined') finishingArr[159] = new Array();
if(typeof(finishingArr[159]['']) == 'undefined') finishingArr[159][''] = new Array();
finishingArr[159][''][0] = new Array(0, 0.02, 0);
if(typeof(finishingArr[159][99]) == 'undefined') finishingArr[159][99] = new Array();
finishingArr[159][99][0] = new Array(0, 0.02, 0);
if(typeof(finishingArr[160]) == 'undefined') finishingArr[160] = new Array();
if(typeof(finishingArr[160]['']) == 'undefined') finishingArr[160][''] = new Array();
finishingArr[160][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[161]) == 'undefined') finishingArr[161] = new Array();
if(typeof(finishingArr[161]['']) == 'undefined') finishingArr[161][''] = new Array();
finishingArr[161][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[162]) == 'undefined') finishingArr[162] = new Array();
if(typeof(finishingArr[162]['']) == 'undefined') finishingArr[162][''] = new Array();
finishingArr[162][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[163]) == 'undefined') finishingArr[163] = new Array();
if(typeof(finishingArr[163][61]) == 'undefined') finishingArr[163][61] = new Array();
finishingArr[163][61][0] = new Array(0, 0, 0);
if(typeof(finishingArr[163][62]) == 'undefined') finishingArr[163][62] = new Array();
finishingArr[163][62][0] = new Array(0, 0, 0);
if(typeof(finishingArr[164]) == 'undefined') finishingArr[164] = new Array();
if(typeof(finishingArr[164][61]) == 'undefined') finishingArr[164][61] = new Array();
finishingArr[164][61][0] = new Array(0, 0.09, 0);
if(typeof(finishingArr[164][62]) == 'undefined') finishingArr[164][62] = new Array();
finishingArr[164][62][0] = new Array(0, 0.1, 0);
if(typeof(finishingArr[165]) == 'undefined') finishingArr[165] = new Array();
if(typeof(finishingArr[165]['']) == 'undefined') finishingArr[165][''] = new Array();
finishingArr[165][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[166]) == 'undefined') finishingArr[166] = new Array();
if(typeof(finishingArr[166]['']) == 'undefined') finishingArr[166][''] = new Array();
finishingArr[166][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[167]) == 'undefined') finishingArr[167] = new Array();
if(typeof(finishingArr[167]['']) == 'undefined') finishingArr[167][''] = new Array();
finishingArr[167][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[170]) == 'undefined') finishingArr[170] = new Array();
if(typeof(finishingArr[170][52]) == 'undefined') finishingArr[170][52] = new Array();
finishingArr[170][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[171]) == 'undefined') finishingArr[171] = new Array();
if(typeof(finishingArr[171][52]) == 'undefined') finishingArr[171][52] = new Array();
finishingArr[171][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[172]) == 'undefined') finishingArr[172] = new Array();
if(typeof(finishingArr[172][52]) == 'undefined') finishingArr[172][52] = new Array();
finishingArr[172][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[174]) == 'undefined') finishingArr[174] = new Array();
if(typeof(finishingArr[174]['']) == 'undefined') finishingArr[174][''] = new Array();
finishingArr[174][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[179]) == 'undefined') finishingArr[179] = new Array();
if(typeof(finishingArr[179]['']) == 'undefined') finishingArr[179][''] = new Array();
finishingArr[179][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[180]) == 'undefined') finishingArr[180] = new Array();
if(typeof(finishingArr[180]['']) == 'undefined') finishingArr[180][''] = new Array();
finishingArr[180][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[181]) == 'undefined') finishingArr[181] = new Array();
if(typeof(finishingArr[181]['']) == 'undefined') finishingArr[181][''] = new Array();
finishingArr[181][''][0] = new Array(0, 0.02, 0);
if(typeof(finishingArr[181][6]) == 'undefined') finishingArr[181][6] = new Array();
finishingArr[181][6][0] = new Array(0, 0.06, 0);
if(typeof(finishingArr[182]) == 'undefined') finishingArr[182] = new Array();
if(typeof(finishingArr[182]['']) == 'undefined') finishingArr[182][''] = new Array();
finishingArr[182][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[186]) == 'undefined') finishingArr[186] = new Array();
if(typeof(finishingArr[186]['']) == 'undefined') finishingArr[186][''] = new Array();
finishingArr[186][''][0] = new Array(5, 0.045, 20);
if(typeof(finishingArr[187]) == 'undefined') finishingArr[187] = new Array();
if(typeof(finishingArr[187]['']) == 'undefined') finishingArr[187][''] = new Array();
finishingArr[187][''][0] = new Array(5, 0.069, 30);
if(typeof(finishingArr[189]) == 'undefined') finishingArr[189] = new Array();
if(typeof(finishingArr[189]['']) == 'undefined') finishingArr[189][''] = new Array();
finishingArr[189][''][0] = new Array(5, 0.045, 20);
if(typeof(finishingArr[190]) == 'undefined') finishingArr[190] = new Array();
if(typeof(finishingArr[190]['']) == 'undefined') finishingArr[190][''] = new Array();
finishingArr[190][''][0] = new Array(5, 0.069, 30);
if(typeof(finishingArr[192]) == 'undefined') finishingArr[192] = new Array();
if(typeof(finishingArr[192]['']) == 'undefined') finishingArr[192][''] = new Array();
finishingArr[192][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[193]) == 'undefined') finishingArr[193] = new Array();
if(typeof(finishingArr[193]['']) == 'undefined') finishingArr[193][''] = new Array();
finishingArr[193][''][0] = new Array(0, 0.014, 0);
if(typeof(finishingArr[194]) == 'undefined') finishingArr[194] = new Array();
if(typeof(finishingArr[194]['']) == 'undefined') finishingArr[194][''] = new Array();
finishingArr[194][''][0] = new Array(0, 0.035, 0);
if(typeof(finishingArr[195]) == 'undefined') finishingArr[195] = new Array();
if(typeof(finishingArr[195]['']) == 'undefined') finishingArr[195][''] = new Array();
finishingArr[195][''][0] = new Array(0, 0.063, 0);
if(typeof(finishingArr[197]) == 'undefined') finishingArr[197] = new Array();
if(typeof(finishingArr[197]['']) == 'undefined') finishingArr[197][''] = new Array();
finishingArr[197][''][0] = new Array(0, 0.041, 0);
if(typeof(finishingArr[198]) == 'undefined') finishingArr[198] = new Array();
if(typeof(finishingArr[198]['']) == 'undefined') finishingArr[198][''] = new Array();
finishingArr[198][''][0] = new Array(0, 0.055, 35);
if(typeof(finishingArr[199]) == 'undefined') finishingArr[199] = new Array();
if(typeof(finishingArr[199]['']) == 'undefined') finishingArr[199][''] = new Array();
finishingArr[199][''][0] = new Array(0, 0.069, 35);
if(typeof(finishingArr[200]) == 'undefined') finishingArr[200] = new Array();
if(typeof(finishingArr[200]['']) == 'undefined') finishingArr[200][''] = new Array();
finishingArr[200][''][0] = new Array(0, 0.083, 35);
if(typeof(finishingArr[201]) == 'undefined') finishingArr[201] = new Array();
if(typeof(finishingArr[201]['']) == 'undefined') finishingArr[201][''] = new Array();
finishingArr[201][''][0] = new Array(0, 0.097, 35);
if(typeof(finishingArr[290]) == 'undefined') finishingArr[290] = new Array();
if(typeof(finishingArr[290]['']) == 'undefined') finishingArr[290][''] = new Array();
finishingArr[290][''][0] = new Array(0, 0.01, 20);
if(typeof(finishingArr[290][6]) == 'undefined') finishingArr[290][6] = new Array();
finishingArr[290][6][0] = new Array(0, 0.01, 20);
if(typeof(finishingArr[290][11]) == 'undefined') finishingArr[290][11] = new Array();
finishingArr[290][11][0] = new Array(0, 0.01, 20);
if(typeof(finishingArr[290][15]) == 'undefined') finishingArr[290][15] = new Array();
finishingArr[290][15][0] = new Array(0, 0, 0);
if(typeof(finishingArr[290][52]) == 'undefined') finishingArr[290][52] = new Array();
finishingArr[290][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[290][67]) == 'undefined') finishingArr[290][67] = new Array();
finishingArr[290][67][0] = new Array(0, 0, 0);
if(typeof(finishingArr[290][71]) == 'undefined') finishingArr[290][71] = new Array();
finishingArr[290][71][0] = new Array(0, 0, 0);
if(typeof(finishingArr[290][90]) == 'undefined') finishingArr[290][90] = new Array();
finishingArr[290][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[290][91]) == 'undefined') finishingArr[290][91] = new Array();
finishingArr[290][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[290][92]) == 'undefined') finishingArr[290][92] = new Array();
finishingArr[290][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[290][93]) == 'undefined') finishingArr[290][93] = new Array();
finishingArr[290][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[290][135]) == 'undefined') finishingArr[290][135] = new Array();
finishingArr[290][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[306]) == 'undefined') finishingArr[306] = new Array();
if(typeof(finishingArr[306]['']) == 'undefined') finishingArr[306][''] = new Array();
finishingArr[306][''][20000] = new Array(17, 0.005, 51);
finishingArr[306][''][10000] = new Array(17, 0.01, 51);
finishingArr[306][''][5000] = new Array(17, 0.02, 51);
finishingArr[306][''][2500] = new Array(17, 0.025, 51);
finishingArr[306][''][0] = new Array(17, 0.03, 51);
if(typeof(finishingArr[307]) == 'undefined') finishingArr[307] = new Array();
if(typeof(finishingArr[307][3]) == 'undefined') finishingArr[307][3] = new Array();
finishingArr[307][3][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][4]) == 'undefined') finishingArr[307][4] = new Array();
finishingArr[307][4][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][5]) == 'undefined') finishingArr[307][5] = new Array();
finishingArr[307][5][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][6]) == 'undefined') finishingArr[307][6] = new Array();
finishingArr[307][6][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][7]) == 'undefined') finishingArr[307][7] = new Array();
finishingArr[307][7][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][8]) == 'undefined') finishingArr[307][8] = new Array();
finishingArr[307][8][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][9]) == 'undefined') finishingArr[307][9] = new Array();
finishingArr[307][9][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][10]) == 'undefined') finishingArr[307][10] = new Array();
finishingArr[307][10][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][11]) == 'undefined') finishingArr[307][11] = new Array();
finishingArr[307][11][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][12]) == 'undefined') finishingArr[307][12] = new Array();
finishingArr[307][12][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][13]) == 'undefined') finishingArr[307][13] = new Array();
finishingArr[307][13][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][14]) == 'undefined') finishingArr[307][14] = new Array();
finishingArr[307][14][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][15]) == 'undefined') finishingArr[307][15] = new Array();
finishingArr[307][15][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][16]) == 'undefined') finishingArr[307][16] = new Array();
finishingArr[307][16][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][17]) == 'undefined') finishingArr[307][17] = new Array();
finishingArr[307][17][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][18]) == 'undefined') finishingArr[307][18] = new Array();
finishingArr[307][18][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][19]) == 'undefined') finishingArr[307][19] = new Array();
finishingArr[307][19][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][20]) == 'undefined') finishingArr[307][20] = new Array();
finishingArr[307][20][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][43]) == 'undefined') finishingArr[307][43] = new Array();
finishingArr[307][43][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][52]) == 'undefined') finishingArr[307][52] = new Array();
finishingArr[307][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][56]) == 'undefined') finishingArr[307][56] = new Array();
finishingArr[307][56][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][57]) == 'undefined') finishingArr[307][57] = new Array();
finishingArr[307][57][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][59]) == 'undefined') finishingArr[307][59] = new Array();
finishingArr[307][59][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][60]) == 'undefined') finishingArr[307][60] = new Array();
finishingArr[307][60][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][61]) == 'undefined') finishingArr[307][61] = new Array();
finishingArr[307][61][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][62]) == 'undefined') finishingArr[307][62] = new Array();
finishingArr[307][62][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][65]) == 'undefined') finishingArr[307][65] = new Array();
finishingArr[307][65][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][66]) == 'undefined') finishingArr[307][66] = new Array();
finishingArr[307][66][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][67]) == 'undefined') finishingArr[307][67] = new Array();
finishingArr[307][67][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][68]) == 'undefined') finishingArr[307][68] = new Array();
finishingArr[307][68][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][69]) == 'undefined') finishingArr[307][69] = new Array();
finishingArr[307][69][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][70]) == 'undefined') finishingArr[307][70] = new Array();
finishingArr[307][70][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][71]) == 'undefined') finishingArr[307][71] = new Array();
finishingArr[307][71][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][72]) == 'undefined') finishingArr[307][72] = new Array();
finishingArr[307][72][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][73]) == 'undefined') finishingArr[307][73] = new Array();
finishingArr[307][73][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][74]) == 'undefined') finishingArr[307][74] = new Array();
finishingArr[307][74][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][75]) == 'undefined') finishingArr[307][75] = new Array();
finishingArr[307][75][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][76]) == 'undefined') finishingArr[307][76] = new Array();
finishingArr[307][76][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][77]) == 'undefined') finishingArr[307][77] = new Array();
finishingArr[307][77][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][78]) == 'undefined') finishingArr[307][78] = new Array();
finishingArr[307][78][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][81]) == 'undefined') finishingArr[307][81] = new Array();
finishingArr[307][81][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][89]) == 'undefined') finishingArr[307][89] = new Array();
finishingArr[307][89][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][90]) == 'undefined') finishingArr[307][90] = new Array();
finishingArr[307][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][91]) == 'undefined') finishingArr[307][91] = new Array();
finishingArr[307][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][92]) == 'undefined') finishingArr[307][92] = new Array();
finishingArr[307][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][93]) == 'undefined') finishingArr[307][93] = new Array();
finishingArr[307][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][94]) == 'undefined') finishingArr[307][94] = new Array();
finishingArr[307][94][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][96]) == 'undefined') finishingArr[307][96] = new Array();
finishingArr[307][96][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][97]) == 'undefined') finishingArr[307][97] = new Array();
finishingArr[307][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][98]) == 'undefined') finishingArr[307][98] = new Array();
finishingArr[307][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][99]) == 'undefined') finishingArr[307][99] = new Array();
finishingArr[307][99][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][100]) == 'undefined') finishingArr[307][100] = new Array();
finishingArr[307][100][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][101]) == 'undefined') finishingArr[307][101] = new Array();
finishingArr[307][101][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][102]) == 'undefined') finishingArr[307][102] = new Array();
finishingArr[307][102][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][103]) == 'undefined') finishingArr[307][103] = new Array();
finishingArr[307][103][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][104]) == 'undefined') finishingArr[307][104] = new Array();
finishingArr[307][104][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][105]) == 'undefined') finishingArr[307][105] = new Array();
finishingArr[307][105][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][106]) == 'undefined') finishingArr[307][106] = new Array();
finishingArr[307][106][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][107]) == 'undefined') finishingArr[307][107] = new Array();
finishingArr[307][107][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][108]) == 'undefined') finishingArr[307][108] = new Array();
finishingArr[307][108][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][109]) == 'undefined') finishingArr[307][109] = new Array();
finishingArr[307][109][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][116]) == 'undefined') finishingArr[307][116] = new Array();
finishingArr[307][116][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][117]) == 'undefined') finishingArr[307][117] = new Array();
finishingArr[307][117][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][118]) == 'undefined') finishingArr[307][118] = new Array();
finishingArr[307][118][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][119]) == 'undefined') finishingArr[307][119] = new Array();
finishingArr[307][119][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][120]) == 'undefined') finishingArr[307][120] = new Array();
finishingArr[307][120][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][121]) == 'undefined') finishingArr[307][121] = new Array();
finishingArr[307][121][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][135]) == 'undefined') finishingArr[307][135] = new Array();
finishingArr[307][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][136]) == 'undefined') finishingArr[307][136] = new Array();
finishingArr[307][136][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][137]) == 'undefined') finishingArr[307][137] = new Array();
finishingArr[307][137][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][138]) == 'undefined') finishingArr[307][138] = new Array();
finishingArr[307][138][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][139]) == 'undefined') finishingArr[307][139] = new Array();
finishingArr[307][139][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][140]) == 'undefined') finishingArr[307][140] = new Array();
finishingArr[307][140][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][141]) == 'undefined') finishingArr[307][141] = new Array();
finishingArr[307][141][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][142]) == 'undefined') finishingArr[307][142] = new Array();
finishingArr[307][142][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][143]) == 'undefined') finishingArr[307][143] = new Array();
finishingArr[307][143][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][144]) == 'undefined') finishingArr[307][144] = new Array();
finishingArr[307][144][0] = new Array(0, 0, 0);
if(typeof(finishingArr[307][145]) == 'undefined') finishingArr[307][145] = new Array();
finishingArr[307][145][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308]) == 'undefined') finishingArr[308] = new Array();
if(typeof(finishingArr[308][3]) == 'undefined') finishingArr[308][3] = new Array();
finishingArr[308][3][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][4]) == 'undefined') finishingArr[308][4] = new Array();
finishingArr[308][4][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][5]) == 'undefined') finishingArr[308][5] = new Array();
finishingArr[308][5][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][6]) == 'undefined') finishingArr[308][6] = new Array();
finishingArr[308][6][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][7]) == 'undefined') finishingArr[308][7] = new Array();
finishingArr[308][7][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][8]) == 'undefined') finishingArr[308][8] = new Array();
finishingArr[308][8][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][9]) == 'undefined') finishingArr[308][9] = new Array();
finishingArr[308][9][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][10]) == 'undefined') finishingArr[308][10] = new Array();
finishingArr[308][10][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][11]) == 'undefined') finishingArr[308][11] = new Array();
finishingArr[308][11][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][12]) == 'undefined') finishingArr[308][12] = new Array();
finishingArr[308][12][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][13]) == 'undefined') finishingArr[308][13] = new Array();
finishingArr[308][13][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][14]) == 'undefined') finishingArr[308][14] = new Array();
finishingArr[308][14][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][15]) == 'undefined') finishingArr[308][15] = new Array();
finishingArr[308][15][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][16]) == 'undefined') finishingArr[308][16] = new Array();
finishingArr[308][16][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][17]) == 'undefined') finishingArr[308][17] = new Array();
finishingArr[308][17][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][18]) == 'undefined') finishingArr[308][18] = new Array();
finishingArr[308][18][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][19]) == 'undefined') finishingArr[308][19] = new Array();
finishingArr[308][19][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][20]) == 'undefined') finishingArr[308][20] = new Array();
finishingArr[308][20][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][43]) == 'undefined') finishingArr[308][43] = new Array();
finishingArr[308][43][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][52]) == 'undefined') finishingArr[308][52] = new Array();
finishingArr[308][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][56]) == 'undefined') finishingArr[308][56] = new Array();
finishingArr[308][56][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][57]) == 'undefined') finishingArr[308][57] = new Array();
finishingArr[308][57][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][59]) == 'undefined') finishingArr[308][59] = new Array();
finishingArr[308][59][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][60]) == 'undefined') finishingArr[308][60] = new Array();
finishingArr[308][60][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][61]) == 'undefined') finishingArr[308][61] = new Array();
finishingArr[308][61][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][62]) == 'undefined') finishingArr[308][62] = new Array();
finishingArr[308][62][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][65]) == 'undefined') finishingArr[308][65] = new Array();
finishingArr[308][65][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][66]) == 'undefined') finishingArr[308][66] = new Array();
finishingArr[308][66][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][67]) == 'undefined') finishingArr[308][67] = new Array();
finishingArr[308][67][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][68]) == 'undefined') finishingArr[308][68] = new Array();
finishingArr[308][68][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][69]) == 'undefined') finishingArr[308][69] = new Array();
finishingArr[308][69][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][70]) == 'undefined') finishingArr[308][70] = new Array();
finishingArr[308][70][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][71]) == 'undefined') finishingArr[308][71] = new Array();
finishingArr[308][71][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][72]) == 'undefined') finishingArr[308][72] = new Array();
finishingArr[308][72][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][73]) == 'undefined') finishingArr[308][73] = new Array();
finishingArr[308][73][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][74]) == 'undefined') finishingArr[308][74] = new Array();
finishingArr[308][74][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][75]) == 'undefined') finishingArr[308][75] = new Array();
finishingArr[308][75][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][76]) == 'undefined') finishingArr[308][76] = new Array();
finishingArr[308][76][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][77]) == 'undefined') finishingArr[308][77] = new Array();
finishingArr[308][77][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][78]) == 'undefined') finishingArr[308][78] = new Array();
finishingArr[308][78][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][81]) == 'undefined') finishingArr[308][81] = new Array();
finishingArr[308][81][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][89]) == 'undefined') finishingArr[308][89] = new Array();
finishingArr[308][89][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][90]) == 'undefined') finishingArr[308][90] = new Array();
finishingArr[308][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][91]) == 'undefined') finishingArr[308][91] = new Array();
finishingArr[308][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][92]) == 'undefined') finishingArr[308][92] = new Array();
finishingArr[308][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][93]) == 'undefined') finishingArr[308][93] = new Array();
finishingArr[308][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][94]) == 'undefined') finishingArr[308][94] = new Array();
finishingArr[308][94][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][96]) == 'undefined') finishingArr[308][96] = new Array();
finishingArr[308][96][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][97]) == 'undefined') finishingArr[308][97] = new Array();
finishingArr[308][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][98]) == 'undefined') finishingArr[308][98] = new Array();
finishingArr[308][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][99]) == 'undefined') finishingArr[308][99] = new Array();
finishingArr[308][99][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][100]) == 'undefined') finishingArr[308][100] = new Array();
finishingArr[308][100][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][101]) == 'undefined') finishingArr[308][101] = new Array();
finishingArr[308][101][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][102]) == 'undefined') finishingArr[308][102] = new Array();
finishingArr[308][102][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][103]) == 'undefined') finishingArr[308][103] = new Array();
finishingArr[308][103][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][104]) == 'undefined') finishingArr[308][104] = new Array();
finishingArr[308][104][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][105]) == 'undefined') finishingArr[308][105] = new Array();
finishingArr[308][105][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][106]) == 'undefined') finishingArr[308][106] = new Array();
finishingArr[308][106][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][107]) == 'undefined') finishingArr[308][107] = new Array();
finishingArr[308][107][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][108]) == 'undefined') finishingArr[308][108] = new Array();
finishingArr[308][108][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][109]) == 'undefined') finishingArr[308][109] = new Array();
finishingArr[308][109][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][116]) == 'undefined') finishingArr[308][116] = new Array();
finishingArr[308][116][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][117]) == 'undefined') finishingArr[308][117] = new Array();
finishingArr[308][117][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][118]) == 'undefined') finishingArr[308][118] = new Array();
finishingArr[308][118][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][119]) == 'undefined') finishingArr[308][119] = new Array();
finishingArr[308][119][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][120]) == 'undefined') finishingArr[308][120] = new Array();
finishingArr[308][120][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][121]) == 'undefined') finishingArr[308][121] = new Array();
finishingArr[308][121][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][135]) == 'undefined') finishingArr[308][135] = new Array();
finishingArr[308][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][136]) == 'undefined') finishingArr[308][136] = new Array();
finishingArr[308][136][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][137]) == 'undefined') finishingArr[308][137] = new Array();
finishingArr[308][137][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][138]) == 'undefined') finishingArr[308][138] = new Array();
finishingArr[308][138][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][139]) == 'undefined') finishingArr[308][139] = new Array();
finishingArr[308][139][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][140]) == 'undefined') finishingArr[308][140] = new Array();
finishingArr[308][140][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][141]) == 'undefined') finishingArr[308][141] = new Array();
finishingArr[308][141][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][142]) == 'undefined') finishingArr[308][142] = new Array();
finishingArr[308][142][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][143]) == 'undefined') finishingArr[308][143] = new Array();
finishingArr[308][143][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][144]) == 'undefined') finishingArr[308][144] = new Array();
finishingArr[308][144][0] = new Array(0, 0, 0);
if(typeof(finishingArr[308][145]) == 'undefined') finishingArr[308][145] = new Array();
finishingArr[308][145][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310]) == 'undefined') finishingArr[310] = new Array();
if(typeof(finishingArr[310][3]) == 'undefined') finishingArr[310][3] = new Array();
finishingArr[310][3][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[310][4]) == 'undefined') finishingArr[310][4] = new Array();
finishingArr[310][4][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[310][5]) == 'undefined') finishingArr[310][5] = new Array();
finishingArr[310][5][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[310][6]) == 'undefined') finishingArr[310][6] = new Array();
finishingArr[310][6][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[310][7]) == 'undefined') finishingArr[310][7] = new Array();
finishingArr[310][7][0] = new Array(13, 0.003, 0);
if(typeof(finishingArr[310][8]) == 'undefined') finishingArr[310][8] = new Array();
finishingArr[310][8][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[310][9]) == 'undefined') finishingArr[310][9] = new Array();
finishingArr[310][9][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[310][10]) == 'undefined') finishingArr[310][10] = new Array();
finishingArr[310][10][0] = new Array(17, 0.004, 0);
if(typeof(finishingArr[310][11]) == 'undefined') finishingArr[310][11] = new Array();
finishingArr[310][11][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[310][12]) == 'undefined') finishingArr[310][12] = new Array();
finishingArr[310][12][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[310][13]) == 'undefined') finishingArr[310][13] = new Array();
finishingArr[310][13][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[310][14]) == 'undefined') finishingArr[310][14] = new Array();
finishingArr[310][14][0] = new Array(19, 0.004, 0);
if(typeof(finishingArr[310][15]) == 'undefined') finishingArr[310][15] = new Array();
finishingArr[310][15][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][16]) == 'undefined') finishingArr[310][16] = new Array();
finishingArr[310][16][0] = new Array(54, 0.01, 0);
if(typeof(finishingArr[310][17]) == 'undefined') finishingArr[310][17] = new Array();
finishingArr[310][17][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[310][18]) == 'undefined') finishingArr[310][18] = new Array();
finishingArr[310][18][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[310][19]) == 'undefined') finishingArr[310][19] = new Array();
finishingArr[310][19][0] = new Array(10.5, 0.003, 0);
if(typeof(finishingArr[310][20]) == 'undefined') finishingArr[310][20] = new Array();
finishingArr[310][20][0] = new Array(27.5, 0.005, 0);
if(typeof(finishingArr[310][43]) == 'undefined') finishingArr[310][43] = new Array();
finishingArr[310][43][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[310][52]) == 'undefined') finishingArr[310][52] = new Array();
finishingArr[310][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][56]) == 'undefined') finishingArr[310][56] = new Array();
finishingArr[310][56][0] = new Array(28.5, 0.0075, 0);
if(typeof(finishingArr[310][57]) == 'undefined') finishingArr[310][57] = new Array();
finishingArr[310][57][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[310][59]) == 'undefined') finishingArr[310][59] = new Array();
finishingArr[310][59][0] = new Array(5, 0.002, 0);
if(typeof(finishingArr[310][60]) == 'undefined') finishingArr[310][60] = new Array();
finishingArr[310][60][0] = new Array(6, 0.002, 0);
if(typeof(finishingArr[310][61]) == 'undefined') finishingArr[310][61] = new Array();
finishingArr[310][61][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][62]) == 'undefined') finishingArr[310][62] = new Array();
finishingArr[310][62][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][65]) == 'undefined') finishingArr[310][65] = new Array();
finishingArr[310][65][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[310][66]) == 'undefined') finishingArr[310][66] = new Array();
finishingArr[310][66][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[310][67]) == 'undefined') finishingArr[310][67] = new Array();
finishingArr[310][67][0] = new Array(41, 0.012, 0);
if(typeof(finishingArr[310][68]) == 'undefined') finishingArr[310][68] = new Array();
finishingArr[310][68][0] = new Array(10.5, 0.004, 0);
if(typeof(finishingArr[310][69]) == 'undefined') finishingArr[310][69] = new Array();
finishingArr[310][69][0] = new Array(8.5, 0.003, 0);
if(typeof(finishingArr[310][70]) == 'undefined') finishingArr[310][70] = new Array();
finishingArr[310][70][0] = new Array(15.5, 0.003, 0);
if(typeof(finishingArr[310][71]) == 'undefined') finishingArr[310][71] = new Array();
finishingArr[310][71][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][72]) == 'undefined') finishingArr[310][72] = new Array();
finishingArr[310][72][0] = new Array(11.5, 0.001, 0);
if(typeof(finishingArr[310][73]) == 'undefined') finishingArr[310][73] = new Array();
finishingArr[310][73][0] = new Array(14, 0.0015, 0);
if(typeof(finishingArr[310][74]) == 'undefined') finishingArr[310][74] = new Array();
finishingArr[310][74][0] = new Array(17.5, 0.002, 0);
if(typeof(finishingArr[310][75]) == 'undefined') finishingArr[310][75] = new Array();
finishingArr[310][75][0] = new Array(11.5, 0.001, 0);
if(typeof(finishingArr[310][76]) == 'undefined') finishingArr[310][76] = new Array();
finishingArr[310][76][0] = new Array(8.5, 0.0008, 0);
if(typeof(finishingArr[310][77]) == 'undefined') finishingArr[310][77] = new Array();
finishingArr[310][77][0] = new Array(13, 0.0015, 0);
if(typeof(finishingArr[310][78]) == 'undefined') finishingArr[310][78] = new Array();
finishingArr[310][78][0] = new Array(16.5, 0.002, 0);
if(typeof(finishingArr[310][81]) == 'undefined') finishingArr[310][81] = new Array();
finishingArr[310][81][0] = new Array(18, 0.004, 0);
if(typeof(finishingArr[310][89]) == 'undefined') finishingArr[310][89] = new Array();
finishingArr[310][89][0] = new Array(19, 0.003, 0);
if(typeof(finishingArr[310][90]) == 'undefined') finishingArr[310][90] = new Array();
finishingArr[310][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][91]) == 'undefined') finishingArr[310][91] = new Array();
finishingArr[310][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][92]) == 'undefined') finishingArr[310][92] = new Array();
finishingArr[310][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][93]) == 'undefined') finishingArr[310][93] = new Array();
finishingArr[310][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][94]) == 'undefined') finishingArr[310][94] = new Array();
finishingArr[310][94][0] = new Array(28.5, 0.0075, 0);
if(typeof(finishingArr[310][96]) == 'undefined') finishingArr[310][96] = new Array();
finishingArr[310][96][0] = new Array(14, 0.0026, 0);
if(typeof(finishingArr[310][97]) == 'undefined') finishingArr[310][97] = new Array();
finishingArr[310][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][98]) == 'undefined') finishingArr[310][98] = new Array();
finishingArr[310][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][99]) == 'undefined') finishingArr[310][99] = new Array();
finishingArr[310][99][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[310][100]) == 'undefined') finishingArr[310][100] = new Array();
finishingArr[310][100][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[310][101]) == 'undefined') finishingArr[310][101] = new Array();
finishingArr[310][101][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[310][102]) == 'undefined') finishingArr[310][102] = new Array();
finishingArr[310][102][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[310][103]) == 'undefined') finishingArr[310][103] = new Array();
finishingArr[310][103][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][104]) == 'undefined') finishingArr[310][104] = new Array();
finishingArr[310][104][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][105]) == 'undefined') finishingArr[310][105] = new Array();
finishingArr[310][105][0] = new Array(19, 0.003, 0);
if(typeof(finishingArr[310][106]) == 'undefined') finishingArr[310][106] = new Array();
finishingArr[310][106][0] = new Array(28, 0.003, 0);
if(typeof(finishingArr[310][107]) == 'undefined') finishingArr[310][107] = new Array();
finishingArr[310][107][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][108]) == 'undefined') finishingArr[310][108] = new Array();
finishingArr[310][108][0] = new Array(55, 0.05, 0);
if(typeof(finishingArr[310][109]) == 'undefined') finishingArr[310][109] = new Array();
finishingArr[310][109][0] = new Array(75, 0.07, 0);
if(typeof(finishingArr[310][116]) == 'undefined') finishingArr[310][116] = new Array();
finishingArr[310][116][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][117]) == 'undefined') finishingArr[310][117] = new Array();
finishingArr[310][117][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][118]) == 'undefined') finishingArr[310][118] = new Array();
finishingArr[310][118][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][119]) == 'undefined') finishingArr[310][119] = new Array();
finishingArr[310][119][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][120]) == 'undefined') finishingArr[310][120] = new Array();
finishingArr[310][120][0] = new Array(7.5, 0.0015, 0);
if(typeof(finishingArr[310][121]) == 'undefined') finishingArr[310][121] = new Array();
finishingArr[310][121][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[310][135]) == 'undefined') finishingArr[310][135] = new Array();
finishingArr[310][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][136]) == 'undefined') finishingArr[310][136] = new Array();
finishingArr[310][136][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][137]) == 'undefined') finishingArr[310][137] = new Array();
finishingArr[310][137][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][138]) == 'undefined') finishingArr[310][138] = new Array();
finishingArr[310][138][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][139]) == 'undefined') finishingArr[310][139] = new Array();
finishingArr[310][139][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][140]) == 'undefined') finishingArr[310][140] = new Array();
finishingArr[310][140][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][141]) == 'undefined') finishingArr[310][141] = new Array();
finishingArr[310][141][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][142]) == 'undefined') finishingArr[310][142] = new Array();
finishingArr[310][142][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][143]) == 'undefined') finishingArr[310][143] = new Array();
finishingArr[310][143][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][144]) == 'undefined') finishingArr[310][144] = new Array();
finishingArr[310][144][0] = new Array(0, 0, 0);
if(typeof(finishingArr[310][145]) == 'undefined') finishingArr[310][145] = new Array();
finishingArr[310][145][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311]) == 'undefined') finishingArr[311] = new Array();
if(typeof(finishingArr[311][3]) == 'undefined') finishingArr[311][3] = new Array();
finishingArr[311][3][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[311][4]) == 'undefined') finishingArr[311][4] = new Array();
finishingArr[311][4][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[311][5]) == 'undefined') finishingArr[311][5] = new Array();
finishingArr[311][5][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[311][6]) == 'undefined') finishingArr[311][6] = new Array();
finishingArr[311][6][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[311][7]) == 'undefined') finishingArr[311][7] = new Array();
finishingArr[311][7][0] = new Array(13, 0.003, 0);
if(typeof(finishingArr[311][8]) == 'undefined') finishingArr[311][8] = new Array();
finishingArr[311][8][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[311][9]) == 'undefined') finishingArr[311][9] = new Array();
finishingArr[311][9][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[311][10]) == 'undefined') finishingArr[311][10] = new Array();
finishingArr[311][10][0] = new Array(17, 0.004, 0);
if(typeof(finishingArr[311][11]) == 'undefined') finishingArr[311][11] = new Array();
finishingArr[311][11][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[311][12]) == 'undefined') finishingArr[311][12] = new Array();
finishingArr[311][12][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[311][13]) == 'undefined') finishingArr[311][13] = new Array();
finishingArr[311][13][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[311][14]) == 'undefined') finishingArr[311][14] = new Array();
finishingArr[311][14][0] = new Array(19, 0.004, 0);
if(typeof(finishingArr[311][15]) == 'undefined') finishingArr[311][15] = new Array();
finishingArr[311][15][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][16]) == 'undefined') finishingArr[311][16] = new Array();
finishingArr[311][16][0] = new Array(54, 0.01, 0);
if(typeof(finishingArr[311][17]) == 'undefined') finishingArr[311][17] = new Array();
finishingArr[311][17][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[311][18]) == 'undefined') finishingArr[311][18] = new Array();
finishingArr[311][18][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[311][19]) == 'undefined') finishingArr[311][19] = new Array();
finishingArr[311][19][0] = new Array(10.5, 0.003, 0);
if(typeof(finishingArr[311][20]) == 'undefined') finishingArr[311][20] = new Array();
finishingArr[311][20][0] = new Array(27.5, 0.005, 0);
if(typeof(finishingArr[311][43]) == 'undefined') finishingArr[311][43] = new Array();
finishingArr[311][43][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[311][52]) == 'undefined') finishingArr[311][52] = new Array();
finishingArr[311][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][56]) == 'undefined') finishingArr[311][56] = new Array();
finishingArr[311][56][0] = new Array(28.5, 0.0075, 0);
if(typeof(finishingArr[311][57]) == 'undefined') finishingArr[311][57] = new Array();
finishingArr[311][57][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[311][59]) == 'undefined') finishingArr[311][59] = new Array();
finishingArr[311][59][0] = new Array(5, 0.002, 0);
if(typeof(finishingArr[311][60]) == 'undefined') finishingArr[311][60] = new Array();
finishingArr[311][60][0] = new Array(6, 0.002, 0);
if(typeof(finishingArr[311][61]) == 'undefined') finishingArr[311][61] = new Array();
finishingArr[311][61][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][62]) == 'undefined') finishingArr[311][62] = new Array();
finishingArr[311][62][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][65]) == 'undefined') finishingArr[311][65] = new Array();
finishingArr[311][65][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[311][66]) == 'undefined') finishingArr[311][66] = new Array();
finishingArr[311][66][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[311][67]) == 'undefined') finishingArr[311][67] = new Array();
finishingArr[311][67][0] = new Array(41, 0.012, 0);
if(typeof(finishingArr[311][68]) == 'undefined') finishingArr[311][68] = new Array();
finishingArr[311][68][0] = new Array(10.5, 0.004, 0);
if(typeof(finishingArr[311][69]) == 'undefined') finishingArr[311][69] = new Array();
finishingArr[311][69][0] = new Array(8.5, 0.003, 0);
if(typeof(finishingArr[311][70]) == 'undefined') finishingArr[311][70] = new Array();
finishingArr[311][70][0] = new Array(15.5, 0.003, 0);
if(typeof(finishingArr[311][71]) == 'undefined') finishingArr[311][71] = new Array();
finishingArr[311][71][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][72]) == 'undefined') finishingArr[311][72] = new Array();
finishingArr[311][72][0] = new Array(11.5, 0.001, 0);
if(typeof(finishingArr[311][73]) == 'undefined') finishingArr[311][73] = new Array();
finishingArr[311][73][0] = new Array(14, 0.0015, 0);
if(typeof(finishingArr[311][74]) == 'undefined') finishingArr[311][74] = new Array();
finishingArr[311][74][0] = new Array(17.5, 0.002, 0);
if(typeof(finishingArr[311][75]) == 'undefined') finishingArr[311][75] = new Array();
finishingArr[311][75][0] = new Array(11.5, 0.001, 0);
if(typeof(finishingArr[311][76]) == 'undefined') finishingArr[311][76] = new Array();
finishingArr[311][76][0] = new Array(8.5, 0.0008, 0);
if(typeof(finishingArr[311][77]) == 'undefined') finishingArr[311][77] = new Array();
finishingArr[311][77][0] = new Array(13, 0.0015, 0);
if(typeof(finishingArr[311][78]) == 'undefined') finishingArr[311][78] = new Array();
finishingArr[311][78][0] = new Array(16.5, 0.002, 0);
if(typeof(finishingArr[311][81]) == 'undefined') finishingArr[311][81] = new Array();
finishingArr[311][81][0] = new Array(18, 0.004, 0);
if(typeof(finishingArr[311][89]) == 'undefined') finishingArr[311][89] = new Array();
finishingArr[311][89][0] = new Array(19, 0.003, 0);
if(typeof(finishingArr[311][90]) == 'undefined') finishingArr[311][90] = new Array();
finishingArr[311][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][91]) == 'undefined') finishingArr[311][91] = new Array();
finishingArr[311][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][92]) == 'undefined') finishingArr[311][92] = new Array();
finishingArr[311][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][93]) == 'undefined') finishingArr[311][93] = new Array();
finishingArr[311][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][94]) == 'undefined') finishingArr[311][94] = new Array();
finishingArr[311][94][0] = new Array(28.5, 0.0075, 0);
if(typeof(finishingArr[311][96]) == 'undefined') finishingArr[311][96] = new Array();
finishingArr[311][96][0] = new Array(14, 0.0026, 0);
if(typeof(finishingArr[311][97]) == 'undefined') finishingArr[311][97] = new Array();
finishingArr[311][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][98]) == 'undefined') finishingArr[311][98] = new Array();
finishingArr[311][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][99]) == 'undefined') finishingArr[311][99] = new Array();
finishingArr[311][99][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[311][100]) == 'undefined') finishingArr[311][100] = new Array();
finishingArr[311][100][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[311][101]) == 'undefined') finishingArr[311][101] = new Array();
finishingArr[311][101][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[311][102]) == 'undefined') finishingArr[311][102] = new Array();
finishingArr[311][102][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[311][103]) == 'undefined') finishingArr[311][103] = new Array();
finishingArr[311][103][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][104]) == 'undefined') finishingArr[311][104] = new Array();
finishingArr[311][104][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][105]) == 'undefined') finishingArr[311][105] = new Array();
finishingArr[311][105][0] = new Array(19, 0.003, 0);
if(typeof(finishingArr[311][106]) == 'undefined') finishingArr[311][106] = new Array();
finishingArr[311][106][0] = new Array(28, 0.003, 0);
if(typeof(finishingArr[311][107]) == 'undefined') finishingArr[311][107] = new Array();
finishingArr[311][107][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][108]) == 'undefined') finishingArr[311][108] = new Array();
finishingArr[311][108][0] = new Array(55, 0.05, 0);
if(typeof(finishingArr[311][109]) == 'undefined') finishingArr[311][109] = new Array();
finishingArr[311][109][0] = new Array(75, 0.07, 0);
if(typeof(finishingArr[311][116]) == 'undefined') finishingArr[311][116] = new Array();
finishingArr[311][116][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][117]) == 'undefined') finishingArr[311][117] = new Array();
finishingArr[311][117][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][118]) == 'undefined') finishingArr[311][118] = new Array();
finishingArr[311][118][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][119]) == 'undefined') finishingArr[311][119] = new Array();
finishingArr[311][119][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][120]) == 'undefined') finishingArr[311][120] = new Array();
finishingArr[311][120][0] = new Array(7.5, 0.0015, 0);
if(typeof(finishingArr[311][121]) == 'undefined') finishingArr[311][121] = new Array();
finishingArr[311][121][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[311][135]) == 'undefined') finishingArr[311][135] = new Array();
finishingArr[311][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][136]) == 'undefined') finishingArr[311][136] = new Array();
finishingArr[311][136][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][137]) == 'undefined') finishingArr[311][137] = new Array();
finishingArr[311][137][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][138]) == 'undefined') finishingArr[311][138] = new Array();
finishingArr[311][138][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][139]) == 'undefined') finishingArr[311][139] = new Array();
finishingArr[311][139][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][140]) == 'undefined') finishingArr[311][140] = new Array();
finishingArr[311][140][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][141]) == 'undefined') finishingArr[311][141] = new Array();
finishingArr[311][141][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][142]) == 'undefined') finishingArr[311][142] = new Array();
finishingArr[311][142][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][143]) == 'undefined') finishingArr[311][143] = new Array();
finishingArr[311][143][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][144]) == 'undefined') finishingArr[311][144] = new Array();
finishingArr[311][144][0] = new Array(0, 0, 0);
if(typeof(finishingArr[311][145]) == 'undefined') finishingArr[311][145] = new Array();
finishingArr[311][145][0] = new Array(0, 0, 0);
if(typeof(finishingArr[317]) == 'undefined') finishingArr[317] = new Array();
if(typeof(finishingArr[317]['']) == 'undefined') finishingArr[317][''] = new Array();
finishingArr[317][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[318]) == 'undefined') finishingArr[318] = new Array();
if(typeof(finishingArr[318]['']) == 'undefined') finishingArr[318][''] = new Array();
finishingArr[318][''][0] = new Array(5, 0.01, 15);
if(typeof(finishingArr[318][15]) == 'undefined') finishingArr[318][15] = new Array();
finishingArr[318][15][0] = new Array(0, 0, 0);
if(typeof(finishingArr[318][52]) == 'undefined') finishingArr[318][52] = new Array();
finishingArr[318][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[318][67]) == 'undefined') finishingArr[318][67] = new Array();
finishingArr[318][67][0] = new Array(0, 0, 0);
if(typeof(finishingArr[318][71]) == 'undefined') finishingArr[318][71] = new Array();
finishingArr[318][71][0] = new Array(0, 0, 0);
if(typeof(finishingArr[318][90]) == 'undefined') finishingArr[318][90] = new Array();
finishingArr[318][90][0] = new Array(5, 0.01, 15);
if(typeof(finishingArr[318][91]) == 'undefined') finishingArr[318][91] = new Array();
finishingArr[318][91][0] = new Array(5, 0.01, 15);
if(typeof(finishingArr[319]) == 'undefined') finishingArr[319] = new Array();
if(typeof(finishingArr[319]['']) == 'undefined') finishingArr[319][''] = new Array();
finishingArr[319][''][0] = new Array(5, 0.004, 0);
if(typeof(finishingArr[320]) == 'undefined') finishingArr[320] = new Array();
if(typeof(finishingArr[320]['']) == 'undefined') finishingArr[320][''] = new Array();
finishingArr[320][''][0] = new Array(0, 0.07, 25);
if(typeof(finishingArr[324]) == 'undefined') finishingArr[324] = new Array();
if(typeof(finishingArr[324]['']) == 'undefined') finishingArr[324][''] = new Array();
finishingArr[324][''][0] = new Array(0, 0.01, 20);
if(typeof(finishingArr[324][65]) == 'undefined') finishingArr[324][65] = new Array();
finishingArr[324][65][0] = new Array(0, 0, 0);
if(typeof(finishingArr[324][66]) == 'undefined') finishingArr[324][66] = new Array();
finishingArr[324][66][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343]) == 'undefined') finishingArr[343] = new Array();
if(typeof(finishingArr[343][3]) == 'undefined') finishingArr[343][3] = new Array();
finishingArr[343][3][0] = new Array(70, 0.02, 0);
if(typeof(finishingArr[343][4]) == 'undefined') finishingArr[343][4] = new Array();
finishingArr[343][4][0] = new Array(70, 0.02, 0);
if(typeof(finishingArr[343][5]) == 'undefined') finishingArr[343][5] = new Array();
finishingArr[343][5][0] = new Array(45, 0.006, 0);
if(typeof(finishingArr[343][6]) == 'undefined') finishingArr[343][6] = new Array();
finishingArr[343][6][0] = new Array(70, 0.02, 0);
if(typeof(finishingArr[343][7]) == 'undefined') finishingArr[343][7] = new Array();
finishingArr[343][7][0] = new Array(55, 0.007, 0);
if(typeof(finishingArr[343][8]) == 'undefined') finishingArr[343][8] = new Array();
finishingArr[343][8][0] = new Array(40, 0.006, 0);
if(typeof(finishingArr[343][9]) == 'undefined') finishingArr[343][9] = new Array();
finishingArr[343][9][0] = new Array(35, 0.009, 0);
if(typeof(finishingArr[343][10]) == 'undefined') finishingArr[343][10] = new Array();
finishingArr[343][10][0] = new Array(65, 0.018, 0);
if(typeof(finishingArr[343][11]) == 'undefined') finishingArr[343][11] = new Array();
finishingArr[343][11][0] = new Array(70, 0.02, 0);
if(typeof(finishingArr[343][12]) == 'undefined') finishingArr[343][12] = new Array();
finishingArr[343][12][0] = new Array(35, 0.009, 0);
if(typeof(finishingArr[343][13]) == 'undefined') finishingArr[343][13] = new Array();
finishingArr[343][13][0] = new Array(40, 0.022, 0);
if(typeof(finishingArr[343][14]) == 'undefined') finishingArr[343][14] = new Array();
finishingArr[343][14][0] = new Array(35, 0.007, 0);
if(typeof(finishingArr[343][15]) == 'undefined') finishingArr[343][15] = new Array();
finishingArr[343][15][0] = new Array(45, 0.037, 0);
if(typeof(finishingArr[343][16]) == 'undefined') finishingArr[343][16] = new Array();
finishingArr[343][16][0] = new Array(275, 0.09, 0);
if(typeof(finishingArr[343][17]) == 'undefined') finishingArr[343][17] = new Array();
finishingArr[343][17][0] = new Array(35, 0.009, 0);
if(typeof(finishingArr[343][18]) == 'undefined') finishingArr[343][18] = new Array();
finishingArr[343][18][0] = new Array(70, 0.02, 0);
if(typeof(finishingArr[343][19]) == 'undefined') finishingArr[343][19] = new Array();
finishingArr[343][19][0] = new Array(50, 0.006, 0);
if(typeof(finishingArr[343][20]) == 'undefined') finishingArr[343][20] = new Array();
finishingArr[343][20][0] = new Array(70, 0.02, 0);
if(typeof(finishingArr[343][43]) == 'undefined') finishingArr[343][43] = new Array();
finishingArr[343][43][0] = new Array(35, 0.009, 0);
if(typeof(finishingArr[343][52]) == 'undefined') finishingArr[343][52] = new Array();
finishingArr[343][52][0] = new Array(410, 0.12, 0);
if(typeof(finishingArr[343][56]) == 'undefined') finishingArr[343][56] = new Array();
finishingArr[343][56][0] = new Array(260, 0.07, 0);
if(typeof(finishingArr[343][57]) == 'undefined') finishingArr[343][57] = new Array();
finishingArr[343][57][0] = new Array(45, 0.006, 0);
if(typeof(finishingArr[343][59]) == 'undefined') finishingArr[343][59] = new Array();
finishingArr[343][59][0] = new Array(45, 0.005, 0);
if(typeof(finishingArr[343][60]) == 'undefined') finishingArr[343][60] = new Array();
finishingArr[343][60][0] = new Array(45, 0.006, 0);
if(typeof(finishingArr[343][61]) == 'undefined') finishingArr[343][61] = new Array();
finishingArr[343][61][0] = new Array(70, 0.02, 0);
if(typeof(finishingArr[343][62]) == 'undefined') finishingArr[343][62] = new Array();
finishingArr[343][62][0] = new Array(70, 0.02, 0);
if(typeof(finishingArr[343][65]) == 'undefined') finishingArr[343][65] = new Array();
finishingArr[343][65][0] = new Array(70, 0.02, 0);
if(typeof(finishingArr[343][66]) == 'undefined') finishingArr[343][66] = new Array();
finishingArr[343][66][0] = new Array(70, 0.02, 0);
if(typeof(finishingArr[343][67]) == 'undefined') finishingArr[343][67] = new Array();
finishingArr[343][67][0] = new Array(150, 0.09, 0);
if(typeof(finishingArr[343][68]) == 'undefined') finishingArr[343][68] = new Array();
finishingArr[343][68][0] = new Array(50, 0.007, 0);
if(typeof(finishingArr[343][69]) == 'undefined') finishingArr[343][69] = new Array();
finishingArr[343][69][0] = new Array(45, 0.005, 0);
if(typeof(finishingArr[343][70]) == 'undefined') finishingArr[343][70] = new Array();
finishingArr[343][70][0] = new Array(65, 0.007, 0);
if(typeof(finishingArr[343][71]) == 'undefined') finishingArr[343][71] = new Array();
finishingArr[343][71][0] = new Array(50, 0.045, 0);
if(typeof(finishingArr[343][72]) == 'undefined') finishingArr[343][72] = new Array();
finishingArr[343][72][0] = new Array(40, 0.006, 0);
if(typeof(finishingArr[343][73]) == 'undefined') finishingArr[343][73] = new Array();
finishingArr[343][73][0] = new Array(40, 0.006, 0);
if(typeof(finishingArr[343][74]) == 'undefined') finishingArr[343][74] = new Array();
finishingArr[343][74][0] = new Array(40, 0.006, 0);
if(typeof(finishingArr[343][75]) == 'undefined') finishingArr[343][75] = new Array();
finishingArr[343][75][0] = new Array(40, 0.006, 0);
if(typeof(finishingArr[343][76]) == 'undefined') finishingArr[343][76] = new Array();
finishingArr[343][76][0] = new Array(40, 0.006, 0);
if(typeof(finishingArr[343][77]) == 'undefined') finishingArr[343][77] = new Array();
finishingArr[343][77][0] = new Array(40, 0.006, 0);
if(typeof(finishingArr[343][78]) == 'undefined') finishingArr[343][78] = new Array();
finishingArr[343][78][0] = new Array(40, 0.006, 0);
if(typeof(finishingArr[343][81]) == 'undefined') finishingArr[343][81] = new Array();
finishingArr[343][81][0] = new Array(75, 0.008, 0);
if(typeof(finishingArr[343][89]) == 'undefined') finishingArr[343][89] = new Array();
finishingArr[343][89][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][90]) == 'undefined') finishingArr[343][90] = new Array();
finishingArr[343][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][91]) == 'undefined') finishingArr[343][91] = new Array();
finishingArr[343][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][92]) == 'undefined') finishingArr[343][92] = new Array();
finishingArr[343][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][93]) == 'undefined') finishingArr[343][93] = new Array();
finishingArr[343][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][94]) == 'undefined') finishingArr[343][94] = new Array();
finishingArr[343][94][0] = new Array(260, 0.07, 0);
if(typeof(finishingArr[343][96]) == 'undefined') finishingArr[343][96] = new Array();
finishingArr[343][96][0] = new Array(40, 0.0014, 0);
if(typeof(finishingArr[343][97]) == 'undefined') finishingArr[343][97] = new Array();
finishingArr[343][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][98]) == 'undefined') finishingArr[343][98] = new Array();
finishingArr[343][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][99]) == 'undefined') finishingArr[343][99] = new Array();
finishingArr[343][99][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][100]) == 'undefined') finishingArr[343][100] = new Array();
finishingArr[343][100][0] = new Array(35, 0.015, 0);
if(typeof(finishingArr[343][101]) == 'undefined') finishingArr[343][101] = new Array();
finishingArr[343][101][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][102]) == 'undefined') finishingArr[343][102] = new Array();
finishingArr[343][102][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][103]) == 'undefined') finishingArr[343][103] = new Array();
finishingArr[343][103][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][104]) == 'undefined') finishingArr[343][104] = new Array();
finishingArr[343][104][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][105]) == 'undefined') finishingArr[343][105] = new Array();
finishingArr[343][105][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][106]) == 'undefined') finishingArr[343][106] = new Array();
finishingArr[343][106][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][107]) == 'undefined') finishingArr[343][107] = new Array();
finishingArr[343][107][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][108]) == 'undefined') finishingArr[343][108] = new Array();
finishingArr[343][108][0] = new Array(105, 0.7, 0);
if(typeof(finishingArr[343][109]) == 'undefined') finishingArr[343][109] = new Array();
finishingArr[343][109][0] = new Array(105, 0.07, 0);
if(typeof(finishingArr[343][116]) == 'undefined') finishingArr[343][116] = new Array();
finishingArr[343][116][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][117]) == 'undefined') finishingArr[343][117] = new Array();
finishingArr[343][117][0] = new Array(50, 0.035, 0);
if(typeof(finishingArr[343][118]) == 'undefined') finishingArr[343][118] = new Array();
finishingArr[343][118][0] = new Array(45, 0.07, 0);
if(typeof(finishingArr[343][119]) == 'undefined') finishingArr[343][119] = new Array();
finishingArr[343][119][0] = new Array(0.95, 0.12, 0);
if(typeof(finishingArr[343][120]) == 'undefined') finishingArr[343][120] = new Array();
finishingArr[343][120][0] = new Array(25, 0.0008, 0);
if(typeof(finishingArr[343][121]) == 'undefined') finishingArr[343][121] = new Array();
finishingArr[343][121][0] = new Array(35, 0.001, 0);
if(typeof(finishingArr[343][135]) == 'undefined') finishingArr[343][135] = new Array();
finishingArr[343][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][136]) == 'undefined') finishingArr[343][136] = new Array();
finishingArr[343][136][0] = new Array(0, 0.168, 0);
if(typeof(finishingArr[343][137]) == 'undefined') finishingArr[343][137] = new Array();
finishingArr[343][137][0] = new Array(0, 0.264, 0);
if(typeof(finishingArr[343][138]) == 'undefined') finishingArr[343][138] = new Array();
finishingArr[343][138][0] = new Array(0, 0.168, 0);
if(typeof(finishingArr[343][139]) == 'undefined') finishingArr[343][139] = new Array();
finishingArr[343][139][0] = new Array(0, 0.416, 0);
if(typeof(finishingArr[343][140]) == 'undefined') finishingArr[343][140] = new Array();
finishingArr[343][140][0] = new Array(0, 0.368, 0);
if(typeof(finishingArr[343][141]) == 'undefined') finishingArr[343][141] = new Array();
finishingArr[343][141][0] = new Array(0, 0.526, 0);
if(typeof(finishingArr[343][142]) == 'undefined') finishingArr[343][142] = new Array();
finishingArr[343][142][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][143]) == 'undefined') finishingArr[343][143] = new Array();
finishingArr[343][143][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][144]) == 'undefined') finishingArr[343][144] = new Array();
finishingArr[343][144][0] = new Array(0, 0, 0);
if(typeof(finishingArr[343][145]) == 'undefined') finishingArr[343][145] = new Array();
finishingArr[343][145][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344]) == 'undefined') finishingArr[344] = new Array();
if(typeof(finishingArr[344][3]) == 'undefined') finishingArr[344][3] = new Array();
finishingArr[344][3][0] = new Array(70, 0.03, 0);
if(typeof(finishingArr[344][4]) == 'undefined') finishingArr[344][4] = new Array();
finishingArr[344][4][0] = new Array(70, 0.03, 0);
if(typeof(finishingArr[344][5]) == 'undefined') finishingArr[344][5] = new Array();
finishingArr[344][5][0] = new Array(45, 0.007, 0);
if(typeof(finishingArr[344][6]) == 'undefined') finishingArr[344][6] = new Array();
finishingArr[344][6][0] = new Array(70, 0.03, 0);
if(typeof(finishingArr[344][7]) == 'undefined') finishingArr[344][7] = new Array();
finishingArr[344][7][0] = new Array(55, 0.01, 0);
if(typeof(finishingArr[344][8]) == 'undefined') finishingArr[344][8] = new Array();
finishingArr[344][8][0] = new Array(40, 0.009, 0);
if(typeof(finishingArr[344][9]) == 'undefined') finishingArr[344][9] = new Array();
finishingArr[344][9][0] = new Array(35, 0.01, 0);
if(typeof(finishingArr[344][10]) == 'undefined') finishingArr[344][10] = new Array();
finishingArr[344][10][0] = new Array(65, 0.027, 0);
if(typeof(finishingArr[344][11]) == 'undefined') finishingArr[344][11] = new Array();
finishingArr[344][11][0] = new Array(70, 0.03, 0);
if(typeof(finishingArr[344][12]) == 'undefined') finishingArr[344][12] = new Array();
finishingArr[344][12][0] = new Array(35, 0.01, 0);
if(typeof(finishingArr[344][13]) == 'undefined') finishingArr[344][13] = new Array();
finishingArr[344][13][0] = new Array(40, 0.023, 0);
if(typeof(finishingArr[344][14]) == 'undefined') finishingArr[344][14] = new Array();
finishingArr[344][14][0] = new Array(38, 0.009, 0);
if(typeof(finishingArr[344][15]) == 'undefined') finishingArr[344][15] = new Array();
finishingArr[344][15][0] = new Array(45, 0.05, 0);
if(typeof(finishingArr[344][16]) == 'undefined') finishingArr[344][16] = new Array();
finishingArr[344][16][0] = new Array(275, 0.1, 0);
if(typeof(finishingArr[344][17]) == 'undefined') finishingArr[344][17] = new Array();
finishingArr[344][17][0] = new Array(35, 0.01, 0);
if(typeof(finishingArr[344][18]) == 'undefined') finishingArr[344][18] = new Array();
finishingArr[344][18][0] = new Array(70, 0.03, 0);
if(typeof(finishingArr[344][19]) == 'undefined') finishingArr[344][19] = new Array();
finishingArr[344][19][0] = new Array(50, 0.009, 0);
if(typeof(finishingArr[344][20]) == 'undefined') finishingArr[344][20] = new Array();
finishingArr[344][20][0] = new Array(70, 0.03, 0);
if(typeof(finishingArr[344][43]) == 'undefined') finishingArr[344][43] = new Array();
finishingArr[344][43][0] = new Array(35, 0.01, 0);
if(typeof(finishingArr[344][52]) == 'undefined') finishingArr[344][52] = new Array();
finishingArr[344][52][0] = new Array(590, 0.12, 0);
if(typeof(finishingArr[344][56]) == 'undefined') finishingArr[344][56] = new Array();
finishingArr[344][56][0] = new Array(260, 0.07, 0);
if(typeof(finishingArr[344][57]) == 'undefined') finishingArr[344][57] = new Array();
finishingArr[344][57][0] = new Array(45, 0.007, 0);
if(typeof(finishingArr[344][59]) == 'undefined') finishingArr[344][59] = new Array();
finishingArr[344][59][0] = new Array(45, 0.006, 0);
if(typeof(finishingArr[344][60]) == 'undefined') finishingArr[344][60] = new Array();
finishingArr[344][60][0] = new Array(45, 0.007, 0);
if(typeof(finishingArr[344][61]) == 'undefined') finishingArr[344][61] = new Array();
finishingArr[344][61][0] = new Array(70, 0.03, 0);
if(typeof(finishingArr[344][62]) == 'undefined') finishingArr[344][62] = new Array();
finishingArr[344][62][0] = new Array(70, 0.03, 0);
if(typeof(finishingArr[344][65]) == 'undefined') finishingArr[344][65] = new Array();
finishingArr[344][65][0] = new Array(70, 0.03, 0);
if(typeof(finishingArr[344][66]) == 'undefined') finishingArr[344][66] = new Array();
finishingArr[344][66][0] = new Array(70, 0.03, 0);
if(typeof(finishingArr[344][67]) == 'undefined') finishingArr[344][67] = new Array();
finishingArr[344][67][0] = new Array(360, 0.09, 0);
if(typeof(finishingArr[344][68]) == 'undefined') finishingArr[344][68] = new Array();
finishingArr[344][68][0] = new Array(50, 0.011, 0);
if(typeof(finishingArr[344][69]) == 'undefined') finishingArr[344][69] = new Array();
finishingArr[344][69][0] = new Array(45, 0.006, 0);
if(typeof(finishingArr[344][70]) == 'undefined') finishingArr[344][70] = new Array();
finishingArr[344][70][0] = new Array(65, 0.01, 0);
if(typeof(finishingArr[344][71]) == 'undefined') finishingArr[344][71] = new Array();
finishingArr[344][71][0] = new Array(50, 0.055, 0);
if(typeof(finishingArr[344][72]) == 'undefined') finishingArr[344][72] = new Array();
finishingArr[344][72][0] = new Array(45, 0.009, 0);
if(typeof(finishingArr[344][73]) == 'undefined') finishingArr[344][73] = new Array();
finishingArr[344][73][0] = new Array(45, 0.009, 0);
if(typeof(finishingArr[344][74]) == 'undefined') finishingArr[344][74] = new Array();
finishingArr[344][74][0] = new Array(45, 0.009, 0);
if(typeof(finishingArr[344][75]) == 'undefined') finishingArr[344][75] = new Array();
finishingArr[344][75][0] = new Array(45, 0.009, 0);
if(typeof(finishingArr[344][76]) == 'undefined') finishingArr[344][76] = new Array();
finishingArr[344][76][0] = new Array(45, 0.009, 0);
if(typeof(finishingArr[344][77]) == 'undefined') finishingArr[344][77] = new Array();
finishingArr[344][77][0] = new Array(45, 0.009, 0);
if(typeof(finishingArr[344][78]) == 'undefined') finishingArr[344][78] = new Array();
finishingArr[344][78][0] = new Array(45, 0.009, 0);
if(typeof(finishingArr[344][81]) == 'undefined') finishingArr[344][81] = new Array();
finishingArr[344][81][0] = new Array(75, 0.011, 0);
if(typeof(finishingArr[344][89]) == 'undefined') finishingArr[344][89] = new Array();
finishingArr[344][89][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][90]) == 'undefined') finishingArr[344][90] = new Array();
finishingArr[344][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][91]) == 'undefined') finishingArr[344][91] = new Array();
finishingArr[344][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][92]) == 'undefined') finishingArr[344][92] = new Array();
finishingArr[344][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][93]) == 'undefined') finishingArr[344][93] = new Array();
finishingArr[344][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][94]) == 'undefined') finishingArr[344][94] = new Array();
finishingArr[344][94][0] = new Array(260, 0.07, 0);
if(typeof(finishingArr[344][96]) == 'undefined') finishingArr[344][96] = new Array();
finishingArr[344][96][0] = new Array(45, 0.0032, 0);
if(typeof(finishingArr[344][97]) == 'undefined') finishingArr[344][97] = new Array();
finishingArr[344][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][98]) == 'undefined') finishingArr[344][98] = new Array();
finishingArr[344][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][99]) == 'undefined') finishingArr[344][99] = new Array();
finishingArr[344][99][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][100]) == 'undefined') finishingArr[344][100] = new Array();
finishingArr[344][100][0] = new Array(55, 0.015, 0);
if(typeof(finishingArr[344][101]) == 'undefined') finishingArr[344][101] = new Array();
finishingArr[344][101][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][102]) == 'undefined') finishingArr[344][102] = new Array();
finishingArr[344][102][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][103]) == 'undefined') finishingArr[344][103] = new Array();
finishingArr[344][103][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][104]) == 'undefined') finishingArr[344][104] = new Array();
finishingArr[344][104][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][105]) == 'undefined') finishingArr[344][105] = new Array();
finishingArr[344][105][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][106]) == 'undefined') finishingArr[344][106] = new Array();
finishingArr[344][106][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][107]) == 'undefined') finishingArr[344][107] = new Array();
finishingArr[344][107][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][108]) == 'undefined') finishingArr[344][108] = new Array();
finishingArr[344][108][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][109]) == 'undefined') finishingArr[344][109] = new Array();
finishingArr[344][109][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][116]) == 'undefined') finishingArr[344][116] = new Array();
finishingArr[344][116][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][117]) == 'undefined') finishingArr[344][117] = new Array();
finishingArr[344][117][0] = new Array(130, 0.04, 0);
if(typeof(finishingArr[344][118]) == 'undefined') finishingArr[344][118] = new Array();
finishingArr[344][118][0] = new Array(120, 0.075, 0);
if(typeof(finishingArr[344][119]) == 'undefined') finishingArr[344][119] = new Array();
finishingArr[344][119][0] = new Array(170, 0.125, 0);
if(typeof(finishingArr[344][120]) == 'undefined') finishingArr[344][120] = new Array();
finishingArr[344][120][0] = new Array(30, 0.0014, 0);
if(typeof(finishingArr[344][121]) == 'undefined') finishingArr[344][121] = new Array();
finishingArr[344][121][0] = new Array(35, 0.0024, 0);
if(typeof(finishingArr[344][135]) == 'undefined') finishingArr[344][135] = new Array();
finishingArr[344][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][136]) == 'undefined') finishingArr[344][136] = new Array();
finishingArr[344][136][0] = new Array(0, 0.336, 0);
if(typeof(finishingArr[344][137]) == 'undefined') finishingArr[344][137] = new Array();
finishingArr[344][137][0] = new Array(0, 0.396, 0);
if(typeof(finishingArr[344][138]) == 'undefined') finishingArr[344][138] = new Array();
finishingArr[344][138][0] = new Array(0, 0.336, 0);
if(typeof(finishingArr[344][139]) == 'undefined') finishingArr[344][139] = new Array();
finishingArr[344][139][0] = new Array(0, 0.52, 0);
if(typeof(finishingArr[344][140]) == 'undefined') finishingArr[344][140] = new Array();
finishingArr[344][140][0] = new Array(0, 0.46, 0);
if(typeof(finishingArr[344][141]) == 'undefined') finishingArr[344][141] = new Array();
finishingArr[344][141][0] = new Array(0, 0.658, 0);
if(typeof(finishingArr[344][142]) == 'undefined') finishingArr[344][142] = new Array();
finishingArr[344][142][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][143]) == 'undefined') finishingArr[344][143] = new Array();
finishingArr[344][143][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][144]) == 'undefined') finishingArr[344][144] = new Array();
finishingArr[344][144][0] = new Array(0, 0, 0);
if(typeof(finishingArr[344][145]) == 'undefined') finishingArr[344][145] = new Array();
finishingArr[344][145][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345]) == 'undefined') finishingArr[345] = new Array();
if(typeof(finishingArr[345][3]) == 'undefined') finishingArr[345][3] = new Array();
finishingArr[345][3][0] = new Array(110, 0.045, 0);
if(typeof(finishingArr[345][4]) == 'undefined') finishingArr[345][4] = new Array();
finishingArr[345][4][0] = new Array(110, 0.045, 0);
if(typeof(finishingArr[345][5]) == 'undefined') finishingArr[345][5] = new Array();
finishingArr[345][5][0] = new Array(65, 0.015, 0);
if(typeof(finishingArr[345][6]) == 'undefined') finishingArr[345][6] = new Array();
finishingArr[345][6][0] = new Array(110, 0.045, 0);
if(typeof(finishingArr[345][7]) == 'undefined') finishingArr[345][7] = new Array();
finishingArr[345][7][0] = new Array(100, 0.018, 0);
if(typeof(finishingArr[345][8]) == 'undefined') finishingArr[345][8] = new Array();
finishingArr[345][8][0] = new Array(75, 0.014, 0);
if(typeof(finishingArr[345][9]) == 'undefined') finishingArr[345][9] = new Array();
finishingArr[345][9][0] = new Array(50, 0.015, 0);
if(typeof(finishingArr[345][10]) == 'undefined') finishingArr[345][10] = new Array();
finishingArr[345][10][0] = new Array(100, 0.043, 0);
if(typeof(finishingArr[345][11]) == 'undefined') finishingArr[345][11] = new Array();
finishingArr[345][11][0] = new Array(110, 0.045, 0);
if(typeof(finishingArr[345][12]) == 'undefined') finishingArr[345][12] = new Array();
finishingArr[345][12][0] = new Array(50, 0.015, 0);
if(typeof(finishingArr[345][13]) == 'undefined') finishingArr[345][13] = new Array();
finishingArr[345][13][0] = new Array(45, 0.027, 0);
if(typeof(finishingArr[345][14]) == 'undefined') finishingArr[345][14] = new Array();
finishingArr[345][14][0] = new Array(55, 0.027, 0);
if(typeof(finishingArr[345][15]) == 'undefined') finishingArr[345][15] = new Array();
finishingArr[345][15][0] = new Array(95, 0.065, 0);
if(typeof(finishingArr[345][16]) == 'undefined') finishingArr[345][16] = new Array();
finishingArr[345][16][0] = new Array(340, 0.13, 0);
if(typeof(finishingArr[345][17]) == 'undefined') finishingArr[345][17] = new Array();
finishingArr[345][17][0] = new Array(50, 0.015, 0);
if(typeof(finishingArr[345][18]) == 'undefined') finishingArr[345][18] = new Array();
finishingArr[345][18][0] = new Array(110, 0.045, 0);
if(typeof(finishingArr[345][19]) == 'undefined') finishingArr[345][19] = new Array();
finishingArr[345][19][0] = new Array(85, 0.014, 0);
if(typeof(finishingArr[345][20]) == 'undefined') finishingArr[345][20] = new Array();
finishingArr[345][20][0] = new Array(110, 0.045, 0);
if(typeof(finishingArr[345][43]) == 'undefined') finishingArr[345][43] = new Array();
finishingArr[345][43][0] = new Array(50, 0.015, 0);
if(typeof(finishingArr[345][52]) == 'undefined') finishingArr[345][52] = new Array();
finishingArr[345][52][0] = new Array(860, 0.12, 0);
if(typeof(finishingArr[345][56]) == 'undefined') finishingArr[345][56] = new Array();
finishingArr[345][56][0] = new Array(320, 0.09, 0);
if(typeof(finishingArr[345][57]) == 'undefined') finishingArr[345][57] = new Array();
finishingArr[345][57][0] = new Array(65, 0.015, 0);
if(typeof(finishingArr[345][59]) == 'undefined') finishingArr[345][59] = new Array();
finishingArr[345][59][0] = new Array(65, 0.013, 0);
if(typeof(finishingArr[345][60]) == 'undefined') finishingArr[345][60] = new Array();
finishingArr[345][60][0] = new Array(75, 0.015, 0);
if(typeof(finishingArr[345][61]) == 'undefined') finishingArr[345][61] = new Array();
finishingArr[345][61][0] = new Array(110, 0.045, 0);
if(typeof(finishingArr[345][62]) == 'undefined') finishingArr[345][62] = new Array();
finishingArr[345][62][0] = new Array(110, 0.045, 0);
if(typeof(finishingArr[345][65]) == 'undefined') finishingArr[345][65] = new Array();
finishingArr[345][65][0] = new Array(110, 0.045, 0);
if(typeof(finishingArr[345][66]) == 'undefined') finishingArr[345][66] = new Array();
finishingArr[345][66][0] = new Array(110, 0.045, 0);
if(typeof(finishingArr[345][67]) == 'undefined') finishingArr[345][67] = new Array();
finishingArr[345][67][0] = new Array(520, 0.09, 0);
if(typeof(finishingArr[345][68]) == 'undefined') finishingArr[345][68] = new Array();
finishingArr[345][68][0] = new Array(95, 0.02, 0);
if(typeof(finishingArr[345][69]) == 'undefined') finishingArr[345][69] = new Array();
finishingArr[345][69][0] = new Array(70, 0.01, 0);
if(typeof(finishingArr[345][70]) == 'undefined') finishingArr[345][70] = new Array();
finishingArr[345][70][0] = new Array(130, 0.02, 0);
if(typeof(finishingArr[345][71]) == 'undefined') finishingArr[345][71] = new Array();
finishingArr[345][71][0] = new Array(90, 0.08, 0);
if(typeof(finishingArr[345][72]) == 'undefined') finishingArr[345][72] = new Array();
finishingArr[345][72][0] = new Array(55, 0.027, 0);
if(typeof(finishingArr[345][73]) == 'undefined') finishingArr[345][73] = new Array();
finishingArr[345][73][0] = new Array(63, 0.027, 0);
if(typeof(finishingArr[345][74]) == 'undefined') finishingArr[345][74] = new Array();
finishingArr[345][74][0] = new Array(63, 0.027, 0);
if(typeof(finishingArr[345][75]) == 'undefined') finishingArr[345][75] = new Array();
finishingArr[345][75][0] = new Array(63, 0.027, 0);
if(typeof(finishingArr[345][76]) == 'undefined') finishingArr[345][76] = new Array();
finishingArr[345][76][0] = new Array(55, 0.027, 0);
if(typeof(finishingArr[345][77]) == 'undefined') finishingArr[345][77] = new Array();
finishingArr[345][77][0] = new Array(63, 0.027, 0);
if(typeof(finishingArr[345][78]) == 'undefined') finishingArr[345][78] = new Array();
finishingArr[345][78][0] = new Array(63, 0.027, 0);
if(typeof(finishingArr[345][81]) == 'undefined') finishingArr[345][81] = new Array();
finishingArr[345][81][0] = new Array(150, 0.022, 0);
if(typeof(finishingArr[345][89]) == 'undefined') finishingArr[345][89] = new Array();
finishingArr[345][89][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][90]) == 'undefined') finishingArr[345][90] = new Array();
finishingArr[345][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][91]) == 'undefined') finishingArr[345][91] = new Array();
finishingArr[345][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][92]) == 'undefined') finishingArr[345][92] = new Array();
finishingArr[345][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][93]) == 'undefined') finishingArr[345][93] = new Array();
finishingArr[345][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][94]) == 'undefined') finishingArr[345][94] = new Array();
finishingArr[345][94][0] = new Array(320, 0.09, 0);
if(typeof(finishingArr[345][96]) == 'undefined') finishingArr[345][96] = new Array();
finishingArr[345][96][0] = new Array(85, 0.009, 0);
if(typeof(finishingArr[345][97]) == 'undefined') finishingArr[345][97] = new Array();
finishingArr[345][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][98]) == 'undefined') finishingArr[345][98] = new Array();
finishingArr[345][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][99]) == 'undefined') finishingArr[345][99] = new Array();
finishingArr[345][99][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][100]) == 'undefined') finishingArr[345][100] = new Array();
finishingArr[345][100][0] = new Array(75, 0.015, 0);
if(typeof(finishingArr[345][101]) == 'undefined') finishingArr[345][101] = new Array();
finishingArr[345][101][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][102]) == 'undefined') finishingArr[345][102] = new Array();
finishingArr[345][102][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][103]) == 'undefined') finishingArr[345][103] = new Array();
finishingArr[345][103][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][104]) == 'undefined') finishingArr[345][104] = new Array();
finishingArr[345][104][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][105]) == 'undefined') finishingArr[345][105] = new Array();
finishingArr[345][105][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][106]) == 'undefined') finishingArr[345][106] = new Array();
finishingArr[345][106][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][107]) == 'undefined') finishingArr[345][107] = new Array();
finishingArr[345][107][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][108]) == 'undefined') finishingArr[345][108] = new Array();
finishingArr[345][108][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][109]) == 'undefined') finishingArr[345][109] = new Array();
finishingArr[345][109][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][116]) == 'undefined') finishingArr[345][116] = new Array();
finishingArr[345][116][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][117]) == 'undefined') finishingArr[345][117] = new Array();
finishingArr[345][117][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][118]) == 'undefined') finishingArr[345][118] = new Array();
finishingArr[345][118][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][119]) == 'undefined') finishingArr[345][119] = new Array();
finishingArr[345][119][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][120]) == 'undefined') finishingArr[345][120] = new Array();
finishingArr[345][120][0] = new Array(60, 0.005, 0);
if(typeof(finishingArr[345][121]) == 'undefined') finishingArr[345][121] = new Array();
finishingArr[345][121][0] = new Array(75, 0.007, 0);
if(typeof(finishingArr[345][135]) == 'undefined') finishingArr[345][135] = new Array();
finishingArr[345][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][136]) == 'undefined') finishingArr[345][136] = new Array();
finishingArr[345][136][0] = new Array(0, 0.336, 0);
if(typeof(finishingArr[345][137]) == 'undefined') finishingArr[345][137] = new Array();
finishingArr[345][137][0] = new Array(0, 0.396, 0);
if(typeof(finishingArr[345][138]) == 'undefined') finishingArr[345][138] = new Array();
finishingArr[345][138][0] = new Array(0, 0.336, 0);
if(typeof(finishingArr[345][139]) == 'undefined') finishingArr[345][139] = new Array();
finishingArr[345][139][0] = new Array(0, 0.52, 0);
if(typeof(finishingArr[345][140]) == 'undefined') finishingArr[345][140] = new Array();
finishingArr[345][140][0] = new Array(0, 0.46, 0);
if(typeof(finishingArr[345][141]) == 'undefined') finishingArr[345][141] = new Array();
finishingArr[345][141][0] = new Array(0, 0.658, 0);
if(typeof(finishingArr[345][142]) == 'undefined') finishingArr[345][142] = new Array();
finishingArr[345][142][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][143]) == 'undefined') finishingArr[345][143] = new Array();
finishingArr[345][143][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][144]) == 'undefined') finishingArr[345][144] = new Array();
finishingArr[345][144][0] = new Array(0, 0, 0);
if(typeof(finishingArr[345][145]) == 'undefined') finishingArr[345][145] = new Array();
finishingArr[345][145][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346]) == 'undefined') finishingArr[346] = new Array();
if(typeof(finishingArr[346][3]) == 'undefined') finishingArr[346][3] = new Array();
finishingArr[346][3][0] = new Array(150, 0.048, 0);
if(typeof(finishingArr[346][4]) == 'undefined') finishingArr[346][4] = new Array();
finishingArr[346][4][0] = new Array(150, 0.048, 0);
if(typeof(finishingArr[346][5]) == 'undefined') finishingArr[346][5] = new Array();
finishingArr[346][5][0] = new Array(75, 0.017, 0);
if(typeof(finishingArr[346][6]) == 'undefined') finishingArr[346][6] = new Array();
finishingArr[346][6][0] = new Array(150, 0.048, 0);
if(typeof(finishingArr[346][7]) == 'undefined') finishingArr[346][7] = new Array();
finishingArr[346][7][0] = new Array(120, 0.022, 0);
if(typeof(finishingArr[346][8]) == 'undefined') finishingArr[346][8] = new Array();
finishingArr[346][8][0] = new Array(85, 0.016, 0);
if(typeof(finishingArr[346][9]) == 'undefined') finishingArr[346][9] = new Array();
finishingArr[346][9][0] = new Array(70, 0.017, 0);
if(typeof(finishingArr[346][10]) == 'undefined') finishingArr[346][10] = new Array();
finishingArr[346][10][0] = new Array(140, 0.045, 0);
if(typeof(finishingArr[346][11]) == 'undefined') finishingArr[346][11] = new Array();
finishingArr[346][11][0] = new Array(150, 0.048, 0);
if(typeof(finishingArr[346][12]) == 'undefined') finishingArr[346][12] = new Array();
finishingArr[346][12][0] = new Array(70, 0.017, 0);
if(typeof(finishingArr[346][13]) == 'undefined') finishingArr[346][13] = new Array();
finishingArr[346][13][0] = new Array(65, 0.029, 0);
if(typeof(finishingArr[346][14]) == 'undefined') finishingArr[346][14] = new Array();
finishingArr[346][14][0] = new Array(75, 0.034, 0);
if(typeof(finishingArr[346][15]) == 'undefined') finishingArr[346][15] = new Array();
finishingArr[346][15][0] = new Array(120, 0.075, 0);
if(typeof(finishingArr[346][16]) == 'undefined') finishingArr[346][16] = new Array();
finishingArr[346][16][0] = new Array(425, 0.16, 0);
if(typeof(finishingArr[346][17]) == 'undefined') finishingArr[346][17] = new Array();
finishingArr[346][17][0] = new Array(70, 0.017, 0);
if(typeof(finishingArr[346][18]) == 'undefined') finishingArr[346][18] = new Array();
finishingArr[346][18][0] = new Array(150, 0.048, 0);
if(typeof(finishingArr[346][19]) == 'undefined') finishingArr[346][19] = new Array();
finishingArr[346][19][0] = new Array(95, 0.016, 0);
if(typeof(finishingArr[346][20]) == 'undefined') finishingArr[346][20] = new Array();
finishingArr[346][20][0] = new Array(150, 0.048, 0);
if(typeof(finishingArr[346][43]) == 'undefined') finishingArr[346][43] = new Array();
finishingArr[346][43][0] = new Array(70, 0.017, 0);
if(typeof(finishingArr[346][52]) == 'undefined') finishingArr[346][52] = new Array();
finishingArr[346][52][0] = new Array(1140, 0.12, 0);
if(typeof(finishingArr[346][56]) == 'undefined') finishingArr[346][56] = new Array();
finishingArr[346][56][0] = new Array(400, 0.11, 0);
if(typeof(finishingArr[346][57]) == 'undefined') finishingArr[346][57] = new Array();
finishingArr[346][57][0] = new Array(75, 0.017, 0);
if(typeof(finishingArr[346][59]) == 'undefined') finishingArr[346][59] = new Array();
finishingArr[346][59][0] = new Array(75, 0.015, 0);
if(typeof(finishingArr[346][60]) == 'undefined') finishingArr[346][60] = new Array();
finishingArr[346][60][0] = new Array(95, 0.017, 0);
if(typeof(finishingArr[346][61]) == 'undefined') finishingArr[346][61] = new Array();
finishingArr[346][61][0] = new Array(150, 0.048, 0);
if(typeof(finishingArr[346][62]) == 'undefined') finishingArr[346][62] = new Array();
finishingArr[346][62][0] = new Array(150, 0.048, 0);
if(typeof(finishingArr[346][65]) == 'undefined') finishingArr[346][65] = new Array();
finishingArr[346][65][0] = new Array(150, 0.048, 0);
if(typeof(finishingArr[346][66]) == 'undefined') finishingArr[346][66] = new Array();
finishingArr[346][66][0] = new Array(150, 0.048, 0);
if(typeof(finishingArr[346][67]) == 'undefined') finishingArr[346][67] = new Array();
finishingArr[346][67][0] = new Array(700, 0.09, 0);
if(typeof(finishingArr[346][68]) == 'undefined') finishingArr[346][68] = new Array();
finishingArr[346][68][0] = new Array(110, 0.024, 0);
if(typeof(finishingArr[346][69]) == 'undefined') finishingArr[346][69] = new Array();
finishingArr[346][69][0] = new Array(80, 0.012, 0);
if(typeof(finishingArr[346][70]) == 'undefined') finishingArr[346][70] = new Array();
finishingArr[346][70][0] = new Array(150, 0.025, 0);
if(typeof(finishingArr[346][71]) == 'undefined') finishingArr[346][71] = new Array();
finishingArr[346][71][0] = new Array(110, 0.09, 0);
if(typeof(finishingArr[346][72]) == 'undefined') finishingArr[346][72] = new Array();
finishingArr[346][72][0] = new Array(75, 0.034, 0);
if(typeof(finishingArr[346][73]) == 'undefined') finishingArr[346][73] = new Array();
finishingArr[346][73][0] = new Array(83, 0.034, 0);
if(typeof(finishingArr[346][74]) == 'undefined') finishingArr[346][74] = new Array();
finishingArr[346][74][0] = new Array(83, 0.034, 0);
if(typeof(finishingArr[346][75]) == 'undefined') finishingArr[346][75] = new Array();
finishingArr[346][75][0] = new Array(83, 0.034, 0);
if(typeof(finishingArr[346][76]) == 'undefined') finishingArr[346][76] = new Array();
finishingArr[346][76][0] = new Array(75, 0.034, 0);
if(typeof(finishingArr[346][77]) == 'undefined') finishingArr[346][77] = new Array();
finishingArr[346][77][0] = new Array(83, 0.034, 0);
if(typeof(finishingArr[346][78]) == 'undefined') finishingArr[346][78] = new Array();
finishingArr[346][78][0] = new Array(83, 0.034, 0);
if(typeof(finishingArr[346][81]) == 'undefined') finishingArr[346][81] = new Array();
finishingArr[346][81][0] = new Array(180, 0.027, 0);
if(typeof(finishingArr[346][89]) == 'undefined') finishingArr[346][89] = new Array();
finishingArr[346][89][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][90]) == 'undefined') finishingArr[346][90] = new Array();
finishingArr[346][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][91]) == 'undefined') finishingArr[346][91] = new Array();
finishingArr[346][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][92]) == 'undefined') finishingArr[346][92] = new Array();
finishingArr[346][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][93]) == 'undefined') finishingArr[346][93] = new Array();
finishingArr[346][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][94]) == 'undefined') finishingArr[346][94] = new Array();
finishingArr[346][94][0] = new Array(400, 0.11, 0);
if(typeof(finishingArr[346][96]) == 'undefined') finishingArr[346][96] = new Array();
finishingArr[346][96][0] = new Array(110, 0.013, 0);
if(typeof(finishingArr[346][97]) == 'undefined') finishingArr[346][97] = new Array();
finishingArr[346][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][98]) == 'undefined') finishingArr[346][98] = new Array();
finishingArr[346][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][99]) == 'undefined') finishingArr[346][99] = new Array();
finishingArr[346][99][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][100]) == 'undefined') finishingArr[346][100] = new Array();
finishingArr[346][100][0] = new Array(95, 0.015, 0);
if(typeof(finishingArr[346][101]) == 'undefined') finishingArr[346][101] = new Array();
finishingArr[346][101][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][102]) == 'undefined') finishingArr[346][102] = new Array();
finishingArr[346][102][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][103]) == 'undefined') finishingArr[346][103] = new Array();
finishingArr[346][103][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][104]) == 'undefined') finishingArr[346][104] = new Array();
finishingArr[346][104][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][105]) == 'undefined') finishingArr[346][105] = new Array();
finishingArr[346][105][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][106]) == 'undefined') finishingArr[346][106] = new Array();
finishingArr[346][106][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][107]) == 'undefined') finishingArr[346][107] = new Array();
finishingArr[346][107][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][108]) == 'undefined') finishingArr[346][108] = new Array();
finishingArr[346][108][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][109]) == 'undefined') finishingArr[346][109] = new Array();
finishingArr[346][109][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][116]) == 'undefined') finishingArr[346][116] = new Array();
finishingArr[346][116][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][117]) == 'undefined') finishingArr[346][117] = new Array();
finishingArr[346][117][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][118]) == 'undefined') finishingArr[346][118] = new Array();
finishingArr[346][118][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][119]) == 'undefined') finishingArr[346][119] = new Array();
finishingArr[346][119][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][120]) == 'undefined') finishingArr[346][120] = new Array();
finishingArr[346][120][0] = new Array(75, 0.007, 0);
if(typeof(finishingArr[346][121]) == 'undefined') finishingArr[346][121] = new Array();
finishingArr[346][121][0] = new Array(95, 0.009, 0);
if(typeof(finishingArr[346][135]) == 'undefined') finishingArr[346][135] = new Array();
finishingArr[346][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][136]) == 'undefined') finishingArr[346][136] = new Array();
finishingArr[346][136][0] = new Array(0, 0.336, 0);
if(typeof(finishingArr[346][137]) == 'undefined') finishingArr[346][137] = new Array();
finishingArr[346][137][0] = new Array(0, 0.396, 0);
if(typeof(finishingArr[346][138]) == 'undefined') finishingArr[346][138] = new Array();
finishingArr[346][138][0] = new Array(0, 0.336, 0);
if(typeof(finishingArr[346][139]) == 'undefined') finishingArr[346][139] = new Array();
finishingArr[346][139][0] = new Array(0, 0.52, 0);
if(typeof(finishingArr[346][140]) == 'undefined') finishingArr[346][140] = new Array();
finishingArr[346][140][0] = new Array(0, 0.46, 0);
if(typeof(finishingArr[346][141]) == 'undefined') finishingArr[346][141] = new Array();
finishingArr[346][141][0] = new Array(0, 0.658, 0);
if(typeof(finishingArr[346][142]) == 'undefined') finishingArr[346][142] = new Array();
finishingArr[346][142][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][143]) == 'undefined') finishingArr[346][143] = new Array();
finishingArr[346][143][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][144]) == 'undefined') finishingArr[346][144] = new Array();
finishingArr[346][144][0] = new Array(0, 0, 0);
if(typeof(finishingArr[346][145]) == 'undefined') finishingArr[346][145] = new Array();
finishingArr[346][145][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347]) == 'undefined') finishingArr[347] = new Array();
if(typeof(finishingArr[347][3]) == 'undefined') finishingArr[347][3] = new Array();
finishingArr[347][3][0] = new Array(180, 0.058, 0);
if(typeof(finishingArr[347][4]) == 'undefined') finishingArr[347][4] = new Array();
finishingArr[347][4][0] = new Array(180, 0.058, 0);
if(typeof(finishingArr[347][5]) == 'undefined') finishingArr[347][5] = new Array();
finishingArr[347][5][0] = new Array(95, 0.019, 0);
if(typeof(finishingArr[347][6]) == 'undefined') finishingArr[347][6] = new Array();
finishingArr[347][6][0] = new Array(180, 0.058, 0);
if(typeof(finishingArr[347][7]) == 'undefined') finishingArr[347][7] = new Array();
finishingArr[347][7][0] = new Array(135, 0.028, 0);
if(typeof(finishingArr[347][8]) == 'undefined') finishingArr[347][8] = new Array();
finishingArr[347][8][0] = new Array(95, 0.023, 0);
if(typeof(finishingArr[347][9]) == 'undefined') finishingArr[347][9] = new Array();
finishingArr[347][9][0] = new Array(90, 0.019, 0);
if(typeof(finishingArr[347][10]) == 'undefined') finishingArr[347][10] = new Array();
finishingArr[347][10][0] = new Array(170, 0.053, 0);
if(typeof(finishingArr[347][11]) == 'undefined') finishingArr[347][11] = new Array();
finishingArr[347][11][0] = new Array(180, 0.058, 0);
if(typeof(finishingArr[347][12]) == 'undefined') finishingArr[347][12] = new Array();
finishingArr[347][12][0] = new Array(90, 0.019, 0);
if(typeof(finishingArr[347][13]) == 'undefined') finishingArr[347][13] = new Array();
finishingArr[347][13][0] = new Array(75, 0.031, 0);
if(typeof(finishingArr[347][14]) == 'undefined') finishingArr[347][14] = new Array();
finishingArr[347][14][0] = new Array(95, 0.044, 0);
if(typeof(finishingArr[347][15]) == 'undefined') finishingArr[347][15] = new Array();
finishingArr[347][15][0] = new Array(140, 0.09, 0);
if(typeof(finishingArr[347][16]) == 'undefined') finishingArr[347][16] = new Array();
finishingArr[347][16][0] = new Array(475, 0.2, 0);
if(typeof(finishingArr[347][17]) == 'undefined') finishingArr[347][17] = new Array();
finishingArr[347][17][0] = new Array(90, 0.019, 0);
if(typeof(finishingArr[347][18]) == 'undefined') finishingArr[347][18] = new Array();
finishingArr[347][18][0] = new Array(180, 0.058, 0);
if(typeof(finishingArr[347][19]) == 'undefined') finishingArr[347][19] = new Array();
finishingArr[347][19][0] = new Array(110, 0.023, 0);
if(typeof(finishingArr[347][20]) == 'undefined') finishingArr[347][20] = new Array();
finishingArr[347][20][0] = new Array(180, 0.058, 0);
if(typeof(finishingArr[347][43]) == 'undefined') finishingArr[347][43] = new Array();
finishingArr[347][43][0] = new Array(90, 0.019, 0);
if(typeof(finishingArr[347][52]) == 'undefined') finishingArr[347][52] = new Array();
finishingArr[347][52][0] = new Array(1410, 0.12, 0);
if(typeof(finishingArr[347][56]) == 'undefined') finishingArr[347][56] = new Array();
finishingArr[347][56][0] = new Array(440, 0.12, 0);
if(typeof(finishingArr[347][57]) == 'undefined') finishingArr[347][57] = new Array();
finishingArr[347][57][0] = new Array(95, 0.019, 0);
if(typeof(finishingArr[347][59]) == 'undefined') finishingArr[347][59] = new Array();
finishingArr[347][59][0] = new Array(90, 0.017, 0);
if(typeof(finishingArr[347][60]) == 'undefined') finishingArr[347][60] = new Array();
finishingArr[347][60][0] = new Array(115, 0.019, 0);
if(typeof(finishingArr[347][61]) == 'undefined') finishingArr[347][61] = new Array();
finishingArr[347][61][0] = new Array(180, 0.058, 0);
if(typeof(finishingArr[347][62]) == 'undefined') finishingArr[347][62] = new Array();
finishingArr[347][62][0] = new Array(180, 0.058, 0);
if(typeof(finishingArr[347][65]) == 'undefined') finishingArr[347][65] = new Array();
finishingArr[347][65][0] = new Array(180, 0.058, 0);
if(typeof(finishingArr[347][66]) == 'undefined') finishingArr[347][66] = new Array();
finishingArr[347][66][0] = new Array(180, 0.058, 0);
if(typeof(finishingArr[347][67]) == 'undefined') finishingArr[347][67] = new Array();
finishingArr[347][67][0] = new Array(1290, 0.09, 0);
if(typeof(finishingArr[347][68]) == 'undefined') finishingArr[347][68] = new Array();
finishingArr[347][68][0] = new Array(130, 0.028, 0);
if(typeof(finishingArr[347][69]) == 'undefined') finishingArr[347][69] = new Array();
finishingArr[347][69][0] = new Array(90, 0.017, 0);
if(typeof(finishingArr[347][70]) == 'undefined') finishingArr[347][70] = new Array();
finishingArr[347][70][0] = new Array(170, 0.03, 0);
if(typeof(finishingArr[347][71]) == 'undefined') finishingArr[347][71] = new Array();
finishingArr[347][71][0] = new Array(150, 0.1, 0);
if(typeof(finishingArr[347][72]) == 'undefined') finishingArr[347][72] = new Array();
finishingArr[347][72][0] = new Array(95, 0.044, 0);
if(typeof(finishingArr[347][73]) == 'undefined') finishingArr[347][73] = new Array();
finishingArr[347][73][0] = new Array(113, 0.044, 0);
if(typeof(finishingArr[347][74]) == 'undefined') finishingArr[347][74] = new Array();
finishingArr[347][74][0] = new Array(113, 0.044, 0);
if(typeof(finishingArr[347][75]) == 'undefined') finishingArr[347][75] = new Array();
finishingArr[347][75][0] = new Array(113, 0.044, 0);
if(typeof(finishingArr[347][76]) == 'undefined') finishingArr[347][76] = new Array();
finishingArr[347][76][0] = new Array(95, 0.044, 0);
if(typeof(finishingArr[347][77]) == 'undefined') finishingArr[347][77] = new Array();
finishingArr[347][77][0] = new Array(113, 0.044, 0);
if(typeof(finishingArr[347][78]) == 'undefined') finishingArr[347][78] = new Array();
finishingArr[347][78][0] = new Array(113, 0.044, 0);
if(typeof(finishingArr[347][81]) == 'undefined') finishingArr[347][81] = new Array();
finishingArr[347][81][0] = new Array(200, 0.036, 0);
if(typeof(finishingArr[347][89]) == 'undefined') finishingArr[347][89] = new Array();
finishingArr[347][89][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][90]) == 'undefined') finishingArr[347][90] = new Array();
finishingArr[347][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][91]) == 'undefined') finishingArr[347][91] = new Array();
finishingArr[347][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][92]) == 'undefined') finishingArr[347][92] = new Array();
finishingArr[347][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][93]) == 'undefined') finishingArr[347][93] = new Array();
finishingArr[347][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][94]) == 'undefined') finishingArr[347][94] = new Array();
finishingArr[347][94][0] = new Array(440, 0.12, 0);
if(typeof(finishingArr[347][96]) == 'undefined') finishingArr[347][96] = new Array();
finishingArr[347][96][0] = new Array(130, 0.016, 0);
if(typeof(finishingArr[347][97]) == 'undefined') finishingArr[347][97] = new Array();
finishingArr[347][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][98]) == 'undefined') finishingArr[347][98] = new Array();
finishingArr[347][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][99]) == 'undefined') finishingArr[347][99] = new Array();
finishingArr[347][99][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][100]) == 'undefined') finishingArr[347][100] = new Array();
finishingArr[347][100][0] = new Array(115, 0.015, 0);
if(typeof(finishingArr[347][101]) == 'undefined') finishingArr[347][101] = new Array();
finishingArr[347][101][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][102]) == 'undefined') finishingArr[347][102] = new Array();
finishingArr[347][102][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][103]) == 'undefined') finishingArr[347][103] = new Array();
finishingArr[347][103][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][104]) == 'undefined') finishingArr[347][104] = new Array();
finishingArr[347][104][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][105]) == 'undefined') finishingArr[347][105] = new Array();
finishingArr[347][105][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][106]) == 'undefined') finishingArr[347][106] = new Array();
finishingArr[347][106][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][107]) == 'undefined') finishingArr[347][107] = new Array();
finishingArr[347][107][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][108]) == 'undefined') finishingArr[347][108] = new Array();
finishingArr[347][108][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][109]) == 'undefined') finishingArr[347][109] = new Array();
finishingArr[347][109][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][116]) == 'undefined') finishingArr[347][116] = new Array();
finishingArr[347][116][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][117]) == 'undefined') finishingArr[347][117] = new Array();
finishingArr[347][117][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][118]) == 'undefined') finishingArr[347][118] = new Array();
finishingArr[347][118][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][119]) == 'undefined') finishingArr[347][119] = new Array();
finishingArr[347][119][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][120]) == 'undefined') finishingArr[347][120] = new Array();
finishingArr[347][120][0] = new Array(90, 0.09, 0);
if(typeof(finishingArr[347][121]) == 'undefined') finishingArr[347][121] = new Array();
finishingArr[347][121][0] = new Array(115, 0.012, 0);
if(typeof(finishingArr[347][135]) == 'undefined') finishingArr[347][135] = new Array();
finishingArr[347][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][136]) == 'undefined') finishingArr[347][136] = new Array();
finishingArr[347][136][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][137]) == 'undefined') finishingArr[347][137] = new Array();
finishingArr[347][137][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][138]) == 'undefined') finishingArr[347][138] = new Array();
finishingArr[347][138][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][139]) == 'undefined') finishingArr[347][139] = new Array();
finishingArr[347][139][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][140]) == 'undefined') finishingArr[347][140] = new Array();
finishingArr[347][140][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][141]) == 'undefined') finishingArr[347][141] = new Array();
finishingArr[347][141][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][142]) == 'undefined') finishingArr[347][142] = new Array();
finishingArr[347][142][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][143]) == 'undefined') finishingArr[347][143] = new Array();
finishingArr[347][143][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][144]) == 'undefined') finishingArr[347][144] = new Array();
finishingArr[347][144][0] = new Array(0, 0, 0);
if(typeof(finishingArr[347][145]) == 'undefined') finishingArr[347][145] = new Array();
finishingArr[347][145][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349]) == 'undefined') finishingArr[349] = new Array();
if(typeof(finishingArr[349][3]) == 'undefined') finishingArr[349][3] = new Array();
finishingArr[349][3][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[349][4]) == 'undefined') finishingArr[349][4] = new Array();
finishingArr[349][4][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[349][5]) == 'undefined') finishingArr[349][5] = new Array();
finishingArr[349][5][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[349][6]) == 'undefined') finishingArr[349][6] = new Array();
finishingArr[349][6][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[349][7]) == 'undefined') finishingArr[349][7] = new Array();
finishingArr[349][7][0] = new Array(13, 0.003, 0);
if(typeof(finishingArr[349][8]) == 'undefined') finishingArr[349][8] = new Array();
finishingArr[349][8][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[349][9]) == 'undefined') finishingArr[349][9] = new Array();
finishingArr[349][9][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[349][10]) == 'undefined') finishingArr[349][10] = new Array();
finishingArr[349][10][0] = new Array(17, 0.004, 0);
if(typeof(finishingArr[349][11]) == 'undefined') finishingArr[349][11] = new Array();
finishingArr[349][11][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[349][12]) == 'undefined') finishingArr[349][12] = new Array();
finishingArr[349][12][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[349][13]) == 'undefined') finishingArr[349][13] = new Array();
finishingArr[349][13][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[349][14]) == 'undefined') finishingArr[349][14] = new Array();
finishingArr[349][14][0] = new Array(19, 0.004, 0);
if(typeof(finishingArr[349][15]) == 'undefined') finishingArr[349][15] = new Array();
finishingArr[349][15][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][16]) == 'undefined') finishingArr[349][16] = new Array();
finishingArr[349][16][0] = new Array(54, 0.01, 0);
if(typeof(finishingArr[349][17]) == 'undefined') finishingArr[349][17] = new Array();
finishingArr[349][17][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[349][18]) == 'undefined') finishingArr[349][18] = new Array();
finishingArr[349][18][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[349][19]) == 'undefined') finishingArr[349][19] = new Array();
finishingArr[349][19][0] = new Array(10.5, 0.003, 0);
if(typeof(finishingArr[349][20]) == 'undefined') finishingArr[349][20] = new Array();
finishingArr[349][20][0] = new Array(27.5, 0.005, 0);
if(typeof(finishingArr[349][43]) == 'undefined') finishingArr[349][43] = new Array();
finishingArr[349][43][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[349][52]) == 'undefined') finishingArr[349][52] = new Array();
finishingArr[349][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][56]) == 'undefined') finishingArr[349][56] = new Array();
finishingArr[349][56][0] = new Array(28.5, 0.0075, 0);
if(typeof(finishingArr[349][57]) == 'undefined') finishingArr[349][57] = new Array();
finishingArr[349][57][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[349][59]) == 'undefined') finishingArr[349][59] = new Array();
finishingArr[349][59][0] = new Array(5, 0.002, 0);
if(typeof(finishingArr[349][60]) == 'undefined') finishingArr[349][60] = new Array();
finishingArr[349][60][0] = new Array(6, 0.002, 0);
if(typeof(finishingArr[349][61]) == 'undefined') finishingArr[349][61] = new Array();
finishingArr[349][61][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][62]) == 'undefined') finishingArr[349][62] = new Array();
finishingArr[349][62][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][65]) == 'undefined') finishingArr[349][65] = new Array();
finishingArr[349][65][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[349][66]) == 'undefined') finishingArr[349][66] = new Array();
finishingArr[349][66][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[349][67]) == 'undefined') finishingArr[349][67] = new Array();
finishingArr[349][67][0] = new Array(41, 0.012, 0);
if(typeof(finishingArr[349][68]) == 'undefined') finishingArr[349][68] = new Array();
finishingArr[349][68][0] = new Array(10.5, 0.004, 0);
if(typeof(finishingArr[349][69]) == 'undefined') finishingArr[349][69] = new Array();
finishingArr[349][69][0] = new Array(8.5, 0.003, 0);
if(typeof(finishingArr[349][70]) == 'undefined') finishingArr[349][70] = new Array();
finishingArr[349][70][0] = new Array(15.5, 0.003, 0);
if(typeof(finishingArr[349][71]) == 'undefined') finishingArr[349][71] = new Array();
finishingArr[349][71][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][72]) == 'undefined') finishingArr[349][72] = new Array();
finishingArr[349][72][0] = new Array(11.5, 0.001, 0);
if(typeof(finishingArr[349][73]) == 'undefined') finishingArr[349][73] = new Array();
finishingArr[349][73][0] = new Array(14, 0.0015, 0);
if(typeof(finishingArr[349][74]) == 'undefined') finishingArr[349][74] = new Array();
finishingArr[349][74][0] = new Array(17.5, 0.002, 0);
if(typeof(finishingArr[349][75]) == 'undefined') finishingArr[349][75] = new Array();
finishingArr[349][75][0] = new Array(11.5, 0.001, 0);
if(typeof(finishingArr[349][76]) == 'undefined') finishingArr[349][76] = new Array();
finishingArr[349][76][0] = new Array(8.5, 0.0008, 0);
if(typeof(finishingArr[349][77]) == 'undefined') finishingArr[349][77] = new Array();
finishingArr[349][77][0] = new Array(13, 0.0015, 0);
if(typeof(finishingArr[349][78]) == 'undefined') finishingArr[349][78] = new Array();
finishingArr[349][78][0] = new Array(16.5, 0.002, 0);
if(typeof(finishingArr[349][81]) == 'undefined') finishingArr[349][81] = new Array();
finishingArr[349][81][0] = new Array(18, 0.004, 0);
if(typeof(finishingArr[349][89]) == 'undefined') finishingArr[349][89] = new Array();
finishingArr[349][89][0] = new Array(19, 0.003, 0);
if(typeof(finishingArr[349][90]) == 'undefined') finishingArr[349][90] = new Array();
finishingArr[349][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][91]) == 'undefined') finishingArr[349][91] = new Array();
finishingArr[349][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][92]) == 'undefined') finishingArr[349][92] = new Array();
finishingArr[349][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][93]) == 'undefined') finishingArr[349][93] = new Array();
finishingArr[349][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][94]) == 'undefined') finishingArr[349][94] = new Array();
finishingArr[349][94][0] = new Array(28.5, 0.0075, 0);
if(typeof(finishingArr[349][96]) == 'undefined') finishingArr[349][96] = new Array();
finishingArr[349][96][0] = new Array(14, 0.0026, 0);
if(typeof(finishingArr[349][97]) == 'undefined') finishingArr[349][97] = new Array();
finishingArr[349][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][98]) == 'undefined') finishingArr[349][98] = new Array();
finishingArr[349][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][99]) == 'undefined') finishingArr[349][99] = new Array();
finishingArr[349][99][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[349][100]) == 'undefined') finishingArr[349][100] = new Array();
finishingArr[349][100][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[349][101]) == 'undefined') finishingArr[349][101] = new Array();
finishingArr[349][101][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[349][102]) == 'undefined') finishingArr[349][102] = new Array();
finishingArr[349][102][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[349][103]) == 'undefined') finishingArr[349][103] = new Array();
finishingArr[349][103][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][104]) == 'undefined') finishingArr[349][104] = new Array();
finishingArr[349][104][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][105]) == 'undefined') finishingArr[349][105] = new Array();
finishingArr[349][105][0] = new Array(19, 0.003, 0);
if(typeof(finishingArr[349][106]) == 'undefined') finishingArr[349][106] = new Array();
finishingArr[349][106][0] = new Array(28, 0.003, 0);
if(typeof(finishingArr[349][107]) == 'undefined') finishingArr[349][107] = new Array();
finishingArr[349][107][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][108]) == 'undefined') finishingArr[349][108] = new Array();
finishingArr[349][108][0] = new Array(55, 0.05, 0);
if(typeof(finishingArr[349][109]) == 'undefined') finishingArr[349][109] = new Array();
finishingArr[349][109][0] = new Array(75, 0.07, 0);
if(typeof(finishingArr[349][116]) == 'undefined') finishingArr[349][116] = new Array();
finishingArr[349][116][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][117]) == 'undefined') finishingArr[349][117] = new Array();
finishingArr[349][117][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][118]) == 'undefined') finishingArr[349][118] = new Array();
finishingArr[349][118][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][119]) == 'undefined') finishingArr[349][119] = new Array();
finishingArr[349][119][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][120]) == 'undefined') finishingArr[349][120] = new Array();
finishingArr[349][120][0] = new Array(7.5, 0.0015, 0);
if(typeof(finishingArr[349][121]) == 'undefined') finishingArr[349][121] = new Array();
finishingArr[349][121][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[349][135]) == 'undefined') finishingArr[349][135] = new Array();
finishingArr[349][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][136]) == 'undefined') finishingArr[349][136] = new Array();
finishingArr[349][136][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][137]) == 'undefined') finishingArr[349][137] = new Array();
finishingArr[349][137][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][138]) == 'undefined') finishingArr[349][138] = new Array();
finishingArr[349][138][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][139]) == 'undefined') finishingArr[349][139] = new Array();
finishingArr[349][139][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][140]) == 'undefined') finishingArr[349][140] = new Array();
finishingArr[349][140][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][141]) == 'undefined') finishingArr[349][141] = new Array();
finishingArr[349][141][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][142]) == 'undefined') finishingArr[349][142] = new Array();
finishingArr[349][142][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][143]) == 'undefined') finishingArr[349][143] = new Array();
finishingArr[349][143][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][144]) == 'undefined') finishingArr[349][144] = new Array();
finishingArr[349][144][0] = new Array(0, 0, 0);
if(typeof(finishingArr[349][145]) == 'undefined') finishingArr[349][145] = new Array();
finishingArr[349][145][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350]) == 'undefined') finishingArr[350] = new Array();
if(typeof(finishingArr[350][3]) == 'undefined') finishingArr[350][3] = new Array();
finishingArr[350][3][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[350][4]) == 'undefined') finishingArr[350][4] = new Array();
finishingArr[350][4][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[350][5]) == 'undefined') finishingArr[350][5] = new Array();
finishingArr[350][5][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[350][6]) == 'undefined') finishingArr[350][6] = new Array();
finishingArr[350][6][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[350][7]) == 'undefined') finishingArr[350][7] = new Array();
finishingArr[350][7][0] = new Array(13, 0.003, 0);
if(typeof(finishingArr[350][8]) == 'undefined') finishingArr[350][8] = new Array();
finishingArr[350][8][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[350][9]) == 'undefined') finishingArr[350][9] = new Array();
finishingArr[350][9][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[350][10]) == 'undefined') finishingArr[350][10] = new Array();
finishingArr[350][10][0] = new Array(17, 0.004, 0);
if(typeof(finishingArr[350][11]) == 'undefined') finishingArr[350][11] = new Array();
finishingArr[350][11][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[350][12]) == 'undefined') finishingArr[350][12] = new Array();
finishingArr[350][12][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[350][13]) == 'undefined') finishingArr[350][13] = new Array();
finishingArr[350][13][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[350][14]) == 'undefined') finishingArr[350][14] = new Array();
finishingArr[350][14][0] = new Array(19, 0.004, 0);
if(typeof(finishingArr[350][15]) == 'undefined') finishingArr[350][15] = new Array();
finishingArr[350][15][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][16]) == 'undefined') finishingArr[350][16] = new Array();
finishingArr[350][16][0] = new Array(54, 0.01, 0);
if(typeof(finishingArr[350][17]) == 'undefined') finishingArr[350][17] = new Array();
finishingArr[350][17][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[350][18]) == 'undefined') finishingArr[350][18] = new Array();
finishingArr[350][18][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[350][19]) == 'undefined') finishingArr[350][19] = new Array();
finishingArr[350][19][0] = new Array(10.5, 0.003, 0);
if(typeof(finishingArr[350][20]) == 'undefined') finishingArr[350][20] = new Array();
finishingArr[350][20][0] = new Array(27.5, 0.005, 0);
if(typeof(finishingArr[350][43]) == 'undefined') finishingArr[350][43] = new Array();
finishingArr[350][43][0] = new Array(12, 0.0025, 0);
if(typeof(finishingArr[350][52]) == 'undefined') finishingArr[350][52] = new Array();
finishingArr[350][52][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][56]) == 'undefined') finishingArr[350][56] = new Array();
finishingArr[350][56][0] = new Array(28.5, 0.0075, 0);
if(typeof(finishingArr[350][57]) == 'undefined') finishingArr[350][57] = new Array();
finishingArr[350][57][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[350][59]) == 'undefined') finishingArr[350][59] = new Array();
finishingArr[350][59][0] = new Array(5, 0.002, 0);
if(typeof(finishingArr[350][60]) == 'undefined') finishingArr[350][60] = new Array();
finishingArr[350][60][0] = new Array(6, 0.002, 0);
if(typeof(finishingArr[350][61]) == 'undefined') finishingArr[350][61] = new Array();
finishingArr[350][61][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][62]) == 'undefined') finishingArr[350][62] = new Array();
finishingArr[350][62][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][65]) == 'undefined') finishingArr[350][65] = new Array();
finishingArr[350][65][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[350][66]) == 'undefined') finishingArr[350][66] = new Array();
finishingArr[350][66][0] = new Array(18.5, 0.005, 0);
if(typeof(finishingArr[350][67]) == 'undefined') finishingArr[350][67] = new Array();
finishingArr[350][67][0] = new Array(41, 0.012, 0);
if(typeof(finishingArr[350][68]) == 'undefined') finishingArr[350][68] = new Array();
finishingArr[350][68][0] = new Array(10.5, 0.004, 0);
if(typeof(finishingArr[350][69]) == 'undefined') finishingArr[350][69] = new Array();
finishingArr[350][69][0] = new Array(8.5, 0.003, 0);
if(typeof(finishingArr[350][70]) == 'undefined') finishingArr[350][70] = new Array();
finishingArr[350][70][0] = new Array(15.5, 0.003, 0);
if(typeof(finishingArr[350][71]) == 'undefined') finishingArr[350][71] = new Array();
finishingArr[350][71][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][72]) == 'undefined') finishingArr[350][72] = new Array();
finishingArr[350][72][0] = new Array(11.5, 0.001, 0);
if(typeof(finishingArr[350][73]) == 'undefined') finishingArr[350][73] = new Array();
finishingArr[350][73][0] = new Array(14, 0.0015, 0);
if(typeof(finishingArr[350][74]) == 'undefined') finishingArr[350][74] = new Array();
finishingArr[350][74][0] = new Array(17.5, 0.002, 0);
if(typeof(finishingArr[350][75]) == 'undefined') finishingArr[350][75] = new Array();
finishingArr[350][75][0] = new Array(11.5, 0.001, 0);
if(typeof(finishingArr[350][76]) == 'undefined') finishingArr[350][76] = new Array();
finishingArr[350][76][0] = new Array(8.5, 0.0008, 0);
if(typeof(finishingArr[350][77]) == 'undefined') finishingArr[350][77] = new Array();
finishingArr[350][77][0] = new Array(13, 0.0015, 0);
if(typeof(finishingArr[350][78]) == 'undefined') finishingArr[350][78] = new Array();
finishingArr[350][78][0] = new Array(16.5, 0.002, 0);
if(typeof(finishingArr[350][81]) == 'undefined') finishingArr[350][81] = new Array();
finishingArr[350][81][0] = new Array(18, 0.004, 0);
if(typeof(finishingArr[350][89]) == 'undefined') finishingArr[350][89] = new Array();
finishingArr[350][89][0] = new Array(19, 0.003, 0);
if(typeof(finishingArr[350][90]) == 'undefined') finishingArr[350][90] = new Array();
finishingArr[350][90][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][91]) == 'undefined') finishingArr[350][91] = new Array();
finishingArr[350][91][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][92]) == 'undefined') finishingArr[350][92] = new Array();
finishingArr[350][92][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][93]) == 'undefined') finishingArr[350][93] = new Array();
finishingArr[350][93][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][94]) == 'undefined') finishingArr[350][94] = new Array();
finishingArr[350][94][0] = new Array(28.5, 0.0075, 0);
if(typeof(finishingArr[350][96]) == 'undefined') finishingArr[350][96] = new Array();
finishingArr[350][96][0] = new Array(14, 0.0026, 0);
if(typeof(finishingArr[350][97]) == 'undefined') finishingArr[350][97] = new Array();
finishingArr[350][97][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][98]) == 'undefined') finishingArr[350][98] = new Array();
finishingArr[350][98][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][99]) == 'undefined') finishingArr[350][99] = new Array();
finishingArr[350][99][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[350][100]) == 'undefined') finishingArr[350][100] = new Array();
finishingArr[350][100][0] = new Array(3.5, 0.002, 0);
if(typeof(finishingArr[350][101]) == 'undefined') finishingArr[350][101] = new Array();
finishingArr[350][101][0] = new Array(6.5, 0.002, 0);
if(typeof(finishingArr[350][102]) == 'undefined') finishingArr[350][102] = new Array();
finishingArr[350][102][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[350][103]) == 'undefined') finishingArr[350][103] = new Array();
finishingArr[350][103][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][104]) == 'undefined') finishingArr[350][104] = new Array();
finishingArr[350][104][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][105]) == 'undefined') finishingArr[350][105] = new Array();
finishingArr[350][105][0] = new Array(19, 0.003, 0);
if(typeof(finishingArr[350][106]) == 'undefined') finishingArr[350][106] = new Array();
finishingArr[350][106][0] = new Array(28, 0.003, 0);
if(typeof(finishingArr[350][107]) == 'undefined') finishingArr[350][107] = new Array();
finishingArr[350][107][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][108]) == 'undefined') finishingArr[350][108] = new Array();
finishingArr[350][108][0] = new Array(55, 0.05, 0);
if(typeof(finishingArr[350][109]) == 'undefined') finishingArr[350][109] = new Array();
finishingArr[350][109][0] = new Array(75, 0.07, 0);
if(typeof(finishingArr[350][116]) == 'undefined') finishingArr[350][116] = new Array();
finishingArr[350][116][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][117]) == 'undefined') finishingArr[350][117] = new Array();
finishingArr[350][117][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][118]) == 'undefined') finishingArr[350][118] = new Array();
finishingArr[350][118][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][119]) == 'undefined') finishingArr[350][119] = new Array();
finishingArr[350][119][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][120]) == 'undefined') finishingArr[350][120] = new Array();
finishingArr[350][120][0] = new Array(7.5, 0.0015, 0);
if(typeof(finishingArr[350][121]) == 'undefined') finishingArr[350][121] = new Array();
finishingArr[350][121][0] = new Array(10, 0.002, 0);
if(typeof(finishingArr[350][135]) == 'undefined') finishingArr[350][135] = new Array();
finishingArr[350][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][136]) == 'undefined') finishingArr[350][136] = new Array();
finishingArr[350][136][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][137]) == 'undefined') finishingArr[350][137] = new Array();
finishingArr[350][137][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][138]) == 'undefined') finishingArr[350][138] = new Array();
finishingArr[350][138][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][139]) == 'undefined') finishingArr[350][139] = new Array();
finishingArr[350][139][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][140]) == 'undefined') finishingArr[350][140] = new Array();
finishingArr[350][140][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][141]) == 'undefined') finishingArr[350][141] = new Array();
finishingArr[350][141][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][142]) == 'undefined') finishingArr[350][142] = new Array();
finishingArr[350][142][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][143]) == 'undefined') finishingArr[350][143] = new Array();
finishingArr[350][143][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][144]) == 'undefined') finishingArr[350][144] = new Array();
finishingArr[350][144][0] = new Array(0, 0, 0);
if(typeof(finishingArr[350][145]) == 'undefined') finishingArr[350][145] = new Array();
finishingArr[350][145][0] = new Array(0, 0, 0);
if(typeof(finishingArr[370]) == 'undefined') finishingArr[370] = new Array();
if(typeof(finishingArr[370]['']) == 'undefined') finishingArr[370][''] = new Array();
finishingArr[370][''][0] = new Array(0, 0.01, 20);
if(typeof(finishingArr[389]) == 'undefined') finishingArr[389] = new Array();
if(typeof(finishingArr[389]['']) == 'undefined') finishingArr[389][''] = new Array();
finishingArr[389][''][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[392]) == 'undefined') finishingArr[392] = new Array();
if(typeof(finishingArr[392][96]) == 'undefined') finishingArr[392][96] = new Array();
finishingArr[392][96][0] = new Array(0, 0.13, 0);
if(typeof(finishingArr[392][117]) == 'undefined') finishingArr[392][117] = new Array();
finishingArr[392][117][0] = new Array(0, 0.1, 0);
if(typeof(finishingArr[392][118]) == 'undefined') finishingArr[392][118] = new Array();
finishingArr[392][118][0] = new Array(0, 0.13, 0);
if(typeof(finishingArr[392][119]) == 'undefined') finishingArr[392][119] = new Array();
finishingArr[392][119][0] = new Array(0, 0.16, 0);
if(typeof(finishingArr[392][120]) == 'undefined') finishingArr[392][120] = new Array();
finishingArr[392][120][0] = new Array(0, 0.065, 0);
if(typeof(finishingArr[392][121]) == 'undefined') finishingArr[392][121] = new Array();
finishingArr[392][121][0] = new Array(0, 0.1, 0);
if(typeof(finishingArr[393]) == 'undefined') finishingArr[393] = new Array();
if(typeof(finishingArr[393][117]) == 'undefined') finishingArr[393][117] = new Array();
finishingArr[393][117][0] = new Array(0, 0.2, 0);
if(typeof(finishingArr[393][118]) == 'undefined') finishingArr[393][118] = new Array();
finishingArr[393][118][0] = new Array(0, 0.2, 0);
if(typeof(finishingArr[394]) == 'undefined') finishingArr[394] = new Array();
if(typeof(finishingArr[394][96]) == 'undefined') finishingArr[394][96] = new Array();
finishingArr[394][96][0] = new Array(5, 0.24, 0);
if(typeof(finishingArr[394][117]) == 'undefined') finishingArr[394][117] = new Array();
finishingArr[394][117][0] = new Array(5, 0.18, 0);
if(typeof(finishingArr[394][118]) == 'undefined') finishingArr[394][118] = new Array();
finishingArr[394][118][0] = new Array(5, 0.24, 0);
if(typeof(finishingArr[394][119]) == 'undefined') finishingArr[394][119] = new Array();
finishingArr[394][119][0] = new Array(5, 0.3, 0);
if(typeof(finishingArr[394][120]) == 'undefined') finishingArr[394][120] = new Array();
finishingArr[394][120][0] = new Array(5, 0.12, 0);
if(typeof(finishingArr[394][121]) == 'undefined') finishingArr[394][121] = new Array();
finishingArr[394][121][0] = new Array(5, 0.18, 0);
if(typeof(finishingArr[396]) == 'undefined') finishingArr[396] = new Array();
if(typeof(finishingArr[396][96]) == 'undefined') finishingArr[396][96] = new Array();
finishingArr[396][96][0] = new Array(0, 0.03, 0);
if(typeof(finishingArr[396][117]) == 'undefined') finishingArr[396][117] = new Array();
finishingArr[396][117][0] = new Array(0, 0.02, 0);
if(typeof(finishingArr[396][118]) == 'undefined') finishingArr[396][118] = new Array();
finishingArr[396][118][0] = new Array(0, 0.03, 0);
if(typeof(finishingArr[396][119]) == 'undefined') finishingArr[396][119] = new Array();
finishingArr[396][119][0] = new Array(0, 0.04, 0);
if(typeof(finishingArr[396][120]) == 'undefined') finishingArr[396][120] = new Array();
finishingArr[396][120][0] = new Array(0, 0.01, 0);
if(typeof(finishingArr[396][121]) == 'undefined') finishingArr[396][121] = new Array();
finishingArr[396][121][0] = new Array(0, 0.02, 0);
if(typeof(finishingArr[397]) == 'undefined') finishingArr[397] = new Array();
if(typeof(finishingArr[397]['']) == 'undefined') finishingArr[397][''] = new Array();
finishingArr[397][''][500] = new Array(0, 3, 0);
finishingArr[397][''][250] = new Array(0, 3.65, 0);
finishingArr[397][''][0] = new Array(0, 4.25, 0);
if(typeof(finishingArr[398]) == 'undefined') finishingArr[398] = new Array();
if(typeof(finishingArr[398]['']) == 'undefined') finishingArr[398][''] = new Array();
finishingArr[398][''][500] = new Array(0, 3, 0);
finishingArr[398][''][250] = new Array(0, 3.65, 0);
finishingArr[398][''][0] = new Array(0, 4.25, 0);
if(typeof(finishingArr[399]) == 'undefined') finishingArr[399] = new Array();
if(typeof(finishingArr[399][117]) == 'undefined') finishingArr[399][117] = new Array();
finishingArr[399][117][0] = new Array(0, 1.43, 0);
if(typeof(finishingArr[399][118]) == 'undefined') finishingArr[399][118] = new Array();
finishingArr[399][118][0] = new Array(0, 1.64, 0);
if(typeof(finishingArr[401]) == 'undefined') finishingArr[401] = new Array();
if(typeof(finishingArr[401]['']) == 'undefined') finishingArr[401][''] = new Array();
finishingArr[401][''][0] = new Array(20, 0.02, 0);
if(typeof(finishingArr[402]) == 'undefined') finishingArr[402] = new Array();
if(typeof(finishingArr[402]['']) == 'undefined') finishingArr[402][''] = new Array();
finishingArr[402][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[403]) == 'undefined') finishingArr[403] = new Array();
if(typeof(finishingArr[403]['']) == 'undefined') finishingArr[403][''] = new Array();
finishingArr[403][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[405]) == 'undefined') finishingArr[405] = new Array();
if(typeof(finishingArr[405]['']) == 'undefined') finishingArr[405][''] = new Array();
finishingArr[405][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[406]) == 'undefined') finishingArr[406] = new Array();
if(typeof(finishingArr[406]['']) == 'undefined') finishingArr[406][''] = new Array();
finishingArr[406][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[407]) == 'undefined') finishingArr[407] = new Array();
if(typeof(finishingArr[407]['']) == 'undefined') finishingArr[407][''] = new Array();
finishingArr[407][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[410]) == 'undefined') finishingArr[410] = new Array();
if(typeof(finishingArr[410]['']) == 'undefined') finishingArr[410][''] = new Array();
finishingArr[410][''][0] = new Array(0, 0, 40);
if(typeof(finishingArr[410][96]) == 'undefined') finishingArr[410][96] = new Array();
finishingArr[410][96][0] = new Array(0, 0, 35);
if(typeof(finishingArr[410][120]) == 'undefined') finishingArr[410][120] = new Array();
finishingArr[410][120][0] = new Array(0, 0, 30);
if(typeof(finishingArr[410][121]) == 'undefined') finishingArr[410][121] = new Array();
finishingArr[410][121][0] = new Array(0, 0, 30);
if(typeof(finishingArr[410][135]) == 'undefined') finishingArr[410][135] = new Array();
finishingArr[410][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[411]) == 'undefined') finishingArr[411] = new Array();
if(typeof(finishingArr[411]['']) == 'undefined') finishingArr[411][''] = new Array();
finishingArr[411][''][0] = new Array(0, 0, 55);
if(typeof(finishingArr[411][96]) == 'undefined') finishingArr[411][96] = new Array();
finishingArr[411][96][0] = new Array(0, 0, 50);
if(typeof(finishingArr[411][120]) == 'undefined') finishingArr[411][120] = new Array();
finishingArr[411][120][0] = new Array(0, 0, 40);
if(typeof(finishingArr[411][121]) == 'undefined') finishingArr[411][121] = new Array();
finishingArr[411][121][0] = new Array(0, 0, 45);
if(typeof(finishingArr[411][135]) == 'undefined') finishingArr[411][135] = new Array();
finishingArr[411][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[412]) == 'undefined') finishingArr[412] = new Array();
if(typeof(finishingArr[412]['']) == 'undefined') finishingArr[412][''] = new Array();
finishingArr[412][''][0] = new Array(0, 0, 90);
if(typeof(finishingArr[412][135]) == 'undefined') finishingArr[412][135] = new Array();
finishingArr[412][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[413]) == 'undefined') finishingArr[413] = new Array();
if(typeof(finishingArr[413]['']) == 'undefined') finishingArr[413][''] = new Array();
finishingArr[413][''][0] = new Array(0, 0, 115);
if(typeof(finishingArr[413][135]) == 'undefined') finishingArr[413][135] = new Array();
finishingArr[413][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[414]) == 'undefined') finishingArr[414] = new Array();
if(typeof(finishingArr[414]['']) == 'undefined') finishingArr[414][''] = new Array();
finishingArr[414][''][0] = new Array(0, 0, 130);
if(typeof(finishingArr[414][135]) == 'undefined') finishingArr[414][135] = new Array();
finishingArr[414][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[450]) == 'undefined') finishingArr[450] = new Array();
if(typeof(finishingArr[450]['']) == 'undefined') finishingArr[450][''] = new Array();
finishingArr[450][''][0] = new Array(50, 0.07, 0);
if(typeof(finishingArr[451]) == 'undefined') finishingArr[451] = new Array();
if(typeof(finishingArr[451]['']) == 'undefined') finishingArr[451][''] = new Array();
finishingArr[451][''][0] = new Array(50, 0.07, 0);
if(typeof(finishingArr[452]) == 'undefined') finishingArr[452] = new Array();
if(typeof(finishingArr[452]['']) == 'undefined') finishingArr[452][''] = new Array();
finishingArr[452][''][0] = new Array(50, 0.07, 0);
if(typeof(finishingArr[454]) == 'undefined') finishingArr[454] = new Array();
if(typeof(finishingArr[454]['']) == 'undefined') finishingArr[454][''] = new Array();
finishingArr[454][''][0] = new Array(50, 0.07, 0);
if(typeof(finishingArr[455]) == 'undefined') finishingArr[455] = new Array();
if(typeof(finishingArr[455]['']) == 'undefined') finishingArr[455][''] = new Array();
finishingArr[455][''][0] = new Array(50, 0.07, 0);
if(typeof(finishingArr[456]) == 'undefined') finishingArr[456] = new Array();
if(typeof(finishingArr[456]['']) == 'undefined') finishingArr[456][''] = new Array();
finishingArr[456][''][0] = new Array(35, 0.005, 100);
if(typeof(finishingArr[457]) == 'undefined') finishingArr[457] = new Array();
if(typeof(finishingArr[457]['']) == 'undefined') finishingArr[457][''] = new Array();
finishingArr[457][''][0] = new Array(0, 0.03, 0);
if(typeof(finishingArr[458]) == 'undefined') finishingArr[458] = new Array();
if(typeof(finishingArr[458]['']) == 'undefined') finishingArr[458][''] = new Array();
finishingArr[458][''][0] = new Array(0, 0.06, 0);
if(typeof(finishingArr[459]) == 'undefined') finishingArr[459] = new Array();
if(typeof(finishingArr[459]['']) == 'undefined') finishingArr[459][''] = new Array();
finishingArr[459][''][0] = new Array(96, 0.211, 0);
if(typeof(finishingArr[494]) == 'undefined') finishingArr[494] = new Array();
if(typeof(finishingArr[494]['']) == 'undefined') finishingArr[494][''] = new Array();
finishingArr[494][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[495]) == 'undefined') finishingArr[495] = new Array();
if(typeof(finishingArr[495]['']) == 'undefined') finishingArr[495][''] = new Array();
finishingArr[495][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[496]) == 'undefined') finishingArr[496] = new Array();
if(typeof(finishingArr[496]['']) == 'undefined') finishingArr[496][''] = new Array();
finishingArr[496][''][0] = new Array(0, 1, 0);
if(typeof(finishingArr[497]) == 'undefined') finishingArr[497] = new Array();
if(typeof(finishingArr[497]['']) == 'undefined') finishingArr[497][''] = new Array();
finishingArr[497][''][0] = new Array(0, 2, 0);
if(typeof(finishingArr[498]) == 'undefined') finishingArr[498] = new Array();
if(typeof(finishingArr[498]['']) == 'undefined') finishingArr[498][''] = new Array();
finishingArr[498][''][0] = new Array(58, 0.07, 0);
if(typeof(finishingArr[499]) == 'undefined') finishingArr[499] = new Array();
if(typeof(finishingArr[499]['']) == 'undefined') finishingArr[499][''] = new Array();
finishingArr[499][''][0] = new Array(58, 0.07, 0);
if(typeof(finishingArr[500]) == 'undefined') finishingArr[500] = new Array();
if(typeof(finishingArr[500]['']) == 'undefined') finishingArr[500][''] = new Array();
finishingArr[500][''][0] = new Array(58, 0.07, 0);
if(typeof(finishingArr[501]) == 'undefined') finishingArr[501] = new Array();
if(typeof(finishingArr[501]['']) == 'undefined') finishingArr[501][''] = new Array();
finishingArr[501][''][0] = new Array(58, 0.07, 0);
if(typeof(finishingArr[502]) == 'undefined') finishingArr[502] = new Array();
if(typeof(finishingArr[502]['']) == 'undefined') finishingArr[502][''] = new Array();
finishingArr[502][''][0] = new Array(58, 0.07, 0);
if(typeof(finishingArr[503]) == 'undefined') finishingArr[503] = new Array();
if(typeof(finishingArr[503]['']) == 'undefined') finishingArr[503][''] = new Array();
finishingArr[503][''][0] = new Array(58, 0.07, 0);
if(typeof(finishingArr[504]) == 'undefined') finishingArr[504] = new Array();
if(typeof(finishingArr[504]['']) == 'undefined') finishingArr[504][''] = new Array();
finishingArr[504][''][0] = new Array(58, 0.07, 0);
if(typeof(finishingArr[505]) == 'undefined') finishingArr[505] = new Array();
if(typeof(finishingArr[505]['']) == 'undefined') finishingArr[505][''] = new Array();
finishingArr[505][''][0] = new Array(58, 0.07, 0);
if(typeof(finishingArr[506]) == 'undefined') finishingArr[506] = new Array();
if(typeof(finishingArr[506]['']) == 'undefined') finishingArr[506][''] = new Array();
finishingArr[506][''][0] = new Array(58, 0.07, 0);
if(typeof(finishingArr[507]) == 'undefined') finishingArr[507] = new Array();
if(typeof(finishingArr[507]['']) == 'undefined') finishingArr[507][''] = new Array();
finishingArr[507][''][0] = new Array(58, 0.07, 0);
if(typeof(finishingArr[508]) == 'undefined') finishingArr[508] = new Array();
if(typeof(finishingArr[508]['']) == 'undefined') finishingArr[508][''] = new Array();
finishingArr[508][''][0] = new Array(5, 0.08, 58);
if(typeof(finishingArr[509]) == 'undefined') finishingArr[509] = new Array();
if(typeof(finishingArr[509]['']) == 'undefined') finishingArr[509][''] = new Array();
finishingArr[509][''][0] = new Array(5, 0.08, 58);
if(typeof(finishingArr[510]) == 'undefined') finishingArr[510] = new Array();
if(typeof(finishingArr[510]['']) == 'undefined') finishingArr[510][''] = new Array();
finishingArr[510][''][0] = new Array(5, 0.08, 58);
if(typeof(finishingArr[511]) == 'undefined') finishingArr[511] = new Array();
if(typeof(finishingArr[511]['']) == 'undefined') finishingArr[511][''] = new Array();
finishingArr[511][''][0] = new Array(5, 0.08, 58);
if(typeof(finishingArr[512]) == 'undefined') finishingArr[512] = new Array();
if(typeof(finishingArr[512]['']) == 'undefined') finishingArr[512][''] = new Array();
finishingArr[512][''][0] = new Array(5, 0.08, 58);
if(typeof(finishingArr[513]) == 'undefined') finishingArr[513] = new Array();
if(typeof(finishingArr[513]['']) == 'undefined') finishingArr[513][''] = new Array();
finishingArr[513][''][0] = new Array(129, 0.19, 0);
if(typeof(finishingArr[514]) == 'undefined') finishingArr[514] = new Array();
if(typeof(finishingArr[514]['']) == 'undefined') finishingArr[514][''] = new Array();
finishingArr[514][''][0] = new Array(131, 0.225, 0);
if(typeof(finishingArr[515]) == 'undefined') finishingArr[515] = new Array();
if(typeof(finishingArr[515]['']) == 'undefined') finishingArr[515][''] = new Array();
finishingArr[515][''][0] = new Array(145.5, 0.358, 0);
if(typeof(finishingArr[516]) == 'undefined') finishingArr[516] = new Array();
if(typeof(finishingArr[516]['']) == 'undefined') finishingArr[516][''] = new Array();
finishingArr[516][''][0] = new Array(134, 0.222, 0);
if(typeof(finishingArr[517]) == 'undefined') finishingArr[517] = new Array();
if(typeof(finishingArr[517]['']) == 'undefined') finishingArr[517][''] = new Array();
finishingArr[517][''][0] = new Array(136, 0.29, 0);
if(typeof(finishingArr[518]) == 'undefined') finishingArr[518] = new Array();
if(typeof(finishingArr[518]['']) == 'undefined') finishingArr[518][''] = new Array();
finishingArr[518][''][0] = new Array(150.5, 0.208, 0);
if(typeof(finishingArr[519]) == 'undefined') finishingArr[519] = new Array();
if(typeof(finishingArr[519]['']) == 'undefined') finishingArr[519][''] = new Array();
finishingArr[519][''][0] = new Array(0, 0.05, 0);
if(typeof(finishingArr[520]) == 'undefined') finishingArr[520] = new Array();
if(typeof(finishingArr[520]['']) == 'undefined') finishingArr[520][''] = new Array();
finishingArr[520][''][0] = new Array(0, 0.1, 0);
if(typeof(finishingArr[521]) == 'undefined') finishingArr[521] = new Array();
if(typeof(finishingArr[521]['']) == 'undefined') finishingArr[521][''] = new Array();
finishingArr[521][''][0] = new Array(0, 0.15, 0);
if(typeof(finishingArr[522]) == 'undefined') finishingArr[522] = new Array();
if(typeof(finishingArr[522]['']) == 'undefined') finishingArr[522][''] = new Array();
finishingArr[522][''][0] = new Array(0, 0.2, 0);
if(typeof(finishingArr[523]) == 'undefined') finishingArr[523] = new Array();
if(typeof(finishingArr[523]['']) == 'undefined') finishingArr[523][''] = new Array();
finishingArr[523][''][0] = new Array(0, 0.25, 0);
if(typeof(finishingArr[524]) == 'undefined') finishingArr[524] = new Array();
if(typeof(finishingArr[524]['']) == 'undefined') finishingArr[524][''] = new Array();
finishingArr[524][''][0] = new Array(0, 1.25, 0);
if(typeof(finishingArr[529]) == 'undefined') finishingArr[529] = new Array();
if(typeof(finishingArr[529]['']) == 'undefined') finishingArr[529][''] = new Array();
finishingArr[529][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[530]) == 'undefined') finishingArr[530] = new Array();
if(typeof(finishingArr[530]['']) == 'undefined') finishingArr[530][''] = new Array();
finishingArr[530][''][0] = new Array(0, 0.25, 0);
if(typeof(finishingArr[531]) == 'undefined') finishingArr[531] = new Array();
if(typeof(finishingArr[531]['']) == 'undefined') finishingArr[531][''] = new Array();
finishingArr[531][''][0] = new Array(0, 1, 0);
if(typeof(finishingArr[594]) == 'undefined') finishingArr[594] = new Array();
if(typeof(finishingArr[594]['']) == 'undefined') finishingArr[594][''] = new Array();
finishingArr[594][''][0] = new Array(0, 5, 44);
if(typeof(finishingArr[595]) == 'undefined') finishingArr[595] = new Array();
if(typeof(finishingArr[595]['']) == 'undefined') finishingArr[595][''] = new Array();
finishingArr[595][''][0] = new Array(0, 5, 64);
if(typeof(finishingArr[596]) == 'undefined') finishingArr[596] = new Array();
if(typeof(finishingArr[596]['']) == 'undefined') finishingArr[596][''] = new Array();
finishingArr[596][''][0] = new Array(0, 29, 50);
if(typeof(finishingArr[597]) == 'undefined') finishingArr[597] = new Array();
if(typeof(finishingArr[597]['']) == 'undefined') finishingArr[597][''] = new Array();
finishingArr[597][''][0] = new Array(0, 39, 80);
if(typeof(finishingArr[598]) == 'undefined') finishingArr[598] = new Array();
if(typeof(finishingArr[598]['']) == 'undefined') finishingArr[598][''] = new Array();
finishingArr[598][''][0] = new Array(0, 249, 0);
if(typeof(finishingArr[599]) == 'undefined') finishingArr[599] = new Array();
if(typeof(finishingArr[599]['']) == 'undefined') finishingArr[599][''] = new Array();
finishingArr[599][''][0] = new Array(0, 399, 0);
if(typeof(finishingArr[600]) == 'undefined') finishingArr[600] = new Array();
if(typeof(finishingArr[600]['']) == 'undefined') finishingArr[600][''] = new Array();
finishingArr[600][''][0] = new Array(0, 39, 40);
if(typeof(finishingArr[601]) == 'undefined') finishingArr[601] = new Array();
if(typeof(finishingArr[601]['']) == 'undefined') finishingArr[601][''] = new Array();
finishingArr[601][''][0] = new Array(0, 99, 200);
if(typeof(finishingArr[602]) == 'undefined') finishingArr[602] = new Array();
if(typeof(finishingArr[602]['']) == 'undefined') finishingArr[602][''] = new Array();
finishingArr[602][''][0] = new Array(0, 19, 30);
if(typeof(finishingArr[603]) == 'undefined') finishingArr[603] = new Array();
if(typeof(finishingArr[603]['']) == 'undefined') finishingArr[603][''] = new Array();
finishingArr[603][''][0] = new Array(0, 29, 40);
if(typeof(finishingArr[604]) == 'undefined') finishingArr[604] = new Array();
if(typeof(finishingArr[604]['']) == 'undefined') finishingArr[604][''] = new Array();
finishingArr[604][''][0] = new Array(0, 79, 170);
if(typeof(finishingArr[605]) == 'undefined') finishingArr[605] = new Array();
if(typeof(finishingArr[605]['']) == 'undefined') finishingArr[605][''] = new Array();
finishingArr[605][''][0] = new Array(0, 159, 340);
if(typeof(finishingArr[606]) == 'undefined') finishingArr[606] = new Array();
if(typeof(finishingArr[606]['']) == 'undefined') finishingArr[606][''] = new Array();
finishingArr[606][''][0] = new Array(0, 39, 80);
if(typeof(finishingArr[607]) == 'undefined') finishingArr[607] = new Array();
if(typeof(finishingArr[607]['']) == 'undefined') finishingArr[607][''] = new Array();
finishingArr[607][''][0] = new Array(0, 99, 200);
if(typeof(finishingArr[608]) == 'undefined') finishingArr[608] = new Array();
if(typeof(finishingArr[608]['']) == 'undefined') finishingArr[608][''] = new Array();
finishingArr[608][''][0] = new Array(0, 199, 400);
if(typeof(finishingArr[610]) == 'undefined') finishingArr[610] = new Array();
if(typeof(finishingArr[610]['']) == 'undefined') finishingArr[610][''] = new Array();
finishingArr[610][''][0] = new Array(0, 149, 300);
if(typeof(finishingArr[611]) == 'undefined') finishingArr[611] = new Array();
if(typeof(finishingArr[611]['']) == 'undefined') finishingArr[611][''] = new Array();
finishingArr[611][''][0] = new Array(0, 299, 400);
if(typeof(finishingArr[612]) == 'undefined') finishingArr[612] = new Array();
if(typeof(finishingArr[612]['']) == 'undefined') finishingArr[612][''] = new Array();
finishingArr[612][''][0] = new Array(0, 5, 14);
if(typeof(finishingArr[613]) == 'undefined') finishingArr[613] = new Array();
if(typeof(finishingArr[613]['']) == 'undefined') finishingArr[613][''] = new Array();
finishingArr[613][''][0] = new Array(0, 19, 30);
if(typeof(finishingArr[614]) == 'undefined') finishingArr[614] = new Array();
if(typeof(finishingArr[614]['']) == 'undefined') finishingArr[614][''] = new Array();
finishingArr[614][''][0] = new Array(0, 899, 0);
if(typeof(finishingArr[615]) == 'undefined') finishingArr[615] = new Array();
if(typeof(finishingArr[615]['']) == 'undefined') finishingArr[615][''] = new Array();
finishingArr[615][''][0] = new Array(0, 1139, 0);
if(typeof(finishingArr[616]) == 'undefined') finishingArr[616] = new Array();
if(typeof(finishingArr[616]['']) == 'undefined') finishingArr[616][''] = new Array();
finishingArr[616][''][0] = new Array(0, 1379, 0);
if(typeof(finishingArr[617]) == 'undefined') finishingArr[617] = new Array();
if(typeof(finishingArr[617]['']) == 'undefined') finishingArr[617][''] = new Array();
finishingArr[617][''][0] = new Array(0, 1619, 0);
if(typeof(finishingArr[618]) == 'undefined') finishingArr[618] = new Array();
if(typeof(finishingArr[618]['']) == 'undefined') finishingArr[618][''] = new Array();
finishingArr[618][''][0] = new Array(0, 49, 80);
if(typeof(finishingArr[619]) == 'undefined') finishingArr[619] = new Array();
if(typeof(finishingArr[619]['']) == 'undefined') finishingArr[619][''] = new Array();
finishingArr[619][''][0] = new Array(0, 89, 110);
if(typeof(finishingArr[620]) == 'undefined') finishingArr[620] = new Array();
if(typeof(finishingArr[620]['']) == 'undefined') finishingArr[620][''] = new Array();
finishingArr[620][''][0] = new Array(0, 75, 0);
if(typeof(finishingArr[621]) == 'undefined') finishingArr[621] = new Array();
if(typeof(finishingArr[621]['']) == 'undefined') finishingArr[621][''] = new Array();
finishingArr[621][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[622]) == 'undefined') finishingArr[622] = new Array();
if(typeof(finishingArr[622]['']) == 'undefined') finishingArr[622][''] = new Array();
finishingArr[622][''][0] = new Array(0, 79, 170);
if(typeof(finishingArr[623]) == 'undefined') finishingArr[623] = new Array();
if(typeof(finishingArr[623]['']) == 'undefined') finishingArr[623][''] = new Array();
finishingArr[623][''][0] = new Array(0, 59, 100);
if(typeof(finishingArr[624]) == 'undefined') finishingArr[624] = new Array();
if(typeof(finishingArr[624]['']) == 'undefined') finishingArr[624][''] = new Array();
finishingArr[624][''][0] = new Array(0, 99, 200);
if(typeof(finishingArr[627]) == 'undefined') finishingArr[627] = new Array();
if(typeof(finishingArr[627]['']) == 'undefined') finishingArr[627][''] = new Array();
finishingArr[627][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[628]) == 'undefined') finishingArr[628] = new Array();
if(typeof(finishingArr[628]['']) == 'undefined') finishingArr[628][''] = new Array();
finishingArr[628][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[629]) == 'undefined') finishingArr[629] = new Array();
if(typeof(finishingArr[629]['']) == 'undefined') finishingArr[629][''] = new Array();
finishingArr[629][''][0] = new Array(75, 0, 0);
if(typeof(finishingArr[630]) == 'undefined') finishingArr[630] = new Array();
if(typeof(finishingArr[630]['']) == 'undefined') finishingArr[630][''] = new Array();
finishingArr[630][''][0] = new Array(0, 0.07, 25);
if(typeof(finishingArr[634]) == 'undefined') finishingArr[634] = new Array();
if(typeof(finishingArr[634]['']) == 'undefined') finishingArr[634][''] = new Array();
finishingArr[634][''][0] = new Array(0, 0.02, 25);
if(typeof(finishingArr[634][6]) == 'undefined') finishingArr[634][6] = new Array();
finishingArr[634][6][0] = new Array(0, 0.06, 25);
if(typeof(finishingArr[634][65]) == 'undefined') finishingArr[634][65] = new Array();
finishingArr[634][65][0] = new Array(0, 0.06, 25);
if(typeof(finishingArr[635]) == 'undefined') finishingArr[635] = new Array();
if(typeof(finishingArr[635]['']) == 'undefined') finishingArr[635][''] = new Array();
finishingArr[635][''][0] = new Array(20, 0.06, 20);
if(typeof(finishingArr[636]) == 'undefined') finishingArr[636] = new Array();
if(typeof(finishingArr[636]['']) == 'undefined') finishingArr[636][''] = new Array();
finishingArr[636][''][0] = new Array(20, 0.06, 20);
if(typeof(finishingArr[637]) == 'undefined') finishingArr[637] = new Array();
if(typeof(finishingArr[637]['']) == 'undefined') finishingArr[637][''] = new Array();
finishingArr[637][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[644]) == 'undefined') finishingArr[644] = new Array();
if(typeof(finishingArr[644]['']) == 'undefined') finishingArr[644][''] = new Array();
finishingArr[644][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[645]) == 'undefined') finishingArr[645] = new Array();
if(typeof(finishingArr[645]['']) == 'undefined') finishingArr[645][''] = new Array();
finishingArr[645][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[646]) == 'undefined') finishingArr[646] = new Array();
if(typeof(finishingArr[646]['']) == 'undefined') finishingArr[646][''] = new Array();
finishingArr[646][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[647]) == 'undefined') finishingArr[647] = new Array();
if(typeof(finishingArr[647]['']) == 'undefined') finishingArr[647][''] = new Array();
finishingArr[647][''][0] = new Array(0, 0.01, 20);
if(typeof(finishingArr[648]) == 'undefined') finishingArr[648] = new Array();
if(typeof(finishingArr[648]['']) == 'undefined') finishingArr[648][''] = new Array();
finishingArr[648][''][0] = new Array(0, 0.01, 20);
if(typeof(finishingArr[649]) == 'undefined') finishingArr[649] = new Array();
if(typeof(finishingArr[649]['']) == 'undefined') finishingArr[649][''] = new Array();
finishingArr[649][''][0] = new Array(0, 0.01, 20);
if(typeof(finishingArr[650]) == 'undefined') finishingArr[650] = new Array();
if(typeof(finishingArr[650]['']) == 'undefined') finishingArr[650][''] = new Array();
finishingArr[650][''][0] = new Array(0, 0.02, 40);
if(typeof(finishingArr[651]) == 'undefined') finishingArr[651] = new Array();
if(typeof(finishingArr[651]['']) == 'undefined') finishingArr[651][''] = new Array();
finishingArr[651][''][0] = new Array(0, 0.02, 40);
if(typeof(finishingArr[652]) == 'undefined') finishingArr[652] = new Array();
if(typeof(finishingArr[652]['']) == 'undefined') finishingArr[652][''] = new Array();
finishingArr[652][''][0] = new Array(0, 0.02, 40);
if(typeof(finishingArr[733]) == 'undefined') finishingArr[733] = new Array();
if(typeof(finishingArr[733][6]) == 'undefined') finishingArr[733][6] = new Array();
finishingArr[733][6][0] = new Array(0, 0.2917, 5.25);
if(typeof(finishingArr[733][11]) == 'undefined') finishingArr[733][11] = new Array();
finishingArr[733][11][0] = new Array(0, 0.08, 5.25);
if(typeof(finishingArr[733][65]) == 'undefined') finishingArr[733][65] = new Array();
finishingArr[733][65][0] = new Array(0, 0.2917, 5.25);
if(typeof(finishingArr[733][66]) == 'undefined') finishingArr[733][66] = new Array();
finishingArr[733][66][0] = new Array(0, 0.08, 5.25);
if(typeof(finishingArr[733][135]) == 'undefined') finishingArr[733][135] = new Array();
finishingArr[733][135][0] = new Array(0, 0.2917, 5.25);
if(typeof(finishingArr[738]) == 'undefined') finishingArr[738] = new Array();
if(typeof(finishingArr[738]['']) == 'undefined') finishingArr[738][''] = new Array();
finishingArr[738][''][0] = new Array(0.35, 0, 8.75);
if(typeof(finishingArr[742]) == 'undefined') finishingArr[742] = new Array();
if(typeof(finishingArr[742]['']) == 'undefined') finishingArr[742][''] = new Array();
finishingArr[742][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[743]) == 'undefined') finishingArr[743] = new Array();
if(typeof(finishingArr[743]['']) == 'undefined') finishingArr[743][''] = new Array();
finishingArr[743][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[744]) == 'undefined') finishingArr[744] = new Array();
if(typeof(finishingArr[744]['']) == 'undefined') finishingArr[744][''] = new Array();
finishingArr[744][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[745]) == 'undefined') finishingArr[745] = new Array();
if(typeof(finishingArr[745]['']) == 'undefined') finishingArr[745][''] = new Array();
finishingArr[745][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[746]) == 'undefined') finishingArr[746] = new Array();
if(typeof(finishingArr[746]['']) == 'undefined') finishingArr[746][''] = new Array();
finishingArr[746][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[747]) == 'undefined') finishingArr[747] = new Array();
if(typeof(finishingArr[747]['']) == 'undefined') finishingArr[747][''] = new Array();
finishingArr[747][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[750]) == 'undefined') finishingArr[750] = new Array();
if(typeof(finishingArr[750]['']) == 'undefined') finishingArr[750][''] = new Array();
finishingArr[750][''][0] = new Array(25, 0.02, 0);
if(typeof(finishingArr[751]) == 'undefined') finishingArr[751] = new Array();
if(typeof(finishingArr[751]['']) == 'undefined') finishingArr[751][''] = new Array();
finishingArr[751][''][0] = new Array(25, 0.02, 0);
if(typeof(finishingArr[754]) == 'undefined') finishingArr[754] = new Array();
if(typeof(finishingArr[754]['']) == 'undefined') finishingArr[754][''] = new Array();
finishingArr[754][''][0] = new Array(0, 0.02, 0);
if(typeof(finishingArr[755]) == 'undefined') finishingArr[755] = new Array();
if(typeof(finishingArr[755]['']) == 'undefined') finishingArr[755][''] = new Array();
finishingArr[755][''][0] = new Array(0, 0.02, 0);
if(typeof(finishingArr[756]) == 'undefined') finishingArr[756] = new Array();
if(typeof(finishingArr[756]['']) == 'undefined') finishingArr[756][''] = new Array();
finishingArr[756][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[760]) == 'undefined') finishingArr[760] = new Array();
if(typeof(finishingArr[760]['']) == 'undefined') finishingArr[760][''] = new Array();
finishingArr[760][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[761]) == 'undefined') finishingArr[761] = new Array();
if(typeof(finishingArr[761]['']) == 'undefined') finishingArr[761][''] = new Array();
finishingArr[761][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[764]) == 'undefined') finishingArr[764] = new Array();
if(typeof(finishingArr[764]['']) == 'undefined') finishingArr[764][''] = new Array();
finishingArr[764][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[766]) == 'undefined') finishingArr[766] = new Array();
if(typeof(finishingArr[766]['']) == 'undefined') finishingArr[766][''] = new Array();
finishingArr[766][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[781]) == 'undefined') finishingArr[781] = new Array();
if(typeof(finishingArr[781]['']) == 'undefined') finishingArr[781][''] = new Array();
finishingArr[781][''][0] = new Array(0, 35, 64);
if(typeof(finishingArr[782]) == 'undefined') finishingArr[782] = new Array();
if(typeof(finishingArr[782]['']) == 'undefined') finishingArr[782][''] = new Array();
finishingArr[782][''][0] = new Array(0, 17, 32);
if(typeof(finishingArr[783]) == 'undefined') finishingArr[783] = new Array();
if(typeof(finishingArr[783]['']) == 'undefined') finishingArr[783][''] = new Array();
finishingArr[783][''][0] = new Array(0, 5, 0);
if(typeof(finishingArr[784]) == 'undefined') finishingArr[784] = new Array();
if(typeof(finishingArr[784]['']) == 'undefined') finishingArr[784][''] = new Array();
finishingArr[784][''][0] = new Array(0, 45, 84);
if(typeof(finishingArr[785]) == 'undefined') finishingArr[785] = new Array();
if(typeof(finishingArr[785]['']) == 'undefined') finishingArr[785][''] = new Array();
finishingArr[785][''][0] = new Array(0, 5, 24);
if(typeof(finishingArr[786]) == 'undefined') finishingArr[786] = new Array();
if(typeof(finishingArr[786][3]) == 'undefined') finishingArr[786][3] = new Array();
finishingArr[786][3][0] = new Array(37, 0.036, 0);
if(typeof(finishingArr[786][4]) == 'undefined') finishingArr[786][4] = new Array();
finishingArr[786][4][0] = new Array(37, 0.036, 0);
if(typeof(finishingArr[786][5]) == 'undefined') finishingArr[786][5] = new Array();
finishingArr[786][5][0] = new Array(13, 0.0075, 0);
if(typeof(finishingArr[786][6]) == 'undefined') finishingArr[786][6] = new Array();
finishingArr[786][6][0] = new Array(37, 0.036, 0);
if(typeof(finishingArr[786][7]) == 'undefined') finishingArr[786][7] = new Array();
finishingArr[786][7][0] = new Array(22, 0.012, 0);
if(typeof(finishingArr[786][8]) == 'undefined') finishingArr[786][8] = new Array();
finishingArr[786][8][0] = new Array(16, 0.009, 0);
if(typeof(finishingArr[786][9]) == 'undefined') finishingArr[786][9] = new Array();
finishingArr[786][9][0] = new Array(24, 0.018, 0);
if(typeof(finishingArr[786][10]) == 'undefined') finishingArr[786][10] = new Array();
finishingArr[786][10][0] = new Array(28, 0.025, 0);
if(typeof(finishingArr[786][11]) == 'undefined') finishingArr[786][11] = new Array();
finishingArr[786][11][0] = new Array(37, 0.036, 0);
if(typeof(finishingArr[786][12]) == 'undefined') finishingArr[786][12] = new Array();
finishingArr[786][12][0] = new Array(24, 0.018, 0);
if(typeof(finishingArr[786][13]) == 'undefined') finishingArr[786][13] = new Array();
finishingArr[786][13][0] = new Array(10.5, 0.006, 0);
if(typeof(finishingArr[786][14]) == 'undefined') finishingArr[786][14] = new Array();
finishingArr[786][14][0] = new Array(38, 0.025, 0);
if(typeof(finishingArr[786][15]) == 'undefined') finishingArr[786][15] = new Array();
finishingArr[786][15][0] = new Array(22, 0.018, 0);
if(typeof(finishingArr[786][19]) == 'undefined') finishingArr[786][19] = new Array();
finishingArr[786][19][0] = new Array(21, 0.009, 0);
if(typeof(finishingArr[786][20]) == 'undefined') finishingArr[786][20] = new Array();
finishingArr[786][20][0] = new Array(54, 0.036, 0);
if(typeof(finishingArr[786][57]) == 'undefined') finishingArr[786][57] = new Array();
finishingArr[786][57][0] = new Array(13, 0.0075, 0);
if(typeof(finishingArr[786][59]) == 'undefined') finishingArr[786][59] = new Array();
finishingArr[786][59][0] = new Array(12, 0.006, 0);
if(typeof(finishingArr[786][60]) == 'undefined') finishingArr[786][60] = new Array();
finishingArr[786][60][0] = new Array(12, 0.007, 0);
if(typeof(finishingArr[786][65]) == 'undefined') finishingArr[786][65] = new Array();
finishingArr[786][65][0] = new Array(37, 0.036, 0);
if(typeof(finishingArr[786][66]) == 'undefined') finishingArr[786][66] = new Array();
finishingArr[786][66][0] = new Array(37, 0.036, 0);
if(typeof(finishingArr[786][67]) == 'undefined') finishingArr[786][67] = new Array();
finishingArr[786][67][0] = new Array(45, 0.042, 0);
if(typeof(finishingArr[786][68]) == 'undefined') finishingArr[786][68] = new Array();
finishingArr[786][68][0] = new Array(21, 0.012, 0);
if(typeof(finishingArr[786][69]) == 'undefined') finishingArr[786][69] = new Array();
finishingArr[786][69][0] = new Array(17, 0.009, 0);
if(typeof(finishingArr[786][70]) == 'undefined') finishingArr[786][70] = new Array();
finishingArr[786][70][0] = new Array(24, 0.012, 0);
if(typeof(finishingArr[786][71]) == 'undefined') finishingArr[786][71] = new Array();
finishingArr[786][71][0] = new Array(21, 0.012, 0);
if(typeof(finishingArr[786][72]) == 'undefined') finishingArr[786][72] = new Array();
finishingArr[786][72][0] = new Array(17, 0.009, 0);
if(typeof(finishingArr[786][73]) == 'undefined') finishingArr[786][73] = new Array();
finishingArr[786][73][0] = new Array(21, 0.012, 0);
if(typeof(finishingArr[786][74]) == 'undefined') finishingArr[786][74] = new Array();
finishingArr[786][74][0] = new Array(24, 0.018, 0);
if(typeof(finishingArr[786][75]) == 'undefined') finishingArr[786][75] = new Array();
finishingArr[786][75][0] = new Array(18, 0.012, 0);
if(typeof(finishingArr[786][76]) == 'undefined') finishingArr[786][76] = new Array();
finishingArr[786][76][0] = new Array(15, 0.009, 0);
if(typeof(finishingArr[786][77]) == 'undefined') finishingArr[786][77] = new Array();
finishingArr[786][77][0] = new Array(20, 0.012, 0);
if(typeof(finishingArr[786][78]) == 'undefined') finishingArr[786][78] = new Array();
finishingArr[786][78][0] = new Array(22, 0.018, 0);
if(typeof(finishingArr[786][81]) == 'undefined') finishingArr[786][81] = new Array();
finishingArr[786][81][0] = new Array(24, 0.015, 0);
if(typeof(finishingArr[786][135]) == 'undefined') finishingArr[786][135] = new Array();
finishingArr[786][135][0] = new Array(0, 0, 0);
if(typeof(finishingArr[787]) == 'undefined') finishingArr[787] = new Array();
if(typeof(finishingArr[787]['']) == 'undefined') finishingArr[787][''] = new Array();
finishingArr[787][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[788]) == 'undefined') finishingArr[788] = new Array();
if(typeof(finishingArr[788]['']) == 'undefined') finishingArr[788][''] = new Array();
finishingArr[788][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[789]) == 'undefined') finishingArr[789] = new Array();
if(typeof(finishingArr[789]['']) == 'undefined') finishingArr[789][''] = new Array();
finishingArr[789][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[790]) == 'undefined') finishingArr[790] = new Array();
if(typeof(finishingArr[790]['']) == 'undefined') finishingArr[790][''] = new Array();
finishingArr[790][''][0] = new Array(0, 0, 0);
if(typeof(finishingArr[791]) == 'undefined') finishingArr[791] = new Array();
if(typeof(finishingArr[791]['']) == 'undefined') finishingArr[791][''] = new Array();
finishingArr[791][''][0] = new Array(0, 0, 0);
paperInfoArr[9] = new Array('80# Gloss Text', 'Text', 1, 1, 7, 0.000168421052631579, 'Topkote', 9);
paperInfoArr[10] = new Array('70# Uncoated Text', 'Text', 1, 1, 4, 0.000147368421052632, 'Hammermill', 15);
paperInfoArr[11] = new Array('80# Dull/Matte Text', 'Text', 2, 1, 7, 0.000168421052631579, 'Topkote', 7);
paperInfoArr[12] = new Array('100# Gloss Text', 'Text', 2, 1, 9, 0.000210526315789474, 'Topkote', 9);
paperInfoArr[13] = new Array('70# Colorsource Text', 'Text', 8, 2, 4, 0.000147368421052632, 'Colorsource ', 16);
paperInfoArr[14] = new Array('80# Dull/Matte Cover', 'Cover', 4, 1, 7, 0.000307692307692308, 'Topkote', 7);
paperInfoArr[15] = new Array('10 pt Carolina C1S Cover', 'Cover', 5, 2, 14, 0.000313461538461539, 'Carolina', 3);
paperInfoArr[16] = new Array('80# Cougar Text', 'Text', 26, 2, 7, 0.000168421052631579, 'Cougar ', 15);
paperInfoArr[17] = new Array('80# Gloss Cover', 'Cover', 3, 1, 7, 0.000307692307692308, 'Topkote', 9);
paperInfoArr[18] = new Array('80# Lustro Dull Text', 'Text', 5, 2, 7, 0.000168421052631579, 'Lustro Dull ', 7);
paperInfoArr[19] = new Array('80# Lustro Dull Cream Text', 'Text', 5, 2, 7, 0.000168421052631579, 'Lustro Dull Cream ', 7);
paperInfoArr[20] = new Array('80# Centura Silk Text', 'Text', 27, 2, 7, 0.000168421052631579, 'Centura Silk ', 14);
paperInfoArr[21] = new Array('80# Centura Gloss Text', 'Text', 27, 2, 7, 0.000168421052631579, 'Centura ', 9);
paperInfoArr[22] = new Array('100# Dull/Matte Text', 'Text', 26, 1, 9, 0.000210526315789474, 'Topkote ', 7);
paperInfoArr[23] = new Array('100# Gloss Cover', 'Cover', 4, 2, 9, 0.000384615384615385, 'Topkote', 9);
paperInfoArr[24] = new Array('80# Nekoosa Linen Text', 'Text', '', 2, 7, 0.000168421052631579, 'Nekoosa Linen ', 12);
paperInfoArr[25] = new Array('70# Royal Fiber Text', 'Text', 28, 2, 4, 0.000147368421052632, 'Royal Fiber ', 15);
paperInfoArr[26] = new Array('100# Cougar Text', 'Text', 27, 2, 9, 0.000210526315789474, 'Cougar ', 15);
paperInfoArr[27] = new Array('24# Classic Crest Writing', 'Text', 27, 2, 1, 0.000128342245989305, 'Classic Crest Writing', 15);
paperInfoArr[28] = new Array('24# Classic Columns Writing', 'Text', 26, 2, 1, 0.000128342245989305, 'Classic Columns Writing', 6);
paperInfoArr[29] = new Array('100# Lustro Dull Text', 'Text', 8, 2, 9, 0.000210526315789474, 'Lustro Dull ', 7);
paperInfoArr[30] = new Array('100# Lustro Dull Cream Text', 'Text', 8, 2, 9, 0.000210526315789474, 'Lustro Dull Cream ', 7);
paperInfoArr[31] = new Array('100# Centura Silk Text', 'Text', 27, 2, 9, 0.000210526315789474, 'Centura Silk ', 14);
paperInfoArr[32] = new Array('100# Centura Gloss Text', 'Text', 27, 2, 9, 0.000210526315789474, 'Centura ', 9);
paperInfoArr[33] = new Array('12pt. Carolina C1S Cover', 'Cover', 8, 2, 15, 0.000355769230769231, 'Carolina', 3);
paperInfoArr[34] = new Array('80# Skytone Text', 'Text', 8, 2, 7, 0.000168421052631579, 'Skytone ', 13);
paperInfoArr[35] = new Array('80# Environment Text', 'Text', 29, 2, 7, 0.000168421052631579, 'Environment ', 15);
paperInfoArr[36] = new Array('24# Classic Cotton Writing 25', 'Text', 28, 2, 1, 0.000128342245989305, 'Classic Cotton Writing 25', 17);
paperInfoArr[37] = new Array('24# Strathmore Writing 25 - Cotton', 'Text', 33, 2, 1, 0.000128342245989305, 'Strathmore Writing 25 - Cotton', 17);
paperInfoArr[38] = new Array('75# Classic Laid Text', 'Text', 28, 2, 5, 0.000157894736842105, 'Classic Laid ', 11);
paperInfoArr[39] = new Array('80# Classic Columns Text', 'Text', 30, 2, 7, 0.000168421052631579, 'Classic Columns ', 6);
paperInfoArr[40] = new Array('80# Evergreen 100 PC Text', 'Text', 10, 2, 7, 0.000168421052631579, 'Evergreen 100 PC ', 15);
paperInfoArr[41] = new Array('80# Feltweave Text', 'Text', 10, 2, 7, 0.000168421052631579, 'Feltweave ', 8);
paperInfoArr[42] = new Array('100# Uncoated Cover', 'Cover', 6, 1, 9, 0.000384615384615385, 'Starbrite', '');
paperInfoArr[43] = new Array('120# Gloss Cover 14 pt', 'Cover', 6, 1, 12, 0.000461538461538462, 'Nordic', 9);
paperInfoArr[44] = new Array('120# Dull/Matte Cover 14 pt', 'Cover', 7, 1, 12, 0.000461538461538462, 'Nordic', 7);
paperInfoArr[45] = new Array('80# Starwhite Text', 'Text', 33, 2, 7, 0.000168421052631579, 'Starwhite ', 15);
paperInfoArr[46] = new Array('80# Lustro Dull Cover', 'Cover', 10, 2, 7, 0.000307692307692308, 'Lustro Dull ', 7);
paperInfoArr[47] = new Array('80# Lustro Dull Cream Cover', 'Cover', 10, 2, 7, 0.000307692307692308, 'Lustro Dull Cream ', 7);
paperInfoArr[48] = new Array('80# Centura Silk Cover', 'Cover', 34, 2, 7, 0.000307692307692308, 'Centura Silk ', 14);
paperInfoArr[49] = new Array('80# Centura Gloss Cover', 'Cover', 34, 2, 7, 0.000307692307692308, 'Centura ', 9);
paperInfoArr[50] = new Array('80# Classic Crest Text', 'Text', 29, 2, 7, 0.000168421052631579, 'Classic Crest ', 15);
paperInfoArr[51] = new Array('80# Cougar Cover', 'Cover', 34, 2, 7, 0.000307692307692308, 'Cougar ', 15);
paperInfoArr[52] = new Array('80# Classic Linen Text', 'Text', 30, 2, 7, 0.000168421052631579, 'Classic Linen ', 12);
paperInfoArr[53] = new Array('80# Astrobrights Cover', 'Cover', 36, 2, 7, 0.000307692307692308, 'Astrobrights ', 15);
paperInfoArr[54] = new Array('100# Cougar Cover', 'Cover', 34, 2, 9, 0.000384615384615385, 'Cougar ', 15);
paperInfoArr[55] = new Array('100# Lustro Dull Cover', 'Cover', 11, 2, 9, 0.000384615384615385, 'Lustro Dull ', 7);
paperInfoArr[56] = new Array('100# Lustro Dull Cream Cover', 'Cover', 11, 2, 9, 0.000384615384615385, 'Lustro Dull Cream ', 7);
paperInfoArr[57] = new Array('100# Classic Crest Text', 'Text', 31, 2, 9, 0.000210526315789474, 'Classic Crest ', 15);
paperInfoArr[58] = new Array('80# Environment Cover', 'Cover', 36, 2, 7, 0.000307692307692308, 'Environment ', 15);
paperInfoArr[59] = new Array('65# Skytone Cover', 'Cover', 11, 2, 18, 0.00025, 'Skytone ', 13);
paperInfoArr[60] = new Array('100# Centura Silk Cover', 'Cover', 34, 2, 9, 0.000384615384615385, 'Centura Silk ', 14);
paperInfoArr[61] = new Array('80# Feltweave Cover', 'Cover', 36, 2, 7, 0.000307692307692308, 'Feltweave ', 8);
paperInfoArr[62] = new Array('80# Nekoosa Linen Cover', 'Cover', 36, 2, 7, 0.000307692307692308, 'Nekoosa Linen ', 12);
paperInfoArr[63] = new Array('80# Royal Fiber Cover', 'Cover', 36, 2, 7, 0.000307692307692308, 'Royal Fiber ', 15);
paperInfoArr[64] = new Array('10 pt Kromekote C1S Cover', 'Cover', 35, 2, 14, 0.000313461538461539, 'Kromekote', 3);
paperInfoArr[65] = new Array('80# Evergreen 100 PC Cover', 'Cover', 12, 2, 7, 0.000307692307692308, 'Evergreen 100 PC ', 15);
paperInfoArr[66] = new Array('120# Centura Silk Cover', 'Cover', 36, 2, 12, 0.000461538461538462, 'Centura Silk ', 14);
paperInfoArr[67] = new Array('80# Starwhite Cover', 'Cover', 38, 2, 7, 0.000307692307692308, 'Starwhite ', 15);
paperInfoArr[68] = new Array('12 pt Kromekote C1S Cover', 'Cover', 36, 2, 15, 0.000355769230769231, 'Kromekote', 9);
paperInfoArr[69] = new Array('80# Classic Laid Cover', 'Cover', 38, 2, 7, 0.000307692307692308, 'Classic Laid ', 11);
paperInfoArr[70] = new Array('100# Centura Gloss Cover', 'Cover', 34, 2, 9, 0.000384615384615385, 'Centura ', 9);
paperInfoArr[71] = new Array('80# Classic Crest Cover', 'Cover', 37, 2, 7, 0.000307692307692308, 'Classic Crest ', 15);
paperInfoArr[72] = new Array('100# Nekoosa Linen Cover', 'Cover', 37, 2, 9, 0.000384615384615385, 'Nekoosa Linen ', 12);
paperInfoArr[73] = new Array('10 pt Kromekote C2S Cover', 'Cover', 37, 2, 14, 0.000313461538461539, 'Kromekote', 5);
paperInfoArr[74] = new Array('80# Classic Linen Cover', 'Cover', 38, 2, 7, 0.000307692307692308, 'Classic Linen ', 12);
paperInfoArr[75] = new Array('80# Classic Columns Cover', 'Cover', 39, 2, 7, 0.000307692307692308, 'Classic Columns ', 6);
paperInfoArr[76] = new Array('120# Centura Gloss Cover', 'Cover', 35, 2, 12, 0.000461538461538462, 'Centura ', 9);
paperInfoArr[77] = new Array('12 pt Kromekote C2S Cover', 'Cover', 38, 2, 15, 0.000355769230769231, 'Kromekote', 5);
paperInfoArr[78] = new Array('100# Classic Crest Cover', 'Cover', 39, 2, 9, 0.000384615384615385, 'Classic Crest ', 15);
paperInfoArr[80] = new Array('80# Strathmore Writing Cover', 'Cover', 39, 2, 7, 0.000307692307692308, 'Strathmore ', 17);
paperInfoArr[81] = new Array('80# Classic Cotton Bristol', 'Cover', 39, 2, 7, 0.000307692307692308, 'Classic Cotton Bristol', 17);
paperInfoArr[82] = new Array('13 Pt Magnet Stock', 'Magnet', 14, 1, 16, 0.000882142857142857, 'Magnekote', '');
paperInfoArr[277] = new Array('24# Uncoated Wove', 'Text', '', 1, 1, 0.000128342245989305, 'Signet', 17);
paperInfoArr[278] = new Array('28# Uncoated Wove', 'Text', '', 1, 2, 0.000149732620320856, 'Signet', 17);
paperInfoArr[279] = new Array('13 oz Vinyl Banner', 'Other', '', 2, 17, 0.01003086, '', 9);
paperInfoArr[280] = new Array('CBSL-BCrd-001', 'Cover', '', 3, 13, 0.0005, 'Starwhite Tiara', 15);
paperInfoArr[281] = new Array('CBSL-LH&E-001', 'Text', '', 3, 4, 0.000147368421052632, 'Starwhite Tiara', 15);
paperInfoArr[282] = new Array('CBSL-Lthd-001', 'Text', '', 3, 4, 0.000147368421052632, 'Starwhite Tiara', 15);
paperInfoArr[283] = new Array('CBSL-Prez-001', 'Cover', '', 3, 12, 0.000461538461538462, 'Topkote', 9);
paperInfoArr[284] = new Array('2-Part NCR', 'Text', '', 1, 21, 0.0002105, 'NCR Paper', '');
paperInfoArr[285] = new Array('3-Part NCR', 'Text', '', 1, 22, 0.000308, 'NCR Paper', '');
paperInfoArr[286] = new Array('60# MacTac Labels', 'Label', 32, 2, 3, 0.000312, 'MacTac Metro', 9);
paperInfoArr[287] = new Array('Mounted Foamboard', 'Foamboard', '', 1, 23, 0.001, '', '');
paperInfoArr[383] = new Array('60# Fasson Crack n Peel', 'Label', 15, 2, 3, 0.000312, 'Blockout Labelstock', '');
paperInfoArr[385] = new Array('110# Starwhite Cover', 'Cover', 39, 2, 10, 0.000423076923076923, 'Starwhite', 15);
paperInfoArr[386] = new Array('130# Centura Gloss Cover', 'Cover', 37, 2, 13, 0.0005, 'Centura', 9);
paperInfoArr[387] = new Array('70# Classic Crest Text ', 'Text', 29, 2, 4, 0.000147368421052632, 'Classic Crest', 15);
paperInfoArr[388] = new Array('4-Part NCR', 'Text', '', 1, 24, 0.000421, 'NCR Paper', '');
paperInfoArr[390] = new Array('100# Classic Linen Cover', 'Cover', 40, 2, 9, 0.000384615384615385, 'Classic', 12);
paperInfoArr[415] = new Array('70# Whitehall Text', 'Text', 2, 1, 4, 0.000147368421052632, 'Whitehall', 15);
paperInfoArr[417] = new Array('110# Classic Crest Cover', 'Cover', 42, 2, 10, 0.000423076923076923, 'Classic', 15);
paperInfoArr[418] = new Array('110# Classic Crest Cover', 'Cover', 13, 2, 10, 0.000423076923076923, 'Classic Crest', 15);
paperInfoArr[419] = new Array('24# Laser', 'Text', '', 2, 1, 0.000128342245989305, '', '');
paperInfoArr[420] = new Array('32# Laser', 'Text', '', 2, 7, 0.000168421052631579, '', '');
paperInfoArr[421] = new Array('20# Bond', 'Text', '', 4, 3, 0.000126315789473684, '', '');
paperInfoArr[423] = new Array('24# Classic Linen Writing', 'Text', '', 2, 1, 0.000128342245989305, 'Classic', 12);
paperInfoArr[424] = new Array('24# Classic Laid Writing', 'Text', '', 2, 1, 0.000128342245989305, 'Classic', 11);
paperInfoArr[425] = new Array('80# Classic Linen Cover Epic Black', 'Cover', 43, 2, 7, 0.000307692307692308, 'Classic', 12);
paperInfoArr[426] = new Array('70# Classic Linen Text', 'Text', 29, 2, 4, 0.000147368421052632, 'Classic', 12);
paperInfoArr[427] = new Array('60# Galaxy Offset Text', 'Text', 2, 2, 3, 0.000126315789473684, 'Galaxy', 15);
paperInfoArr[428] = new Array('70# Domtar Colors Text', 'Text', 27, 2, 4, 0.000147368421052632, 'Domtar', 15);
paperInfoArr[429] = new Array('70# Feltweave Text', 'Text', 27, 2, 4, 0.000147368421052632, 'Feltweave', 8);
paperInfoArr[430] = new Array('70# Nekoosa Linen Text', 'Text', 27, 2, 4, 0.000147368421052632, 'Nekoosa', 12);
paperInfoArr[431] = new Array('65# Skytone Text', 'Text', 30, 2, 18, '', 'Skytone', '');
paperInfoArr[432] = new Array('60# Whitehall Text', 'Text', 2, 2, 3, 0.000126315789473684, 'Whitehall', '');
paperInfoArr[433] = new Array('80# McCoy Silk Text', 'Text', 28, 2, 7, 0.000168421052631579, 'McCoy', 14);
paperInfoArr[434] = new Array('100# McCoy Silk Text', 'Text', 29, 2, 9, 0.000210526315789474, 'McCoy', 14);
paperInfoArr[435] = new Array('60# Astrobrights Text', 'Text', 28, 2, 3, 0.000126315789473684, 'Astrobrights', 15);
paperInfoArr[436] = new Array('10 pt Nordic C1S Cover', 'Cover', 7, 2, 14, 0.000313461538461539, 'Nordic', 3);
paperInfoArr[437] = new Array('12 pt Nordic C1S Cover', 'Cover', 34, 2, 15, 0.000355769230769231, 'Nordic', 3);
paperInfoArr[438] = new Array('80# McCoy Silk Cover', 'Cover', 35, 2, 7, 0.000307692307692308, 'McCoy', 14);
paperInfoArr[439] = new Array('100# McCoy Silk Cover', 'Cover', 37, 2, 9, 0.000384615384615385, 'McCoy', 14);
paperInfoArr[440] = new Array('120# McCoy Silk Cover', 'Cover', 40, 2, 12, 0.000461538461538462, 'McCoy', 14);
paperInfoArr[441] = new Array('28# UV/Ultra II Translucent', 'Cover', 39, 2, 14, 0.000313461538461539, 'UV/Ultra II', '');
paperInfoArr[442] = new Array('36# UV/Ultra II Translucent ', 'Cover', 40, 2, 7, 0.000307692307692308, 'UV/Ultra II', '');
paperInfoArr[444] = new Array('130# Classic Crest Cover', 'Cover', 43, 2, 13, 0.0005, 'Classic', 15);
paperInfoArr[445] = new Array('130# Topkote Gloss Cover', 'Cover', 37, 2, 13, 0.0005, 'Topkote', 15);
paperInfoArr[446] = new Array('100# Topkote Dull/Matte Cover', 'Cover', 35, 2, 9, 0.000384615384615385, 'Topkote', 7);
paperInfoArr[447] = new Array('130# Topkote Dull/Matte Cover', 'Cover', 37, 2, 13, 0.0005, 'Topkote', 7);
paperInfoArr[448] = new Array('88# Strathmore Bristol', 'Cover', 40, 2, 27, 0.000384615384615385, 'Strathmore', '');
paperInfoArr[465] = new Array('65# Astrobrights Cover', 'Cover', 35, 2, 18, 0.00025, 'Astrobrights', 15);
paperInfoArr[633] = new Array('80# Photo Gloss', 'Text', '', 2, 30, 0.0005, '', 9);
paperInfoArr[638] = new Array('Post-It Notes Text', 'Text', '', 1, 36, 0.003208556, 'Other', 15);
paperInfoArr[639] = new Array('120# Topkote Gloss Cover', 'Cover', 34, 2, 12, 0.000461538461538462, 'Topkote', 9);
paperInfoArr[640] = new Array('120# Topkote Dull/Matte Cover', 'Cover', 34, 2, 12, 0.000461538461538462, 'Topkote', 7);
paperInfoArr[641] = new Array('30 mil Plastic', 'Other', '', 2, 32, 0.0011115, 'Unknown', 9);
paperInfoArr[642] = new Array('80# Photo Gloss with Foamboard', 'Foamboard', '', 2, 14, '', '', 9);
paperInfoArr[643] = new Array('80# Photo Gloss on Foamboard', 'Foamboard', '', 2, 23, 0.001, '', 9);
paperInfoArr[731] = new Array('Car Magnet-Biz Dev', 'Other', '', 4, 34, 0.45, 'Unknown', '');
paperInfoArr[732] = new Array('Plastic Sign-Biz Dev', 'Other', '', 4, 35, 0.15, 'Unknown', '');
paperInfoArr[748] = new Array('120# Gloss Cover 14 pt PC55', 'Cover', 44, 1, 12, 0.000461538461538462, 'Nordic', 9);
paperInfoArr[749] = new Array('120# Dull/Matte Cover 14 pt PC55', 'Cover', 45, 1, 12, 0.000461538461538462, 'Nordic', 7);
paperInfoArr[765] = new Array('20 mil Plastic', 'Other', '', 2, 37, 0.0005577, 'Unknown', 9);
paperInfoArr[769] = new Array('Post-It Notes Neon Text', 'Text', '', 2, 36, 0.003208556, 'Other', 15);
paperInfoArr[770] = new Array('Post-It notes Recycled Text', 'Text', '', 2, 36, 0.003208556, 'Other', 15);
paperWeightInfoArr[1] = new Array(24, '#');
paperWeightInfoArr[2] = new Array(28, '#');
paperWeightInfoArr[3] = new Array(60, '#');
paperWeightInfoArr[4] = new Array(70, '#');
paperWeightInfoArr[5] = new Array(75, '#');
paperWeightInfoArr[6] = new Array(78, '#');
paperWeightInfoArr[7] = new Array(80, '#');
paperWeightInfoArr[8] = new Array(95, '#');
paperWeightInfoArr[9] = new Array(100, '#');
paperWeightInfoArr[10] = new Array(110, '#');
paperWeightInfoArr[11] = new Array(111, '#');
paperWeightInfoArr[12] = new Array(120, '#');
paperWeightInfoArr[13] = new Array(130, '#');
paperWeightInfoArr[14] = new Array(10, 'pt');
paperWeightInfoArr[15] = new Array(12, 'pt');
paperWeightInfoArr[16] = new Array(13, 'pt');
paperWeightInfoArr[17] = new Array(13, 'oz Vinyl');
paperWeightInfoArr[18] = new Array(65, '#');
paperWeightInfoArr[21] = new Array(20, '# 2-Part');
paperWeightInfoArr[22] = new Array(20, '# 3-Part');
paperWeightInfoArr[23] = new Array(10, 'oz ');
paperWeightInfoArr[24] = new Array(20, '# 4-Part');
paperWeightInfoArr[25] = new Array(14, 'pt');
paperWeightInfoArr[26] = new Array(36, '#');
paperWeightInfoArr[27] = new Array(88, '#');
paperWeightInfoArr[28] = new Array(28, '# UV');
paperWeightInfoArr[29] = new Array(36, '# UV');
paperWeightInfoArr[30] = new Array(80, '# Photo');
paperWeightInfoArr[32] = new Array(30, 'mil');
paperWeightInfoArr[34] = new Array(34, 'Car-Mag');
paperWeightInfoArr[35] = new Array(999, 'oz Plastic');
paperWeightInfoArr[36] = new Array(24, '# PN25shts');
paperWeightInfoArr[37] = new Array(20, 'mil');
pricedPerSignatureArr[9] = new Array(true);
pricedPerSignatureArr[10] = new Array(true);
pricedPerSignatureArr[11] = new Array(true);
pricedPerSignatureArr[12] = new Array(true);
pricedPerSignatureArr[13] = new Array(true);
pricedPerSignatureArr[14] = new Array(true);
pricedPerSignatureArr[15] = new Array(true);
pricedPerSignatureArr[16] = new Array(true);
pricedPerSignatureArr[17] = new Array(true);
pricedPerSignatureArr[18] = new Array(true);
pricedPerSignatureArr[19] = new Array(true);
pricedPerSignatureArr[20] = new Array(true);
pricedPerSignatureArr[21] = new Array(true);
pricedPerSignatureArr[22] = new Array(true);
pricedPerSignatureArr[23] = new Array(true);
pricedPerSignatureArr[24] = new Array(true);
pricedPerSignatureArr[25] = new Array(true);
pricedPerSignatureArr[26] = new Array(true);
pricedPerSignatureArr[27] = new Array(true);
pricedPerSignatureArr[28] = new Array(true);
pricedPerSignatureArr[29] = new Array(true);
pricedPerSignatureArr[30] = new Array(true);
pricedPerSignatureArr[31] = new Array(true);
pricedPerSignatureArr[32] = new Array(true);
pricedPerSignatureArr[33] = new Array(true);
pricedPerSignatureArr[34] = new Array(true);
pricedPerSignatureArr[35] = new Array(true);
pricedPerSignatureArr[36] = new Array(true);
pricedPerSignatureArr[37] = new Array(true);
pricedPerSignatureArr[38] = new Array(true);
pricedPerSignatureArr[39] = new Array(true);
pricedPerSignatureArr[40] = new Array(true);
pricedPerSignatureArr[41] = new Array(true);
pricedPerSignatureArr[42] = new Array(true);
pricedPerSignatureArr[43] = new Array(true);
pricedPerSignatureArr[44] = new Array(true);
pricedPerSignatureArr[45] = new Array(true);
pricedPerSignatureArr[46] = new Array(true);
pricedPerSignatureArr[47] = new Array(true);
pricedPerSignatureArr[48] = new Array(true);
pricedPerSignatureArr[49] = new Array(true);
pricedPerSignatureArr[50] = new Array(true);
pricedPerSignatureArr[51] = new Array(true);
pricedPerSignatureArr[52] = new Array(true);
pricedPerSignatureArr[53] = new Array(true);
pricedPerSignatureArr[54] = new Array(true);
pricedPerSignatureArr[55] = new Array(true);
pricedPerSignatureArr[56] = new Array(true);
pricedPerSignatureArr[57] = new Array(true);
pricedPerSignatureArr[58] = new Array(true);
pricedPerSignatureArr[59] = new Array(true);
pricedPerSignatureArr[60] = new Array(true);
pricedPerSignatureArr[61] = new Array(true);
pricedPerSignatureArr[62] = new Array(true);
pricedPerSignatureArr[63] = new Array(true);
pricedPerSignatureArr[64] = new Array(true);
pricedPerSignatureArr[65] = new Array(true);
pricedPerSignatureArr[66] = new Array(true);
pricedPerSignatureArr[67] = new Array(true);
pricedPerSignatureArr[68] = new Array(true);
pricedPerSignatureArr[69] = new Array(true);
pricedPerSignatureArr[70] = new Array(true);
pricedPerSignatureArr[71] = new Array(true);
pricedPerSignatureArr[72] = new Array(true);
pricedPerSignatureArr[73] = new Array(true);
pricedPerSignatureArr[74] = new Array(true);
pricedPerSignatureArr[75] = new Array(true);
pricedPerSignatureArr[76] = new Array(true);
pricedPerSignatureArr[77] = new Array(true);
pricedPerSignatureArr[78] = new Array(true);
pricedPerSignatureArr[80] = new Array(true);
pricedPerSignatureArr[81] = new Array(true);
pricedPerSignatureArr[82] = new Array(true);
pricedPerSignatureArr[83] = new Array(true);
pricedPerSignatureArr[85] = new Array(true);
pricedPerSignatureArr[87] = new Array(true);
pricedPerSignatureArr[97] = new Array(true);
pricedPerSignatureArr[98] = new Array(true);
pricedPerSignatureArr[99] = new Array(true);
pricedPerSignatureArr[101] = new Array(true);
pricedPerSignatureArr[103] = new Array(true);
pricedPerSignatureArr[104] = new Array(true);
pricedPerSignatureArr[105] = new Array(true);
pricedPerSignatureArr[106] = new Array(true);
pricedPerSignatureArr[107] = new Array(true);
pricedPerSignatureArr[108] = new Array(true);
pricedPerSignatureArr[109] = new Array(true);
pricedPerSignatureArr[110] = new Array(true);
pricedPerSignatureArr[111] = new Array(true);
pricedPerSignatureArr[112] = new Array(true);
pricedPerSignatureArr[113] = new Array(true);
pricedPerSignatureArr[114] = new Array(true);
pricedPerSignatureArr[115] = new Array(true);
pricedPerSignatureArr[116] = new Array(true);
pricedPerSignatureArr[117] = new Array(true);
pricedPerSignatureArr[118] = new Array(true);
pricedPerSignatureArr[119] = new Array(true);
pricedPerSignatureArr[120] = new Array(true);
pricedPerSignatureArr[121] = new Array(true);
pricedPerSignatureArr[122] = new Array(true);
pricedPerSignatureArr[123] = new Array(true);
pricedPerSignatureArr[128] = new Array(true);
pricedPerSignatureArr[129] = new Array(true);
pricedPerSignatureArr[130] = new Array(true);
pricedPerSignatureArr[131] = new Array(true);
pricedPerSignatureArr[132] = new Array(true);
pricedPerSignatureArr[133] = new Array(true);
pricedPerSignatureArr[138] = new Array(true);
pricedPerSignatureArr[139] = new Array(true);
pricedPerSignatureArr[140] = new Array(true);
pricedPerSignatureArr[141] = new Array(true);
pricedPerSignatureArr[142] = new Array(true);
pricedPerSignatureArr[143] = new Array(true);
pricedPerSignatureArr[150] = new Array(true);
pricedPerSignatureArr[151] = new Array(true);
pricedPerSignatureArr[158] = new Array(true);
pricedPerSignatureArr[159] = new Array(true);
pricedPerSignatureArr[160] = new Array(true);
pricedPerSignatureArr[161] = new Array(true);
pricedPerSignatureArr[162] = new Array(true);
pricedPerSignatureArr[170] = new Array(true);
pricedPerSignatureArr[171] = new Array(true);
pricedPerSignatureArr[172] = new Array(true);
pricedPerSignatureArr[173] = new Array(true);
pricedPerSignatureArr[179] = new Array(true);
pricedPerSignatureArr[180] = new Array(true);
pricedPerSignatureArr[197] = new Array(true);
pricedPerSignatureArr[198] = new Array(true);
pricedPerSignatureArr[199] = new Array(true);
pricedPerSignatureArr[200] = new Array(true);
pricedPerSignatureArr[201] = new Array(true);
pricedPerSignatureArr[202] = new Array(true);
pricedPerSignatureArr[203] = new Array(true);
pricedPerSignatureArr[277] = new Array(true);
pricedPerSignatureArr[278] = new Array(true);
pricedPerSignatureArr[279] = new Array(true);
pricedPerSignatureArr[280] = new Array(true);
pricedPerSignatureArr[281] = new Array(true);
pricedPerSignatureArr[282] = new Array(true);
pricedPerSignatureArr[283] = new Array(true);
pricedPerSignatureArr[284] = new Array(true);
pricedPerSignatureArr[285] = new Array(true);
pricedPerSignatureArr[286] = new Array(true);
pricedPerSignatureArr[287] = new Array(true);
pricedPerSignatureArr[289] = new Array(true);
pricedPerSignatureArr[290] = new Array(true);
pricedPerSignatureArr[306] = new Array(true);
pricedPerSignatureArr[307] = new Array(true);
pricedPerSignatureArr[308] = new Array(true);
pricedPerSignatureArr[310] = new Array(true);
pricedPerSignatureArr[311] = new Array(true);
pricedPerSignatureArr[312] = new Array(true);
pricedPerSignatureArr[317] = new Array(true);
pricedPerSignatureArr[318] = new Array(true);
pricedPerSignatureArr[319] = new Array(true);
pricedPerSignatureArr[320] = new Array(true);
pricedPerSignatureArr[321] = new Array(true);
pricedPerSignatureArr[322] = new Array(true);
pricedPerSignatureArr[323] = new Array(true);
pricedPerSignatureArr[326] = new Array(true);
pricedPerSignatureArr[328] = new Array(true);
pricedPerSignatureArr[329] = new Array(true);
pricedPerSignatureArr[330] = new Array(true);
pricedPerSignatureArr[331] = new Array(true);
pricedPerSignatureArr[332] = new Array(true);
pricedPerSignatureArr[333] = new Array(true);
pricedPerSignatureArr[334] = new Array(true);
pricedPerSignatureArr[335] = new Array(true);
pricedPerSignatureArr[336] = new Array(true);
pricedPerSignatureArr[337] = new Array(true);
pricedPerSignatureArr[338] = new Array(true);
pricedPerSignatureArr[339] = new Array(true);
pricedPerSignatureArr[340] = new Array(true);
pricedPerSignatureArr[341] = new Array(true);
pricedPerSignatureArr[342] = new Array(true);
pricedPerSignatureArr[343] = new Array(true);
pricedPerSignatureArr[344] = new Array(true);
pricedPerSignatureArr[345] = new Array(true);
pricedPerSignatureArr[346] = new Array(true);
pricedPerSignatureArr[347] = new Array(true);
pricedPerSignatureArr[348] = new Array(true);
pricedPerSignatureArr[349] = new Array(true);
pricedPerSignatureArr[350] = new Array(true);
pricedPerSignatureArr[351] = new Array(true);
pricedPerSignatureArr[352] = new Array(true);
pricedPerSignatureArr[353] = new Array(true);
pricedPerSignatureArr[354] = new Array(true);
pricedPerSignatureArr[355] = new Array(true);
pricedPerSignatureArr[356] = new Array(true);
pricedPerSignatureArr[357] = new Array(true);
pricedPerSignatureArr[358] = new Array(true);
pricedPerSignatureArr[359] = new Array(true);
pricedPerSignatureArr[360] = new Array(true);
pricedPerSignatureArr[361] = new Array(true);
pricedPerSignatureArr[363] = new Array(true);
pricedPerSignatureArr[368] = new Array(true);
pricedPerSignatureArr[369] = new Array(true);
pricedPerSignatureArr[372] = new Array(true);
pricedPerSignatureArr[373] = new Array(true);
pricedPerSignatureArr[381] = new Array(true);
pricedPerSignatureArr[383] = new Array(true);
pricedPerSignatureArr[385] = new Array(true);
pricedPerSignatureArr[386] = new Array(true);
pricedPerSignatureArr[387] = new Array(true);
pricedPerSignatureArr[388] = new Array(true);
pricedPerSignatureArr[389] = new Array(true);
pricedPerSignatureArr[390] = new Array(true);
pricedPerSignatureArr[401] = new Array(true);
pricedPerSignatureArr[402] = new Array(true);
pricedPerSignatureArr[403] = new Array(true);
pricedPerSignatureArr[404] = new Array(true);
pricedPerSignatureArr[415] = new Array(true);
pricedPerSignatureArr[417] = new Array(true);
pricedPerSignatureArr[418] = new Array(true);
pricedPerSignatureArr[419] = new Array(true);
pricedPerSignatureArr[420] = new Array(true);
pricedPerSignatureArr[421] = new Array(true);
pricedPerSignatureArr[422] = new Array(true);
pricedPerSignatureArr[423] = new Array(true);
pricedPerSignatureArr[424] = new Array(true);
pricedPerSignatureArr[425] = new Array(true);
pricedPerSignatureArr[426] = new Array(true);
pricedPerSignatureArr[427] = new Array(true);
pricedPerSignatureArr[428] = new Array(true);
pricedPerSignatureArr[429] = new Array(true);
pricedPerSignatureArr[430] = new Array(true);
pricedPerSignatureArr[431] = new Array(true);
pricedPerSignatureArr[432] = new Array(true);
pricedPerSignatureArr[433] = new Array(true);
pricedPerSignatureArr[434] = new Array(true);
pricedPerSignatureArr[435] = new Array(true);
pricedPerSignatureArr[436] = new Array(true);
pricedPerSignatureArr[437] = new Array(true);
pricedPerSignatureArr[438] = new Array(true);
pricedPerSignatureArr[439] = new Array(true);
pricedPerSignatureArr[440] = new Array(true);
pricedPerSignatureArr[441] = new Array(true);
pricedPerSignatureArr[442] = new Array(true);
pricedPerSignatureArr[444] = new Array(true);
pricedPerSignatureArr[445] = new Array(true);
pricedPerSignatureArr[446] = new Array(true);
pricedPerSignatureArr[447] = new Array(true);
pricedPerSignatureArr[448] = new Array(true);
pricedPerSignatureArr[449] = new Array(true);
pricedPerSignatureArr[450] = new Array(true);
pricedPerSignatureArr[451] = new Array(true);
pricedPerSignatureArr[452] = new Array(true);
pricedPerSignatureArr[453] = new Array(true);
pricedPerSignatureArr[454] = new Array(true);
pricedPerSignatureArr[455] = new Array(true);
pricedPerSignatureArr[465] = new Array(true);
pricedPerSignatureArr[498] = new Array(true);
pricedPerSignatureArr[499] = new Array(true);
pricedPerSignatureArr[500] = new Array(true);
pricedPerSignatureArr[501] = new Array(true);
pricedPerSignatureArr[502] = new Array(true);
pricedPerSignatureArr[503] = new Array(true);
pricedPerSignatureArr[504] = new Array(true);
pricedPerSignatureArr[505] = new Array(true);
pricedPerSignatureArr[506] = new Array(true);
pricedPerSignatureArr[507] = new Array(true);
pricedPerSignatureArr[508] = new Array(true);
pricedPerSignatureArr[509] = new Array(true);
pricedPerSignatureArr[510] = new Array(true);
pricedPerSignatureArr[511] = new Array(true);
pricedPerSignatureArr[512] = new Array(true);
pricedPerSignatureArr[513] = new Array(true);
pricedPerSignatureArr[514] = new Array(true);
pricedPerSignatureArr[515] = new Array(true);
pricedPerSignatureArr[516] = new Array(true);
pricedPerSignatureArr[517] = new Array(true);
pricedPerSignatureArr[518] = new Array(true);
pricedPerSignatureArr[532] = new Array(true);
pricedPerSignatureArr[533] = new Array(true);
pricedPerSignatureArr[534] = new Array(true);
pricedPerSignatureArr[535] = new Array(true);
pricedPerSignatureArr[536] = new Array(true);
pricedPerSignatureArr[537] = new Array(true);
pricedPerSignatureArr[538] = new Array(true);
pricedPerSignatureArr[539] = new Array(true);
pricedPerSignatureArr[540] = new Array(true);
pricedPerSignatureArr[541] = new Array(true);
pricedPerSignatureArr[542] = new Array(true);
pricedPerSignatureArr[543] = new Array(true);
pricedPerSignatureArr[544] = new Array(true);
pricedPerSignatureArr[545] = new Array(true);
pricedPerSignatureArr[546] = new Array(true);
pricedPerSignatureArr[547] = new Array(true);
pricedPerSignatureArr[548] = new Array(true);
pricedPerSignatureArr[549] = new Array(true);
pricedPerSignatureArr[550] = new Array(true);
pricedPerSignatureArr[551] = new Array(true);
pricedPerSignatureArr[552] = new Array(true);
pricedPerSignatureArr[553] = new Array(true);
pricedPerSignatureArr[554] = new Array(true);
pricedPerSignatureArr[555] = new Array(true);
pricedPerSignatureArr[556] = new Array(true);
pricedPerSignatureArr[557] = new Array(true);
pricedPerSignatureArr[558] = new Array(true);
pricedPerSignatureArr[559] = new Array(true);
pricedPerSignatureArr[560] = new Array(true);
pricedPerSignatureArr[561] = new Array(true);
pricedPerSignatureArr[562] = new Array(true);
pricedPerSignatureArr[563] = new Array(true);
pricedPerSignatureArr[564] = new Array(true);
pricedPerSignatureArr[565] = new Array(true);
pricedPerSignatureArr[566] = new Array(true);
pricedPerSignatureArr[567] = new Array(true);
pricedPerSignatureArr[568] = new Array(true);
pricedPerSignatureArr[569] = new Array(true);
pricedPerSignatureArr[570] = new Array(true);
pricedPerSignatureArr[571] = new Array(true);
pricedPerSignatureArr[572] = new Array(true);
pricedPerSignatureArr[573] = new Array(true);
pricedPerSignatureArr[574] = new Array(true);
pricedPerSignatureArr[575] = new Array(true);
pricedPerSignatureArr[576] = new Array(true);
pricedPerSignatureArr[577] = new Array(true);
pricedPerSignatureArr[578] = new Array(true);
pricedPerSignatureArr[579] = new Array(true);
pricedPerSignatureArr[580] = new Array(true);
pricedPerSignatureArr[581] = new Array(true);
pricedPerSignatureArr[582] = new Array(true);
pricedPerSignatureArr[583] = new Array(true);
pricedPerSignatureArr[584] = new Array(true);
pricedPerSignatureArr[585] = new Array(true);
pricedPerSignatureArr[586] = new Array(true);
pricedPerSignatureArr[587] = new Array(true);
pricedPerSignatureArr[588] = new Array(true);
pricedPerSignatureArr[589] = new Array(true);
pricedPerSignatureArr[590] = new Array(true);
pricedPerSignatureArr[591] = new Array(true);
pricedPerSignatureArr[592] = new Array(true);
pricedPerSignatureArr[593] = new Array(true);
pricedPerSignatureArr[630] = new Array(true);
pricedPerSignatureArr[633] = new Array(true);
pricedPerSignatureArr[635] = new Array(true);
pricedPerSignatureArr[636] = new Array(true);
pricedPerSignatureArr[637] = new Array(true);
pricedPerSignatureArr[638] = new Array(true);
pricedPerSignatureArr[639] = new Array(true);
pricedPerSignatureArr[640] = new Array(true);
pricedPerSignatureArr[641] = new Array(true);
pricedPerSignatureArr[642] = new Array(true);
pricedPerSignatureArr[643] = new Array(true);
pricedPerSignatureArr[714] = new Array(true);
pricedPerSignatureArr[715] = new Array(true);
pricedPerSignatureArr[723] = new Array(true);
pricedPerSignatureArr[728] = new Array(true);
pricedPerSignatureArr[729] = new Array(true);
pricedPerSignatureArr[730] = new Array(true);
pricedPerSignatureArr[731] = new Array(true);
pricedPerSignatureArr[732] = new Array(true);
pricedPerSignatureArr[733] = new Array(true);
pricedPerSignatureArr[748] = new Array(true);
pricedPerSignatureArr[749] = new Array(true);
pricedPerSignatureArr[750] = new Array(true);
pricedPerSignatureArr[751] = new Array(true);
pricedPerSignatureArr[754] = new Array(true);
pricedPerSignatureArr[755] = new Array(true);
pricedPerSignatureArr[756] = new Array(true);
pricedPerSignatureArr[760] = new Array(true);
pricedPerSignatureArr[761] = new Array(true);
pricedPerSignatureArr[764] = new Array(true);
pricedPerSignatureArr[765] = new Array(true);
pricedPerSignatureArr[766] = new Array(true);
pricedPerSignatureArr[768] = new Array(true);
pricedPerSignatureArr[769] = new Array(true);
pricedPerSignatureArr[770] = new Array(true);
pricedPerSignatureArr[771] = new Array(true);
pricedPerSignatureArr[772] = new Array(true);
pricedPerSignatureArr[773] = new Array(true);
pricedPerSignatureArr[774] = new Array(true);
pricedPerSignatureArr[775] = new Array(true);
pricedPerSignatureArr[776] = new Array(true);
pricedPerSignatureArr[777] = new Array(true);
pricedPerSignatureArr[778] = new Array(true);
pricedPerSignatureArr[779] = new Array(true);
pricedPerSignatureArr[780] = new Array(true);
pricedPerSignatureArr[786] = new Array(true);
productInfoArr[116] = new Array(25, 6.5, 18.5, 12, '', true, 6.5, 18.5, 6.5, 18.5, 6.5, 18.5);
productInfoArr[9] = new Array(250, 8.5, 11, 9, '', true, 5, 9, 9, 12, 8.5, 11);
productInfoArr[3] = new Array(250, 11, 17, 9, '', true, 8, 12, 11.5, 18, 11, 17);
productInfoArr[85] = new Array(500, 8.5, 4.25, '', '', '', '', '', '', '', 8.5, 4.25);
productInfoArr[10] = new Array(250, 8.5, 14, 9, '', true, 5, 12, 9, 16, 8.5, 14);
productInfoArr[20] = new Array(50, 11.5, 18, 12, '', true, 8, 14, 11.75, 18.75, 11.5, 18);
productInfoArr[16] = new Array(50, 17, 24, 12, '', true, 11, 18, 18, 24.25, 17, 24);
productInfoArr[56] = new Array(250, 11, 25.5, 9, '', true, 8, 18, 11.5, 26, 11, 25.5);
productInfoArr[65] = new Array(250, 8.5, 11, '9,9', 2, true, 5, 9, 9.5, 12.63, 5.5, 8.5);
productInfoArr[66] = new Array(250, 11, 17, '9,9', 1, true, 8, 16, 12, 19, 8.5, 11);
productInfoArr[117] = new Array(250, 5.5, 8.5, 284, '', true, 4, 4, 5.5, 8.5, 5.5, 8.5);
productInfoArr[118] = new Array(250, 8.5, 11, 284, '', true, 5, 9, 8.5, 11, 8.5, 11);
productInfoArr[119] = new Array(250, 8.5, 14, 284, '', true, 5, 11, 9, 16, 8.5, 14);
productInfoArr[59] = new Array(500, 2, 6, 43, '', true, 1, 3.6, 2, 6, 2, 6);
productInfoArr[60] = new Array(500, 2, 7, 43, '', true, 1, 3.6, 2, 8, 2, 7);
productInfoArr[13] = new Array(500, 3.5, 2, 43, '', true, 1, 1.5, 4, 2.5, 3.5, 2);
productInfoArr[68] = new Array(500, 4.25, 11, 12, '', true, 2, 9, 5, 11.5, 4.25, 11);
productInfoArr[69] = new Array(500, 3.5, 8.5, 12, '', true, 2, 7, 4, 9, 3.5, 8.5);
productInfoArr[15] = new Array(250, 10, 7, 44, '', true, 5.5, 8.5, 7.5, 10.5, 5, 7);
productInfoArr[71] = new Array(250, 8.5, 5.5, 44, '', true, 4.25, 5.5, 6, 9, 4.25, 5.5);
productInfoArr[84] = new Array(500, 3, 5, '', '', '', '', '', '', '', 3, 5);
productInfoArr[5] = new Array(500, 4, 6, 43, '', true, 2.25, 3.75, 4.25, 6, 4, 6);
productInfoArr[8] = new Array(500, 5, 7, 43, '', true, 4.25, 5.5, 5.5, 7.5, 5, 7);
productInfoArr[7] = new Array(500, 5.5, 8.5, 43, '', true, 5.5, 7.5, 5.5, 8.5, 5.5, 8.5);
productInfoArr[57] = new Array(500, 4.25, 5.5, 43, '', true, 2.25, 3.75, 4.25, 5.5, 4.25, 5.5);
productInfoArr[70] = new Array(500, 6, 9, 43, '', true, 5.5, 8.5, 6.5, 9.5, 6, 9);
productInfoArr[81] = new Array(500, 6, 11, 43, '', true, 4, 9, 6.5, 11.5, 6, 11);
productInfoArr[19] = new Array(500, 4, 9, 43, '', true, 2, 6, 4.5, 9.5, 4, 9);
productInfoArr[99] = new Array(250, 3.5, 2, 43, '', false, 9.1, 16.1, 12, 19, 3.5, 2);
productInfoArr[11] = new Array(250, 11, 17, '9,9', 1, true, 8, 16, 12, 19, 8.5, 11);
productInfoArr[6] = new Array(250, 8.5, 11, '9,9', 2, true, 5, 9, 9, 12, 5.5, 8.5);
productInfoArr[87] = new Array(25, 18, 16, '', '', false, '', '', '', '', 9, 12);
productInfoArr[14] = new Array(250, 15.35, 4.724, 12, '', true, 15.35, 4.72, 15.35, 4.72, 4.724, 4.724);
productInfoArr[34] = new Array(500, '', '', '', 1, false, '', '', '', '', '', '');
productInfoArr[143] = new Array(500, 3.5, 2, 641, '', true, 3.5, 2, 3.5, 2, 3.5, 2);
productInfoArr[142] = new Array(500, 3.375, 2.125, 641, '', true, 3.375, 2.125, 3.375, 2.125, 3.375, 2.125);
productInfoArr[144] = new Array(500, 3, 5, 641, '', true, 3, 5, 3, 5, 3, 5);
productInfoArr[145] = new Array(500, 4, 6, 641, '', true, 4, 6, 4, 6, 4, 6);
productInfoArr[112] = new Array(1, '', '', '', '', false, 9.1, 16.1, 12, 19, '', '');
productInfoArr[113] = new Array(1, '', '', '', '', false, 9.1, 16.1, 12, 19, '', '');
productInfoArr[114] = new Array(1, '', '', '', '', false, 9.1, 16.1, 12, 19, '', '');
productInfoArr[115] = new Array(1, '', '', '', '', false, '', '', '', '', '', '');
productInfoArr[100] = new Array(1, 3.5, 2.5, '', '', false, 9.1, 16.1, 12, 19, 3.5, 2.5);
productInfoArr[101] = new Array(1, 4, 6, '', '', false, 9.1, 16.1, 12, 19, 4, 6);
productInfoArr[102] = new Array(1, 3.5, 8.5, '', '', false, 9.1, 16.1, 12, 19, 3.5, 8.5);
productInfoArr[103] = new Array(1, 5.5, 8.5, '', '', false, 9.1, 16.1, 12, 19, 5.5, 8.5);
productInfoArr[104] = new Array(1, 7, 10, '', '', false, 9.1, 16.1, 12, 19, 7, 10);
productInfoArr[105] = new Array(1, 8.5, 11, '', '', false, 9.1, 16.1, 12, 19, 8.5, 11);
productInfoArr[106] = new Array(1, 11, 17, '', '', false, 9.1, 16.1, 12, 19, 11, 17);
productInfoArr[107] = new Array(1, 12, 18, '', '', false, 9.1, 16.1, 12, 19, 12, 18);
productInfoArr[108] = new Array(1, 38, 38, '', '', false, 9.1, 16.1, 12, 19, 38, 38);
productInfoArr[109] = new Array(1, 38, 38, '', '', false, 9.1, 16.1, 12, 19, 38, 38);
productInfoArr[110] = new Array(1, 68, 68, '', '', false, 9.1, 16.1, 12, 19, 68, 68);
productInfoArr[111] = new Array(1, '', '', '', '', false, 9.1, 16.1, 12, 19, '', '');
productInfoArr[135] = new Array(1, 0, 0, '348,348', '', true, 0, 0, 999, 999, 0, 0);
productInfoArr[86] = new Array(500, 4.5, 11, '', '', '', '', '', '', '', 4.5, 11);
productInfoArr[67] = new Array(250, 18, 11.625, 43, '', true, 18, 11.63, 18, 11.63, 9, 11.625);
productInfoArr[93] = new Array(100, 5.5, 8.5, '', '', false, '', '', '', '', 5.5, 4.25);
productInfoArr[92] = new Array(100, 7, 10, '', '', false, '', '', '', '', 7, 5);
productInfoArr[91] = new Array(250, 5.5, 8.5, '', '', false, '', '', '', '', 5.5, 4.25);
productInfoArr[90] = new Array(250, 7, 10, '', '', false, '', '', '', '', 7, 5);
productInfoArr[97] = new Array(1, 22, 30, 287, '', true, 22, 30, 22, 30, 22, 30);
productInfoArr[98] = new Array(1, 28, 38, 287, '', false, 28, 38, 28, 38, 28, 38);
productInfoArr[95] = new Array(250, 7, 12, '', '', false, '', '', '', '', 7, 12);
productInfoArr[12] = new Array(250, 8.5, 11, 10, '', true, 5, 9, 9, 12, 8.5, 11);
productInfoArr[4] = new Array(250, 11, 17, 10, '', true, 8, 16, 11.5, 18, 11, 17);
productInfoArr[94] = new Array(250, 11, 25.5, 10, '', true, 8, 18, 11.5, 26, 11, 25.5);
productInfoArr[120] = new Array(250, 4.25, 5.5, 9, '', true, 3, 3, 4.5, 6, 4.25, 5.5);
productInfoArr[121] = new Array(250, 5.5, 8.5, 9, '', true, 3, 6, 5.5, 8.5, 5.5, 8.5);
productInfoArr[96] = new Array(250, 8.5, 11, 9, '', true, 5, 9, 9, 12, 8.5, 11);
productInfoArr[149] = new Array(1, 0, 0, 348, '', true, 0, 0, 999, 999, 0, 0);
productInfoArr[136] = new Array(500, 2.75, 3, 638, '', true, 2.75, 3, 2.75, 3, 2.75, 3);
productInfoArr[137] = new Array(500, 2.75, 3, 638, '', true, 2.75, 3, 2.75, 3, 2.75, 3);
productInfoArr[138] = new Array(500, 3, 4, 638, '', true, 3, 4, 3, 4, 3, 4);
productInfoArr[139] = new Array(500, 3, 4, 638, '', true, 3, 4, 3, 4, 3, 4);
productInfoArr[140] = new Array(500, 4, 6, 638, '', true, 4, 6, 4, 6, 4, 6);
productInfoArr[141] = new Array(500, 4, 6, 638, '', true, 4, 6, 4, 6, 4, 6);
productInfoArr[52] = new Array(250, 18, 16, 43, '', true, 18, 16, 18, 16, 9, 12);
productInfoArr[72] = new Array(500, 3.5, 8.5, 9, '', true, 2, 7, 4, 9, 3.5, 8.5);
productInfoArr[73] = new Array(500, 7, 8.5, 9, '', true, 3.75, 7, 7.5, 9, 7, 8.5);
productInfoArr[74] = new Array(500, 10.5, 8.5, 9, '', true, 9, 6, 10.5, 8.5, 10.5, 8.5);
productInfoArr[75] = new Array(500, 5.5, 8.5, 9, '', true, 4, 7, 5.5, 8.5, 5.5, 8.5);
productInfoArr[76] = new Array(500, 3.5, 7, 9, '', true, 2, 6, 3.75, 7, 3.5, 7);
productInfoArr[77] = new Array(500, 7, 7, 9, '', true, 3.75, 6, 7.5, 7.5, 7, 7);
productInfoArr[78] = new Array(500, 10.5, 7, 9, '', true, 9, 6, 10.5, 7.5, 10.5, 7);
productInfoArr[43] = new Array(250, 9, 9.5, 10, '', true, 9, 9.5, 9, 9.5, 4.125, 9.5);
productInfoArr[88] = new Array(250, 8.5, 14, '', '', false, '', '', '', '', 8.5, 14);
productInfoArr[18] = new Array(250, 17.5, 11, 10, '', true, 17.5, 11, 17.5, 11, 8.5, 11);
productInfoArr[17] = new Array(250, 8.5, 11, 10, '', true, 5, 9, 9, 12, 8.5, 11);
productInfoArr[61] = new Array(500, 18, 12, 278, '', true, 9, 12, 9, 12, 9, 12);
productInfoArr[62] = new Array(500, 19, 12.625, 278, '', true, 9.5, 12.63, 9.5, 12.63, 9.5, 12.625);
productInfoArr[89] = new Array(500, 9.5, 9, '', '', false, '', '', '', '', 9.5, 4.25);
shippingWeightArr['0.0001'] = new Array('0.0', '0.0');
shippingWeightArr['0.0014'] = new Array('7.7', '0.0007326');
shippingWeightArr['0.002'] = new Array('7.7', '0.0011');
shippingWeightArr['0.0025'] = new Array('7.7', '0.00165');
shippingWeightArr['0.003'] = new Array('7.7', '0.0022');
shippingWeightArr['0.005'] = new Array('7.7', '0.0033');
shippingWeightArr['0.007'] = new Array('7.7', '0.0044');
shippingWeightArr['0.009'] = new Array('7.7', '0.0055');
shippingWeightArr['0.011'] = new Array('8.25', '0.0066');
shippingWeightArr['0.015'] = new Array('8.8', '0.0099');
shippingWeightArr['0.02'] = new Array('9.35', '0.0132');
shippingWeightArr['0.025'] = new Array('9.9', '0.0165');
shippingWeightArr['0.025315'] = new Array('10.45', '0.0198');
shippingWeightArr['0.025316'] = new Array('11.0', '0.154');
shippingWeightArr['0.03'] = new Array('10.45', '0.0198');
shippingWeightArr['0.035'] = new Array('11.0', '0.0231');
shippingWeightArr['0.04'] = new Array('11.55', '0.0264');
shippingWeightArr['0.045'] = new Array('12.1', '0.0297');
shippingWeightArr['0.05'] = new Array('12.65', '0.033');
shippingWeightArr['0.055'] = new Array('13.2', '0.0363');
shippingWeightArr['0.06'] = new Array('13.75', '0.0396');
shippingWeightArr['0.065'] = new Array('14.3', '0.0473');
shippingWeightArr['0.07'] = new Array('14.85', '0.0506');
shippingWeightArr['0.075'] = new Array('15.4', '0.0539');
shippingWeightArr['0.08'] = new Array('15.95', '0.0572');
shippingWeightArr['0.085'] = new Array('16.5', '0.0605');
shippingWeightArr['0.09'] = new Array('17.05', '0.0638');
shippingWeightArr['0.095'] = new Array('17.6', '0.0671');
shippingWeightArr['0.1'] = new Array('18.15', '0.0704');
shippingWeightArr['0.105'] = new Array('18.7', '0.0737');
shippingWeightArr['0.11'] = new Array('19.25', '0.077');
shippingWeightArr['0.115'] = new Array('19.8', '0.0803');
shippingWeightArr['0.12'] = new Array('20.35', '0.0836');
shippingWeightArr['0.125'] = new Array('20.9', '0.0869');
shippingWeightArr['0.13'] = new Array('21.45', '0.0902');
shippingWeightArr['0.135'] = new Array('22.0', '0.0935');
shippingWeightArr['0.14'] = new Array('22.55', '0.0968');
shippingWeightArr['0.145'] = new Array('23.1', '0.1001');
shippingWeightArr['0.15'] = new Array('23.65', '0.1034');
shippingWeightArr['0.155'] = new Array('24.2', '0.1067');
shippingWeightArr['0.16'] = new Array('24.75', '0.11');
shippingWeightArr['0.165'] = new Array('25.3', '0.1133');
shippingWeightArr['0.17'] = new Array('25.85', '0.1166');
shippingWeightArr['0.175'] = new Array('26.4', '0.1199');
shippingWeightArr['0.18'] = new Array('26.95', '0.1232');
shippingWeightArr['0.185'] = new Array('27.5', '0.1265');
shippingWeightArr['0.19'] = new Array('28.05', '0.1298');
shippingWeightArr['0.195'] = new Array('28.6', '0.1331');
shippingWeightArr['0.2'] = new Array('29.15', '0.1364');
shippingWeightArr['0.21'] = new Array('30.25', '0.143');
shippingWeightArr['0.22'] = new Array('31.35', '0.1496');
shippingWeightArr['0.23'] = new Array('32.45', '0.1562');
shippingWeightArr['0.24'] = new Array('33.55', '0.1628');
shippingWeightArr['0.25'] = new Array('34.65', '0.1694');
shippingWeightArr['0.26'] = new Array('35.75', '0.176');
shippingWeightArr['0.27'] = new Array('36.85', '0.1826');
shippingWeightArr['0.28'] = new Array('37.95', '0.1892');
shippingWeightArr['0.29'] = new Array('39.05', '0.1958');
shippingWeightArr['0.3'] = new Array('40.15', '0.2024');
shippingWeightArr['0.31'] = new Array('41.25', '0.209');
shippingWeightArr['0.32'] = new Array('42.35', '0.2156');
shippingWeightArr['0.33'] = new Array('43.45', '0.2222');
shippingWeightArr['0.34'] = new Array('44.55', '0.2288');
shippingWeightArr['0.35'] = new Array('45.65', '0.2354');
shippingWeightArr['0.36'] = new Array('46.75', '0.242');
shippingWeightArr['0.37'] = new Array('47.85', '0.2486');
shippingWeightArr['0.38'] = new Array('48.95', '0.2552');
shippingWeightArr['0.39'] = new Array('50.05', '0.2618');
shippingWeightArr['0.4'] = new Array('51.15', '0.2684');
shippingWeightArr['0.41'] = new Array('52.25', '0.275');
shippingWeightArr['0.42'] = new Array('53.35', '0.2816');
shippingWeightArr['0.43'] = new Array('54.45', '0.2882');
shippingWeightArr['0.44'] = new Array('55.55', '0.2948');
shippingWeightArr['0.45'] = new Array('56.65', '0.3014');
shippingWeightArr['0.46'] = new Array('57.75', '0.308');
shippingWeightArr['0.47'] = new Array('58.85', '0.3146');
shippingWeightArr['0.48'] = new Array('59.95', '0.3212');
shippingWeightArr['0.49'] = new Array('61.05', '0.3278');
shippingWeightArr['0.5'] = new Array('62.15', '0.3344');
shippingWeightArr['0.51'] = new Array('63.25', '0.341');
shippingWeightArr['0.52'] = new Array('64.35', '0.3476');
shippingWeightArr['0.53'] = new Array('65.45', '0.3542');
shippingWeightArr['0.54'] = new Array('66.55', '0.3608');
shippingWeightArr['0.55'] = new Array('67.65', '0.3674');
shippingWeightArr['0.56'] = new Array('68.75', '0.374');
shippingWeightArr['0.57'] = new Array('69.85', '0.3806');
shippingWeightArr['0.58'] = new Array('70.95', '0.3872');
shippingWeightArr['0.59'] = new Array('72.05', '0.3938');
shippingWeightArr['0.6'] = new Array('73.15', '0.4004');
shippingWeightArr['0.61'] = new Array('74.25', '0.407');
shippingWeightArr['0.62'] = new Array('75.35', '0.4136');
shippingWeightArr['0.63'] = new Array('76.45', '0.4202');
shippingWeightArr['0.64'] = new Array('77.55', '0.4268');
shippingWeightArr['0.65'] = new Array('78.65', '0.4334');
shippingWeightArr['0.659999'] = new Array('79.75', '0.44');
shippingWeightArr['0.660671'] = new Array('17.545', '2.2');
shippingWeightArr['0.660672'] = new Array('79.75', '0.044');
shippingWeightArr['0.7'] = new Array('80.85', '0.0506');
shippingWeightArr['0.75'] = new Array('86.35', '0.0836');
shippingWeightArr['0.8'] = new Array('91.85', '0.1166');
shippingWeightArr['0.85'] = new Array('97.35', '0.1496');
shippingWeightArr['0.9'] = new Array('102.85', '0.1826');
shippingWeightArr['0.95'] = new Array('108.35', '0.2156');
shippingWeightArr['1.0'] = new Array('113.85', '0.2486');
shippingWeightArr['1.05'] = new Array('113.85', '0.2486');
shippingWeightArr['1.065065'] = new Array('20.845', '2.2');
shippingWeightArr['1.065066'] = new Array('113.85', '0.2486');
shippingWeightArr['1.5'] = new Array('119.35', '0.2816');
shippingWeightArr['2.0'] = new Array('126.5', '0.3146');
shippingWeightArr['3.0'] = new Array('132.0', '0.385');
shippingWeightArr['4.0'] = new Array('137.5', '0.4466');
shippingWeightArr['5.0'] = new Array('143.0', '0.5126');
shippingWeightArr['6.0'] = new Array('148.5', '0.5786');
shippingWeightArr['7.0'] = new Array('154.0', '0.6446');
shippingWeightArr['8.0'] = new Array('159.5', '0.7106');
shippingWeightArr['9.0'] = new Array('165.0', '0.7766');
shippingWeightArr['10.0'] = new Array('170.5', '0.8426');
if(typeof(shipTypeArr['CPU']) == 'undefined') shipTypeArr['CPU'] = new Array();
shipTypeArr['CPU'][''] = new Array(6, 0.4, 'Customer Pickup', '', '');
if(typeof(shipTypeArr['DIS']) == 'undefined') shipTypeArr['DIS'] = new Array();
shipTypeArr['DIS'][''] = new Array(30, 0, 'Discard', '', '');
if(typeof(shipTypeArr['FDX2DA']) == 'undefined') shipTypeArr['FDX2DA'] = new Array();
shipTypeArr['FDX2DA'][''] = new Array(3, 4.5, 'FedEx 2 Day', '', '');
if(typeof(shipTypeArr['FDX3DA']) == 'undefined') shipTypeArr['FDX3DA'] = new Array();
shipTypeArr['FDX3DA'][''] = new Array(2, 3, 'FedEx 3 Day', '', '');
if(typeof(shipTypeArr['FDXG']) == 'undefined') shipTypeArr['FDXG'] = new Array();
shipTypeArr['FDXG'][''] = new Array(1, 1, 'FedEx Ground', '', '');
if(typeof(shipTypeArr['FDXIE']) == 'undefined') shipTypeArr['FDXIE'] = new Array();
shipTypeArr['FDXIE'][''] = new Array(42, 2.25, 'FedEx International Economy', '', '');
if(typeof(shipTypeArr['FDXIG']) == 'undefined') shipTypeArr['FDXIG'] = new Array();
shipTypeArr['FDXIG'][''] = new Array(41, 1.67, 'FedEx International Ground', '', '');
if(typeof(shipTypeArr['FDXIP']) == 'undefined') shipTypeArr['FDXIP'] = new Array();
shipTypeArr['FDXIP'][''] = new Array(43, 3.34, 'FedEx International Priority', '', '');
if(typeof(shipTypeArr['FDXNDA']) == 'undefined') shipTypeArr['FDXNDA'] = new Array();
shipTypeArr['FDXNDA'][''] = new Array(4, 6.5, 'FedEx Overnight PM', '', '');
if(typeof(shipTypeArr['FDXNDP']) == 'undefined') shipTypeArr['FDXNDP'] = new Array();
shipTypeArr['FDXNDP'][''] = new Array(26, 7.15, 'FedEx Overnight AM', '', '');
if(typeof(shipTypeArr['FDXS']) == 'undefined') shipTypeArr['FDXS'] = new Array();
shipTypeArr['FDXS'][''] = new Array(19, 7.8, 'FedEx Saturday', '', '');
if(typeof(shipTypeArr['MP']) == 'undefined') shipTypeArr['MP'] = new Array();
shipTypeArr['MP'][''] = new Array(251, 1, 'Manually Priced', '', '');
if(typeof(shipTypeArr['SDD']) == 'undefined') shipTypeArr['SDD'] = new Array();
shipTypeArr['SDD'][''] = new Array(5, 1, 'Local Courier', '', '');
shipTypeArr['FDX2DA'][13] = new Array(8, 4, 'FedEx 2 Day', 2, '');
shipTypeArr['FDX3DA'][13] = new Array(7, 2.5, 'FedEx 3 Day', 2, '');
shipTypeArr['FDXNDA'][13] = new Array(9, 5, 'FedEx Overnight PM', 2, '');
shipTypeArr['FDXNDP'][13] = new Array(27, 5.5, 'FedEx Overnight AM', 2, '');
shipTypeArr['FDXS'][13] = new Array(10, 6, 'FedEx Saturday', 2, '');
shipTypeArr['FDX2DA'][52] = new Array(183, 3, 'FedEx 2 Day', 4, '');
shipTypeArr['FDX3DA'][52] = new Array(182, 2, 'FedEx 3 Day', 4, '');
shipTypeArr['FDXG'][52] = new Array(181, 0.7, 'FedEx Ground', 4, '');
shipTypeArr['FDXNDA'][52] = new Array(184, 4.5, 'FedEx Overnight PM', 4, '');
shipTypeArr['FDX2DA'][59] = new Array(14, 4, 'FedEx 2 Day', 2, '');
shipTypeArr['FDX3DA'][59] = new Array(13, 2.5, 'FedEx 3 Day', 2, '');
shipTypeArr['FDXNDA'][59] = new Array(15, 5, 'FedEx Overnight PM', 2, '');
shipTypeArr['FDXNDP'][59] = new Array(28, 5.5, 'FedEx Overnight AM', 2, '');
shipTypeArr['FDXS'][59] = new Array(11, 6, 'FedEx Saturday', 2, '');
shipTypeArr['FDX2DA'][60] = new Array(17, 4, 'FedEx 2 Day', 2, '');
shipTypeArr['FDX3DA'][60] = new Array(16, 2.5, 'FedEx 3 Day', 2, '');
shipTypeArr['FDXNDA'][60] = new Array(18, 5, 'FedEx Overnight PM', 2, '');
shipTypeArr['FDXNDP'][60] = new Array(29, 5.5, 'FedEx Overnight AM', 2, '');
shipTypeArr['FDXS'][60] = new Array(12, 6, 'FedEx Saturday', 2, '');
shipTypeArr['FDX2DA'][67] = new Array(187, 3.75, 'FedEx 2 Day', 4, '');
shipTypeArr['FDX3DA'][67] = new Array(186, 2.6, 'FedEx 3 Day', 4, '');
shipTypeArr['FDXG'][67] = new Array(185, 0.85, 'FedEx Ground', 4, '');
shipTypeArr['FDXNDA'][67] = new Array(188, 5.5, 'FedEx Overnight PM', 4, '');
shipTypeArr['FDX2DA'][82] = new Array(32, 4, 'FedEx 2 Day', 2, '');
shipTypeArr['FDX3DA'][82] = new Array(31, 2.5, 'FedEx 3 Day', 2, '');
shipTypeArr['FDXNDA'][82] = new Array(33, 5, 'FedEx Overnight PM', 2, '');
shipTypeArr['FDXNDP'][82] = new Array(35, 5.5, 'FedEx Overnight AM', 2, '');
shipTypeArr['FDXS'][82] = new Array(34, 6, 'FedEx Saturday', 2, '');
shipTypeArr['FDX2DA'][83] = new Array(37, 4, 'FedEx 2 Day', 2, '');
shipTypeArr['FDX3DA'][83] = new Array(36, 2.5, 'FedEx 3 Day', 2, '');
shipTypeArr['FDXNDA'][83] = new Array(38, 5, 'FedEx Overnight PM', 2, '');
shipTypeArr['FDXNDP'][83] = new Array(40, 5.5, 'FedEx Overnight AM', 2, '');
shipTypeArr['FDXS'][83] = new Array(39, 6, 'FedEx Saturday', 2, '');
shipTypeArr['FDX2DA'][99] = new Array(45, 4, 'FedEx 2 Day', 2, '');
shipTypeArr['FDX3DA'][99] = new Array(44, 2.5, 'FedEx 3 Day', 2, '');
shipTypeArr['FDXNDA'][99] = new Array(46, 5, 'FedEx Overnight PM', 2, '');
shipTypeArr['FDXNDP'][99] = new Array(48, 5.5, 'FedEx Overnight AM', 2, '');
shipTypeArr['FDXS'][99] = new Array(47, 6, 'FedEx Saturday', 2, '');
shipTypeArr['FDX2DA'][137] = new Array(264, 7.5, 'FedEx 2 Day', 5, '');
shipTypeArr['FDX3DA'][137] = new Array(262, 5, 'FedEx 3 Day', 5, '');
shipTypeArr['FDXG'][137] = new Array(263, 1.7, 'FedEx Ground', 5, '');
shipTypeArr['FDXNDA'][137] = new Array(265, 11, 'FedEx Overnight PM', 5, '');
shipTypeArr['FDXNDP'][137] = new Array(266, 12, 'FedEx Overnight AM', 5, '');
shipTypeArr['FDXS'][137] = new Array(277, 13, 'FedEx Saturday', 5, '');
shipTypeArr['FDX2DA'][139] = new Array(269, 9, 'FedEx 2 Day', 5, '');
shipTypeArr['FDX3DA'][139] = new Array(268, 6, 'FedEx 3 Day', 5, '');
shipTypeArr['FDXG'][139] = new Array(267, 2, 'FedEx Ground', 5, '');
shipTypeArr['FDXNDA'][139] = new Array(270, 12, 'FedEx Overnight PM', 5, '');
shipTypeArr['FDXNDP'][139] = new Array(271, 13, 'FedEx Overnight AM', 5, '');
shipTypeArr['FDXS'][139] = new Array(278, 13.5, 'FedEx Saturday', 5, '');
shipTypeArr['FDX2DA'][141] = new Array(274, 8, 'FedEx 2 Day', 5, '');
shipTypeArr['FDX3DA'][141] = new Array(273, 5.4, 'FedEx 3 Day', 5, '');
shipTypeArr['FDXG'][141] = new Array(272, 1.8, 'FedEx Ground', 5, '');
shipTypeArr['FDXNDA'][141] = new Array(275, 11.5, 'FedEx Overnight PM', 5, '');
shipTypeArr['FDXNDP'][141] = new Array(276, 12.5, 'FedEx Overnight AM', 5, '');
shipTypeArr['FDXS'][141] = new Array(279, 13, 'FedEx Saturday', 5, '');

function PricingPercent(percentType, percent) {
this.percentType = percentType;
this.percent = percent;
}

PricingPercent.prototype.ApplyPricingPercent = function(price) {
switch (this.percentType)
{
case PricingPercentTypeEnum.Channel:
return this.ApplyPercent(price);
case PricingPercentTypeEnum.Markup:
return this.ApplyMarkupPercent(price);
case PricingPercentTypeEnum.MultiVersion:
return this.ApplyPercent(price);
default:
return price;
}
};

PricingPercent.prototype.ApplyPercent = function(price) {
return price * this.percent;
};

PricingPercent.prototype.ApplyMarkupPercent = function(price) {
if (this.percent != 0) {
price *= (1 + this.percent);
}
return price;
};/// <reference path="PricingPercent.js" />

function PricingPercentCollection(percentCollection) {
this.percentCollection = percentCollection;
this.canApplyChannel = false;
this.canApplyMarkup = false;
this.canApplyMultiVersion = false;
}

PricingPercentCollection.prototype.ApplyPricingPercents = function(price) {
if (this.canApplyMultiVersion) {
price = this.ApplyPricingPercent(price, PricingPercentTypeEnum.MultiVersion);
}
if (this.canApplyChannel) {
price = this.ApplyPricingPercent(price, PricingPercentTypeEnum.Channel);
}
if (this.canApplyMarkup) {
price = this.ApplyPricingPercent(price, PricingPercentTypeEnum.Markup);
}
return FormatDollar(price);
};

PricingPercentCollection.prototype.ApplyPricingPercent = function(price, percentType) {
if (this.percentCollection != null) {
for(var i = 0, loopCnt = this.percentCollection.length; i < loopCnt; i++) {
 //for(var pricingPercent in this.percentCollection) {
 if (this.percentCollection[i].percentType == percentType)
 {
 price = this.percentCollection[i].ApplyPricingPercent(price);
 }
 }
 }
return price;
};

PricingPercentCollection.prototype.SetCanApplyPercentVariables = function(adjustType, channelID) {
switch (adjustType) {
case AdjustTypeEnum.Aqueous:
case AdjustTypeEnum.Finishing:
case AdjustTypeEnum.Ink:
case AdjustTypeEnum.Paper:
case AdjustTypeEnum.Product:
case AdjustTypeEnum.Spot:
this.canApplyChannel = true;
this.canApplyMarkup = true;
this.canApplyMultiVersion = true;
break;
case AdjustTypeEnum.Mailing:
case AdjustTypeEnum.Shipping:
this.canApplyChannel = false;
this.canApplyMarkup = (channelID == ChannelIDEnum.OfficeMax);
this.canApplyMultiVersion = false;
break;
case AdjustTypeEnum.Envelope:
case AdjustTypeEnum.SecondSheet:
this.canApplyChannel = true;
this.canApplyMarkup = (channelID == ChannelIDEnum.Mimeo || channelID == ChannelIDEnum.OfficeMax);
this.canApplyMultiVersion = false;
break;
case AdjustTypeEnum.Turnaround:
// Turnaround price is calculated based on printing subtotal, which all percentages were already applied, therefore don't apply any of the percent variables again
this.canApplyChannel = false;
this.canApplyMarkup = false;
this.canApplyMultiVersion = false;
break;
default:
break;
}
};/// <reference path="PartAttribute.js" />
/// <reference path="../../JavaScript/ArrayHelper.js" />

//var Parts;

function Part(partNumber, attributes) {
this.partNumber = partNumber;
this.attributes = attributes;
}

Part.prototype.GetAttributeValueID = function(AttributeID, AttributePlacement) {
 for (var a = 0, loopCnt = this.attributes.length; a < loopCnt; a++) {
if (this.attributes[a].attributeID == AttributeID && (AttributePlacement == null || AttributePlacement == '' || this.attributes[a].attributePlacement == AttributePlacement)){
return this.attributes[a].attributeValueID;
}
}
return null;
};

Part.prototype.Equals = function(partObj) {
//check that both parts have the same number of part attributes
if (this.attributes.length != partObj.attributes.length) {
return false;
}
//sort the part attributes
this.attributes.sort(sortPartAttributes);
partObj.attributes.sort(sortPartAttributes);

//now check that all of the part attributes exist in partObj 
for (var a = 0, loopCnt = this.attributes.length; a < loopCnt; a++) {
if (!this.attributes[a].Equals(partObj.attributes[a])) {
return false;
}
}
return true;
};


// Sorts by attributeValueID and attributePlacement
function sortPartAttributes(a, b) {
if (a.attributeValueID > b.attributeValueID)
{
return 1;
}
else if (a.attributeValueID < b.attributeValueID)
{
return -1;
}
else if (a.attributePlacement > b.attributePlacement)
{
return 1;
}
else if (a.attributePlacement < b.attributePlacement)
{
return -1;
}
return 0;
}function PartAttribute(attributeID, attributeValueID, attributePlacement) {
this.attributeID = attributeID;
this.attributeValueID = attributeValueID;
this.attributePlacement = attributePlacement;
}

PartAttribute.prototype.Equals = function(value, dummy) {
if (typeof(dummy) != 'undefined') {
return (dummy.attributeValueID == value.attributeValueID && dummy.attributePlacement == value.attributePlacement);
}
else {
return (this.attributeValueID == value.attributeValueID && this.attributePlacement == value.attributePlacement);
}
};
/// <reference path="Part.js" />

function Signature(partsPerSignature, parts) {
this.partsPerSignature = partsPerSignature;
this.parts = parts;
}

Signature.prototype.TotalSignatures = function() {
var totalSignatures = 0;
if (this.partsPerSignature > 0) {
totalSignatures = this.parts.length / this.partsPerSignature;
}
return totalSignatures;
};

Signature.prototype.TotalWholeSignatures = function() {
return Math.ceil(this.TotalSignatures());
};

Signature.prototype.TotalSignaturePricingPercent = function() {
var sigPartial = this.TotalSignatures() % 1;
var sigWhole = this.TotalSignatures() - sigPartial;
var sigPricingPercent = GetSignaturePricingPercent(sigPartial);
return sigWhole + sigPricingPercent;
};

Signature.prototype.GetAttributeValueID = function(AttributeID, AttributePlacement) {
return this.parts[0].GetAttributeValueID(AttributeID, AttributePlacement);
};

//ldkfjsdlkfjsdlkfjlsdkfj sdfksdlfkjsl sdkfj flsdjfl
function GetSignaturePricingPercent(signaturePercent) {
if(signaturePercent == 0.5) {
return 0.7;
}
else {
return signaturePercent;
}
}

Signature.prototype.ContainsAttributeValueID = function(attributeValueID, attributePlacement) {
 if (this.parts.length > 0) {
 for (var a = 0, loopCnt = this.parts[0].attributes.length; a < loopCnt; a++) {
 if (this.parts[0].attributes[a].attributeValueID == attributeValueID) {
 if (typeof (attributePlacement) != 'undefined') {
 if (this.parts[0].attributes[a].attributePlacement == attributePlacement) {
 return true;
 }
 }
 else {
 return true;
 }
 }
 }
 return false;
 }
};/// <reference path="Signature.js" />

function CreateSignatureCollection(parts, partsPerSignature) {
var signatures = new Array();
var matchingPartExists = false;
for(var i = 0, loopCnt = parts.length; i < loopCnt; i++)
{
for (var j = 0, loopCnt2 = signatures.length; j < loopCnt2; j++)
{
// Do the parts in this signature have the same attributes as i?
if (typeof(signatures[j].parts) != 'undefined' && typeof(signatures[j].parts[0]) != 'undefined' && parts[i].Equals(signatures[j].parts[0]))
{
// If matched, add the part to this signature.
signatures[j].parts.push(parts[i]);
matchingPartExists = true;
break;
}
}

if (!matchingPartExists)
{
/// Create a new signature, Add the different part to the signature
/// and add the signature to the signature collection.
var partsNew = new Array();
partsNew.push(parts[i]);
var sig = new Signature(partsPerSignature, partsNew);
signatures.push(sig);
}
matchingPartExists = false;
}

return signatures;
}
var IMAGES_DIR = "images";/// <reference path="../../PricingJS/Enums/ProductIDEnum.js" />
/// <reference path="../../PricingJS/Enums/AttributeValueIDEnum.js" />
/// <reference path="../../PricingJS/Enums/AttributeIDEnum.js" />
/// <reference path="../../PricingJS/Enums/NoValueEnum.js" />

//IMPORTANT//
//CommonWeb/JavaScript/EnvironmentIdentification.js must be included before StandardValidation.js

var lHost = window.location.host.toLowerCase();
var isChangeOrderPage = (url.indexOf("CHANGEORDER.ASPX") != -1);

function getQuerystring(key, default_){
 if (default_==null) default_="";
 key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
 var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
 var qs = regex.exec(window.location.href);
 if (qs == null) return default_;
 else return qs[1];
}
var CB = getQuerystring('CB');
var CB = CB.toUpperCase();

//determine site specific coding
var site;
if (url.indexOf('DOBCARDS') != -1) { site = "DO"; }
else if (url.indexOf('INSTAORDER') != -1) { site = "TO"; }
else if (CB != "") { site = "CB"; }
else { site = "default"; }

// Added for cobrand system.
if ((weblocation == "PUBLIC") && (((site == "CB") || (site == "default")) && !isChangeOrderPage)) {
var protocol = window.location.protocol;
var preferedHost = 'www.printingforless.com';
if (protocol == "http:" || lHost != preferedHost) {
 var secureUrl = window.location.href.toLowerCase().replace('http:', 'https:');
 secureUrl = secureUrl.replace(lHost, preferedHost);
 if (site == "default") {
 secureUrl = secureUrl.replace('c/', 'C/');
 }
location.replace(secureUrl); // replace current page in history and redirect
}
}

function hideLayer(layerid) {
 var layerElement = (document.layers) ? document.layers[layerid] : document.getElementById(layerid);
 layerElement.style.display = "none";
}

function showLayer(layerid) {
 var layerElement = (document.layers) ? document.layers[layerid] : document.getElementById(layerid);
 layerElement.style.display = "";
}

function CopyInfo() {
document.price.SHIPPINGCOMPANYNAME.value = document.price.COMPANYNAME.value;
document.price.SHIPPINGCUSTOMERFIRSTNAME.value = document.price.CUSTOMERFIRSTNAME.value;
document.price.SHIPPINGCUSTOMERLASTNAME.value = document.price.CUSTOMERLASTNAME.value;
document.price.SHIPPINGADDRESS.value = document.price.BILLINGADDRESS.value;
document.price.SHIPPINGADDRESS2.value = document.price.BILLINGADDRESS2.value;
document.price.SHIPPINGCITY.value = document.price.BILLINGCITY.value;
document.price.SHIPPINGSTATE.selectedIndex = document.price.BILLINGSTATE.selectedIndex;
document.price.SHIPPINGZIPCODE.value = document.price.BILLINGZIPCODE.value;
document.price.SHIPPINGCOUNTRY.selectedIndex = document.price.BILLINGCOUNTRY.selectedIndex;
document.price.SHIPPINGAREACODE.value = document.price.BILLINGAREACODE.value;
document.price.SHIPPINGPHONENUMBER.value = document.price.BILLINGPHONENUMBER.value;
if (document.price.SHIPPINGCOUNTRY.selectedIndex != 0) {
 alert('Quoted Shipping prices are only valid for addresses in the USA.\n\nPlease contact customer service for shipping prices to other countries.');
} 
}

var markupArray = new Array();
for (var i = 0; i < 100; i++) {
markupArray[i] = new Array(0.3, 0.4, 0.5, 0, 0.1, 0.2);
}
//-----------------------------------------------------------------------------
function MakeCents(value) {
var valueWithCorrectDecimalPosition = value / 100;
return FormatFractionalNumber(valueWithCorrectDecimalPosition, 2);
} 

function FormatFractionalNumber(num, decimalPlaces) {
var powerOfTen = Math.pow(10, decimalPlaces);
var stringNum = (Math.round(num * powerOfTen) / powerOfTen).toString();
var posDecimal = stringNum.indexOf(".");
var zeroToAppendCnt = 0;
if (posDecimal < 0) {
stringNum += ".";
zeroToAppendCnt = decimalPlaces;
} else {
zeroToAppendCnt = decimalPlaces - (stringNum.length - posDecimal - 1);
}
for (var i = 0; i < zeroToAppendCnt; i++) {
stringNum += "0";
}
return stringNum;
}

function checkFileTransfer() {
if (document.price.file1.value !="" || document.price.file2.value !="" || document.price.file3.value !="" || document.price.file4.value !="") {
alert("You have selected a file to upload. You must choose 'Select the File(s) to Upload from Your Computer' as your File Transfter Method");
document.price.filetransfer[0].checked=true;
}
}

function CheckCoupon() {
var customerGroup = document.price.CUSTOMER;
var theCoupon = document.price.ctl00$PricingPlaceHolder1$ProductPricing1$txtCouponCode.value.toUpperCase();
var MailingServices = document.price.mailingPrice.value;

//remove leading or trailing whitespace
theCoupon.replace(/^\s*/, '').replace(/\s*$/, ''); 

// NC coupons are only for new customers
if (customerGroup[1].checked && (theCoupon.substring(0, 2) == "NC" || (site == "CB" && GetCBInfo().CouponFirstTimeCustomerOnly))) {
 alert('The coupon you have entered is only valid for new customers.');
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$txtCouponCode.value = "";
 if (site == "CB") {
 if (GetCBInfo().CouponFirstTimeCustomerOnly) {
 EmptyCoupon();
 return (false);
 }
 else {
 SetCobrandCoupon();
 }
 } 
 return (false);
}
else if (site == "CB" && theCoupon.length != 0) {
//first check for product specific cobrand coupons
if (site == "CB" && (document.price.productTypeInt.value != 13 && (theCoupon == "BFBC" || theCoupon == "BFFBC40" || theCoupon == "VISABUSINESS"))) {
EmptyCoupon();
return (false);
}
if (site == "CB" && document.price.productTypeInt.value != 13 != 99 && theCoupon == "BLSRFBC") {
EmptyCoupon()
return (false);
}
if (theCoupon == GetCBInfo().CouponCode) {
 SetCobrandCoupon();
 }
 else if (theCoupon == "NC20PN" || theCoupon == "NC20PB" || theCoupon == "NC20PC") {
 SetCoupon(theCoupon, 0, .2, 0);
 }
 else if (document.price.productTypeInt.value == 52 && theCoupon == "NC100PF") {
 SetCoupon(theCoupon, 100, 0, 0);
 } 
}
else if ((theCoupon.length != 0) && (theCoupon.indexOf("RP1") >= 0)) {
 alert('The coupon you entered in the Promotional Code field is a Referral Code. Please enter this code in the Referral Code field.');
 return (false);
}
else if (!(isValidCoupon(theCoupon))) {
 alert('The Promotional Code field contains an invalid character.');
 return (false);
}
}

function CheckReferralCode() {
var theRefCoupon = document.price.REFCOUPON.value.toUpperCase();
var customerGroup = document.price.CUSTOMER;

//remove leading or trailing whitespace
theRefCoupon.replace(/^\s*/, '').replace(/\s*$/, ''); 

if ((theRefCoupon.length!=0) && ((theRefCoupon.indexOf("RP1") < 0) && (theRefCoupon.indexOf("RP5") < 0))) {
alert('The coupon you entered in the Referral Code field is a Promotional Code. Please enter this code in the Promotional Code field.');
return (false);
} else if ((theRefCoupon.length!=0) && (theRefCoupon.indexOf("RP1") < 0) && (customerGroup[1].checked)) {
alert('The coupon you have entered is only valid for new customers.');
return (false);
} else if (theRefCoupon.length > 9) {
alert('Only one coupon is allowed in the Referral Code field. Place all other referral code coupons in the Special instructions textbox.');
return (false);
} else if (!(isValidCoupon(theRefCoupon))) {
alert('The Referral Code field contains an invalid character.');
return (false);
}
}

function shippingValidate() {
 if(document.price.SHIPPINGCUSTOMERFIRSTNAME.value =="") {
 alert("Please type in your first name (Shipping)");
 document.price.SHIPPINGCUSTOMERFIRSTNAME.focus();
 return (false);
 } else if(document.price.SHIPPINGCUSTOMERLASTNAME.value =="") {
 alert("Please type in your last name (Shipping)");
 document.price.SHIPPINGCUSTOMERLASTNAME.focus();
 return (false);
 } else if(document.price.SHIPPINGADDRESS.value =="") {
 alert("Please type in your address (Shipping)");
 document.price.SHIPPINGADDRESS.focus();
 return (false);
 } else if(document.price.SHIPPINGCITY.value =="") {
 alert("Please type in your city (Shipping)");
 document.price.SHIPPINGCITY.focus();
 return (false);
 } else if(document.price.SHIPPINGSTATE.value =="") {
 alert("Please indicate in your state (Shipping)");
 document.price.SHIPPINGSTATE.focus();
 return (false);
 } else if(document.price.SHIPPINGZIPCODE.value =="") {
 alert("Please type in your zipcode (Shipping)");
 document.price.SHIPPINGZIPCODE.focus();
 return (false);
 } else if (document.price.SHIPPINGCOUNTRY.selectedIndex != 0) {
 alert('Quoted Shipping prices are only valid for addresses in the USA.\n\nPlease contact customer service for shipping prices to other countries.');
 } else if(document.price.SHIPPINGAREACODE.value =="") {
 alert("Please type in your area code (Shipping)");
 document.price.SHIPPINGAREACODE.focus();
 return (false);
 } else if(document.price.SHIPPINGPHONENUMBER.value =="") {
 alert("Please type in your phonenumber (Shipping)");
 document.price.SHIPPINGPHONENUMBER.focus();
 return (false);
 } else if (document.price.shiptype && (document.price.shiptype.value == 'FDXG' || document.price.shiptype.value == 'FDX3DA') &&
 (document.price.SHIPPINGSTATE.value == "HI" || document.price.SHIPPINGSTATE.value == "AK" ||
 document.price.SHIPPINGSTATE.value == "PR" || document.price.SHIPPINGSTATE.value == "VI")) {
 alert('Air Shipping is required for Alaska, Hawaii, Puerto Rico or the Virgin Islands');
 return (false);
 } 
 return (true);
}

function standardCustomerValidate(customerIDvalidate) {
 if (!(customerIDvalidate)) { //there is a valid Customer Account Number
 var customerGroup = document.price.CUSTOMER;
 if (!(customerGroup[0].checked || customerGroup[1].checked)) {
 alert("Please indicate your customer status.");
 document.price.CUSTOMER[0].focus();
 return (false);
 }
} // end customerIDvalidate

 if(document.price.CUSTOMERFIRSTNAME.value =="") {
 alert("Please type in your first name");
 document.price.CUSTOMERFIRSTNAME.focus();
 return (false);
 } else if(document.price.CUSTOMERLASTNAME.value =="") {
 alert("Please type in your last name");
 document.price.CUSTOMERLASTNAME.focus();
 return (false);
 } 
 
 if (!(customerIDvalidate)) {
 //if customer account number is supplied - do not require billing phone
 if (document.price.BILLINGAREACODE.value =="") {
 alert("Please type in your area code");
 document.price.BILLINGAREACODE.focus();
 return (false);
 } else if (document.price.BILLINGPHONENUMBER.value =="") {
 alert("Please type in your phonenumber");
 document.price.BILLINGPHONENUMBER.focus();
 return (false);
 }
 } 
 
 var the_email = document.price.EMAIL.value;
 var atindex = the_email.indexOf('@');
 if (document.price.EMAIL.value == "") {
 alert("Please type in your email");
 document.price.EMAIL.focus();
 return (false);
 } else if ((atindex == -1) || (atindex == 0) || (atindex == the_email.length-1)) {
 alert("Your email is not formatted correctly.");
 document.price.EMAIL.focus();
 return (false);
 }
return (true);
}

function billingValidate() {
if (typeof (document.price.PAYMENTNEEDED) == 'undefined' || ((typeof (document.price.PAYMENTNEEDED) != 'undefined') && document.price.PAYMENTNEEDED[1].checked)) {
if (document.price.BILLINGADDRESS.value == "") {
alert("Please type in your billing address");
document.price.BILLINGADDRESS.focus();
return (false);
}
else if (document.price.BILLINGCITY.value == "") {
alert("Please type in your billing city");
document.price.BILLINGCITY.focus();
return (false);
}
else if (document.price.BILLINGSTATE.options[document.price.BILLINGSTATE.selectedIndex].value == "") {
alert("Please indicate in your billing state");
document.price.BILLINGSTATE.focus();
return (false);
}
else if (document.price.BILLINGZIPCODE.value == "") {
alert("Please type in your billing zipcode");
document.price.BILLINGZIPCODE.focus();
return (false);
}
}
return (true);
}

function paymentValidate(customerIDvalidate) {
var creditcardGroup = document.price.CREDITCARD;
var creditcardsChecked = (creditcardGroup[0].checked || creditcardGroup[1].checked || creditcardGroup[2].checked || creditcardGroup[3].checked);
var illegalChars = /[^a-zA-Z0-9 \-.]/;
// allow only letters, numbers, and spaces, dashes and periods

if (typeof (document.price.PAYMENTNEEDED) == 'undefined' || ((typeof (document.price.PAYMENTNEEDED) != 'undefined') && document.price.PAYMENTNEEDED[1].checked)) {

var creditcardGroup = document.price.CREDITCARD;
var creditcardsChecked = (creditcardGroup[0].checked || creditcardGroup[1].checked || creditcardGroup[2].checked || creditcardGroup[3].checked );
var illegalChars = /[^a-zA-Z0-9 \-.]/;// allow only letters, numbers, and spaces, dashes and periods

if ((document.price.LAST4DIGITS) && (!(creditcardGroup[4].checked))) document.price.LAST4DIGITS.value = '';

if (creditcardsChecked && document.price.CREDITCARDNUMBER && document.price.CREDITCARDNUMBER.value.length >= 4) {
var start = document.price.CREDITCARDNUMBER.value.length - 4;
document.price.LAST4DIGITS.value = document.price.CREDITCARDNUMBER.value.substring(start);
}

if (creditcardGroup[4].checked) { // card on file
if (document.price.CUSTOMER[0].checked) {
alert("The 'card on file' payment option is only valid for returning customers.");
return (false);
} else if (document.price.LAST4DIGITS.value == "") {
alert("Please supply the last four digits of your credit card.");
document.price.LAST4DIGITS.focus();
return (false);
} else if (!(isNumberString(document.price.LAST4DIGITS.value))) {
alert("Please supply the last four digits of your credit card.");
document.price.LAST4DIGITS.focus();
return (false);
}
}
if ((creditcardsChecked || !customerIDvalidate) && !billingValidate()) { return false; }
}
 return (true);
}

function isValidAccount(){
 //check for validity of customer Account
 var InString;
 InString = document.price.account.value;
 if (InString.length != 9) { //string length = 9
 isInvalidAccountMessage();
 return (false);
 } else {
 var AlphaString;
 var NumericString;
 AlphaString = InString.substring(0,4);
 NumericString = InString.substring(4,9);
 if (!(isAlphabeticString(AlphaString))) 
 {
 isInvalidAccountMessage();
 return (false);
 }
 if (!(isNumberString(NumericString))) 
 {
 isInvalidAccountMessage();
 return (false);
 }
 // valid customer id has been identified
 } //end of string length = 9
 return (true);
}

function validateMailing()
{
 var MailingText = GetElementByIDOrName('ctl00$PricingPlaceHolder1$ProductPricing1$MailingPricing1$txtMailingQuantity');
 if (MailingText != null && typeof(MailingText) != 'undefined' && MailingText.value != '' && MailingText.value != '0' )
 {
 var MailingType = GetRadioCheckedValueByName('ctl00$PricingPlaceHolder1$ProductPricing1$MailingPricing1$rblMailingMethod');
 return MailingType != '';
 }
 return true;
}

function isValidCoupon (InString) {
if(InString.length==0) 
 return (true);
var RefString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789%-";
for (Count=0; Count < InString.length; Count++) {
TempChar= InString.substring(Count, Count+1);
if (RefString.indexOf(TempChar, 0) == -1) {
return (false);
}
}
return (true);
}

function isAlphabeticString (InString) {
if (InString.length == 0) {
return (false);
}
RefString="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (Count=0; Count < InString.length; Count++) {
TempChar= InString.substring(Count, Count+1);
if (RefString.indexOf(TempChar, 0) == -1) {
return (false);
}
}
return (true);
}

function isNumberString (InString) {
if (InString.length == 0) {
return (false);
}
RefString="1234567890";
for (Count=0; Count < InString.length; Count++) {
TempChar= InString.substring (Count, Count+1);
if (RefString.indexOf(TempChar, 0) == -1) {
return (false);
}
}
return (true);
}

function isCurrency (InString) {
if (InString.length == 0) {
return (false);
}
RefString="0123456789.,$";
for (Count=0; Count < InString.length; Count++) {
TempChar= InString.substring (Count, Count+1);
if (RefString.indexOf(TempChar, 0) == -1) {
return (false);
}
}
return (true);
}

function strip(filter,str){
 var i,curChar;
 var retStr = '';
 var len = str.length;
 for(i=0; i<len; i++){
 curChar = str.charAt(i);
 if (filter.indexOf(curChar) < 0) {
 //not in filter, keep it
 retStr += curChar;
 }
 }
 return retStr;
}

function isInvalidAccountMessage() {
alert("The account number you entered is invalid. If you are entering a Promotional Code, please enter the code within the coupon field provided below. If you don't have an account number, please leave the account field blank.");
 document.price.account.value="";
 document.price.account.focus();
}

function macWindow(openWindow) {
if (openWindow) {
 windowHandle = window.open('macfile.html','window3','width=270,height=200');
 if (!windowHandle.opener) windowHandle.opener = self;
 }
else
windowHandle.close();
}

 // Call onclick function for the checked item of a collection
function Click(elem) {
for (var i = 0; i < elem.length; i++) {
if (elem[i].checked) {
elem[i].click();
break;
}
}
}

function newWindow(file,window) {
 msgWindow=open(file,window,'resizable=no,width=500,height=520');
 if (msgWindow.opener == null) msgWindow.opener = self;
 }
//-------------------------------------------------------------------------------
var pfl1status;
var pfl1date;

function CheckSubmit() {
 if (site != "DO" && site != "TO") {
 var filetransferGroup = document.price.filetransfer;
var uploading_files = filetransferGroup[0].checked;
}

 var customerIDvalidate = false;

 //check for size radio buttons
 if (typeof(document.price.ctl00$PricingPlaceHolder1$ProductPricing1$SizePricing1$rblSize) != 'undefined') {
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$SizePricing1$rblSize', 'productTypeInt'); //product ID
 }
 var producttype = document.price.productTypeInt.value;

 //set hidden pricing fields from span values (post CQ Phase 1)
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblPrintingSubtotal', 'subPrice'); //printing subtotal
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblPrintingCostEach', 'ppcopyPrice'); //printing cost each
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblRushCharge', 'rushPrice'); //rush price
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblShippingHandling', 'shipPrice'); //shipping price
 SetInputVal(($('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblDiscountedTotal') && $('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblHiVolDiscount') && $('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblHiVolDiscount').innerHTML != '$0.00') ? 'ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblDiscountedTotal' : 'ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblOrderTotal', 'totalPrice'); //order total price
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblCouponDiscount', 'couponDiscount'); //coupon discount
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblHiVolDiscount', 'highVolumeDiscount'); //high volume discount
 if (document.price.highVolumeDiscount && StripNonNumeric(document.price.highVolumeDiscount.value) > 0) {
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$txtCouponCode.value = "";
 } 
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblUnitCost', 'pp2copyPrice'); //unit cost
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblMailingServices', 'mailingPrice'); //mailing price
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblEnvelopes', 'envelopePrice'); //envelope price
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblSecondSheets', 'secondsheetsPrice'); //second sheets price
 if (producttype == ProductIDEnum.calendars_5_5x8_5 || producttype == ProductIDEnum.calendars_8_5x11 
 || producttype == ProductIDEnum.catalogs_5_5x8_5 || producttype == ProductIDEnum.catalogs_8_5x11) { //catalogs and calendars
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblCoverBasePrintingPrice', 'basePrice'); //base printing price
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblCoverPaperUpgrade', 'paperPrice'); //paper upgrade price
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblCoverGlossVarnish', 'aquaPrice'); //aqueous price
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblInsideFoldCollateStaple', 'foldPrice'); //fold price (fold collate staple)
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblInsideBasePrintingPrice', 'insidepagesPrice'); //inside pages printing
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblInsidePaperUpgrade', 'insidepaperprice'); //inside paper price
 }
 else {
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblBasePrintingPrice', 'basePrice'); //base printing price
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblPaperUpgrade', 'paperPrice'); //paper upgrade price
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblAqueousCoating', 'aquaPrice'); //aqueous price
 SetInputVal('ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1_lblFolding', 'foldPrice'); //fold price
}

 //set hidden attribute description fields
 //ink
 if (producttype == ProductIDEnum.file_folders) { //split ink for file folders
 var ink = GetRadioCheckedValueByName('ctl00$PricingPlaceHolder1$ProductPricing1$InkPricing1$rblInk1'); //use name not id
 var inkArr = ink.split('/');
 if (inkArr.length > 1) {
 if (inkArr[0] == '') {
 document.price.front.value = NoValueEnum[AttributeIDEnum.ink];
 }
 else {
 document.price.front.value = AttributeValueNameEnum[inkArr[0]];
 }
 if (inkArr[1] == '') {
 document.price.back.value = NoValueEnum[AttributeIDEnum.ink];
 }
 else {
 document.price.back.value = AttributeValueNameEnum[inkArr[1]];
 } 
}
 }
 else {
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$InkPricing1$rblInk1', 'front', AttributeIDEnum.ink); //front ink
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$InkPricing1$rblInk2', 'back', AttributeIDEnum.ink); //back ink
 if (producttype == ProductIDEnum.calendars_5_5x8_5 || producttype == ProductIDEnum.calendars_8_5x11 
|| (producttype == ProductIDEnum.catalogs_5_5x8_5 && document.price.ctl00$PricingPlaceHolder1$ProductPricing1$NumPagesPricing1$ddlNumPages.value > 8)
|| (producttype == ProductIDEnum.catalogs_8_5x11 && document.price.ctl00$PricingPlaceHolder1$ProductPricing1$NumPagesPricing1$ddlNumPages.value > 4)) {
SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$InsidePagePricing1$rblInkInside', 'insideink', AttributeIDEnum.ink); //insideink
 }
 }

 //paper
 if (producttype == ProductIDEnum.calendars_5_5x8_5 || producttype == ProductIDEnum.calendars_8_5x11) {
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$PaperPricing1$rblPaperInside', 'insidepaperType', AttributeIDEnum.paper); //insidepaper calendars
 }
 else if ((producttype == ProductIDEnum.catalogs_5_5x8_5 && document.price.ctl00$PricingPlaceHolder1$ProductPricing1$NumPagesPricing1$ddlNumPages.value > 8)
|| (producttype == ProductIDEnum.catalogs_8_5x11 && document.price.ctl00$PricingPlaceHolder1$ProductPricing1$NumPagesPricing1$ddlNumPages.value > 4)) {
SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$InsidePagePricing1$rblPaperInside', 'insidepaperType', AttributeIDEnum.paper); //insidepaper catalogs
 }
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$PaperPricing1$rblPaper', 'paperType', AttributeIDEnum.paper); //paper
 //fold
 if (producttype == ProductIDEnum.calendars_5_5x8_5 || producttype == ProductIDEnum.calendars_8_5x11
 || producttype == ProductIDEnum.catalogs_5_5x8_5 || producttype == ProductIDEnum.catalogs_8_5x11) { //hard code fold collate stitch for catalogs
 if (document.price.ctl00$PricingPlaceHolder1$ProductPricing1$NumPagesPricing1$ddlNumPages.value == 4) {
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$FoldPricing1$rblFold.value = AttributeValueIDEnum.fold_half_fold;
 document.price.folds.value = AttributeValueNameEnum[document.price.ctl00$PricingPlaceHolder1$ProductPricing1$FoldPricing1$rblFold.value];
 }
 else {
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$FoldPricing1$rblFold.value = AttributeValueIDEnum.foldcollatestaple_fold_collate_stitch;
 document.price.folds.value = AttributeValueNameEnum[AttributeValueIDEnum.foldcollatestaple_fold_collate_stitch];
 }
 }
 else {
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$FoldPricing1$rblFold', 'folds', AttributeIDEnum.fold); //fold
 }

 //aqueous
 if ((producttype == ProductIDEnum.greeting_cards || producttype == ProductIDEnum.note_cards ||
 producttype == ProductIDEnum.holiday_deluxe_greeting_card || producttype == ProductIDEnum.holiday_deluxe_note_card ||
 producttype == ProductIDEnum.holiday_premium_greeting_card || producttype == ProductIDEnum.holiday_premium_note_card) &&
 (GetRadioCheckedValueByName('ctl00$PricingPlaceHolder1$ProductPricing1$PaperPricing1$rblPaper') == AttributeValueIDEnum.paper_120lb_gloss_cover ||
 GetRadioCheckedValueByName('ctl00$PricingPlaceHolder1$ProductPricing1$PaperPricing1$rblPaper') == AttributeValueIDEnum.paper_120lb_gloss_cover_14_pt_pc55)) {
 //Hard code free Aqueous for Greeting and Note Cards on 120# Gloss Cover
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$AqueousPricing1$rblAqueous.value = AttributeValueIDEnum.coating_gloss_aqueous;
 document.price.aqueous.value = AttributeValueNameEnum[document.price.ctl00$PricingPlaceHolder1$ProductPricing1$AqueousPricing1$rblAqueous.value];
 }
 else {
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$AqueousPricing1$rblAqueous', 'aqueous', AttributeIDEnum.coating); //aqueous
 }

 //imprint
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$EnvelopePricing1$rblPrintedEnvelope', 'blackimprint', AttributeIDEnum.imprint); //imprint (return address in black)
 //pockets
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$PocketSlitPricing1$rblPocket', 'PocketType', AttributeIDEnum.pockets); //pockets
 //slits
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$PocketSlitPricing1$rblSlit', 'SlitType', AttributeIDEnum.slits); //slits
 //seal
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$SealPricing1$rblSeal', 'sealType', AttributeIDEnum.seal); //seal

 //non PD_AttributeValues (turnaround, shipping, mailing)
 if (producttype != ProductIDEnum.envelopes_only) {
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$TurnaroundPricing1$rblTurnaround', 'shipspeed'); //turnaround
 }
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$ShipTypePricing1$rblShipType', 'shiptype'); //shipping method
 SetAttributeDescription('ctl00$PricingPlaceHolder1$ProductPricing1$MailingPricing1$rblMailingMethod', 'mailingtype'); //mailing method
 
 //envelope size and paper
 if (typeof(document.price.ctl00$PricingPlaceHolder1$ProductPricing1$EnvelopePricing1$txtEnvelopeQuantity) != 'undefined' &&
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$EnvelopePricing1$txtEnvelopeQuantity.value &&
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$EnvelopePricing1$txtEnvelopeQuantity.value != '' &&
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$EnvelopePricing1$txtEnvelopeQuantity.value > 0) {
 if (producttype == ProductIDEnum.greeting_cards || producttype == ProductIDEnum.holiday_deluxe_greeting_card || 
 producttype == ProductIDEnum.holiday_deluxe_note_card) {
 document.price.envelopeID.value = AttributeValueIDEnum.envelopes_a7;
 document.price.envelope.value = AttributeValueNameEnum[document.price.envelopeID.value];
 }
 else if (producttype == ProductIDEnum.note_cards || producttype == ProductIDEnum.holiday_premium_greeting_card || 
 producttype == ProductIDEnum.holiday_premium_note_card) {
 document.price.envelopeID.value = AttributeValueIDEnum.envelopes_a2;
 document.price.envelope.value = AttributeValueNameEnum[document.price.envelopeID.value];
 }
 document.price.envelopepaperID.value = AttributeValueIDEnum.paper_24lb_uncoated;
 document.price.envelopepaper.value = AttributeValueNameEnum[document.price.envelopepaperID.value];
 }

 //doorhanger die cut
 if ((producttype == ProductIDEnum.door_hangers_3_5x8_5 || producttype == ProductIDEnum.door_hangers_4_25x11) &&
 typeof (document.price.diecutID) != 'undefined' && typeof (document.price.diecut) != 'undefined') {
 document.price.diecutID.value = AttributeValueIDEnum.diecut_door_hanger_die_cut;
 document.price.diecut.value = AttributeValueNameEnum[document.price.diecutID.value];
 }

 //calendar drill hole
 if ((producttype == ProductIDEnum.calendars_5_5x8_5 || producttype == ProductIDEnum.calendars_8_5x11) &&
 typeof (document.price.drillholeID) != 'undefined' && typeof (document.price.drillhole) != 'undefined') {
 document.price.drillholeID.value = AttributeValueIDEnum.drillholes_1_8_drill_hole;
 document.price.drillhole.value = AttributeValueNameEnum[document.price.drillholeID.value];
 }

 //cd covers perforation
 if (producttype == ProductIDEnum.cd_covers && typeof (document.price.perforationID) != 'undefined'
 && typeof (document.price.perforation) != 'undefined') {
 document.price.perforationID.value = AttributeValueIDEnum.perfnumber_perforation;
 document.price.perforation.value = AttributeValueNameEnum[document.price.perforationID.value];
 }

 //greeting/note cards and presentation folders score (AND no fold)
 if ((producttype == ProductIDEnum.presentation_folders_9x12 || producttype == ProductIDEnum.presentation_folders_cbsl_9x12 ||
 producttype == ProductIDEnum.greeting_cards || producttype == ProductIDEnum.note_cards ||
 producttype == ProductIDEnum.holiday_deluxe_greeting_card || producttype == ProductIDEnum.holiday_deluxe_note_card ||
 producttype == ProductIDEnum.holiday_premium_greeting_card || producttype == ProductIDEnum.holiday_premium_note_card) &&
 typeof(document.price.scoreID) != 'undefined' && typeof(document.price.score) != 'undefined' &&
 typeof (document.price.folds) != 'undefined' && document.price.folds.value == NoValueEnum[AttributeIDEnum.fold]) {
 document.price.scoreID.value = AttributeValueIDEnum.score_standard;
 document.price.score.value = AttributeValueNameEnum[document.price.scoreID.value];
 }

 //validate mailing
 if (!validateMailing()) {
 alert('Please select a mailing method.');
 $('ctl00$PricingPlaceHolder1$ProductPricing1$MailingPricing1$txtMailingQuantity').focus();
 return false;
 }

if (uploading_files) {
if(document.price.file1.value =="" && document.price.file2.value =="" && document.price.file3.value =="" && document.price.file4.value =="") {
alert("Please select a file to upload or another file transfer option");
document.price.file1.focus();
return false;
}
}

if ((document.price.account.value != "") && (isValidAccount())) { customerIDvalidate = true; }
if (!(standardCustomerValidate(customerIDvalidate))) { return false; }
if (!(paymentValidate(customerIDvalidate))) { return false; }

 if ((!customerIDvalidate) && (!shippingValidate())) {
 return false;
 }

if (site != "DO") { //no upload progress window for DO orders
// Open upload progress window
var w = window.open( "", "UPLOADWINDOW1", "width=380,height=320,resizable=no");
if (document.price.FBC) { //change page to files for Free Business Card ordering page
if (uploading_files) {
w.location.href = "../statusbarupload.html";
}
else {
w.location.href = "../statusbarorder.html";
}
}
else {
if (uploading_files) {
w.location.href = "statusbarupload.html";
}
else {
w.location.href = "statusbarorder.html";
}
}
}
else if (site == "DO") { //DO specific validation
//found in UtilityFunctions.js include file
DeleteCookie("SavedBCardsList");
}

var companyname;
var customername;
var phone;
var email;
var cgiscriptaction;
var customertype;

if (site == "default") { //failed Order only for PFL orders in 'default' sites
if (document.price.CUSTOMER[0].checked) customertype = "new";
else if (document.price.CUSTOMER[1].checked) customertype = "returning"; 
else customertype = "unknown";

companyname = escape(document.price.COMPANYNAME.value);
customername = escape(document.price.CUSTOMERFIRSTNAME.value + "_" + document.price.CUSTOMERLASTNAME.value);
phone = escape(document.price.BILLINGAREACODE.value + "-" + document.price.BILLINGPHONENUMBER.value);
email = escape(document.price.EMAIL.value);
} //end default only

cgiscriptaction = "https://www.printingforless.com/cgi-bin/";
 if (weblocation == "DEVELOPMENT" || weblocation == "INTEGRATION" || weblocation == "STAGING") {
cgiscriptaction += "processorderTestingM.cgi";
} 
else if (weblocation == "TRAINING") {
cgiscriptaction += "processorderTrainingM.cgi";
} 
else { //if (weblocation == "PUBLIC") {
cgiscriptaction += "processorderM.cgi";
}

if (site == "default") { //no failed Order for DO
document.price.action = cgiscriptaction + "?" + companyname + "--" + customername + "--" + customertype + "--" + phone + "--" + email + "--" + producttype;
} // default
else if (site == "CB") {
document.price.action = cgiscriptaction + "?" + "CB=" + CB;
}
else { //not default
document.price.action = cgiscriptaction;
 }

// to stop duplicate orders - 9/8/2006 KR
if (document.price.sendorder) {
document.price.sendorder.disabled = true;
document.price.sendorder.value = "Sending Order...";
}

if (document.price.CREDITCARDNUMBER == undefined) {
document.price.submit();
}
else {
var guid = generateGuid();
if (weblocation == "DEVELOPMENT" || weblocation == "INTEGRATION" || weblocation == "STAGING") {
 if (DevLocal) {
 pfl1.document.formCC.action = "http://" + window.location.host + "/Public/ExternalOrder.aspx";
 }
 else {
 pfl1.document.formCC.action = "https://" + window.location.host.replace("printingforless", "public") + "/ExternalOrder.aspx";
 }
}
else if (weblocation == "TRAINING") {
// Need to update this for training
}
else { //if (weblocation == "PUBLIC") {
 pfl1.document.formCC.action = "https://www.printingforless1.com/ExternalOrder.aspx";
}
pfl1.document.formCC.CC.value = document.price.CREDITCARDNUMBER.value;
pfl1.document.formCC.GUID.value = guid;
pfl1.document.formCC.submit();
document.price.CREDITCARDNUMBER.value = guid;
pfl1status = document.getElementById('pfl1status');
if (pfl1status == null || pfl1status == undefined) {
document.price.submit();
}
else {
pfl1date = new Date();
setTimeout('CheckPFL1Status();', 100);
}
}
}

function SetInputVal(spanID, inputID) {
 var spanElem = document.getElementById(spanID);
 if (typeof (spanElem) != 'undefined' && spanElem != null) {
 var inputElem = GetElementByIDOrName(inputID);
 if (typeof (inputElem) != 'undefined' && inputElem != null) {
 inputElem.value = spanElem.innerHTML.replace('$', ''); //strip out the dollar sign on prices

 }
 }
}

function SetAttributeDescription(attributeID, hiddenID, PDA_RID) {
var attributeElem = document.getElementsByName(attributeID); //use name not id
var elemObj = document.getElementById(attributeID); //used for hidden values (not radio buttons
var attributeValue = "";
if (elemObj) {
if (elemObj.type == "radio" || elemObj.type == "hidden") {
if (typeof (attributeElem) != 'undefined' && attributeElem != null && attributeElem.length > 1) {
attributeValue = GetRadioCheckedValueByName(attributeID);
}
else {
attributeValue = elemObj.value;
}
}
}

if (attributeValue == "" && typeof (attributeElem) != 'undefined' && attributeElem != null) {
attributeValue = GetRadioCheckedValueByName(attributeID);
}

 var hiddenElem = GetElementByIDOrName(hiddenID);
 if (typeof (hiddenElem) != 'undefined' && hiddenElem != null) {
 if (PDA_RID != null) {
 if (attributeValue != '') {
 hiddenElem.value = AttributeValueNameEnum[attributeValue];
 }
 else {
 hiddenElem.value = NoValueEnum[PDA_RID];
 }
 }
 else {
 hiddenElem.value = attributeValue;
 }
 }
}

function GetElementByIDOrName(inputID) {
var inputElem = document.getElementById(inputID);
if (inputElem == null) {
inputElem = document.getElementsByName(inputID);
if (inputElem != null) {
inputElem = inputElem[0];
}
}
return inputElem;
}

function generateGuid()
{
var result, i, j;
result = '';
for (j = 0; j < 32; j++) {
if (j == 8 || j == 12 || j == 16 || j == 20) {
 result = result + '-';
}
i = Math.floor(Math.random() * 16).toString(16).toUpperCase();
result = result + i;
}
return '{' + result + '}';
}

function CheckPFL1Status() {
var curDate = new Date();
var newdomain = false;
try {
var l = pfl1.location.host;
}
catch (e) {
// a domain change will cause an access denied error
newdomain = true;
}
if (pfl1status.value == 'complete' || newdomain == true || curDate - pfl1date > 10000) {
// If pfl1 submission is complete or domain in iframe has changed or 10 seconds have elapsed
document.price.submit();
}
else {
// Reset status check
setTimeout('CheckPFL1Status();', 100);
}
}

function CreatePFL1Iframe() {
 // Create the form that will submit to printingforless1.com
 //document.body.innerHTML += '<iframe id="pfl1" name="pfl1" src="pfl1.html" width=0 height=0></iframe>';
 var pfl1 = document.createElement('iframe');
 pfl1.setAttribute('id', 'pfl1');
 pfl1.setAttribute('name', 'pfl1');
 pfl1.setAttribute('width', '0');
 pfl1.setAttribute('height', '0');
 pfl1.setAttribute('src', 'pfl1.html');
 document.body.appendChild(pfl1);
 var pfl1status = document.createElement('input');
 pfl1status.setAttribute('type', 'hidden');
 pfl1status.setAttribute('id', 'pfl1status');
 pfl1status.setAttribute('value', '');
 //document.getElementById('price').appendChild(pfl1status);
 document.price.appendChild(pfl1status);

 // Create hidden var to send server/domain
 var domainprefix = document.domain.substring(0, document.domain.indexOf("-"));
 var domaincode = '';
 if ('dw' == domainprefix) domaincode = 'dev';
 if ('p1' == domainprefix) domaincode = 'prj1';
 if ('iw' == domainprefix) domaincode = 'int';
 if ('sw' == domainprefix) domaincode = 'stg';
 if ('tw' == domainprefix) domaincode = 'trn';
 var orderdomain = document.createElement('input');
 orderdomain.setAttribute('type', 'hidden');
 orderdomain.setAttribute('id', 'orderdomain');
 orderdomain.setAttribute('name', 'orderdomain');
 orderdomain.setAttribute('value', domaincode);
 document.price.appendChild(orderdomain);
}

var highVolumeCoupon = "new Coupon('HVD', DiscountTypeEnum.HiVol, new Array(new CouponValue(20117, 0.0000, 0.28, 25000), new CouponValue(20116, 0.0000, 0.25, 15000), new CouponValue(20115, 0.0000, 0.2, 12500), new CouponValue(20114, 0.0000, 0.15, 10000), new CouponValue(20113, 0.0000, 0.1, 7500), new CouponValue(20112, 0.0000, 0.05, 5000)))";
function SetCobrandCoupon() {
 if (site == "CB" && typeof (InstaPrices) != 'undefined') {
 var objCBInfo = GetCBInfo();
 if (document.price.coupontype) { //free business cards regular and short run
 if (document.price.coupontype.value == "BCD") {
 InstaPrices['ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1'].SetCoupons(new Array(eval(highVolumeCoupon), new Coupon(objCBInfo.FBCCouponCode, DiscountTypeEnum.Promotional, new Array(new CouponValue(objCBInfo.FBCCouponID, objCBInfo.FBCCouponAmount, objCBInfo.FBCCouponPercent, objCBInfo.FBCCouponMiniumn)))));
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$txtCouponCode.value = objCBInfo.FBCCouponCode;
 }
 else if (document.price.coupontype.value == "BCDSR") {
 InstaPrices['ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1'].SetCoupons(new Array(eval(highVolumeCoupon), new Coupon(objCBInfo.SRFBCCouponCode, DiscountTypeEnum.Promotional, new Array(new CouponValue(objCBInfo.SRFBCCouponID, objCBInfo.SRFBCCouponAmount, objCBInfo.SRFBCCouponPercent, objCBInfo.SRFBCCouponMiniumn)))));
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$txtCouponCode.value = objCBInfo.SRFBCCouponCode;
 }
 }
 else {
 InstaPrices['ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1'].SetCoupons(new Array(eval(highVolumeCoupon), new Coupon(objCBInfo.CouponCode, DiscountTypeEnum.Promotional, new Array(new CouponValue(objCBInfo.CouponID, objCBInfo.CouponAmount, objCBInfo.CouponPercent, objCBInfo.CouponMiniumn)))));
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$txtCouponCode.value = objCBInfo.CouponCode;
 }
 }
}

function SetCoupon(couponCode, couponAmount, couponPercent, couponMinimun) {
 if (site == "CB" && typeof (InstaPrices) != 'undefined') {
 InstaPrices['ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1'].SetCoupons(new Array(eval(highVolumeCoupon),new Coupon(couponCode, DiscountTypeEnum.Promotional, new Array(new CouponValue(001, couponAmount, couponPercent, couponMinimun)))));
 }
}

function EmptyCoupon() { //high volume only
 if (site == "CB" && typeof (InstaPrices) != 'undefined') {
 InstaPrices['ctl00_PricingPlaceHolder1_ProductPricing1_InstaPrice1'].SetCoupons(new Array(eval(highVolumeCoupon)));
 document.price.ctl00$PricingPlaceHolder1$ProductPricing1$txtCouponCode.value = "";
 }
}

