//Nothing function to hrefs links
function n() { }

var SWF = {
	add: function (src, w, h, vars, mode, bg, id, not_ffv) {
		var html = '';
		var params = [];
		
		if (!bg) { bg = '';	}
		
		if (src.indexOf("?") > 0) {
			var arr = src.split("?");
			
			src = arr[0];
			vars = arr[1];
		}
		
		//if (!(!(!not_ffv))) { vars = String(vars).split("&").join("0123456789").formatVars().split("0123456789").join("&"); }
		
		if ((id != "undefined") && (id != "") && (id != null)) { id = String(id); }
		else { id = 'swf' }
			
		params["movie"] = src;
		params["src"] = src;
		params["flashvars"] = vars;
		params["wmode"] = (mode != "undefined") ? mode : "opaque";
		params["bgcolor"] = bg;
		params["play"] = "-1";
		params["loop"] = "-1";
		params["quality"] = "high";
		params["menu"] = "-1";
		params["fullscreen"] = "true";
		params["allowfullscreen"] = "true";
		params["allowscriptaccess"] = "always";
		params["scale"] = "showall";
		params["devicefont"] = "0";
		params["embedmovie"] = "0";
		params["seamlesstabbing"] = "false";
		params["allownetworking"] = "true";
		
		html += '<OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" height="'+ h +'" width="'+ w +'" align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="swf_' +id + '">';
		
		for (var item in params) {
			html += '<param name="' + item + '" value="' + params[item] + '">\n';
			
			if (item == "allownetworking") { break; }
		}
		
		html +='<embed width="'+ w +'" height="'+ h +'" name="swf_'+ id +'" align="middle" type="application/x-shockwave-flash" \n';
		html +=' pluginspage="http://www.macromedia.com/go/getflashplayer" id="swf_' + id + '" ';
		
		for (var item in params) {
			var v = params[item];
			
			if (item == "bgcolor") { v = "#" + v; }
			
			html += item + '="' + v + '" ';
			
			if (item == "allownetworking") { break; }
		}
		
		html += '/></OBJECT>';
		
		if ((id.length > 3) && (id)) {
			document.getElementById(id).innerHTML = html;
		} else {
			document.write(html);	
		}
	},
	minVersion: function (tmp_version) {
		if (parseInt(SWF.getVersion()) < parseInt(tmp_version)) {
			if (confirm("Click 'OK' to download the flash player.")) {
				document.location = "http://www.macromedia.com/go/getflashplayer";
			}
		}
	},
	getVersion: function () {
		var version, finded;	
		
		if (navigator.plugins && navigator.mimeTypes.length) {
			var x = navigator.plugins["Shockwave Flash"];
			if (x && x.description) {
				version = x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".");
				version = version[0];
			}
		} else {
			try	{
				try {
					var finded = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				} catch (e) { }
				
				for (var i = 3; finded != null; i++) {
					finded = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
					version = i;
				}
			} catch (e) { }
			
			try {
				version = axo.GetVariable("$version").split(" ")[1].split(",").split(",");
				version = versao[0];
			} catch (e) { }
		}
		
		return version;
	},
	/* auto full */
	/*_autofull_id: "",
	_autofull_min_w: 0,
	_autofull_min_h: 0,
	autoFull: function (tmp_id_div, tmp_min_w, tmp_min_h) {
		this._autofull_id = tmp_id_div;
		this._autofull_min_w = tmp_min_w;
		this._autofull_min_h = tmp_min_h;
		
		Event.add(window, Event.RESIZE, this._onResize.bind(this));
		Event.add(document, Event.READY, this._onReady.bind(this));
	},
	setAutoFullMinW: function (tmp_min_w) {
		this._autofull_min_w = tmp_min_w;
		
		this._onResize(null);
	},
	setAutoFullMinH: function (tmp_min_h) {
		this._autofull_min_h = tmp_min_h;
		
		this._onResize(null);
	},
	_onResize: function (e) {
		var wp = new WindowPosition();
		var w = wp.w;
		var h = wp.h;
		
		if (this._autofull_min_w > 0) {
			if (w < this._autofull_min_w) {
				w = this._autofull_min_w + "px";
			} else {
				w = w + "px";
			}
		} else {
			w = w + "px";
		}
		
		if (this._autofull_min_h > 0) {
			if (h < this._autofull_min_h) {
				h = this._autofull_min_h + "px";
			} else {
				h = h + "px";
			}
		} else {
			h = h + "px";
		}
		
		var el = $(this._autofull_id);
		el.style.width = w;
		el.style.height = h;
	},
	_onReady: function (e) {
		this._onResize(null);
	}*/
}
