/// <reference path="/js/jquery.js"/>

//shipping and billing page - switch out the input image
$(document).ready(function() {
    if ($('select[name="txtElementPaymentID"]').val() == "-1") {
        $('input.ShipBillInformation_ContinueCheckoutButton').attr('src','/Images/buttons/Continue.gif');
    }
    $('select[name="txtElementPaymentID"]').change(function() {
        if ($(this).val() == "-1") {
            $('input.ShipBillInformation_ContinueCheckoutButton').attr('src','/Images/buttons/Continue.gif');
        }
    });
});

// -- Freight to be determined
        $(document).ready(function() {
        $("#ShipBillInformation_txtShipMethod").find("option").each(function () {
       
         var old = $(this).html();
       
          $(this).html(old.replace(/\$0\.00/g, "Billed at Actual Rate"))
       
         });
        });

//-- querystring object

	var querystring = new function () {
        var _       = this;    
        var params  = {};
        
		var init = function () {
            
            var querystring = document.location.search.slice(1);
            
			if(!querystring)
                return false;
            
            var _params = querystring.split('&');
            
            for( var i = 0; i < _params.length; i++ ) {
                var parts = _params[i].split('=');
                
                if ( parts.length == 1 )
                    parts.push(true);
                
                params[ parts[0].toLowerCase() ] = decodeURIComponent( parts[1] );
            }
        };
        
        _.get = function ( param ) {
            return params[param.toLowerCase()] || false;
        };
        
		_.getAll = function () {
            return params;
        };
        
		init();
	}();

//-- checkout fixes

	var nonEmptyCartFixes       = function (parent) {
        var $ = jQuery;
		var self = this;
		var init = function () {
			utils.removeSpaces();
		};
		var utils = {
            removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
		};
		var config = {};
		$(init);
	};
    
    var emptyCartFixes          = function (parent) {
        var $ = jQuery;
        var self = this;
        var init = function () {
			utils.removeSpaces();
        };
        var utils = {
			removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
		};
        var config = {};
        $(init);
    };
    
    var shipBillFixes           = function (parent) {
        var $ = jQuery;
        var self = this;
        var init = function () {
            utils.removeSpaces();
        };
        var utils = {
        	removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
        };
        var config = {};
        $(init);
    };
    
    var orderHistoryFixes       = function (parent) {
        var $ = jQuery;
        var self = this;
        var init = function () {
            utils.removeSpaces();
        };
        var utils = {
            removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
        };
        $(init);
    };
    
    var orderSummaryFixes       = function (parent) {
        var $ = jQuery;
        var self = this;
        var init = function () {
            utils.removeSpaces();
        };
        var utils = {
            removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
        };
        $(init);
    };
    
    var orderConfirmationFixes  = function (parent) {
        var $ = jQuery;
        var self = this;
        var init = function () {
            utils.removeSpaces();
        };
        var utils = {
            removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
        };
        $(init);
    };
    
    var itemDetailFixes			= function (parent) {
        var $ = jQuery;
        var self	= this;
        var init	= function () {
            utils.removeSpaces();
        };
        var utils	= {
        	removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
        };
        $(init);
    };
    
    var quickOrderFixes			= function (parent) {
    	var $ = jQuery;
        var self = this;
        var init = function () {
        	utils.addHeading();
        };
        var utils = {
        	addHeading: function () {
            	$('img[src*=qop_tab.gif]')
                	.before( parent.utils.getHeading( 'Quick Order Pad' ) )
                    .hide();
            }
        };
        $(init);
    };
    
