﻿
// set to true if you want trace
var _global_debug = false;

// console or alert
function trace (arguments)
{
	if(!_global_debug) return;
	
	if(window.console) console.log(arguments);
	else {
		var str = "";
		var n = arguments.length;
		for (i=0; i<n; i++)
			str += arguments[i] + "\n";
			//alert (str);
	}
   
}


// get the hash
function getHash() 
{
	//alert(window.location.hash);
	return window.location.hash;
}


// get the location
function getLocation() 
{
	//alert(window.location);
	return window.location.toString();
}


// get the flash movie 
function getElement(movieName) 
{
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}

// call a flash function
function callFlashFunction(functionName, arg) 
{
	trace(functionName, arg);
	
	switch(functionName)
	{
		case "navigate":
		  getElement("flashmovie").navigate(arg); 
		  break;
		case "changeLang":
		  getElement("flashmovie").changeLang(arg); 
		  break;
	}
}

