// marquee Á¬Ðø»¬¶¯
(function($){
	var opt = {type:'left',interval:30,step:1};
	$.fn.marquee = function(o){
		opt = $.extend(opt, o || {});
		return this.each(function(){new imarquee($(this));});
	};
	var imarquee = function(obj){
		var me = this;
		obj.parent().css({'position':'relative','overflow':'hidden'});
		obj.css({'position':'absolute','left':'0','top':'0','margin':'0'});
		me.max = opt.type=='left' ? obj.width() : obj.height();
		obj.append(obj.find('> *').clone());
		me.element = obj;
		me.stamp = 0;
		me.handle = setInterval(function(){me.play();},opt.interval);
		obj.mouseover(function(){clearInterval(me.handle);});
		obj.mouseout(function(){me.handle = setInterval(function(){me.play();},opt.interval);});
	};
	imarquee.prototype = {
		play:function(){
			var me = this;
			if(me.stamp <= -me.max) me.stamp = 0;
			me.element.css(opt.type == 'left' ? 'left' : 'top',me.stamp+'px');
			me.stamp -= opt.step;
		}
	};
})(jQuery);
// slideshow ±ä»»ÂÖ²¥
(function($){
	var opt = {type:'fade',interval:3};
	$.fn.slideshow = function(o){
		opt = $.extend(opt, o || {});
		return this.each(function(){new islideshow($(this));});
	};
	var islideshow = function(obj){
		var me = this;
		me.elsc = obj.find('> .elsc');
		me.elsc.css({'position':'relative'});
		me.els = me.elsc.find('> a');
		me.els.css({'position':'absolute','display':'none'});
		me.titlebar = obj.find('> .title');
		me.numc = obj.find('> .numnav');
		me.titlec = obj.find('> .titlec');
		me.navs = [];
		if(me.numc.length>0){
			me.els.each(function(x){
				me.navs[x] = $('<span>'+(x+1)+'</span>').appendTo(me.numc).mouseover(function(){me.pause();me.to(x);}).mouseout(function(){me.start();});
			});
		}
		if(me.titlec.length>0){
			me.els.each(function(x){
				me.navs[x] = $('<li>'+$(me.els.get(x)).find('img').attr('alt')+'</li>').appendTo(me.titlec).mouseover(function(){me.pause();me.to(x);}).mouseout(function(){me.start();});
			});
		}
		me.curr = -1;
		me.next();
		me.start();
	};
	islideshow.prototype = {
		start:function(){
			var me = this;
			me.handle = setInterval(function(){me.next();},opt.interval*1000);
		},
		pause:function(){
			var me = this;
			clearInterval(me.handle);
		},
		next:function(){
			var me = this;
			var next =  (me.curr < me.els.length - 1 ) ? me.curr + 1 : 0;
			me.to(next);
		},
		to:function(x){
			var me = this;
			var ocurr = me.curr;
			me.curr = x;
			if(me.navs[ocurr]) me.navs[ocurr].removeClass('hover');
			if(ocurr>0) $(me.els.get(ocurr)).hide();
			if(me.navs[me.curr]) me.navs[me.curr].addClass('hover');
			$(me.els.get(me.curr)).show();
			if(me.titlebar.length>0) me.titlebar.html($(me.els.get(ocurr)).find('img').attr('alt'));
		}
	};
})(jQuery);
//jQuery Plugin: Drop Shadow Text
// call like this: $(element).textDropShadow();
(function($) {
 $.fn.textDropShadow = function(){
	 return this.each(function(){
		 $(this).html('<span class="jq-shadow">'+$(this).html()+'</span><span class="jq-o">'+$(this).html()+'</span>');
	 });
 }
})(jQuery);