//-- profile fixes

    var loginFixes = function (parent) {
        var $ = jQuery;
        var self = this;
        var init = function () {
            utils.removeSpaces();
        };
        var utils = {
            removeSpaces: function () {
                    $('td.ContentLogonFeatureCell > table > tbody > tr:eq(0)').remove();
                    $('table.LogonInputsTable > tbody > tr:eq(0)').remove();
                    $('td.ContentLogonFeatureCell > table > tbody > tr > td > table > tbody > tr > td > form > table > tbody').find('tr:eq(0), tr:eq(1), tr:eq(2)').remove();
                    $('table.LogonInputsTable > tbody > tr:eq(2) > td > table > tbody').find('tr:eq(2), tr:eq(4), tr:eq(6)').remove();
	            }
        };
        $(init);
    };
    
    var accountFixes            = function (parent) {
        var $ = jQuery;
        var self = this;
        var init = function () {
            utils.removeSpaces();
        };
        var utils = {
            removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
        };
        $(init);
    };
    
    var invoiceFixes			= function (parent) {
    	var $ = jQuery;
        var self = this;
        var init = function () {
        	utils.addHeading();
            utils.handleDateTable();
            parent.utils.fixCollapse();
        };
        var utils = {
        	removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
        };
        $(init);
    };
    
    var myInvoicesListFixes		= function (parent) {
    	var $ = jQuery;
        var self = this;
        var init = function () {
        	utils.removeSpaces();
        };
        var utils = {
            removeSpaces: function () {
                $('table.MyAccount_BaseTable').find('tr:eq(0), tr:eq(1), tr:eq(2), tr:eq(6), tr:eq(7)').remove();
                $('table.MyAccountInvoiceDetail_ContainerTable').find('tr:eq(0), tr:eq(1), tr:eq(3), tr:eq(12), tr:eq(18)').remove();
                $('table.MyAccount_BaseTable > tbody > tr:eq(6)').remove();
                $('table.MyAccountInvoicesList_ResultsAreaTable > tbody > tr:nth-child(2n+3)').css('display','none');
                $('table.MyAccountInvoicesList_ResultsAreaTable > tbody > tr:nth-child(4n)').css('background-color','#f6f9fc');
                $('table.MyAccountInvoiceDetail_ResultsAreaTable > tbody > tr:nth-child(2n+3)').css('display','none');
                $('table.MyAccountInvoiceDetail_ResultsAreaTable > tbody > tr:nth-child(4n)').css('background-color','#f6f9fc');
                $('table.MyAccountInvoiceDetail_ContainerTable > tbody > tr:nth-child(13)').hide();
                $('table.MyAccountInvoiceDetail_ContainerTable > tbody > tr:nth-child(15)').hide();
                $('table.MyAccountInvoiceDetail_ContainerTable > tbody > tr:nth-child(16)').hide();
            }
        };
        $(init);
    };
    
    var welcomeFixes            = function (parent) {
        var $ = jQuery;
        var self = this;
        var init = function () {
            utils.removeSpaces();
        };
        var utils = {
            removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
        };
        $(init);
    };
    
    var newShopperFixes			= function (parent) {
    	var $ = jQuery;
        var self = this;
        var init = function () {
        	utils.removeSpaces();
        };
        var utils = {
        	removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
        };
        $(init);
    };
    
    var newCustomerFixes		= function (parent) {
    	var $ = jQuery;
        var self = this;
        var init = function () {
        	utils.removeSpaces();
        };
        var utils = {
            removeSpaces: function () {
                    $('table.NewCustomerTable1 > tbody > tr:eq(0)').remove();
                    $('table.NewCustomerTable1 > tbody > tr:eq(0)').remove();
                    $('table.NewCustomerTable1 > tbody > tr:eq(0)').remove();
                    $('table.NewCustomerInnerTable > tbody > tr:eq(0)').remove();
	            }
        };
        $(init);
	};
	
	    var worksheetFixes		= function (parent) {
	    	var $ = jQuery;
	        var self = this;
	        var init = function () {
	        	utils.removeSpaces();
	        };
	        var utils = {
	            removeSpaces: function () {
	            	$('tr:has(>td.ShoppingList_SeparatorCell)').remove();
	            }
	        };
	        $(init);
	    };
	    
	    var myOpenOrdersFixes		= function (parent) {
	    	var $ = jQuery;
	        var self = this;
	        var init = function () {
	        	utils.removeSpaces();
	        };
	        var utils = {
	            removeSpaces: function () {
	            	$('table.MyAccount_BaseTable>tbody>tr:eq(0)').remove();
	            	$('table.MyAccount_BaseTable>tbody>tr:eq(1)').remove();
	            	$('table.MyAccount_BaseTable>tbody>tr:eq(2)').remove();
	            	$('table.MyAccount_BaseTable > tbody > tr:eq(2)').remove();
	            	$('table.MyAccount_BaseTable > tbody > tr:eq(4)').remove();
	            	$('table.MyAccount_BaseTable > tbody > tr:eq(4)').remove();
	            	$('table.MyAccount_BaseTable > tbody > tr:eq(4)').remove();
	            	$('table.MyAccountOpenOrderList_ResultsAreaTable > tbody > tr:nth-child(2n+3)').css('display','none');
	            	$('table.MyAccountOpenOrderList_ResultsAreaTable > tbody > tr:nth-child(4n)').css('background-color','#f6f9fc');
	            	$('table.MyAccountOpenOrderDetail_ResultsAreaTable > tbody > tr:nth-child(2n+3)').css('display','none');
	            	$('table.MyAccountOpenOrderDetail_ResultsAreaTable > tbody > tr:nth-child(4n)').css('background-color','#f6f9fc');
	            }
	        };
	        $(init);
	    };
	    
	    var myOpenARFixes		= function (parent) {
	    	var $ = jQuery;
	        var self = this;
	        var init = function () {
	        	utils.removeSpaces();
	        	utils.styleFixes();
	        };
	        var utils = {
	            removeSpaces: function () {
	            	$('table.MyAccount_BaseTable>tbody>tr:eq(0)').remove();
	            	$('table.MyAccount_BaseTable>tbody>tr:eq(1)').remove();
	            	$('table.MyAccount_BaseTable>tbody>tr:eq(3)').remove();
	            	$('td.ContentMyAccountOpenARPaymentSummaryFeatureCell>table>tbody>tr:eq(0)').remove();
	            	//$('table.MyAccount_BaseTable > tbody > tr:eq(2)').remove();
	            	//$('table.MyAccount_BaseTable > tbody > tr:eq(7)').remove();
	            	$('td.ContentMyAccountOpenARPaymentFeatureCell > table > tbody > tr:eq(0)').remove();
	            	$('td.ContentMyAccountOpenARPaymentFeatureCell > table > tbody > tr > td > table > tbody > tr > td > form > table > tbody > tr:eq(0)').remove();
	                $('td.ContentMyAccountOpenARPaymentSummaryFeatureCell > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr:eq(0)').remove();
	            },
	            styleFixes: function () {
	                $('.MyAccountOpenARListMakePmtLink').parent().addClass('oddRow');
	                $('table.MyAccountOpenARListPaymentTable>tbody>tr:first-child>td:eq(2)').css("width","105px");
	                $('table.MyAccountOpenARList_ResultsAreaTable > tbody > tr:nth-child(2n+3)').css('display','none');
	                $('table.MyAccountOpenARList_ResultsAreaTable > tbody > tr:nth-child(4n)').css('background-color','#f6f9fc');
	            }
	        };
	        $(init);
	    };
	    
	    var contactUsFixes		= function (parent) {
	    	var $ = jQuery;
	        var self = this;
	        var init = function () {
	        	utils.removeSpaces();
	        };
	        var utils = {
	            removeSpaces: function () {
	            	$('table.ContactUsOuterTable').find('tr:eq(0), tr:eq(1), tr:eq(5), tr:eq(7), tr:eq(9), tr:eq(11), tr:eq(13), tr:eq(15)').remove();
	            	
	            }
	        };
	        $(init);
	    };
	    
	    var orderTrackingFixes		= function (parent) {
	    	var $ = jQuery;
	        var self = this;
	        var init = function () {
	        	utils.removeSpaces();
	        };
	        var utils = {
	        	removeSpaces: function () {
	            	//$('table.MyAccount_BaseTable>tbody>tr:eq(3)').remove();
	            	//$('table.MyAccount_BaseTable>tbody>tr:eq(5)').remove();
	            	//$('table.MyAccount_BaseTable>tbody>tr:eq(6)').remove();
	            	//$('td.ContentMyAccountOrderTrackingListFeatureCell>table>tbody>tr:eq(0)').remove();
	            	$('table.MyAccountOrderTrackingSelectOuterTable > tbody').find('tr:eq(0), tr:eq(2), tr:eq(3), tr:eq(5), tr:eq(9)').remove();
	            }
	        };
	        $(init);
	    };
	    
	    var custCreditInfoFixes		= function (parent) {
	    	var $ = jQuery;
	        var self = this;
	        var init = function () {
	        	utils.removeSpaces();
	        };
	        var utils = {
	            removeSpaces: function () {
                    // TODO: Remove spaces here
	            }
	        };
	        $(init);
	    };
	    
	    var myAccountFixes		= function (parent) {
	    	var $ = jQuery;
	        var self = this;
	        var init = function () {
	        	utils.removeSpaces();
	        };
	        var utils = {
	        	removeSpaces: function () {
                    $('td.ContentMyAccountOrderTrackingListFeatureCell > table > tbody > tr:eq(0)').remove();
                    $('table.MyAccount_BaseTable > tbody').find('tr:eq(0), tr:eq(2), tr:eq(6)').remove();
	            }
	        };
	        $(init);
	    };
	    
	    var pastPurchaseSelectFixes = function (parent) {
	        var $ = jQuery;
	        var self = this;
	        var init = function () {
	            utils.removeSpaces();
	        };
	        var utils = {
	            removeSpaces: function () {
	                $('td.ContentPastPurchasesItemReportFeatureCell>table:first>tbody>tr:first').remove();
	                $('td.ContentPastPurchasesItemDetailReportFeatureCell>table:first>tbody>tr:first').remove();
	                $('td.ContentPastPurchasesSelectFeatureCell > table > tbody > tr:eq(0)').remove();
	                $('td.ContentPastPurchasesCategoryReportFeatureCell > table > tbody > tr:eq(0)').remove();
	            }
	        };
	        $(init);
	    };
	    
	    var pastPurchasesItemDetail = function (parent) {
	        var $ = jQuery;
	        var self = this;
	        var init = function () {
	            utils.removeSpaces();
	        };
	        var utils = {
	            removeSpaces: function () {
	                $('.ContentPastPurchasesItemDetailReportFeatureCell > table > tbody > tr:eq(0)').remove();
	            }
	        };
	        $(init);
	    };
	    
	    var myProfileMainFixes = function (parent) {
	        var $ = jQuery;
	        var self = this;
	        var init = function () {
	            utils.removeSpaces();
	        };
	        var utils = {
	            removeSpaces: function () {
	                $('table.MyAccountProfile_Table002 > tbody').find('tr:eq(0)').remove();
	                $('table.MyAccountProfile_Table002 td.MyAccountProfiletext').remove();
	                $('table.MyAccountProfile_Table001 > tbody > tr:eq(1)').remove();
	                $('table.MyAccountProfile_Table001 > tbody > tr:eq(7)').remove();
	                $('table.MyAccountProfileAcctInnerTable').css('background-color','#ebf2f8');
	                $('table.MyAccountProfileAcctInnerTable td').css('background-color','#ebf2f8');
	                $('table.MyAccountProfileAcctInnerTable td').css('vertical-align','middle');
	                $('td.MyAccountProfileTitleColor').css('background-color','#7CA9D3');
	            }
	        };
	        $(init);
	    };
	    
	    var myAccountOrderTrackingListFixes = function (parent) {
	        var $ = jQuery;
	        var self = this;
	        var init = function () {
	            utils.removeSpaces();
	        };
	        var utils = {
	            removeSpaces: function () {
	                $('td.ContentMyAccountOrderTrackingListFeatureCell > table > tbody > tr:eq(0)').remove();
	                $('table.MyAccount_BaseTable > tbody > tr:eq(0)').remove();
	                $('table.MyAccount_BaseTable > tbody > tr:eq(3)').remove();
	                $('table.MyAccount_BaseTable > tbody > tr:eq(3)').remove();
	                $('table.MyAccount_BaseTable > tbody > tr:eq(5)').remove();
	                $('table.MyAccount_BaseTable > tbody > tr:eq(7)').remove();
	            }
	        };
	        $(init);
	    };
    
