/*------------------------------------------------------------- * * * G L O B A L V A R I A B L E S * * * ------------------------------------------------------------*/ var title_shoppingCart = "View Cart - Ellington Handbags"; //Must correspond with the page title of the shopping cart page var title_shippingMethod = "Shipping Method - Ellington Handbags"; //Must correspond with the page title of the shipping method page var title_reviewAndSubmit = "Review and Submit Order - Ellington Handbags"; //Must correspond with the page title of the review and submit page var column_itemName = 1; //Must correspond with the position of the item name column on the item table var column_itemLink = 1; //Must correspond with the position of the item link column on the item table var account_id = 436694; //Must correspond with the internal NetSuite account number /*------------------------------------------------------------- * * * G E N E R A L P A G E F U N C T I O N S * * * ------------------------------------------------------------*/ function SearchPageTitle(string) //If there is a title in the document it will return a result of > -1 if a match is found. { try { var pageTitle = document.title; var result = pageTitle.search(string); return result; } catch(ex) { return "No title specified in the header of the document"; } } function GetCustomerType() //Element must be manually added to global theme { return document.getElementById("customerType").innerHTML; } function InsertTableRow(tableId, rowPos, html) { var table = document.getElementById(tableId).insertRow(rowPos); var row = table.insertCell(0); row.innerHTML = html; } /*------------------------------------------------------------- * * * S H I P P I N G M E T H O D T A B L E F U N C T I O N S * * * ------------------------------------------------------------*/ function GetNumberOfShippingMethods() { return document.getElementById("shippingmethodtable").getElementsByTagName("input").length - 1; } function RemoveShippingItems(positionArray) { for(i=0; i -1) { var numOfShippingMethods = GetNumberOfShippingMethods(); if(numOfShippingMethods == 8) { var customerType = GetCustomerType(); { if(customerType != "Dealer/Wholesale") { DisplayRetailShippingMethods(); } else { DisplayWholesaleShippingMethods(); } } } } } /*------------------------------------------------------------- * * * R E V I E W & S U B M I T P A G E F U N C T I O N S * * * ------------------------------------------------------------*/ function ReviewAndSubmitPageValidation() { var pageTitle = SearchPageTitle(title_reviewAndSubmit); if(pageTitle > -1) { var numOfShippingMethods = GetNumberOfShippingMethods(); if(numOfShippingMethods == 8) { var customerType = GetCustomerType(); { if(customerType != "Dealer/Wholesale") { DisplayRetailShippingMethods(); } else { DisplayWholesaleShippingMethods(); } } } } }