﻿
	var UC_FOCUS_PTC_index = 0;
	var UC_FOCUS_PTC_enableTimer = true;
	var UC_FOCUS_PTC_arrImage = new Array();
	var UC_FOCUS_PTC_arrTitle = new Array();
	var UC_FOCUS_PTC_arrBrief = new Array();
	var UC_FOCUS_PTC_arrUrl= new Array();

	function UC_FOCUS_PTC_showContent()
	{
		var Pic = document.getElementById("UC_FOCUS_PTC_ctrlPic");
		Pic.src = UC_FOCUS_PTC_arrImage[UC_FOCUS_PTC_index];
		var ctrlTitle = document.getElementById("UC_FOCUS_PTC_ctrlTitle");
		ctrlTitle.innerHTML	= UC_FOCUS_PTC_arrTitle[UC_FOCUS_PTC_index];
		var ctrlBrief = document.getElementById("UC_FOCUS_PTC_ctrlBrief");
		//ctrlBrief.innerHTML = UC_FOCUS_PTC_arrBrief[UC_FOCUS_PTC_index];	 
		var ctrlReadMore = document.getElementById("UC_FOCUS_PTC_ctrlReadMore");
		ctrlReadMore.href = UC_FOCUS_PTC_arrUrl[UC_FOCUS_PTC_index];	
		var ctrlListCount = document.getElementById("UC_FOCUS_PTC_ctrlListCount");
		ctrlListCount.innerHTML = UC_FOCUS_PTC_index + 1;
		var ctrlListSize = document.getElementById("UC_FOCUS_PTC_ctrlListSize");
		ctrlListSize.innerHTML = UC_FOCUS_PTC_arrTitle.length; 
	}

	function UC_FOCUS_PTC_nextItem()
	{
		UC_FOCUS_PTC_index = UC_FOCUS_PTC_index + 1;
		if (UC_FOCUS_PTC_index > (UC_FOCUS_PTC_arrTitle.length - 1))
			UC_FOCUS_PTC_index = 0;
		
		UC_FOCUS_PTC_showContent();
	}
	function UC_FOCUS_PTC_prevItem()
	{
		UC_FOCUS_PTC_index = UC_FOCUS_PTC_index - 1;
		if (UC_FOCUS_PTC_index < 0)
			UC_FOCUS_PTC_index = UC_FOCUS_PTC_arrTitle.length - 1;
		
		UC_FOCUS_PTC_showContent();
	}
	function UC_FOCUS_PTC_viewItem()
	{
		if (UC_FOCUS_PTC_enableTimer)
		{
			UC_FOCUS_PTC_index = UC_FOCUS_PTC_index + 1;
			if (UC_FOCUS_PTC_index > (UC_FOCUS_PTC_arrTitle.length - 1))
				UC_FOCUS_PTC_index = 0;
			
			UC_FOCUS_PTC_showContent();
			setTimeout("UC_FOCUS_PTC_viewItem()", 10 * 500);
		}
	}
	function UC_FOCUS_PTC_toggleTimer()
	{
		var ctrlPause = document.getElementById("UC_FOCUS_PTC_ctrlPause");
		
		if (UC_FOCUS_PTC_enableTimer)
			UC_FOCUS_PTC_enableTimer = false;
		else
			UC_FOCUS_PTC_enableTimer = true;	
			
		if (UC_FOCUS_PTC_enableTimer)
		{
			setTimeout("UC_FOCUS_PTC_viewItem()", 10 * 500);
			ctrlPause.src = ctrlPause.src = ctrlPause.src.replace('On.gif', '.gif');
		}
		else	
			ctrlPause.src = ctrlPause.src.replace('.gif', 'On.gif');
	}
