var oldContent;
var oldControl;
var bbTimeOutId;
var aryQuickCal = new Array(3);
var intQuickCal = 0;


//-------------------
function ShowHide(id)
//-------------------
 {
    obj = document.getElementsByTagName("div");
    if (obj[id].style.visibility == 'visible'){
    obj[id].style.visibility = 'hidden';
    }
    else {
    obj[id].style.visibility = 'visible';
    }
}
//-------------------
function showPage(num, bolTimer)
//-------------------
{
		if (bolTimer==0)
		{
			showContent(document.getElementById('page'+num), document.getElementById('paginate'+num));
			clearTimeout(bbTimeOutId);
			return 0;
		}
		showContent(document.getElementById('page'+num), document.getElementById('paginate'+num));
		num += 1;
		if (num == 4) num = 1;
                bbTimeOutId=setTimeout("showPage(" + num + ", 1)",10000);
}
//-------------------
function showContent(newContent, newControl)
//-------------------
{
	if (oldContent != null)
	{
		oldContent.style.display = 'none';
		oldControl.style.color = '#777';
		oldControl.style.fontWeight = "lighter";
		oldControl.style.textDecoration = "none";
	}
	
	newControl.style.color = '#322';
	newControl.style.fontWeight = "bolder";
	newControl.style.textDecoration = "underline";
	newContent.style.display = 'block';
		
	oldContent = newContent;
	oldControl = newControl;
}

//-------------------
function CountDown(intSecs)
//-------------------
{
	intSecs -= 1;

	if (intSecs <= 0)
	{ 
		return 0;
	}
	else 
	{
		setTimeout("CountDown(" + intSecs + ")",1000);
	}
}

//-------------------
function switch_tab_newslist(intThisId, strBase, intTotalIds)
//-------------------
{
	document.getElementById(strBase+intThisId).style.display='block';
	document.getElementById(strBase+'Tab'+intThisId).style.backgroundColor='#E7F1D6';
	document.getElementById(strBase+'Tab'+intThisId).style.backgroundImage='url(/images/icons/rc_tl_on_10.gif)';
	document.getElementById(strBase+'Tab'+intThisId).style.backgroundRepeat='no-repeat';
	document.getElementById(strBase+'Tab'+intThisId).style.backgroundPosition='top left';
	document.getElementById(strBase+'TabRtCorner'+intThisId).style.backgroundImage='url(/images/icons/rc_tr_on_10.gif)';
	document.getElementById(strBase+'TabRtCorner'+intThisId).style.backgroundRepeat='no-repeat';
	document.getElementById(strBase+'TabRtCorner'+intThisId).style.backgroundPosition='top right';

	for (var i=1; i<=intTotalIds; ++i)
	{
		if (i != intThisId)
		{
			document.getElementById(strBase+i).style.display='none';
			document.getElementById(strBase+'Tab'+i).style.background='#CCDDB9';
			document.getElementById(strBase+'Tab'+i).style.backgroundImage='url(/images/icons/rc_tl_off_10.gif)';
			document.getElementById(strBase+'Tab'+i).style.backgroundRepeat='no-repeat';
			document.getElementById(strBase+'Tab'+i).style.backgroundPosition='top left';
			document.getElementById(strBase+'TabRtCorner'+i).style.backgroundImage='url(/images/icons/rc_tr_off_10.gif)';
			document.getElementById(strBase+'TabRtCorner'+i).style.backgroundRepeat='no-repeat';
			document.getElementById(strBase+'TabRtCorner'+i).style.backgroundPosition='top right';
		}
	}
}

//-------------------
function addArrow(strUlId)
//-------------------
{
	if ((document.getElementById || document.all || document.layers) && !checkIt('safari') )
	{
		strLi = document.getElementById(strUlId).innerHTML;
		strNewLi = strLi.replace(/[ ]*<\/[aA]>/g, '&nbsp;<img src="/images/icons/bullet_arrow.gif" alt="" width="4" height="8" align="bottom" /><\/a>')
		document.getElementById(strUlId).innerHTML=strNewLi;
	}
}

//-------------------
function checkIt(string)
//-------------------
{
	var detect = navigator.userAgent.toLowerCase();
	var place,thestring;
	place = detect.indexOf(string) + 1;
	return place;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}		
function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}				

