(function( $ ){
	
	$.fn.opaqueBg = function(hex,opacity) {

		// Do your awesome plugin stuff here

		this.each(function() {

			if($.browser.msie && $.browser.version < 9){

				var opacDec = parseInt(255 * opacity);

				$(this).css({
					background:'transparent',
					filter:'progid:DXImageTransform.Microsoft.gradient(startColorstr=#'+d2h(opacDec)+cutHex(hex)+',endColorstr=#'+d2h(opacDec)+cutHex(hex)+')',
					zoom:1
				});
			}else{
				$(this).css('background-color','rgba('+HexToRgb(hex)+','+opacity+')');
			}
			
		});
	};
	
	function HexToR(h) {return parseInt((cutHex(h)).substring(0,2),16)}
	function HexToG(h) {return parseInt((cutHex(h)).substring(2,4),16)}
	function HexToB(h) {return parseInt((cutHex(h)).substring(4,6),16)}
	function cutHex(h) {return (h.charAt(0)=="#") ? h.substring(1,7):h}
	function HexToRgb(h){ return HexToR(h)+','+HexToG(h)+','+HexToB(h);}
	function d2h(d) {return d.toString(16);}
	function h2d(h) {return parseInt(h,16);} 
	
})( jQuery );



	