//-- global object

	    var siteFixes = function () {
	        var $ = jQuery;
	        var self = this;
	        var fixObject;
	        var init = $(document).ready(function () {
	            utils.addBrowserClass();
	            var checkout = true;

	            /* if ($('.ShoppingCart_Table').length > 0)
	                fixObject = new nonEmptyCartFixes(self); */
	            /* else if ($('.ShoppingCart_DescriptionText').length > 0)
	                fixObject = new emptyCartFixes(self); */
	            if ($('.Logonlogoninput').length > 0)
	                fixObject = new loginFixes(self);
	            else if ($('.ShipBillInformation_ShipToCaptionImage').length > 0) /* modified */
	                fixObject = new shipBillFixes(self); 
	            else if ($('.ContentPastPurchasesSelectFeatureCell').length > 0 || $('.ContentPastPurchasesCategoryReportTR').length > 0 || querystring.get('page') == 'Past Purchases Select')
	            {
	                fixObject = new pastPurchaseSelectFixes(self);
	                } 
	            else if ($('.ContentPastPurchasesItemDetailReportTR').length > 0)
	                fixObject = new pastPurchasesItemDetail(self);
	            /* else if ($('img[src*=odrsummary_tab.gif]').length > 0)
	                fixObject = new orderSummaryFixes(self); */
	            /* else if ($('.OrderConfirmation_CaptionImage').length > 0)
	                fixObject = new orderConfirmationFixes(self); */
	            else if ($("img[src='myprofile_tab.gif']").length > 0)
	                fixObject = new myProfileMainFixes(self); 
	            else if ($('.ContentMyAccountOrderTrackingListTR').length > 0)
	                fixObject = new myAccountOrderTrackingListFixes(self); 
	            /* else if ($('img[src*=welcome_tab.gif]').length > 0)
	                fixObject = new welcomeFixes(self); */
	            /* else if ($('img[src*=itmdetail_tab.gif]').length > 0)
	                fixObject = new itemDetailFixes(self); */
	            else if ($("img[src='invoices_tab.gif']").length > 0)
	                fixObject = new myInvoicesListFixes(self); 
	            /* else if ($('img[src*=qop_tab.gif]').length > 0)
	                fixObject = new quickOrderFixes(self); */
	            /*else if ($('img[src*=register_tab.gif]').length > 0)
	                fixObject = new newShopperFixes(self); */
	            else if ($("img[src='join_tab.gif']").length > 0)
	                fixObject = new newCustomerFixes(self); 
	            /* else if ($('img[src*=shoplist_tab.gif]').length > 0)
	                fixObject = new worksheetFixes(self); */
	            else if ($("img[src='openorders_tab.gif']").length > 0) /* modified */
	                fixObject = new myOpenOrdersFixes(self);
	            else if ($("img[src='openar_tab.gif']").length > 0) /* modified */
	                fixObject = new myOpenARFixes(self); 
	            else if ($("img[src='contact_tab.gif']").length > 0)
	                fixObject = new contactUsFixes(self); 
	            else if ($("img[src='track_tab.gif']").length > 0)
	                fixObject = new orderTrackingFixes(self);
	            /* else if ($('img[src*=hdr_creditinfo.gif]').length > 0)
	                fixObject = new custCreditInfoFixes(self); */
	            else if ($("img[src='003myaccount_banner.gif']").length > 0)
	                fixObject = new myAccountFixes(self); 
	            else
	                checkout = false;

	            if (checkout) {
	                utils.hideBrokenImages();
	            }
	        });
	        var buttonCount = 0;
	        var utils = self.utils = {
	            addBrowserClass: function () {
	                if ($.browser.msie) {
	                    $('body').addClass('msie');
	                }
	            },
	            getAttributeMap: function (node) {
	                var ret = {};
	                var attr = node.attributes || node[0].attributes;
	                for (var cv = 0; cv < attr.length; cv++)
	                    ret[attr[cv].nodeName] = attr[cv].nodeValue;
	                return ret;
	            },
	            fixCollapse: function () {
	                $('table').css({ borderCollapse: 'collapse' });
	                $('th,tr,td').css({ borderCollapse: 'separate' });
	            },
	            hideBrokenImages: function () {
	                $('img').each(function () {
	                    var src = $(this).attr('src');
	                    var error = function () {
	                        $(this).hide();
	                    };
	                    $(this).error(error).attr('src', src);
	                });
	            }
	        };
	         $(init);
	    } ();
	    
	    
