﻿// JScript File
function ShowHideProductInformation(divToShow)
{
    // hide all divs
    document.getElementById('ProductBulletDiv').style.display = 'none';
    
    var div = document.getElementsByTagName('div');
    for(var i=0; i<div.length; i++)
    { 
        if((/^(ProductContentsDiv)/i).test(div[i].id))
        {
            div[i].style.display = 'none';
        }
        else if((/^(TechnicalSpecDiv)/i).test(div[i].id))
        {
            div[i].style.display = 'none';
        }
        
    }

    // then show the requested one
    document.getElementById(divToShow).style.display = 'block';
    
    return false;
}

function HideShowBigPic(action)
{
    document.getElementById('BigPic').style.display = action;
    return false;
}

function ValidateProcessWithoutPayment(hasPayments)
{
    if (eval(hasPayments) == 1)
    {
        return true;
    }
    else
    {
        return confirm('This order has no payments. Are you sure you wish to process it?');
    }
}


function TogglePaymentOptions(optionToShow, showChooser)
{
    var $cc = $('div.PaymentFormCreditCard');
    var $inv = $('div.PaymentFormInvoice');
    var $ch = $('div.PaymentFormMethodSelector');
    
    //(showChooser) ? $ch.show() : $ch.hide();
    
    if (optionToShow == "CC")
    {
        $cc.show();
        $inv.hide();
    }
    else
    {
        $cc.hide();
        $inv.show();
    }

    return false;
}
