function PennyShowPhoto () {
	$preferences = arguments[0];
	this.$img_circle = $($preferences["img_circle"]);
	this.$show_img = $($preferences["show_img"]);
	this.$img_height = $preferences["img_height"];
	this.$img_width = $preferences["img_width"];
	this.$show_img_a = $($preferences["show_img_a"]);
	this.$img_group = $($preferences["img_group"]);
	this.$img_group.style.display='none';
	this.$img_list = $$('li',this.$img_group);
	this.$img_length = this.$img_list.length;
//	alert($preferences["show_img_a"]);
	this.$number_group = document.createElement("div");
	Pennyutils.setClassName(this.$number_group, "number_group");
//	Pennyutils.setCssStyle(this.$number_group, "width:"+(this.$img_width-20)+"px;height:20px;position:absolute;left:0;top:"+(this.$img_height-20)+"px;text-align:right;");
	Pennyutils.setCssStyle(this.$number_group, "width:"+(this.$img_width-3)+"px;height:20px;position:absolute;left:0;top:"+(this.$img_height-20)+"px;text-align:right;");
	
	this.$method = $preferences["method"]?$preferences["method"]:function(){};
	
	this.a=[];
	this.$imgs=[];
	this.$number_button = {};
	var $_this = this;
	for (var $index=0; $index<this.$img_length; $index++){
		this.a[$index] = {};
		var h = this.$img_list[$index];
		var a = this.a[$index];

		this.$imgs[$index] = $$('img',h)[0];
		
		this.$number_button[$index] = document.createElement("a");
		var $number_text = document.createTextNode($index+1);
		this.$number_button[$index].appendChild($number_text);
		
		Pennyutils.events.addEventHandler(this.$number_button[$index], "mouseover", 
			function () {
				clearInterval($_this.$interval_id);
				var $events = Pennyutils.events.getEvent();
				var $element = $events.target;
//				Pennyutils.setCssStyle($element, "font-weight:none;font-size:12pt;cursor:pointer;color:#bbb;");
				$_this.showImage(Pennyutils.getClassName($element).split(" ")[1]);
			});
		Pennyutils.events.addEventHandler(this.$number_button[$index], "mouseout", 
			function () {
				$_this.setAutoPlay();
				var $events = Pennyutils.events.getEvent();
				var $element = $events.target;
//				Pennyutils.setCssStyle($element, "font-weight:none;font-size:12pt;");
				$_this.showImage(Pennyutils.getClassName($element).split(" ")[1]);
			});
		Pennyutils.setClassName(this.$number_button[$index], "number_text "+$index);
		this.$number_group.appendChild(this.$number_button[$index]);
	}
	
	this.$img_circle.appendChild(this.$number_group);
	
	this.$img_index=0;
	this.showImage(this.$img_index);
	
	this.$interval_id=null;
	this.setAutoPlay();
}

PennyShowPhoto.prototype.showImage = function() {
	this.$img_index=arguments[0]>=this.$img_length?0:arguments[0];
//	alert(arguments[0]+":"+this.$img_index+":"+this.$imgs[0]);
	this.$show_img_a.href = this.$imgs[this.$img_index].title;
	this.$show_img.src = this.$imgs[this.$img_index].src;
	this.$show_img.alt = this.$imgs[this.$img_index].alt;
//	Pennyutils.resizeImage(this.$show_img, this.$img_width, this.$img_height);
	this.$show_img.width = this.$img_width;
	this.$show_img.height = this.$img_height;
	this.$show_img.style.left = (this.$img_width - this.$show_img.width) / 2;
	this.$show_img.style.top = (this.$img_height - this.$show_img.height) / 2;
	$("show_photo_text").value = this.$imgs[this.$img_index].alt;
	for (var $index=0; $index<this.$img_length; $index++){
		if (this.$img_index==$index) {
			Pennyutils.setCssStyle(this.$number_button[this.$img_index], "padding:8px;margin:2px;font-weight:none;cursor:pointer;background:#f00;color:#fff;");
		} else {
			Pennyutils.setCssStyle(this.$number_button[$index], "padding:8px;margin:2px;font-weight:none;background:#000;color:#999;");
		}
	}
}

PennyShowPhoto.prototype.setAutoPlay = function () {
//	$element = 'object'==typeof $element?$element:$($element);
//	var $opacity = $element.style.opacity||this.getStyleProperty($element, 'opacity');
//	var $destine=$alpha>$opacity*100?1:-1;
//	$element.style.opacity = $opacity;
//	clearInterval($element.$interval_id);
//	var $_this = this;
//	$element.$interval_id=setInterval(function(){$_this.showImage($_this.$img_index++)}, 20);
	var $_this = this;
	this.$interval_id=setInterval(
		function(){
			$_this.$img_index++;
			$_this.showImage($_this.$img_index);
			}, 9000);
}
