
	function GetUrlParms()  
	 {  
	 var args=new Object();  
	 var query=location.search.substring(1);
	 var pairs=query.split("&");
	 for(var i=0;i<pairs.length;i++)  
	 {  
	 var pos=pairs[i].indexOf('=');
	 if(pos==-1)   continue;
	 var argname=pairs[i].substring(0,pos);
	 var value=pairs[i].substring(pos+1);
	 args[argname]=unescape(value);
	 }  
	 return args;  
	 }
	
	function getDownloadPic()
	{
	var args = new Object();  
	args = GetUrlParms();
	if(args['lang'] == 'en')
	{
		var node = document.getElementById("dp");
		if (node != null)
		{
		    node.src = "/commun/update/installer/download_en.jpg";
		    document.getElementById("noflash").innerHTML = "<strong>Please upgrade your Flash Player</strong>  Flash Player 6.0.65 or higher is required to run the Tboks install wizard."
		}
	}else{
		var node = document.getElementById("dp");
		if (node != null)
		{
		    node.src = "/commun/update/installer/download_fr.jpg";
		    document.getElementById("noflash").innerHTML = "<strong>Merci de mettre à niveau votre version de Flash Player</strong>  L'installation nécessite la présence de Flash Player version 6.0.65 minimum.";
		}
	}
	}
	function getVersionFile() 
		{
			document.getElementById("installerA").style.display = "none";
			document.getElementById("noflash").style.display = "block";
			
			if(window.ActiveXObject)
	       {
	            xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	            xmlDoc.async="false";  
	            xmlDoc.load("/commun/update/tboks_update.xml"); 
				var url = getvalue();
				showInstaller(url);
	        }
	        else if(document.implementation && document.implementation.createDocument)
	        {
				/*
				xmlDoc=document.implementation.createDocument("", "root", null); 
	            xmlDoc.load("tboks_update.xml"); 
				
				xmlDoc.onload=function(){
					var nodes=xmlDoc.documentElement.childNodes;
					var url = nodes[5].childNodes[0].nodeValue;
					//alert(url);
					
					showInstaller(url);
				}*/
				var xmlHttpReq = new XMLHttpRequest();
				xmlHttpReq.open("GET", "/commun/update/tboks_update.xml", false);
				xmlHttpReq.send(null);
				var url = xmlHttpReq.responseXML.firstChild.childNodes[5].firstChild.nodeValue;
				showInstaller(url);
	        }
	        else
	        {
	            return null;
	        }
		}
		
		
		function getvalue()
		{
			var nodes=xmlDoc.documentElement.childNodes;
			return nodes.item(2).childNodes.item(0).text;
			
		}
		/*
		function getvalueff(){ 
			var nodes=xmlDoc.documentElement.childNodes;
			var url = nodes[5].childNodes[0].nodeValue;
			//alert(url);
			alert('FF-onload');
			showInstaller(url);
		}
		*/
		
				
		
		function showInstaller(url)
		{ 
			// version 9.0.115 or greater is required for launching AIR apps.
			var so = new SWFObject("/commun/update/installer/AIRInstallBadge.swf", "Badge", "215", "180", "9.0.115", "#FFFFFF");
			//
			//so.useExpressInstall('expressinstall.swf');
			//
			// these parameters are required for badge install:
			so.addVariable("airversion", "1.0"); // version of AIR runtime required
			so.addVariable("appname", "TBoks"); // application name to display to the user
			so.addVariable("appurl", url); // absolute URL (beginning with http or https) of the application ".air" file
			
			// these parameters are required to support launching apps from the badge (but optional for install):
			so.addVariable("appid", "com.tboks.air.Tboks"); // the qualified application ID (ex. com.gskinner.air.MyApplication)
			so.addVariable("pubid", ""); // publisher id
			
			// this parameter is required in addition to the above to support upgrading from the badge:
			so.addVariable("appversion", "1.0.2"); // AIR application version
			
			// these parameters are optional: 
			so.addVariable("image", "/commun/update/installer/logo205x170.jpg"); // URL for an image (JPG, PNG, GIF) or SWF to display in the badge (205px wide, 170px high)
			so.addVariable("appinstallarg", "installed from web"); // passed to the application when it is installed from the badge
			so.addVariable("applauncharg", "launched from web"); // passed to the application when it is launched from the badge
			//so.addVariable("helpurl", "help.html"); // optional url to a page containing additional help, displayed in the badge's help screen
			so.addVariable("hidehelp", "true"); // hides the help icon if "true"
			so.addVariable("skiptransition", "true"); // skips the initial transition if "true"
			so.addVariable("titlecolor", "#00AAFF"); // changes the color of titles
			so.addVariable("buttonlabelcolor", "#00AAFF"); // changes the color of the button label
			so.addVariable("appnamecolor", "#00AAFF"); // changes the color of the application name if the image is not specified or loaded
			
			// these parameters allow you to override the default text in the badge:
			// supported strings: str_error, str_err_params, str_err_airunavailable, str_err_airswf, str_loading, str_install, str_launch, str_upgrade, str_close, str_launching, str_launchingtext, str_installing, str_installingtext, str_tryagain, str_beta3, str_beta3text, str_help, str_helptext
			so.addVariable("str_err_airswf", "<u>Running locally?</u><br/><br/>The AIR proxy swf won't load properly when this demo is run from the local file system."); // overrides the error text when the AIR proxy swf fails to load
			so.addVariable("str_install","Installer");
			so.write("flashcontent");
		}			



	

