﻿var currentRowBgColor = "";

//Get the current background color of a hover row
function GetBgColor(element) {
    currentRowBgColor = element.style.backgroundColor;
}

function ClickAddToCart(DivId) {
    if (DivId != null) {
        var objDiv = document.getElementById(DivId);
        if (objDiv != null) {
            var ProductCodeAndPrice = objDiv.attributes["code"].nodeValue + "|" + objDiv.attributes["price"].nodeValue + "|0";
            //alert(ProductCodeAndPrice);
            PageMethods.SetShoppingCartSesstion(ProductCodeAndPrice, SetShoppingCart);
        }
    }
}

function ClickAddToCartMatchedPrice(ProductId, Price, MatchedPrice) {
    var ProductAddToCartInfo = ProductId + "|" + Price + "|" + MatchedPrice;
    //alert(ProductAddToCartInfo);
    PageMethods.SetShoppingCartSesstion(ProductAddToCartInfo, SetShoppingCart);
}

function QuantityUpValue(objQuantity) {
    if (objQuantity != null) {
        objQuantity.value++;
    }
}

function Goto(PagePath) {
    proto = "http://";
    host = location.host;
    window.location = proto + host + "/" + PagePath;
}

function GotoSSL(PagePath) {
    proto = "https://";
    host = location.host;
    window.location = proto + host + "/" + PagePath;
}

function CloseThickbox() {
    if (window.parent.tb_remove != null)
        window.parent.tb_remove();
}

function CloseFancybox() {
    parent.$.fancybox.close();
}

function LoadCountDown(seconds) {
    $('#defaultCountdown').countdown
        ({ until: seconds
            , compact: true
            , description: ''
            , format: 'HMS'
            , onExpiry: HideSpecial
        });
}

function HideSpecial() {
    $('.trSpecial').hide();
    $('.trAdRight').show();
}

function ShowSpecial() {
    $('.trSpecial').show();
    $('.trAdRight').hide();
}
