
function goToCart( newModuleID )
{
	document.smallCartForm.menuItemID.value=newModuleID;
	document.smallCartForm.submit();
}

function smallCart_refresh_logout()
{
    if(document.smallCartForm.cartString.value!="")
        var countItems=document.smallCartForm.cartString.value.split(";").length;
    else
        var countItems=0;
    var myDate=new Date();
    var returnArray="countItem;;"+countItems+";;maxCartTime;;"+myDate.toLocaleDateString();
    smallCart_refreshDisplay(returnArray);
}

function smallCart_refresh()
{
    document.smallCartForm.actionType.value="refresh";
    document.mainFrameForm.ajaxOnUpdateFunction.value="smallCart_refreshDisplay";
    ajaxUpdate("smallCartForm", "userID");
}

function smallCart_refreshDisplay(returnArray)
{
    if(returnArray!="")
    {
        returnArray=returnArray.split(";;");
        if(document.getElementById("smallCartItemCount"))
            document.getElementById("smallCartItemCount").innerHTML=returnArray[1];
        if(document.getElementById("smallCartLastItem"))
            document.getElementById("smallCartLastItem").innerHTML=returnArray[3];
        if(returnArray[3]==0)
        {
            document.getElementById("smallCartLastItemText").style.display="none";
            document.getElementById("smallCartLastItem").style.display="none";
        }
        else
        {
            document.getElementById("smallCartLastItemText").style.display="block";
            document.getElementById("smallCartLastItem").style.display="block";
        }
    }
}

