try {
	var Edgebuilder = Class.create( {
		counter : null,

		initialize : function() {
			this.counter = 0;
			if( 'undefined' == SACTConfig ) return;
			this._loadImages();
			this._replaceMediaPNGs();
		},

		_loadImages : function() {
			try {
				$$( 'img.fimg' ).each( function( item ) {
					this._addFlashContent( item );
				}, this );
			} catch( error ) { 
				//this._log( error ); 
			}
		},

		_addFlashContent : function( element ) {
			try {
				++this.counter;
				var src = element.src;
				var flash;
				var fwidth;
				var fheight;
				var flashclass;
				if( element.hasClassName( 'edge-1' ) ) {
					flash = SACTConfig.image2flash.edge1.flash;
					fwidth = SACTConfig.image2flash.edge1.fwidth;
					fheight = SACTConfig.image2flash.edge1.fheight;
					flashclass = SACTConfig.image2flash.edge1.flashclass;
				} else if( element.hasClassName( 'edge-2' ) ) {
					flash = SACTConfig.image2flash.edge2.flash;
					fwidth = SACTConfig.image2flash.edge2.fwidth;
					fheight = SACTConfig.image2flash.edge2.fheight;
					flashclass = SACTConfig.image2flash.edge2.flashclass;
				}
				else {
					return;
				}

				var imgcontent;
				try {
					imgcontent = (	element.adjacent( 'div.image-content h3' ).size() > 0 ||
									element.adjacent( 'div.image-content p' ).size() > 0  ||
									element.adjacent( 'div.image-content div.link-box' ).size() > 0 ) ? "true" : "false";
				} catch( e ) {
					imgcontent = "false";
				}
				var d = new Element( 'div', { title:element.alt } );
				var fd = new Element( 'div', { id:'fimg-' + this.counter } );

				d.appendChild( fd );
				element.insert( { before:d } );
				swfobject.embedSWF( flash, 'fimg-' + this.counter, fwidth, fheight, '9', null, { img:src,hascontent:imgcontent }, { wmode:'transparent' },{},function(e){if(e.success)$(e.ref).parentNode.adjacent('img.fimg').invoke('remove');} );
			} catch( error ) {  
				//this._log( error ); 
			}
		},

		_replaceMediaPNGs : function() {
			if( false == Prototype.Browser.IE ) return;
			/*@cc_on
			@if( @_jscript_version <= 5.6 ) {
				try {
					$$( 'ul.mediateaserlist-1 .icon-teaser .img-replace img, ul.shoplist .img-replace img').each( function( image ) {
						if( image.src.indexOf( '.png' ) == -1 ) $continue;
						var w = image.getWidth();
						var h = image.getHeight();
						var path = image.src;
						var filtercss = 'width:' + w + 'px;height:' + h + 'px;' +
						   				'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + path + ', sizingMethod=crop);';
						var d = new Element( 'div', { 'style':filtercss } );
						var c = document.createComment( 'replaced' );
						d.appendChild( c );
						image.parentNode.appendChild( d );
						image.remove();
					}, this );
				} catch( error ) {}
			}
			@end
			@*/

		},

		_log : function( w ) {
			if( true == Prototype.Browser.IE ) return;
			//console.log( w );
		}

	} );

	onLoadObj.push("new Edgebuilder();");

} catch(e) { alert(e); }
