function Solider(option){
	var container = $(option.container) || null;
	var width = option.width || 0;
	var height = option.height || 0;
	var time = option.time*1000 || 10000;
	var oimg = container.getElementsByTagName('ul')[0].getElementsByTagName('li');
	var index = 0;
	var lastindex = -1;
	var self = this;
	var tim;

	this.initd = function(){
		Element.setStyle(container, 'height', height);
		Element.setStyle(container, 'overflow', 'hidden');

		for (var i=0; i<oimg.length; i++){
			oimg[i].getElementsByTagName('img')[0].style.verticalAlign='top';
			oimg[i].style.position = 'relative';
			Element.setStyle(oimg[i], 'overflow', 'hidden');
			Element.setStyle(oimg[i], 'height', height);
			Element.setStyle(oimg[i], 'width', width);
			oimg[i].style.top = (-height) * i + 'px';
			if (i>0)Element.setStyle(oimg[i], 'opacity', 0)
			else{
				Element.setStyle(oimg[i], 'z-index', 1000000);
				Element.setStyle(oimg[i], 'opacity', 100);
				}
			}

		if (oimg.length>0){
			var oul = document.createElement('div');
			with(oul){
				style.backgroundImage = 'url(images/solid_bg.jpg)';
				style.height          = '35px';
				style.position        = 'relative';
				style.zIndex          = '1000001';
				style.top = (-height) * (oimg.length-1) - 35 + 'px';
				}
			Element.setStyle(oul, 'opacity', 40);
			container.appendChild(oul);

			var oul = document.createElement('ul');
			with(oul){
				style.position        = 'relative';
				style.zIndex          = '1000002';
				Element.setStyle(oul, 'overflow', 'hidden');
				style.top = (-height) * (oimg.length-1) - 70 + 'px';
				}
			Element.setStyle(oul, 'opacity', 100);
			
			for (var i=oimg.length; i>0; i--){
				var oli = document.createElement('li');
				oli.style.float = 'right';
				oli.style.width = '35px';
				oli.style.height = '35px';
				oli.style.fontFamily = 'arial';
				oli.style.color = '#fff';
				oli.style.overflow  = 'hidden';
				if (i==1){
					oli.style.backgroundColor = '#000';
					oli.style.fontSize        = '18px';
					Element.setStyle(oli, 'opacity', 60);
					}
				else{
					oli.style.fontSize        = '14px';
					oli.style.cursor = 'pointer';
					}

				oli.style.lineHeight = '35px';
				oli.style.textAlign = 'center';
				oli.innerHTML   = i;
				oul.appendChild(oli);

				Event.observe(oli, 'click', new function(n){
					return function(){
						if(index==n) return false;
						if(Element.getStyle(oimg[n], 'opacity')!=100&&Element.getStyle(oimg[n], 'opacity')!=0) return false;
						clearTimeout(tim);
						self.switchto(n);
						tim = setTimeout(function(){self.autoswitch()}, time);
					}}(i-1));

				}

			container.appendChild(oul);
			}
		
		setTimeout(function(){self.autoswitch()}, time);
		}
	
	this.sethitstyle = function(n){
		var oct = container.getElementsByTagName('ul')[1].getElementsByTagName('li');
		for (var i=0; i<oimg.length; i++){
			if (i==n){
				oct[i].style.background = 'none';
				oct[i].style.fontSize        = '14px';
				Element.setStyle(oct[i], 'opacity', 100);
				oct[i].style.cursor = 'pointer';
				}
			else{
				oct[i].style.backgroundColor = '#000';
				oct[i].style.fontSize        = '18px';
				oct[i].style.cursor = 'default';
				Element.setStyle(oct[i], 'opacity', 60);
				}
			}
		}

	this.autoswitch = function(){
		var max = index+1;
		if (max >= oimg.length) max = 0;
		//alert(max)
		this.switchto(max);
		clearTimeout(tim);
		tim = setTimeout(function(){self.autoswitch()}, time);
		}

	this.switchto = function(n){
		if (lastindex > -1)	{
			Element.setStyle(oimg[lastindex], 'z-index', 0);
			Element.setStyle(oimg[index], 'z-index', 1000000);	
		}
		this.sethitstyle(n);
		Element.setStyle(oimg[n], 'z-index', 999999);
		Element.setStyle(oimg[n], 'opacity', 100);
		this.opacitytans(oimg[index], 0, -5);
		lastindex = index;
		index = n;
		}

	this.opacitytans = function(obj, v, step){
		var nv = Element.getStyle(obj, 'opacity');
		clearTimeout(obj.tag);
		if (nv==v) return false;
		Element.setStyle(obj, 'opacity', nv + step);
		obj.tag = setTimeout(function(){self.opacitytans(obj, v, step)}, 30); 
		}

	this.initd();
	}


