// CICLONNE MAILING API
// 1.0.0

// 

// factorium - 2009


if (!window.ciclonne) window.ciclonne = new Object();

ciclonne.mailing = {
	version			: "Ciclonne Mailing API 1.0.0",
	start			: function() {
		if (window.RemoteCiclonne) return;
		
		var retorno;
		var VideoId		= "CiclonneRemoteRequest";
		var URL			= "http://api.ciclonne.com/swf/Ciclonne_RemoteRequest.swf";
		var Height		= 1;
		var Width		= 1;
		
		if (ciclonne.util.getBrowser() == 0) {
			retorno = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" ";
			retorno += "width=\"" + Width + "\" height=\"" + Height + "\" ";
			retorno += "name=\"" + VideoId + "\" id=\"" + VideoId + "\">";
			retorno += "<param name=\"movie\" value=\"" + URL + "\">";
			retorno += "<param name=\"quality\" value=\"high\">";
			retorno += "<param name=\"allowScriptAccess\" value=\"always\">";
			retorno += "<param name=\"wmode\" value=\"transparent\">";
			retorno += "</object>";
		} else {
			retorno = "<embed src=\"" + URL + "\" ";
			retorno += "width=\"" + Width + "\" height=\"" + Height + "\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" ";
			retorno += "name=\"" + VideoId + "\" id=\"" + VideoId + "\" ";
			retorno += "allowscriptaccess=\"always\" ";
			retorno += "wmode=\"transparent\"";
			retorno += "></embed>";
		}
		
		document.write("<div style='border:0px none; background:none; padding:0px; margin:0px; float:left; width:1px; height:1px; overflow:auto; position:absolute;'>" + retorno + "</div>");
		
		if (ciclonne.util.getBrowser() == 0) {
			window[VideoId] = document.getElementById(VideoId);
		} else {
			document[VideoId] = document.getElementById(VideoId);
		}
	},
	registerClass	: function() {
		if (window.CiclonneMailing) return;
		
		var CiclonneClass = function(properties) {
			var klass = function() {
				return this.start.apply(this);
			};
			klass.prototype = properties;
			klass.constructor = arguments.callee;
			return klass;
		};
		
		window.CiclonneMailing = new CiclonneClass({
			start	: function() {
				this.transport = new RemoteCiclonne();
				this.transport.changeMode("mailingIn");
			},
			onLoad	: function() {},
			post	: function(PostValue) {
				this.transport.post(PostValue);
				this.transport.onLoad = this.onLoad;
			},
			version	: function() {
				return ciclonne.mailing.version;
			}
		});
	}
}

ciclonne.util = {
	getBrowser : function() {
		if (navigator.appName.indexOf("Microsoft") != -1) {
			return 0;
		} else {
			return 1;
		}
	}
}

ciclonne.mailing.start();