var cu_image=0;
var all_image=0;
var img1=null;
var img2=null;
var img_array=new Array();
var swithImg=true;
var spanel=null;
var speed=20;
var IE=false;
var scurleft = scurleft = 0; 
var tmp_scurtop=0;
function slow_slide_image(list_image,panel,style){
	if(document.all!=null) IE=true;
	spanel=panel;
	img_array=list_image.split(',');
	all_image=img_array.length;
	img1 = document.createElement("img");
	img1.src="slide_images/"+img_array[cu_image]+".jpg";
	img1.id="img1"
	img1.style.position="absolute";
	document.getElementById(spanel).appendChild(img1);
	cu_image++;
	if(img_array.length>1){
		img2 = document.createElement("img");
		img2.src="slide_images/"+img_array[cu_image]+".jpg";
		img2.id="img2"
		img2.style.position="absolute";
		document.getElementById(spanel).appendChild(img2);
		obj=document.getElementById(spanel);		
		if (obj.offsetParent) {
			scurleft = obj.offsetLeft
			scurtop = obj.offsetTop
			while (obj = obj.offsetParent) {
				scurleft += obj.offsetLeft
				scurtop += obj.offsetTop
			}
		}				
 		if(IE){tmp_scurtop=200}else{tmp_scurtop=200+scurtop};
		img2.style.top=tmp_scurtop;
		//img2.style.left=0;
		cu_image++
	}	
	setTimeout(swith_image,3000);
}
function swith_image(){	
  	speed=20;
	slide_img_topup();
}
function slide_img_topup(){
	if(speed>1) speed--;
	var tmp_text="";
	if(swithImg){
		tmp1_text="img1";
		tmp2_text="img2";
	}else{
		tmp1_text="img2";
		tmp2_text="img1";
	}

	var topx=document.getElementById(tmp1_text).style.top;
	topx=Math.floor(topx.substr(0,topx.length-2))-speed;
	document.getElementById(tmp1_text).style.top=topx+5+"px";
	//document.getElementById(tmp1_text).style.left="0px";
	
	var topx2=document.getElementById(tmp2_text).style.top;
	topx2=Math.floor(topx2.substr(0,topx2.length-2))-speed;
	document.getElementById(tmp2_text).style.top=topx2+"px";
	//document.getElementById(tmp2_text).style.left="0px";

	if(IE){tmp_scurtop=0;}else{tmp_scurtop=0;}
	if(topx2!=tmp_scurtop){
		setTimeout(slide_img_topup,1);
	}else{
		update_image();
	}
}
function update_image(){
	if(cu_image>=all_image) cu_image=0;		
	if(swithImg){
		tmp=document.getElementById("img1");
		document.getElementById(spanel).removeChild(tmp);
		img1 = document.createElement("img");
		img1.src="slide_images/"+img_array[cu_image]+".jpg";
		img1.id="img1"
		img1.style.position="absolute";
		document.getElementById(spanel).appendChild(img1);		
		if(IE){tmp_scurtop=200;}else{tmp_scurtop=scurtop+200;}
		img1.style.top=tmp_scurtop;
		//img1.style.left=0;
	}else{
		tmp=document.getElementById("img2");
		document.getElementById(spanel).removeChild(tmp);
		img2 = document.createElement("img");
		img2.src="slide_images/"+img_array[cu_image]+".jpg";
		img2.id="img2"
		img2.style.position="absolute";
		document.getElementById(spanel).appendChild(img2);		
		if(IE){tmp_scurtop=200;}else{tmp_scurtop=scurtop+200;}
		img2.style.top=tmp_scurtop;
		//img2.style.left=0;
	}
	cu_image++;
	swithImg=!swithImg;	
	setTimeout(swith_image,3000);
}
//slow_slide_image("1,2,3","slide_panel","topup");
