//<[CDATA[ 
var eLore_wrap = document.getElementById('eLore_wrap'); 
var aImg = new Array('img/img01.jpg','img/img02.jpg','img/img01.jpg', 'img/img02.jpg'); 
var iImg = 0; 
var iA = 0; 
window.onload = function() { 
	eLore_createD(); 
	//setTimeout('eLore_createD()','3000');
	showMenu();
} 
function eLore_createD() { 
	
	//alert(num);
	
	//iA = parseInt(num); 
	
    if (iImg==10) { 
        eLore_wrap.innerHTML = ''; 
        iImg = 0; 
    } 
    if (iImg==0) {
        eLore_wrap.innerHTML += '<div class="eLore_out" style="right:0px; background:url(' + aImg[iA] + ') -880px top no-repeat;"></div>\n'; 
    } 
    /* 
    var sDiv = '<div class="eLore_img" style="left:' + (720-iImg*90) + 'px; background:url(' + aImg[iA] + ') -720px top no-repeat;">' + iImg++ + '</div>\n'; 
    eLore_wrap.innerHTML += sDiv; 
    */ 
    var oDiv = document.createElement('div'); 
    oDiv.className = 'eLore_img'; 
    oDiv.style.right = iImg*80 +'px'; 
    oDiv.style.background = 'url(' + aImg[iA] + ') -880px top no-repeat'; 
    //oDiv.appendChild(document.createTextNode(iImg)); 
    eLore_wrap.appendChild(oDiv); 
    iImg++; 
	//alert(iImg);
    eLore_move(iImg); 
	document.getElementById("imgShowNum").value=iA;
	
} 
function eLore_move(){ 
    var oDiv = eLore_wrap.getElementsByTagName('div'); 
	
    for (var i=1; i<oDiv.length; i++) { 
        var iBgpx = parseInt(oDiv[i].style.backgroundPosition); 
        if (iBgpx<i*80-760) { 
            var iMovePx = Math.floor((760-i*80+iBgpx)/15); 
			
            oDiv[i].style.backgroundPosition = iBgpx - iMovePx + 'px top'; 
        } else { 
            oDiv[i].style.backgroundPosition = '-' + (760- i*80) + 'px top'; 
			//alert(oDiv[i].style.backgroundPosition);
        } 
    } 
    if (iImg<10) { 
        t=setTimeout('eLore_createD()','50'); 
    } else if (parseInt(oDiv[10].style.backgroundPosition)<40) {
		//alert(oDiv[10].style.backgroundPosition)
        t=setTimeout('eLore_move()','50'); 
    } else { 
        iA = ++iA==aImg.length ? 0 : iA; 
        t=setTimeout('eLore_createD()','5000'); 
    } 
} 


function stopTime() {
	clearTimeout(t);
	//clearTimeout(tt);
	//clearTimeout(ttt);
	return;
}


function eLore_left(){
	stopTime();
//	clearTimeout(t);
//	clearTimeout(tt);
//eLore_move();
 //eLore_createD(); 
	//clearTimeout(ttt);
	//ttt=setTimeout('eLore_createD()','3000'); 
	//alert('aaa');
	//clearTimeout(ttt);	//stopTime();
	//clearTimeout() ;
	var	eLore_wrap = document.getElementById('eLore_wrap'); 
	var	aImg = new Array('img/img01.jpg','img/img02.jpg','img/img01.jpg', 'img/img02.jpg'); 
	var	iImg = 0; 
	var	iA = 0;
	
	iA = document.getElementById("imgShowNum").value 
	if (iA == 0) {
		iA = 3;
	} else {
		iA = parseInt(iA) - 1;	
	}
    eLore_createD_Move(iA); 

}

function eLore_right(){
	stopTime();
//	clearTimeout(t);
//	clearTimeout(tt);
//eLore_move();
 //eLore_createD(); 
	//clearTimeout(ttt);
//ttt=setTimeout('eLore_createD()','3000'); 
	//alert('aaa');
	//clearTimeout(ttt);
	var	eLore_wrap = document.getElementById('eLore_wrap'); 
	var	aImg = new Array('img/img01.jpg','img/img02.jpg','img/img01.jpg', 'img/img02.jpg'); 
	var	iImg = 0; 
	var	iA = 0;
	
	iA = document.getElementById("imgShowNum").value 
	if (iA == 3) {
		iA = 0;
	} else {
		iA = parseInt(iA) + 1;	
	}
    eLore_createD_Move(iA); 

}


function eLore_createD_Move(num) { 
	
	//alert(aImg);
	
	iA = parseInt(num); 
	
    if (iImg==10) { 
        eLore_wrap.innerHTML = ''; 
        iImg = 0; 
    } 
    if (iImg==0) {
		//alert(iA);
        eLore_wrap.innerHTML += '<div class="eLore_out" style="right:0px; background:url(' + aImg[iA] + ') -880px top no-repeat;"></div>\n'; 
    } 
    /* 
    var sDiv = '<div class="eLore_img" style="left:' + (720-iImg*90) + 'px; background:url(' + aImg[iA] + ') -720px top no-repeat;">' + iImg++ + '</div>\n'; 
    eLore_wrap.innerHTML += sDiv; 
    */ 
    var oDiv = document.createElement('div'); 
    oDiv.className = 'eLore_img'; 
    oDiv.style.right = iImg*80 +'px'; 
    oDiv.style.background = 'url(' + aImg[iA] + ') -880px top no-repeat'; 
    //oDiv.appendChild(document.createTextNode(iImg)); 
    eLore_wrap.appendChild(oDiv); 
	//alert(iImg)
    iImg++; 
	//alert(iImg);
    eLore_move2(iImg); 
	document.getElementById("imgShowNum").value=iA;
	
} 


function eLore_move2(){ 
    var oDiv = eLore_wrap.getElementsByTagName('div'); 
	//alert(iImg);
    for (var i=1; i<oDiv.length; i++) { 
        var iBgpx = parseInt(oDiv[i].style.backgroundPosition); 
        if (iBgpx<i*80-760) { 
            var iMovePx = Math.floor((760-i*80+iBgpx)/15); 
			
            oDiv[i].style.backgroundPosition = iBgpx - iMovePx + 'px top'; 
        } else { 
            oDiv[i].style.backgroundPosition = '-' + (760- i*80) + 'px top'; 
			//alert(oDiv[i].style.backgroundPosition);
        } 
    } 
	//alert(iMovePx);
    if (iImg<10) { 
	//alert(iImg)
	//alert(oDiv[10].style.backgroundPosition);
		t=setTimeout('eLore_createD()','50'); 
        //setTimeout('eLore_createD_Move(iA)','50'); 
    } else if (parseInt(oDiv[10].style.backgroundPosition)<40) { 
	//alert(iA)
	//alert(oDiv[10].style.backgroundPosition);
        t=setTimeout('eLore_move2()','50'); 
    } else {
	//alert(oDiv[10].style.backgroundPosition);
	//alert("1231231232")
        iA = ++iA==aImg.length ? 0 : iA; 
		
		//iA = document.getElementById("imgShowNum").value 
		//if (iA == 0) {
		//iA = 3;
		//} else {
			//iA = iA - 1;	
		//}
//alert(iA);
        eLore_createD() 
    } 
} 




//]]> 

