﻿$(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");
	}
	if (document.getElementById("news_content")) {
		setTimeout(news_action_out, 8000);
	}
});
$.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 viewTube(triggerID,movieURL,movieWth,movieHt) {
	var embedcode = "<object width='" + movieWth + "&autostart=1' height='" + movieHt + "'>";
	embedcode += "<param name='movie' value='" + movieURL + "'></param>";
	embedcode += "<param name='wmode' value='transparent'></param>";
	embedcode += "<embed src='" + movieURL + "&autoplay=1' type='application/x-shockwave-flash' wmode='transparent' width='" + movieWth + "' height='" + movieHt + "'></embed></object>";
	document.getElementById(triggerID).innerHTML=embedcode;
}

news_curr = 1;
news_total = 0;

news_action_out = function () {
	if (document.getElementById("news_content")) {
		$('#news_content').fadeOut(
			500, 
			function() {news_action_in();}
		);
	}
}

news_action_in = function () {
	news_curr++;
	if (news_curr > news_total) { news_curr = 1; }
	var id = "news_" + news_curr;

	document.getElementById("news_content").innerHTML = document.getElementById(id).innerHTML;
	document.getElementById("cell_news").href = document.getElementById(id).getAttribute("url");

	$('#news_content').fadeIn(
		1000,
		function () { }
	);
	setTimeout(news_action_out, 8000);
}

