	var total_image = 5; //total image or swf show
	//var now_show_div = ''; //div show image
	var firstrun = "true";
	var load_div = '';// default div
	var now_img = 0; //image show 
	var temp_img = ''; //image fade in effect
	var time_swap = 1000; //time delay
	var swap_cont = ''; //setinterval
	var temp_table_inner = ''; //temporary
	var array_media = '';
	var array_img = '';
	var array_time = '';
	var ty = '';
	var tmp = '';
	var a = ''; //base div
	var b = ''; //fade in div
	var c = ''; //button div
	var d = ''; //table button
	var e = '';
	var f = '';
	var speed22=Math.round(200 / 50);
	var timer22=30;
	var time22='';
	var button_sw='off';
	function start()
	{
		a = x(load_div);
		create_mp();	
	}
	
	function create_mp()
	{
		b = document.createElement("div");
		c = document.createElement("div");
		d = document.createElement("table");
		b.setAttribute("id","show");
		a.appendChild(b);
		c.setAttribute("id","button");
		a.appendChild(c);
		c.style.zIndex=1000;
		c.style.position="absolute";
		c.style.width="1000px";
		//c.style.height="24px";
		d.setAttribute("id","btn_tbl");
		d.setAttribute("border","0");
		d.setAttribute("cellpadding","1");
		d.setAttribute("cellspacing","0");
		c.appendChild(d);
		//a.style.backgroundColor="#999999";
		if(button_sw=='on'){create_button();}
		/*d.innerHTML = */
		auto_swap();
	}
	
	function create_button()
	{
		//temp_table_inner += "<tbody><tr>";
		e = document.createElement("tr");
		d.appendChild(e);
		for(var i=1;i<=total_image;i++)
		{
			//temp_table_inner += "<td><a href=\"javascript:;\" id=\""+i+"\" class=\"img_btn\" onclick=\"swap("+i+");\">"+i+"</a></td>";
			fi = document.createElement("td");
			e.appendChild(fi);
			f = document.createElement("a"); 
			f.setAttribute("id",i);
			f.setAttribute("class","img_btn"); 
			f.setAttribute("href","javascript:;"); 
			f.setAttribute("onclick","swap("+i+")");
			f.innerHTML = i;
			fi.appendChild(f);
		}
		//temp_table_inner += "</tr></tbody>";
		//d.innerHTML = temp_table_inner;
	}
	
	function counting()
	{
		//auto_swap();
		swap_cont = setTimeout(auto_swap,(array_time[ty]*10));
	}
	
	function bg_shw()
	{
		a.style.backgroundImage="url(mainpg/images/"+array_img[temp_img]+")";
		a.style.backgroundRepeat="no-repeat";
		b.style.opacity = 0;
		b.style.MozOpacity = 0;
		b.style.KhtmlOpacity = 0;
		b.style.filter = "alpha(opacity=0)";
	}

	function auto_swap()
	{
		bg_shw();
		b.style.backgroundImage="";
		b.style.backgroundImage="url(mainpg/images/"+array_img[now_img]+")";
		b.style.backgroundRepeat="no-repeat";
		temp_img = now_img;
		b.style.width="1000px";
		b.style.height="264px";
		ty = now_img;
		var g = now_img;
		if(g<total_image){g++;}
		if(button_sw=='on'){
			var h = x(g);
			clear_bgc();
			h.className = "img_btn_forcus";
		}
		var ct = now_img+1;
		if(ct==array_img.length){now_img = 0;}else{now_img++;}
		for(var ii=0;ii<=100;ii++){
		time22 = setTimeout("img_opc('"+ii+"')",(timer22 * speed22));
		timer22++;
		}
		timer22=30;
		b.style.textAlign="center";
		counting();
	}
	
	function img_opc(opc)
	{
		b.style.visibility = "visible";
		b.style.opacity = (opc / 100);
		b.style.MozOpacity = (opc / 100);
		b.style.KhtmlOpacity = (opc / 100);
		b.style.filter = "alpha(opacity=" + opc + ")";
		if(opc == 100){clear_time("off","on");}
	}
	
	function swap(f)
	{
		clear_time("on","on");
		b.style.visibility="hidden";
		if(f==0)
		{
		now_img=0;
		}else{
		now_img = f-1;
		}
		auto_swap("on","on");
	}
	
	function clear_time(d,e)
	{
		if(d=="on"){clearTimeout(swap_cont);}
		if(e=="on"){clearTimeout(time22);}
		
		
	}
	
	function x(d)
	{
		return document.getElementById(d);
	}
	
	function clear_bgc()
	{
		for(var j=1; j<=total_image; j++)
		{
			x(j).className = "img_btn";
		}
	}

	function add_flash()
	{
		
	}
