addEventListener("load", function()
{
    setTimeout(updateLayout, 0);
}, false);

var currentWidth = 0;

function updateLayout()
{
    if (window.innerWidth != currentWidth)
    {
        currentWidth = window.innerWidth;

        var orient = currentWidth == 320 ? "profile" : "landscape";
        document.body.setAttribute("orient", orient);
        setTimeout(function()
        {
            window.scrollTo(0, 1);
        }, 100);           
    }
}

setInterval(updateLayout, 400);

$(document).ready(function(){

	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("div.trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
	});

});

function confirmdelete(item) {
	var answer = confirm ("Are you sure you want to delete this "+item+"?  This can not be undone.");
	if (answer) {
	return true;
	} else {
	return false;
	}
}
