var imgArray = new  Array("downloads/intro_2005.jpg","downloads/intro_2006.jpg","downloads/intro_2007.jpg","downloads/intro_2007_2.jpg","downloads/intro_2008.jpg","downloads/intro_2009.jpg","downloads/intro_2009_2.jpg"); 
var txtArray = new  Array("2005, 离别","2006, 也曾放纵","2007, 为了心中的梦","2007, 那个冲动, 那个惩罚","2008, 初到上海","2009, 我们成长","2010, 拼搏, 在路上"); 

var curIntro = 0;
var fadeTime = null;
var show = 0;   
var showFF = 0;   

function fadeObject(img)
{
  try{   
	  show += 5;   
	  showFF += 0.01;   
	  img.style.filter = "alpha(opacity=" +show+")";
	  img.style.opacity = showFF +"";/*FF兼容*/   
  }catch(e){   
	  window.clearInterval(fadeTime);   
  }          
}

function switchIntro(next)
{
	if(next=="1")
		curIntro += 1;
	else
		curIntro -= 1;
		
	if(curIntro<0)
		curIntro = imgArray.length-1;
	if(curIntro>=imgArray.length)
		curIntro=0;
		
	show = 0 ;   
	showFF = 0.0;   

	var txtObj = document.getElementById("defaultTxt");
	txtObj.innerHTML = txtArray[curIntro];
	
	var imgObj = document .getElementById("defaultImg");
	imgObj.src = imgArray[curIntro]; 
	imgObj.style.filter = "alpha(opacity=" +show+")";   
	imgObj.style.opacity = showFF +"";/*FF兼容*/
	imgObj.alt = txtArray[curIntro];
	imgObj.title = txtArray[curIntro];
	fadeTime = window .setInterval(function(){fadeObject(imgObj);},1);   
}

