﻿var IE = ((document.all)&&(navigator.userAgent.indexOf("Opera")<0) ? parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]):0);
var allCss = (IE==0 || IE==7);

var soizen = {
	FLASH_TEXT_MARGIN : 10,
	FLASH_TEXT_PREFIX : "flashText_",
	/* Class ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
	FlashText : function(id/*String*/, label/*String*/, margin/*Number*/, className/*String*/, menuElement/*Boolean*/, active/*Boolean*/, callBack/*String*/, onClick/*String*/, scale/*Number*/) {
		this.id = id;
		this.domNode = null;
		this.container = null;
		this.margin = margin;
		this.usableWidth = 0;
		this.usableHeight = 0;
		var HTML="";
		var flashVars="";
		flashVars+="FV_label="+label;
		flashVars+="&FV_id="+id;
		flashVars+="&FV_on="+(active?"1":"0");
		flashVars+="&FV_menu="+(menuElement?"1":"0");
		flashVars+="&FV_callBack="+(callBack!="" ? callBack : (this.id+".resize"));
		flashVars+="&FV_onClick="+onClick;
		flashVars+="&FV_scale="+scale;
		HTML+="<div id=\""+soizen.FLASH_TEXT_PREFIX+id+"\" class=\""+className+"\" style=\"width:1px;\">";
		HTML+="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" ";
		HTML+="width=\"100%\" height=\"100%\" align=\"middle\">";
		HTML+="<param name=\"movie\" value=\"../_elements/movies/flashtext.swf?l="+Math.random()+"\" />";
		HTML+="<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
		HTML+="<param name=\"FLASHVARS\" value=\""+flashVars+"\" />";
		HTML+="<param name=\"quality\" value=\"best\" />";
		HTML+="<param name=\"wmode\" value=\"transparent\" />";
		HTML+="<param name=\"scale\" value=\"noscale\" />";
		HTML+="<embed align=\"middle\" allowfullscreen=\"false\" allowscriptaccess=\"sameDomain\" ";
		HTML+="flashvars=\""+flashVars+"\" ";
		HTML+="width=\"100%\" height=\"100%\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" quality=\"best\" scale=\"noscale\" src=\"../_elements/movies/flashtext.swf\" type=\"application/x-shockwave-flash\"  wmode=\"transparent\"></embed>";
		HTML+="</object>";
		HTML+="</div>";
		this.HTML = HTML;
		if(!soizen.FlashTextInitOK) {
			/* Initialisation des méthodes publiques................................................................................................................................................................................................................................................................................................................*/
			soizen.FlashText.prototype.toString = function()/*String*/ {
				return ("FlashText : "+ this.id);
			}
			/* .......................................................................................................................................................................................................................................................................................................................................................*/
			soizen.FlashText.prototype.write = function(container/*Object (Dom Element)*/) {
				if(container) {
					this.container = container;
					container.innerHTML = this.HTML;
				} else {
					document.write(this.HTML);
				}
				this.domNode = document.getElementById(soizen.FLASH_TEXT_PREFIX+this.id);
			}
			/* .......................................................................................................................................................................................................................................................................................................................................................*/
			soizen.FlashText.prototype.debug = function() {
				var debug = window.open();
				debug.document.write(this.HTML);
			}
			/* .......................................................................................................................................................................................................................................................................................................................................................*/
			soizen.FlashText.prototype.resize = function(width/*Number*/, height/*Number*/) {
				this.usableWidth = Math.round(Number(width)+this.margin);
				this.usableHeight = Math.round(Number(height));
				this.domNode.style.width=this.usableWidth+"px";
				this.domNode.style.height=this.usableHeight+"px";
				return this.usableWidth;
			}
			/* .......................................................................................................................................................................................................................................................................................................................................................*/
			soizen.FlashTextInitOK = true;
		}
	},
	/* package ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
	title : {
		/* function ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
		write : function(label) {
			eval("window['pageTitle'] = new soizen.FlashText('pageTitle', \""+label+"\", 0, 'pageTitle', false, true, '', '', 100)");
			pageTitle.write();
		}
		/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
	}
	/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
}

