// JavaScript Document


Event.observe(window, "load", function(){
	new lssTransFilter("mypro01", "images/mypro01_f2.jpg", "mouseover", "mouseout");
	new lssTransFilter("mypro02", "images/mypro02_f2.jpg", "mouseover", "mouseout");
	new lssTransFilter("mypro03", "images/mypro03_f2.jpg", "mouseover", "mouseout");
	new lssTransFilter("mypro04", "images/mypro04_f2.jpg", "mouseover", "mouseout");
	//	window.setTimeout("doBlendTrans()",7000);
});


var lssTransFilter = Class.create({
	initialize : function(inElement, inReplaceSrc, inReplaceEvent, inRestoreEvent){
		this.element = $(inElement);
		this.orgSrc = this.element.src;
		this.replaceSrc = inReplaceSrc;
		
		Event.observe(this.element, inReplaceEvent, this.filterApply.bind(this));
		Event.observe(this.element, inRestoreEvent, this.restoreSrc.bind(this));
	},
	
	filterApply : function(){
		if(typeof this.element.filters != "undefined"){
			this.element.filters.blendTrans.Apply();
			this.element.src = this.replaceSrc;
			this.element.filters.blendTrans.Play();
		}else{
			new Effect.Opacity(this.element, { from : 0.3, to : 0.3 });
			this.element.src = this.replaceSrc;
			new Effect.Opacity(this.element, { from : 0.3, to : 1, duration : 1.0 });
		}
	},
	
	restoreSrc : function(){
		this.element.src = this.orgSrc;
	}
});



