$(document).ready(function() {
    $("#ix-nav li").hover(
		function() { $("ul", this).fadeIn("fast"); },
		function() { }
	);
    $(".nav_stick").hover(
		function() { $(this).children("A").attr("class", "on"); },
		function() { $(this).children("A").attr("class", "off"); }
	);
    if (document.all) {
        $("#ix-nav li").hoverClass("sfHover");
    }
    casesInit();
});

$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};
function txtHover(id,className) {
	document.getElementById(id).className=className;
}
function getProp(obj,prop) {
	if(window.getComputedStyle) {
		compStyle = window.getComputedStyle(obj,null);
		return parseInt(compStyle[prop],10);
	} else if (obj.currentStyle) {
		return parseInt(obj.currentStyle[prop],10);
	} else {
		return parseInt(obj.style[prop],10);
	}
}
function bodyOnLoad() {
	document.getElementById("body_content").style.display = "inline";
}
function gotoForm(txt) {
	window.location.href = txt;
}
function hideMap(id) {
	document.getElementById(id).style.display="none";
}
function showMap(id) {
	document.getElementById(id).style.display="block";
}

var total_cases = 0;
var curr_case = 1;

function casesInit() {
    if (document.getElementById("case_text")) {
        setCurrCase(curr_case);
    }
}

function swapCase() {
    var next_case = curr_case + 1;
    if (next_case > total_cases) {
        next_case = 1;
    }
    curr_case = next_case;

    $("#case_text").animate({ opacity: 0 }, 2000, 'linear', setCurrCase);
    
}

function setCurrCase() {
    document.getElementById("case_text").innerHTML = document.getElementById("case_" + curr_case).innerHTML;
    $("#case_text").animate({ opacity: 1 }, 2000, 'linear');
    setTimeout(swapCase, 7000);
}