﻿/*
--------------------------------------------------------------------
Dropdown Box Functionality for: account.aspx
01/22/2008

Groove Commerce Copyright 2008 All Rights Reserved
Author: John Richardson (john@swankibs.com)
--------------------------------------------------------------------
*/


$(document).ready(function(){
    var hash=location.hash;
    hash = hash.substring(1,hash.length);
    if (hash){
        dropdown_toggle(hash);
    }else{
        dropdown_toggle("AccountInfo");
    }
});


function dropdown_toggle(divid){
    if ($("#"+divid).is(":hidden"))
    {
        $("#OrderHistory").slideUp("fast");
        $("#AddressBook").slideUp("fast");
        $("#AccountInfo").slideUp("fast");
        $("#OpenBoxMsg").html(get_title(divid));
        $("#"+divid).slideDown("fast");
    }   
}


function get_title(divid){
    switch(divid)
    {
        case "OrderHistory":
            return "Order History";
            break;    
        case "AddressBook":
            return "Address Book";
            break;
        case "AccountInfo":
            return "Account Information";
            break;
        default:
            return "#An error has occured - please select a link above.";
    }
}

function forgotpassword_toggle(){
    if ($("#forgot-display").is(":hidden"))
    {
        $("#forgot-display").slideDown("slow");
    }
    else   
    {
        $("#forgot-display").slideUp("fast");
    }
}

function showhidenav(div_name) {
	if (document.getElementById(div_name + "_link").innerHTML == "More")	{
		document.getElementById(div_name + "_link").innerHTML = "Hide";
		$("#" + div_name + "_div").slideToggle("slow");
		$("#" + div_name + "_morethingy").removeClass("more");
		$("#" + div_name + "_morethingy").addClass("hide");
	}
	else {
		document.getElementById(div_name + "_link").innerHTML = "More";
		$("#" + div_name + "_div").slideToggle("slow");
		$("#" + div_name + "_morethingy").removeClass("hide");
		$("#" + div_name + "_morethingy").addClass("more");
	}
}