$(function() {
	// Hide initially
	$("div.sub_content").hide();
	
});


// Used on Claims page -- to swap right side column content
function swapClaims(cont) {
	// Decrement by 1 to compensate for the the array index
	indexToShow = cont - 1;
	
	$("div.sub_content").hide();
	$("div.sub_content:eq("+indexToShow+")").show();
}


function swapModel(id) {
 	$("div.sub_content").each(function() {
		curid = this.id;
		curdisplay = $("#" + curid).css("display");
		if (curdisplay == "none" && curid == id) toggleDiv(curid);
		if (curdisplay != "none" && curid != id) toggleDiv(curid);
		setTimeout(function(){
			$.scrollTo("199%", 0);
		}, 800);
	});
}


// Smooth animation for turning on/off a DIV.
function toggleDiv(id) {
	$("#" + id).animate({
		"height": "toggle",
		"opacity": "toggle"
	}, "slow");
}
