(function(win){
	function Load()
	{
		var url = "widget/widgetsitebudget/WidgetSiteBudget.asp?siteid=" + GetValue(document.SiteBudgetForm.BudgetSiteCmb);
		$.ajax({
			url: url,
			type: "post",
			async: true,
			cache: false,
			success: function(data) {
				HideLoader();
				$("#SiteBudgetContent").html(data);
			},
			error: function(xhr) {
				HideLoader();
				alert(xhr.responseText);
			}
		});
	}
	
	var previousID = null;
	function ToggleHeader(id)
	{
		if(previousID != null && previousID != id)
		{
			$("#SiteBudgetChild" + previousID).hide();
		}
		
		$("#SiteBudgetChild" + id).toggle();
		
		previousID = id; 
	}

	win.widgetsitebudget_onload = Load;
	win.LoadSiteBudget = Load;
	win.ToggleBudgetHeader = ToggleHeader;
})(window);