// ------- Private vars -------
	var jsReady = false;
	var swfReady = false;
	var swfMapReady = false;
	var swfReloadReady = false;

	// ------- functions called by ActionScript -------
	// called to check if the page has initialized and JavaScript is available
	function isReady() {
		return jsReady;
	}

	// called to notify the page that the SWF has set it's callbacks
	function setSWFIsReady() {
		// record that the SWF has registered it's functions (i.e. that JavaScript
		// can safely call the ActionScript functions)
		swfReady = true;
		if (typeof(getCurrentChain) == "function") {
		    getCurrentChain();
		}
	}
	
    function setSWFReloadReady() {
	    // record that the SWF has registered it's functions (i.e. that JavaScript
	    // can safely call the ActionScript functions)
	    swfReloadReady = true;
	    if (typeof(reloadCurrentChain) == "function") {
		    reloadCurrentChain();
		}
    }

	// called to notify the page that the SWF has set it's callbacks
	function setLoginIsReady() {
		// record that the SWF has registered it's functions (i.e. that JavaScript
		// can safely call the ActionScript functions)
		swfReady = true;
		if (typeof(getCurrentChain) == "function") {
		    getCurrentChain();
		}
	}

	// called by the onload event of the <body> tag
	function pageInit() {
		// record that JavaScript is ready to go.
		jsReady = true;
		
	}

//get name of swf depending on browser
	function getSWF(movieName) {
		if (navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName];
		} else {
			return document[movieName];
		}
	}


	function onWebServiceError(result) {
	    alert("An error occurred while contacting the web server. Please try again later.");
	    //\n\r\n\rDetail:\n\r" + result.get_message());
	}
	


