

//change floating div content
function showEvent(str){
 		document.getElementById("info").innerHTML=str;
}

function show_hEvent(str){
 		document.getElementById("h_info").innerHTML=str;
}

function show_mInfo(str){
 		document.getElementById("m_info").innerHTML=str;
}

$(document).ready(function(){
//wait function
	$.fn.wait = function(time, type) {
	  	time = time || 1000;
       	 type = type || "fx";
       	 return this.queue(type, function() {
        	    var self = this;
        	    setTimeout(function() {
         	       $(self).dequeue();
       	     }, time);
       	 });
	};
	
 	if (jQuery.browser.msie) 
		$('a.nav').css("padding-bottom", "4px");

//Show/hide floating div
	$('a.elink').mouseover(function(){
		$('#info').fadeIn('normal');
	});

	$('a.elink').mouseout(function(){
		$('#info').hide();
		$('#info').innerHTML("No Content Description");
	});

	var mouseX = 0;
	var mouseY = 0;
	$('a.elink').mousemove( function(e) {
		mouseX = e.pageX;
		mouseY = e.pageY;
		$('#info').css("top", mouseY);
		$('#info').css("left", mouseX);

		windowH = $(window).height();
		windowW = $(window).width();


		if(mouseY>= windowH-250)
			$('#info').css("top", mouseY-150);

		if(mouseX >= windowW-350)
			$('#info').css("left", mouseX-375);
		

		

	});
	

	$('td.eventDay,td.selected').mouseover(function(){
		$('#h_info').fadeIn('fast');
		$(this).css("color", "#fe9d27");
		$(this).removeClass("eventDay").addClass("selected");
	});

	$('td.eventDay,td.selected').mouseout(function(){
		$(this).css("color", "#496d8c");
		$(this).removeClass("selected").addClass("eventDay");
		$('#h_info').hide();
		$('#h_info').innerHTML("No Content Description");

	});

	var hmouseX = 0;
	var hmouseY = 0;
	$('td.eventDay').mousemove( function(e) {
		hmouseX = e.pageX;
		hmouseY = e.pageY;
		$('#h_info').css("top", hmouseY);
		$('#h_info').css("left", hmouseX);
			hwindowH = $(window).height();			hwindowW = $(window).width();		if(hmouseY>= hwindowH-75)			$('#h_info').css("top", hmouseY-50);		if(hmouseX >= hwindowW-350)			$('#h_info').css("left", hmouseX-300);
	});


//Show/hide floating ministry info div
	$('a.mlink,a.mlink_site').mouseover(function(){
		$('#m_info').fadeIn('fast');
	});

	$('a.mlink,a.mlink_site').mouseout(function(){
		$('#m_info').hide();
		$('#m_info').innerHTML("No Content Description");
	});

	var mouseX = 0;
	var mouseY = 0;
	$('a.mlink,a.mlink_site').mousemove( function(e) {
		mmouseX = e.pageX;
		mmouseY = e.pageY;
		$('#m_info').css("top", mmouseY);
		$('#m_info').css("left", mmouseX);


	});




//Hide text setup for news items supports 5 items

	$('a.moreInfo:eq(0)').click(function(){
		$('div.newsPost:not(:hidden)').hide();
		$('div.newsPostSmall:not(:visible)').show();
		$('div.newsPost:eq(0)').show();
		$('div.newsPostSmall:eq(0)').hide();
	});

	$('a.lessInfo:eq(0)').click(function(){
		$('div.newsPost:eq(0)').hide();
		$('div.newsPostSmall:eq(0)').show();
	});


	$('a.moreInfo:eq(1)').click(function(){
		$('div.newsPost:not(:hidden)').hide();
		$('div.newsPostSmall:not(:visible)').show();
		$('div.newsPost:eq(1)').show();
		$('div.newsPostSmall:eq(1)').hide();
	});

	$('a.lessInfo:eq(1)').click(function(){
		$('div.newsPost:eq(1)').hide();
		$('div.newsPostSmall:eq(1)').show();
	});



	$('a.moreInfo:eq(2)').click(function(){
		$('div.newsPost:not(:hidden)').hide();
		$('div.newsPostSmall:not(:visible)').show();
		$('div.newsPost:eq(2)').show();
		$('div.newsPostSmall:eq(2)').hide();
	});

	$('a.lessInfo:eq(2)').click(function(){
		$('div.newsPost:eq(2)').hide();
		$('div.newsPostSmall:eq(2)').show();
	});



	$('a.moreInfo:eq(3)').click(function(){
		$('div.newsPost:not(:hidden)').hide();
		$('div.newsPostSmall:not(:visible)').show();
		$('div.newsPost:eq(3)').show();
		$('div.newsPostSmall:eq(3)').hide();
	});

	$('a.lessInfo:eq(3)').click(function(){
		$('div.newsPost:eq(3)').hide();
		$('div.newsPostSmall:eq(3)').show();
	});


	$('a.moreInfo:eq(4)').click(function(){
		$('div.newsPost:not(:hidden)').hide();
		$('div.newsPostSmall:not(:visible)').show();
		$('div.newsPost:eq(4)').show();
		$('div.newsPostSmall:eq(4)').hide();
	});

	$('a.lessInfo:eq(4)').click(function(){
		$('div.newsPost:eq(4)').hide();
		$('div.newsPostSmall:eq(4)').show();
	});




	


 });



