// SWF Titles

;(function($) {
var ver = '1.0';
$.fn.swftitle = function(options) {
	
	// if flash
	if (!options.version) {options.version = '8';}
	if (swfobject.hasFlashPlayerVersion(options.version)) {
	
		// options
		if (!options.font) {options.font = 'h1';}
		if (!options.color) {options.color = '000000';}
		if (!options.path) {options.path = '/scripts/jquery/swftitles/';}
		if (!options.width) {options.width = '726';}
		if (!options.height) {options.height = '38';}
		if (!options.left) {options.left = '0';}
		if (!options.top) {options.top = '0';}
		if (!options.zindex) {options.zindex = '11';}
		var text = $(this).html();
		var id = Math.floor(Math.random()*1000000);
		
		// replace
		var replace_code = '<div class="swftitle_'+options.font+'" style="position:relative;width:'+options.width+'px;height:'+options.height+'px;margin-left:'+options.left+'px;margin-top:'+options.top+';z-index:'+options.zindex+';overflow:hidden;"><div style="position:absolute;"><object id="swftitle_'+id+'" type="application/x-shockwave-flash" data="'+options.path+options.font+'.swf" width="800" height="80"><param name="movie" value="'+options.path+options.font+'.swf" /><param name="allowfullscreen" value="false" /><param name="allowscriptaccess" value="always" /><param name="wmode" value="transparent"><param name="flashvars" value="new_title='+text+'&new_titlecolor=0x'+options.color+'" /><p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p></object></div></div>';
		$(this).replaceWith(replace_code);
		
	}
	
}
})(jQuery);
