RoundedCorners = new Class({
	
	Implements: [Options],
	
	options: {
		className: '.rounded',
		topLeftImage: 'images/topleft.png',
		topRightImage: 'images/topright.png',
		bottomLeftImage: 'images/bottomleft.png',
		bottomRightImage: 'images/bottomright.png'
	},
	
	initialize: function(options){
	  this.setOptions(options);
	  this.getImages();
	},
	
	getImages: function(){		
		var self = this;
		$$(this.options.className).each(function(item, i){
			self.addRoundElements(item);
		});
	},
	
	addRoundElements: function(item){

		var roundeddiv = new Element('div', {
	    'class': 'roundeddiv'
		}).wraps(item);

		var topleft = new Element('span', {
	    'class': 'topleft'
		}).inject(roundeddiv);
		
		var topright = new Element('span', {
	    'class': 'topright'
		}).inject(roundeddiv);
		
		var bottomleft = new Element('span', {
	    'class': 'bottomleft'
		}).inject(roundeddiv);
		
		var bottomright = new Element('span', {
	    'class': 'bottomright'
		}).inject(roundeddiv);
		
		if(Browser.Engine.trident4){
			topleft.setStyles({
				'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.options.topLeftImage + "', sizingMethod='scale')",
				'background-image': 'none'
			});
			topright.setStyles({
				'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.options.topRightImage + "', sizingMethod='scale')",
				'background-image': 'none'
			});
			bottomleft.setStyles({
				'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.options.bottomLeftImage + "', sizingMethod='scale')",
				'background-image': 'none'
			});
			bottomright.setStyles({
				'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.options.bottomRightImage + "', sizingMethod='scale')",
				'background-image': 'none'
			});
		}
		
	}

});

window.addEvent('domready', function(){
	RoundedCorners = new RoundedCorners();
});

RoundedCorners2 = new Class({
	
	Implements: [Options],
	
	options: {
		className: '.rounded2',
		topLeftImage: 'images/topleft.png',
		topRightImage: 'images/topright.png',
		bottomLeftImage: 'images/bottomleft.png',
		bottomRightImage: 'images/bottomright.png'
	},
	
	initialize: function(options){
	  this.setOptions(options);
	  this.getImages();
	},
	
	getImages: function(){		
		var self = this;
		$$(this.options.className).each(function(item, i){
			self.addRoundElements(item);
		});
	},
	
	addRoundElements: function(item){

		var topleft = new Element('span', {
	    'class': 'topleft'
		}).inject(item);
		
		var topright = new Element('span', {
	    'class': 'topright'
		}).inject(item);
		
		var bottomleft = new Element('span', {
	    'class': 'bottomleft'
		}).inject(item);
		
		var bottomright = new Element('span', {
	    'class': 'bottomright'
		}).inject(item);
		
		if(Browser.Engine.trident4){
			topleft.setStyles({
				'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.options.topLeftImage + "', sizingMethod='scale')",
				'background-image': 'none'
			});
			topright.setStyles({
				'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.options.topRightImage + "', sizingMethod='scale')",
				'background-image': 'none'
			});
			bottomleft.setStyles({
				'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.options.bottomLeftImage + "', sizingMethod='scale')",
				'background-image': 'none'
			});
			bottomright.setStyles({
				'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.options.bottomRightImage + "', sizingMethod='scale')",
				'background-image': 'none'
			});
		}
		
	}

});

window.addEvent('domready', function(){
	RoundedCorners2 = new RoundedCorners2();
});

RoundedCorners3 = new Class({
	
	Implements: [Options],
	
	options: {
		className: '.rounded3',
		bottomLeftImage: 'images/bottomleft.png'
	},
	
	initialize: function(options){
	  this.setOptions(options);
	  this.getImages();

	},
	
	getImages: function(){		
		var self = this;
		$$(this.options.className).each(function(item, i){
			self.addRoundElements(item);
		});
	},
	
	addRoundElements: function(item){
		
		var bottomleft = new Element('span', {
	    'class': 'bottomleftscroll'
		}).inject(item);
		
		if(Browser.Engine.trident4){
			
			bottomleft.setStyles({
				'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.options.bottomLeftImage + "', sizingMethod='scale')",
				'background-image': 'none'
			});
		}
		
	}
});

window.addEvent('domready', function(){
	RoundedCorners3 = new RoundedCorners3();
});