function itemLoaded(itemCurrent)
{
	if(itemCurrent=='Welcome')
	{
	 scroll();
	}
	else if(itemCurrent=='Members')
	{
		proRataFee();
	} 
}

function proRataFee()
{
      var seasonInsurance=60;
			var seasonCompFee=240;
			var seasonSocFee=180;
			var seasonJunFee=30;
						
			//Jan is 0, Nov is 10, Dec is 11 etc
			var startMonth=10;
			var proRataAfterMonth=1;
							
			var curTime = new Date();
      var curMonth = curTime.getMonth();
						
			if(curMonth<=proRataAfterMonth)
			{
			  var remMonth=12;
			}					
			else if(startMonth>curMonth)
			{
			  var remMonth=startMonth-curMonth;
			}
			else
			{
			  var remMonth=12+(startMonth-curMonth);
			}
			var dueCompFee=Math.floor(seasonCompFee/12*remMonth);
			var dueSocFee=Math.floor(seasonSocFee/12*remMonth);
			var dueJunFee=Math.floor(seasonJunFee/12*remMonth);
			var regCompFee=seasonInsurance+dueCompFee;
			var regSocFee=seasonInsurance+dueSocFee;
			var regJunFee=seasonInsurance+dueJunFee;
			document.getElementById('regCompFee').firstChild.nodeValue='$ '+regCompFee.toFixed(2);
			document.getElementById('regSocFee').firstChild.nodeValue='$ '+regSocFee.toFixed(2);
			document.getElementById('regJunFee').firstChild.nodeValue='$ '+regJunFee.toFixed(2);
} 

function scroll()
{
scrollSource = new Array("images/panamuna2006-rack.jpg","images/panamuna2006-paddle.jpg")
scrollCnt = scrollSource.length;
curScroll = 0;
startScroll();
}
function startScroll()
{
 setTimeout("changeScroll()",10000);
} 
function changeScroll()
{
  if(curScroll>=scrollSource.length-1)
	{
  	curScroll=0;
	}
  else
  {
	  curScroll+=1;
	}
  curSource= scrollSource[curScroll];

  document.getElementById("scroll").setAttribute('src',curSource);
  setTimeout("changeScroll()",5000);	
}
