if(typeof TDB=='undefined')
	var TDB={};
	//
	//
if(typeof TDB.LiveManager=='undefined')
	TDB.LiveManager={};
	//
	//
if(typeof TDB.LiveManager.io=='undefined')
	TDB.LiveManager.io={};
	//
	//
//
TDB.LiveManager=
{
	io:
	{
		send:function(func,prms)
		{
			//
			TDB.LiveManager.SWF.call(func,prms);
			//
			window.document.title=TDB.LiveManager.DEFAULT.PAGE_NAME
			//
		}
		,recieve:function()
		{
			switch(arguments[0])
			{
				case 'updateDhtmlHistoryObject':
					//
					dhtmlHistory.add(arguments[1],null);
					//force pagename to avoid multiple '#' in title name IE.
					window.document.title=TDB.LiveManager.DEFAULT.PAGE_NAME;
					//
					break;
			}
		}
		,unserialize:function(url)
		{
			url=new String(url);
			//
			url=url.replace(/\@/g,"?");
			url=url.replace(/;/g,"&");
			url=url.replace(/:/g,"=");
			//
			return url;
		}
		,serialize:function(url)
		{
			url=new String(url);
			//
			url=url.replace(/\?/g,"@");
			url=url.replace(/&/g,";");
			url=url.replace(/=/g,":");
			//
			return url;
		}
	}
	,initialize:function()
	{
		//
		this.DEFAULT=DEFAULTS;
		//
	}
	,start:function()
	{
		//
		//start flash integration with express install as needed.
		this.SWF=new deconcept.SWFObject
		(
			this.DEFAULT.SWF_MAIN
			,'main'
			,this.DEFAULT.SWF_WIDTH
			,this.DEFAULT.SWF_HEIGHT
			,this.DEFAULT.SWF_VERSION
			,this.DEFAULT.SWF_BACKGROUND_COLOR
			,this.DEFAULT.EXPRESS_INSTALL
		)
		//
		//handle flashvars definitions
		var t=this.DEFAULT.SWF_VARIABLES.length;
		for(i=0;i<t;i++)
		{
			this.SWF.addVariable(this.DEFAULT.SWF_VARIABLES[i].name,this.DEFAULT.SWF_VARIABLES[i].value)
		}
		//handle parameters definitions
		var t=this.DEFAULT.SWF_PARAMS.length;
		for(i=0;i<t;i++)
		{
			this.SWF.addParam(this.DEFAULT.SWF_PARAMS[i].name,this.DEFAULT.SWF_PARAMS[i].value)
		}
		//
		//
		//initialize the dhtml history
		dhtmlHistory.initialize();
		dhtmlHistory.addListener(this.handleHistoryChange);
		//
		//
		//...pass the initialocation if any
		var currentLocation=dhtmlHistory.getCurrentLocation();
		if(currentLocation!='')
		{
			//parse the current location serialized search, into a unserialized version.
			//var parsedCurrentLocation=TDB.LiveManager.io.unserialize(currentLocation);
			//alert('>>parsed current location:'+currentLocation)
			this.SWF.addVariable(this.DEFAULT.SWF_INITIAL_VARIABLE_NAME,currentLocation);
		}
		//
		//...set the proxy for connect live engine with js code.
		this.SWF.setProxy(null,this.DEFAULT.SWF_GATEWAY);
		//then write the flash in the content "div"
		this.SWF.write('flashcontent');
	}
	,handleHistoryChange:function(newlocation,historydata)
	{
		TDB.LiveManager.io.send('onHistoryChange',newlocation);
	}
}
//
//
TDB.LiveManager.initialize();
TDB.FusionManager = TDB.LiveManager;