//table fixes
$(document).ready(function() {
    
    $('table.PastPurchasesItemReport_Table > tbody > tr:nth-child(2n+3)').css('background-color','#f6f9fc');
    $('table.PastPurchaseItemDetailReport_Table > tbody > tr:nth-child(2n+3)').css('background-color','#f6f9fc');
    
    $('table.PastPurchasesCategoryReport_Table > tbody > tr:nth-child(2n+3) > td.PastPurchasesCategoryReport_InvoiceLines').css('background-color','#f6f9fc');
    $('table.PastPurchasesCategoryReport_Table > tbody > tr:nth-child(2n+3) > td.PastPurchasesCategoryReport_ExtendedPrice').css('background-color','#f6f9fc');
    $('table.PastPurchasesCategoryReport_Table > tbody > tr:nth-child(2n+3) > td.PastPurchasesCategoryReport_CategoryName').css('background-color','#f6f9fc');
    
    $('table.PriceBreaks_MainTable > tbody > tr:nth-child(2n)').css('background-color','#f6f9fc');
    $('table.ItemDetailTable2 > tbody > tr:nth-child(2n)').css('background-color','#f6f9fc');
    
    $('table.MyAccountOrderTrackingList_ResultsAreaTable > tbody > tr:nth-child(2n+3)').css('display','none');
    $('table.MyAccountOrderTrackingList_ResultsAreaTable > tbody > tr:nth-child(4n) > td.TrackingListValue').css('background-color','#f6f9fc');
    
    $('table.MyAccountOrderTrackingDetail_ResultsAreaTable > tbody > tr:nth-child(2n+3)').css('display','none');
    $('table.MyAccountOrderTrackingDetail_ResultsAreaTable > tbody > tr:nth-child(4n)').css('background-color','#f6f9fc');
    
    $('table.ShoppingCart_Table > tbody > tr:nth-child(4n) > td').css('background-color','#f6f9fc');
    
    $('table.OrderSummary_Table > tbody > tr:nth-child(2n) > td').css('background-color','#f6f9fc');
    
    $('table.OrderConfirmation_Table > tbody > tr:nth-child(2n) > td').css('background-color','#f6f9fc');
    
    $('table.ShoppingList_Table > tbody > tr:nth-child(4n) > td').css('background-color','#f6f9fc');
    
    if ($('table.OrderConfirmation_ShipTable').length > 0) {
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(2) td').css('background-color','#ebf2f8');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(4) td').css('background-color','#ebf2f8');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(5) td').css('background-color','#ebf2f8');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(6) td').css('background-color','#ebf2f8');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(7) td').css('background-color','#ebf2f8');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(8) td').css('background-color','#ebf2f8');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(9) td').css('background-color','#ebf2f8');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(10) td').css('background-color','#ebf2f8');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(11) td').css('background-color','#ebf2f8');
    }
    
    if ($('table.OrderConfirmation_ShipTable').length > 0) {
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(2) td').css('color','#000');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(4) td').css('color','#000');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(5) td').css('color','#000');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(6) td').css('color','#000');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(7) td').css('color','#000');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(8) td').css('color','#000');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(9) td').css('color','#000');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(10) td').css('color','#000');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(11) td').css('color','#000');
    }
    
    if ($('table.OrderSummary_ShipTable').length > 0) {
        $('table.OrderSummary_ShipTable > tbody > tr:nth-child(2) td').css({'background-color':'#ebf2f8','border-bottom':'1px solid #fff','border-right':'1px solid #fff','color':'#000'});
        $('table.OrderSummary_ShipTable > tbody > tr:nth-child(4) td').css({'background-color':'#ebf2f8','border-bottom':'1px solid #fff','border-right':'1px solid #fff','color':'#000'});
        $('table.OrderSummary_ShipTable > tbody > tr:nth-child(5) td').css({'background-color':'#ebf2f8','border-bottom':'1px solid #fff','border-right':'1px solid #fff','color':'#000'});
        $('table.OrderSummary_ShipTable > tbody > tr:nth-child(6) td').css({'background-color':'#ebf2f8','border-bottom':'1px solid #fff','border-right':'1px solid #fff','color':'#000'});
        $('table.OrderSummary_ShipTable > tbody > tr:nth-child(7) td').css({'background-color':'#ebf2f8','border-bottom':'1px solid #fff','border-right':'1px solid #fff','color':'#000'});
        $('table.OrderSummary_ShipTable > tbody > tr:nth-child(8) td').css({'background-color':'#ebf2f8','border-bottom':'1px solid #fff','border-right':'1px solid #fff','color':'#000'});
        $('table.OrderSummary_ShipTable > tbody > tr:nth-child(9) td').css({'background-color':'#ebf2f8','border-bottom':'1px solid #fff','border-right':'1px solid #fff','color':'#000'});
        $('table.OrderSummary_ShipTable > tbody > tr:nth-child(10) td').css({'background-color':'#ebf2f8','border-bottom':'1px solid #fff','border-right':'1px solid #fff','color':'#000'});
        $('table.OrderSummary_ShipTable > tbody > tr:nth-child(11) td').css({'background-color':'#ebf2f8','border-bottom':'1px solid #fff','border-right':'1px solid #fff','color':'#000'});
    }
    
    if ($('table.OrderConfirmation_ShipTable').length > 0) {
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(2) td').css('border-bottom','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(4) td').css('border-bottom','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(5) td').css('border-bottom','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(6) td').css('border-bottom','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(7) td').css('border-bottom','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(8) td').css('border-bottom','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(9) td').css('border-bottom','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(10) td').css('border-bottom','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(11) td').css('border-bottom','1px solid #fff');
    }
    
    if ($('table.OrderConfirmation_ShipTable').length > 0) {
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(2) td').css('border-right','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(4) td').css('border-right','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(5) td').css('border-right','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(6) td').css('border-right','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(7) td').css('border-right','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(8) td').css('border-right','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(9) td').css('border-right','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(10) td').css('border-right','1px solid #fff');
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(11) td').css('border-right','1px solid #fff');
    }
    
    if ($('table.OrderSummary_ShipTable').length > 0) {
        $('table.OrderSummary_ShipTable > tbody > tr:first-child td').css({'background-color': '#7ca9d3', 'color': '#fff', 'border-bottom': '1px solid #fff', 'border-right': '1px solid #fff'});
        $('table.OrderSummary_ShipTable > tbody > tr:nth-child(3) td').css({'background-color': '#7ca9d3', 'color': '#fff', 'border-bottom': '1px solid #fff', 'border-right': '1px solid #fff'});
        $('table.OrderSummary_BillTable > tbody > tr:first-child td').css({'background-color': '#7ca9d3', 'color': '#fff', 'border-bottom': '1px solid #fff', 'border-right': '1px solid #fff'});
        $('table.OrderSummary_BillTable > tbody > tr:nth-child(3) td').css({'background-color': '#7ca9d3', 'color': '#fff', 'border-bottom': '1px solid #fff', 'border-right': '1px solid #fff'});
    }
    
    $('table.OrderConfirmation_ReferenceTable tbody tr td').css('background-color','#7ca9d3');
    
    if ($('table.OrderConfirmation_ShipTable').length > 0) {
        $('table.OrderConfirmation_ShipTable > tbody > tr:first-child td').css({'background-color':'#7ca9d3','color':'#fff','border-bottom':'1px solid #fff','border-right':'1px solid #fff'});
        $('table.OrderConfirmation_ShipTable > tbody > tr:nth-child(3) td').css({'background-color':'#7ca9d3','color':'#fff','border-bottom':'1px solid #fff','border-right':'1px solid #fff'});
        $('table.OrderConfirmation_BillTable > tbody > tr:first-child td').css({'background-color':'#7ca9d3','color':'#fff','border-bottom':'1px solid #fff','border-right':'1px solid #fff'});
        $('table.OrderConfirmation_BillTable > tbody > tr:nth-child(3) td').css({'background-color':'#7ca9d3','color':'#fff','border-bottom':'1px solid #fff','border-right':'1px solid #fff'});
    }
    
    $('table.OrderConfirmation_ReferenceTable tbody tr td').css('color','#fff');
    $('table.OrderConfirmation_ReferenceTable tbody tr td').css('border-bottom','1px solid #fff');
    $('table.OrderConfirmation_ReferenceTable tbody tr td').css('border-right','1px solid #fff');
    
    if ($('table.OrderSummary_BillTable').length > 0) {
        $('table.OrderSummary_BillTable > tbody > tr:nth-child(2)').css('background-color','#ebf2f8');
        $('table.OrderSummary_BillTable > tbody > tr:nth-child(4)').css('background-color','#ebf2f8');
        
        $('table.OrderSummary_BillTable > tbody > tr:nth-child(2)').css('border-bottom','1px solid #fff');
        $('table.OrderSummary_BillTable > tbody > tr:nth-child(4)').css('border-bottom','1px solid #fff');
        
        $('table.OrderSummary_BillTable > tbody > tr:nth-child(2)').css('border-right','1px solid #fff');
        $('table.OrderSummary_BillTable > tbody > tr:nth-child(4)').css('border-right','1px solid #fff');
    }
    
    if ($('table.OrderConfirmation_BillTable').length > 0) {
        $('table.OrderConfirmation_BillTable > tbody > tr:nth-child(2)').css('background-color','#ebf2f8');
        $('table.OrderConfirmation_BillTable > tbody > tr:nth-child(4)').css('background-color','#ebf2f8');
        
        $('table.OrderConfirmation_BillTable > tbody > tr:nth-child(2)').css('border-bottom','1px solid #fff');
        $('table.OrderConfirmation_BillTable > tbody > tr:nth-child(4)').css('border-bottom','1px solid #fff');
        
        $('table.OrderConfirmation_BillTable > tbody > tr:nth-child(2)').css('border-right','1px solid #fff');
        $('table.OrderConfirmation_BillTable > tbody > tr:nth-child(4)').css('border-right','1px solid #fff');
    }
    
    
    $('table.OrderSummary_ShipBillTable').css('width','930px');
    
    if ($('table.OrderSummary_SubTotalTable').length > 0) {
        $('table.OrderSummary_SubTotalTable > tbody > tr:first-child, table.OrderSummary_SubTotalTable > tbody > tr:nth-child(3), table.OrderSummary_SubTotalTable > tbody > tr:nth-child(4), table.OrderSummary_SubTotalTable > tbody > tr:nth-child(6), table.OrderSummary_SubTotalTable > tbody > tr:nth-child(7), table.OrderSummary_SubTotalTable > tbody > tr:nth-child(9), table.OrderSummary_SubTotalTable > tbody > tr:nth-child(10)').hide();
    }
    
    $('td.OrderSummary_TotalAlign').css('background-color','#7ca9d3');
    $('font.OrderSummary_TotalLabel').css('color','#fff');
    $('font.OrderSummary_TotalLabel').css('font-size','14px');
    $('font.OrderSummary_TotalText').css('color','#fff');
    $('font.OrderSummary_TotalText').css('font-size','14px');
    
    $('table.OrderConfirmation_ShipBillTable').css('width','930px');
    
    if ($('table.OrderConfirmation_SubTotalTable').length > 0) {
        $('table.OrderConfirmation_SubTotalTable > tbody > tr:first-child').hide();
        $('table.OrderConfirmation_SubTotalTable > tbody > tr:nth-child(3)').hide();
        $('table.OrderConfirmation_SubTotalTable > tbody > tr:nth-child(4)').hide();
        
        $('table.OrderConfirmation_SubTotalTable > tbody > tr:nth-child(6)').hide();
        $('table.OrderConfirmation_SubTotalTable > tbody > tr:nth-child(7)').hide();
        
        $('table.OrderConfirmation_SubTotalTable > tbody > tr:nth-child(9)').hide();
        $('table.OrderConfirmation_SubTotalTable > tbody > tr:nth-child(10)').hide();
    }
    
    $('td.OrderConfirmation_TotalAlign').css('background-color','#7ca9d3');
    $('font.OrderConfirmation_TotalLabel').css('color','#fff');
    $('font.OrderConfirmation_TotalLabel').css('font-size','14px');
    $('font.OrderConfirmation_TotalText').css('color','#fff');
    $('font.OrderConfirmation_TotalText').css('font-size','14px');
    
    $('table.OrderSummary_ButtonTable > tbody > tr > td:last-child').css('width','162px');
    
    if ($('table.ShipBillInformation_BillAddressTable').length > 0) {
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(3) > td:nth-child(3)').css('cssText','padding-top:8px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(3) > td:nth-child(2)').css('cssText','padding-top:13px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(3) > td:nth-child(1)').css('cssText','padding-top:8px !important');
        
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(4) > td:nth-child(3)').css('cssText','padding-top:8px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(4) > td:nth-child(2)').css('cssText','padding-top:13px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(4) > td:nth-child(1)').css('cssText','padding-top:8px !important');
        
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(5) > td:nth-child(3)').css('cssText','padding-top:8px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(5) > td:nth-child(2)').css('cssText','padding-top:13px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(5) > td:nth-child(1)').css('cssText','padding-top:8px !important');
        
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(6) > td:nth-child(2)').css('cssText','width:90px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(7) > td:nth-child(2)').css('cssText','width:90px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(8) > td:nth-child(2)').css('cssText','width:90px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(9) > td:nth-child(2)').css('cssText','width:90px !important');
        
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(6) > td:nth-child(2)').css('cssText','padding-right:10px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(7) > td:nth-child(2)').css('cssText','padding-right:10px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(8) > td:nth-child(2)').css('cssText','padding-right:10px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(9) > td:nth-child(2)').css('cssText','padding-right:10px !important');
        
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(6) > td:nth-child(2)').css('cssText','padding-top:12px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(7) > td:nth-child(2)').css('cssText','padding-top:12px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(8) > td:nth-child(2)').css('cssText','padding-top:12px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(9) > td:nth-child(2)').css('cssText','padding-top:12px !important');
        
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:first-child > td:last-child').css('cssText','height:30px');
        
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(6) > td:last-child > input').css('cssText','margin-top:6px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(7) > td:last-child > input').css('cssText','margin-top:6px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(8) > td:last-child > input').css('cssText','margin-top:6px !important');
        $('table.ShipBillInformation_BillAddressTable > tbody > tr:nth-child(9) > td:last-child > input').css('cssText','margin-top:6px !important');
        
    }
   
    $('table.ShipBillInformation_BillAreaTable > tbody > tr:first-child > td:first-child').css('cssText','width:5px !important');
    
    $('table.MyAccountProfile_Table001 tbody tr:nth-child(2) td img').css('display','none');
    $('table.MyAccountProfile_Table001 tbody tr:nth-child(2) td').css('padding','0px');
    $('table.MyAccountProfile_Table001 tbody tr:first-child td:first-child').css('padding','0px');
    $('table.MyAccountProfileRecentOrdersTable tbody tr.MyAccountProfilerecentorders_hdr td').css('padding-left','14px');
    
});
