// JavaScript Document
var index_list=0;
change_banner_numcolor(index_list);
var intervalID=setInterval('autoFocusChange()', 7000);
function $(id) { return document.getElementById(id); }
function moveElement(elementID,final_x,final_y,interval) {
  if (!document.getElementById) return false;
  if (!document.getElementById(elementID)) return false;
  var elem = document.getElementById(elementID);
  if (elem.movement) {
    clearTimeout(elem.movement);
  }
  if (!elem.style.left) {
    elem.style.left = "0px";
  }
  if (!elem.style.top) {
    elem.style.top = "0px";
  }
  var xpos = parseInt(elem.style.left);
  var ypos = parseInt(elem.style.top);
  if (xpos == final_x  &&  ypos == final_y) {
  return true;
  }
  if (xpos < final_x) {
    var dist = Math.ceil((final_x - xpos)/speed);
    xpos = xpos + dist;
  }
  if (xpos > final_x) {
    var dist = Math.ceil((xpos - final_x)/speed);
    xpos = xpos - dist;
  }
  if (ypos < final_y) {
    var dist = Math.ceil((final_y - ypos)/speed);
    ypos = ypos + dist;
  }
  if (ypos > final_y) {
    var dist = Math.ceil((ypos - final_y)/speed);
    ypos = ypos - dist;
  }
  elem.style.left = xpos + "px";
  elem.style.top = ypos + "px";
  var repeat = "moveElement('"+elementID+"',"+final_x+","+final_y+","+interval+")";
  elem.movement = setTimeout(repeat,interval);
}
function classNormal(){
 var focusBtnList = document.getElementById('focus_change_btn').getElementsByTagName('li');
 for(var i=0; i<focusBtnList.length; i++) {
  focusBtnList[i].className='';
 }
}

function focusChange() {
 var focusBtnList = document.getElementById('focus_change_btn').getElementsByTagName('li');
  focusBtnList[0].onmouseover = function() {
   moveElement('focus_change_list',0,0,5);
   classNormal();
   focusBtnList[0].className='current';
clearInterval( intervalID );
change_banner_numcolor(0);
}
  focusBtnList[1].onmouseover = function() {
   moveElement('focus_change_list',-544,0,5);
   classNormal()
   focusBtnList[1].className='current';
clearInterval( intervalID ); 
change_banner_numcolor(1);
  }
  focusBtnList[2].onmouseover = function() {
   moveElement('focus_change_list',-1088,0,5);
   classNormal()
   focusBtnList[2].className='current';
clearInterval( intervalID );
change_banner_numcolor(2);

  }
  focusBtnList[3].onmouseover = function() {
   moveElement('focus_change_list',-1632,0,5);
   classNormal()
   focusBtnList[3].className='current';
clearInterval( intervalID ); 
change_banner_numcolor(3);
  }
  for(i=0;i<focusBtnList.length;i++)
  {
	  focusBtnList[i].onmouseout=function(){
		intervalID=setInterval('autoFocusChange()', 7000);
	  }
  }
 
}



function autoFocusChange() {
 var focusBtnList = document.getElementById('focus_change_btn').getElementsByTagName('li');
 for(var i=0; i<focusBtnList.length; i++) {
  if (focusBtnList[i].className == 'current') {
   var currentNum = i;
  }
 }
 if (currentNum==0 ){
  moveElement('focus_change_list',-544,0,5);
  classNormal()
  focusBtnList[1].className='current';
  change_banner_numcolor(1);
 }
 if (currentNum==1 ){
  moveElement('focus_change_list',-1088,0,5);
  classNormal()
  focusBtnList[2].className='current';
  change_banner_numcolor(2);

 }
 if (currentNum==2 ){
  moveElement('focus_change_list',-1632,0,5);
  classNormal()
  focusBtnList[3].className='current';
  change_banner_numcolor(3);

 } 
 if (currentNum==3 ){
  moveElement('focus_change_list',-2176,0,5);
  classNormal()
  focusBtnList[4].className='current';
  change_banner_numcolor(0);

 }
  if (currentNum==4 ){
	  var elem = document.getElementById('focus_change_list');
	  elem.style.left='0px';
  moveElement('focus_change_list',-544,0,5);
  classNormal()
  focusBtnList[1].className='current';
  change_banner_numcolor(1);

 }
}
function change_banner_numcolor(index_list2)
{var focusBtnList = document.getElementById('focus_change_btn').getElementsByTagName('li');
if(index_list2 != index_list || ( index_list ==0 && index_list2==0))
{   
	/*focusBtnList[index_list].childNodes[0].style.backgroundColor='black';
	focusBtnList[index_list2].childNodes[0].style.backgroundColor='white';
	focusBtnList[index_list].childNodes[0].style.color='white';
	focusBtnList[index_list2].childNodes[0].style.color='black';*/
	focusBtnList[index_list].childNodes[0].style.backgroundImage='url(skins/Skin_1/images/point.PNG)';
	focusBtnList[index_list].childNodes[0].style.backgroundRepeat="no-repeat";
	focusBtnList[index_list2].childNodes[0].style.backgroundImage='url(skins/Skin_1/images/point1.PNG)';
	focusBtnList[index_list2].childNodes[0].style.backgroundRepeat="no-repeat";
	//focusBtnList[index_list].childNodes[0].style.color='white';
	//focusBtnList[index_list2].childNodes[0].style.color='black';
	//alert(focusBtnList[index_list2].childNodes[0].childNodes[0].src);
	index_list=index_list2;
}
}
focusChange();
/*window.onload=function(){
 focusChange();
}*/
