﻿//HomePage Tabs START

function Home_DisplayTab(TabID)
{
    var Tab1 = document.getElementById('Tab1');
    var Tab2 = document.getElementById('Tab2');
    var Tab3 = document.getElementById('Tab3');
    var Tab4 = document.getElementById('Tab4');
    var thisTab = document.getElementById('Tab' + TabID);

    Tab1.style.display = 'none';
    Tab2.style.display = 'none';
    Tab3.style.display = 'none';
    Tab4.style.display = 'none';
    
    thisTab.style.display = 'block';    
}

//HomePage Tabs END


function ShowHideEmailToFriend(EmailToFriendDivID, YourNameTxtID)
{
    var EmailToFriendDiv = document.getElementById(EmailToFriendDivID);
    switch(EmailToFriendDiv.style.display)
    {
    case 'none':    
        EmailToFriendDiv.style.display = 'block';
           
        var YourNameTxt = document.getElementById(YourNameTxtID);
        YourNameTxt.focus();
    
        break;
    case 'block':
        EmailToFriendDiv.style.display = 'none';
    
        break; 
    }    
}


function ChangeProductImage(Img, Image_ID)
{
    document.getElementById(Img).src = "/GDI/ProductImage.aspx?t=2&id=" + Image_ID;
}


function DuplicateTextBoxValue(InputTextBox, CopyTextBox)
{    
    var TextBoxValue = document.getElementById(InputTextBox).value;
    document.getElementById(CopyTextBox).value = TextBoxValue;
}

function WindowPopup(URL, Width, Height)
{
    window.open(URL, 'Popup','menubar=0,toolbar=0,width=' + Width + ',height=' + Height);
}

function SectionUnderConstruction()
{
    alert("This section is currently under construction.");
}



function UniLogin_Profile_Tabs(TabID)
{
    var Tab1 = document.getElementById('Tab1');
    var Tab2 = document.getElementById('Tab2');
    var Tab3 = document.getElementById('Tab3');
    var Tab4 = document.getElementById('Tab4');
    var thisTab = document.getElementById('Tab' + TabID);

    Tab1.style.display = 'none';
    Tab2.style.display = 'none';
    Tab3.style.display = 'none';
    Tab4.style.display = 'none';
    
    thisTab.style.display = 'block';    
}

function TextBox_CharLimit_CountDown(TextBox, CountDownTextBox, MaxLength)
{
    var CountDownTextBox = document.getElementById(CountDownTextBox)
    var TextBox = document.getElementById(TextBox)

    CountDownTextBox.value = (MaxLength - TextBox.value.length);
    
    if(TextBox.value.length > (MaxLength)) {
        TextBox.value = TextBox.value.substring(0,(MaxLength));
        return false;
    };
}

function DisplayTotalCashByQuantity(Value, QuantityTxt, TotalTxt)
{
    var QuantityTxt = document.getElementById(QuantityTxt);
    var TotalTxt = document.getElementById(TotalTxt);
    
    TotalTxt.value = (Value*QuantityTxt.value).toFixed(2);
    
}
