				$(document).ready(function(){
					//admin collapse
					//Hide (Collapse) the toggle containers on load
					//grab cookie value
					var adminstatus0 = $.cookie('csamadminpanel');
					if (adminstatus0 == 'open')
					{
					$(".admintoggle_container").show();
					$('h2.admintrigger').css({'background-position' : 'left bottom'});
					} else if (adminstatus0 == 'close') {
					$(".admintoggle_container").hide();
					$('h2.admintrigger').css({'background-position' : 'left top'});
					}
					else {
					$(".admintoggle_container").show();
					$('h2.admintrigger').css({'background-position' : 'left bottom'});
					$.cookie('csamadminpanel', 'open', { expires: 1 });
					};
					
					if (adminstatus0 == 'close')
					{
					//Switch the "Open" and "Close" state per click
					$("h2.admintrigger").toggle(function(){
						$('h2.admintrigger').css({'background-position' : 'left bottom'});
						}, function () {
						$('h2.admintrigger').css({'background-position' : 'left top'});
					});
					} else {
					//Switch the "Open" and "Close" state per click
					$("h2.admintrigger").toggle(function(){
						$('h2.admintrigger').css({'background-position' : 'left top'});
						}, function () {
						$('h2.admintrigger').css({'background-position' : 'left bottom'});
					});
					}

					//Slide up and down on click
					$("h2.admintrigger").click(function(){
						var adminstatus0 = $.cookie('csamadminpanel');
						if (adminstatus0 == 'open')
						{
						$.cookie('csamadminpanel', 'close', { expires: 1 });
						} else if (adminstatus0 == 'close') {
						$.cookie('csamadminpanel', 'open', { expires: 1 });
						}
						else {
						$.cookie('csamadminpanel', 'open', { expires: 1 });
						};
						$(this).next(".admintoggle_container").slideToggle("slow");
					});

				});