	/*
	-	JS => Flash sommunication:
	-	these functions enable the communication between the flash object and JS engine of the browser.
	*/
	function processURL(){
		var i;
		var myURL	= String(window.location.href).replace("#","?");
		var a		= (myURL.indexOf("?")>-1)?myURL.split("?")[1].split('&'):[];
		var get		= [];
		var _goto	= '';
		//Process GET params
		for(i in a)get[a[i].split("=")[0]] = a[i].split("=")[1];
		return get['page']?String(get['page']):'home';
	}
	//
	function getHTMLElementByID(id) {	return (navigator.appName.indexOf("Microsoft") != -1) ? window[id] : document[id]; }
	//
	function formDropdown(s){
		if(swf==null)swf = getHTMLElementByID("swfObject");
		//call the selected Flash App. page
		var qStr	= 'btn_'+s;
		var skip	= String(window.location.href).indexOf("&skip")>-1;
		qStr		= qStr+""+(skip?"&skip":"");
		swf.sendTextToFlash(qStr);
	}
	//
	function formSend(s) {
		// get the SWF object if not assigned by the vars at the end of the page yet ... (work arround for some browsers)
		if(swf==null)swf = getHTMLElementByID("swfObject");
		//call the selected Flash App. page 
		var qStr	= 'btn_'+s+"&"+flashBytes;
		var skip	= String(window.location.href).indexOf("&skip")>-1;
		qStr		= qStr+""+(skip?"&skip":"");
		swf.sendTextToFlash(qStr);
	}
	//
	function getTextFromFlash(str) { 
		// get the SWF object if not assigned by the vars at the end of the page yet ... (work arround for some browsers)
		if(swf==null)
			swf = getHTMLElementByID("swfObject");
		//check if the callback is activated
		if(swf.sendTextToFlash!=null){
			var qStr	= _goto+"&"+flashBytes;
			var skip	= String(window.location.href).indexOf("&skip")>-1;
			qStr		= qStr+""+(skip?"&skip":"");
			swf.sendTextToFlash(qStr);
		}else{	// dellay execution if object hasn't been loaded yet ...
			setTimeout("getTextFromFlash('')",500);
		}
		//
	}
	//
	function callFromFlash_UpdateURL(s){
		if(String(window.location.href).indexOf("iframe")>-1){
			//parent.title		= defaultTitle;
			var newHtml	= getHTMLpageFromQueryString(s);;
			if(String(window.location.href).indexOf(newHtml)<0)
				parent.location.hash	= newHtml; 
			//
		}else{
			window.location.hash= "page="+s.replace('btn_','');
			document.title		= defaultTitle;
		}
	}
	//
	function flashInfoAlert(s){
		//alert("Flash says: "+s);
	}
	//
	function callFromFlash(s){	
		if(swf==null)
			swf = getHTMLElementByID("swfObject");
		//
		var qStr	= _goto+"&"+flashBytes;
		var skip	= String(window.location.href).indexOf("&skip")>-1;
		qStr		= qStr+""+(skip?"&skip":"");
		//
		//alert(qStr);
		//
		swf.sendTextToFlash(qStr);
	}
	//
	function wk_btn_switch(boo){
		//var _div	= boo?'main':"flashObjectDiv";
		//alert("wk_btn_switch: "+boo+": "+_div);
		toggleDIV('toggle_button_div',true);
		//
		if(boo){
			toggleDIV('main',true);
			toggleDIV('flashObjectDiv',false);
		}else{
			toggleDIV('main',false);
			toggleDIV('flashObjectDiv',true);
			swf.toggleKioskWebButton("toggleBack");
		}
		//alert("'main': "+getZ('main')+"\n'flashObjectDiv': "+getZ('flashObjectDiv'));
		toggleDIV('toggle_button_div',false);
	}
	//
	function toggleDIV(id, boo){
		if (document.getElementById) { // DOM3 = IE5, NS6
			document.getElementById(id).style.display = boo?'block':'none';
		}else{
			if(document.layers){
				document.id.display = boo?'block':'none';
			}else{
				document.all.id.style.visibility = boo?'block':'none';
			}
		}
	}
	//
	function switchToWebMode(){
		var page	= processURL();
		var el		= page.split(",");
		if(page.length<1)return;
		//
		var pgID	= isNaN(el[1])?0:Number(el[1]);
		var htmlPage	= (pages_associations[el[0]][pgID]);
		//
		var flashURL	= window.location.href.replace("\\","/").replace("/flash/","/html/");
		var newURL		= flashURL.split('/');
		newURL.pop();
		window.location.href	= newURL.join("/")+"/"+htmlPage;
	}
	//
	function getHTMLpageFromQueryString(q){
		q	= q.replace("btn_",'');
		var el		= q.split(",");
		if(q.length<1)return '';
		//
		var pgID	= isNaN(el[1])?0:Number(el[1]);
		var htmlPage= (pages_associations[el[0]][pgID]);
		//
		return htmlPage;
	}