﻿/*
--------------------------------------------------------------------
Dropdown Box Functionality for: account.aspx
01/22/2008

ADDED ADDTIONAL FUNCTIONALITIES FOR VARIOUS USES
8/15/2008

Steve Morton added toggleRelatedProducts()
5/06/09

Groove Commerce Copyright 2008 All Rights Reserved
John Richardson
--------------------------------------------------------------------
*/


$(document).ready(function(){
    if (!$("#containerRegNavigation").is(":hidden"))
    {
        if($("#containerRegNavigation").hasClass("virgin"))
        {
            this.sfTimer=setTimeout(closeMeFirstTime,500);
            $("#containerRegNavigation").removeClass("virgin");
            $("#containerRegNavigation").addClass("whore");
        }
        else if(!$("#containerRegNavigation").hasClass("nomoleste"))
        {
            $("#containerRegNavigation").addClass("jqueryoff");
            $("#containerShowRegNav").removeClass("jqueryoff");
        }
    }
});

function closeMeFirstTime(){ $($("#containerRegNavigation")).slideUp(2000); $("#containerShowRegNav").removeClass("jqueryoff"); }
function closeMe(objStr, objInt){ $(objStr).slideUp(objInt) }
function openMe(objStr, objInt){ $(objStr).slideDown(objInt) }

function toggleRegNav(){
    if ($("#containerRegNavigation").is(":hidden"))
    {
        openMe("#containerRegNavigation",500);
        closeMe("#containerSearchRefine",500);
        $("#containerShowRegNav > a").html("<img src=\"/skins/Skin_1/images/nextopiaShowRefines.gif\" alt=\"Back To Refinements\" />");
    }
    else
    {
        closeMe("#containerRegNavigation",500);
        openMe("#containerSearchRefine",500);
        $("#containerShowRegNav > a").html("<img src=\"/skins/Skin_1/images/nextopiaShowCats.gif\" alt=\"Show All Categories\" />");
    }
}

// <-- REQUIRED FOR FORGOT PASSWORD TOGGLE
function forgotpassword_toggle(){
    if ($("#forgot-display").is(":hidden"))
    {
        $("#forgot-display").slideDown("slow");
    }
    else   
    {
        $("#forgot-display").slideUp("fast");
    }
}
// END FORGOT PASSWORD TOGGLE -->


// <-- REQUIRED FOR DEBUGMODE
function toggleSingleDiv(id){
    if ($("#"+id).is(":hidden"))
    {
        $("#"+id).slideDown("fast");
    }
    else
    {
        $("#"+id).slideUp("fast");
    } 
    return false;        
}
// END DEBUGMODE -->


// Displays/Hides additional related products
function slideToggle(div_name) {
	if (document.getElementById("viewAll").innerHTML == "View All")	{
		document.getElementById("viewAll").innerHTML = "Hide";
		$("#" + div_name).slideToggle("slow");
		$("#viewAll").removeClass("view");
		$("#viewAll").addClass("hide");
	}
	else {
		document.getElementById("viewAll").innerHTML = "View All";
		$("#" + div_name).slideToggle("slow");
		$("#viewAll").removeClass("hide");
		$("#viewAll").addClass("view");
	}
}
