jQuery.sifrSettings=function(settings){arguments.callee.settings=jQuery.extend({absoluteOffsetX:null,aoX:0,absoluteOffsetY:null,aoY:0,relativeOffsetX:null,roX:0,relativeOffsetY:null,roY:0,path:'/mm/sifr/',font:null,fontSize:null,color:null,underline:null,textTransform:null,link:null,hover:null,backgroundColor:null,textAlign:null,verticalAlign:null,content:null,width:null,height:null},arguments.callee.settings,settings);return arguments.callee.settings;};jQuery.fn.sifr=function(settings){var hex=function(N){if(N==null)return"00";N=parseInt(N);if(N==0||isNaN(N))return"00";N=Math.max(0,N);N=Math.min(N,255);N=Math.round(N);return"0123456789ABCDEF".charAt((N-N%16)/16)+"0123456789ABCDEF".charAt(N%16);};var hexed=function(color){if(!color){return false;}if(color.search('rgb')>-1){color=color.substr(4,color.length-5).split(', ');color=hex(color[0])+hex(color[1])+hex(color[2]);}color=color.replace('#','');if(color.length<6){color=color.substr(0,1)+color.substr(0,1)+color.substr(1,1)+color.substr(1,1)+color.substr(2,1)+color.substr(2,1);}return color;};return this.each(function(){var o=jQuery(this);if((o.attr('class'))&&o.attr('class').search('sifr')>-1){o.unsifr();}o.flash({},{update:false},function(htmlOptions){var s=jQuery.extend({},jQuery.sifrSettings(),settings);o.addClass('sifr');s.font=s.font||o.css('fontFamily').split(',')[0].replace(/\"|\'/gm,'');s.color=s.color||o.css('color');s.color=hexed(s.color);s.underline=s.underline||(o.css('textDecoration')=='underline');s.backgroundColor=s.backgroundColor||o.css('backgroundColor');s.background=hexed(s.background);s.textAlign=s.textAlign||o.css('textAlign')||'left';s.verticalAlign=s.verticalAlign||o.css('verticleAlign')||'top';o.html('<span style="display:inline;margin:0;padding:0;float:none;width:auto;height:auto;font-weight:inherit;">'+o.html()+'</span>');var oc=jQuery(this.firstChild);s.content=s.content||oc.html();s.textTransform=s.textTransform||o.css('textTransform');s.textTransform=s.textTransform||o.css('textTransform');s.content=(s.textTransform=='uppercase')?oc.html().toUpperCase():(s.textTransform=='lowercase')?s.content=oc.html().toLowerCase():(s.textTransform=='capitalize')?function(){var ochtml=oc.html().split(/\s/);for(var i=0;i<ochtml.length;i++){ochtml[i]=ochtml[i].charAt(0).toUpperCase()+ochtml[i].substring(1);}return ochtml.join(' ');}():s.content;s.content=s.content.replace(/\s+([<>])|([<>])\s+|^\s+|\s+$/g,'$1$2');s.width=s.width||oc.width();s.height=s.height||oc.height();s.aoX=(s.aoX||0)+((s.width/100)*(s.roX||0));s.aoY=(s.aoY||0)+((s.height/100)*(s.roY||0));oc.hide();htmlOptions.style='vertical-align:'+s.verticalAlign+';';htmlOptions.wmode='transparent';htmlOptions.src=s.path+s.font+'.swf';htmlOptions.flashvars.txt=s.content;htmlOptions.width=s.width;htmlOptions.height=s.height;htmlOptions.flashvars.w=s.width;htmlOptions.flashvars.h=s.height;htmlOptions.flashvars.textalign=s.textAlign;if(s.aoX!=0){htmlOptions.flashvars.offsetLeft=s.aoX;}if(s.aoY!=0){htmlOptions.flashvars.offsetTop=s.aoY;}if(s.color){htmlOptions.flashvars.textcolor=s.color;}if(s.link){htmlOptions.flashvars.linkColor=s.link;}if(s.hover){htmlOptions.flashvars.hoverColor=s.hover;}if(s.underline){htmlOptions.flashvars.underline=s.underline;}if(s.backgroundColor){htmlOptions.flashvars.bgColor=s.backgroundColor;}o.append(jQuery.fn.flash.transform(htmlOptions));});});};jQuery.fn.unsifr=function(){return this.each(function(){var o=jQuery(this);var oc=jQuery(this.firstChild);if((o.attr('class'))&&o.attr('class').search('sifr')>-1){o.html(oc.html());o.removeClass('sifr');}});};