﻿				
/**
* this function get a flash movie by its name
*/
function getFlashMovie(movieName) 
{   
	var isIE = navigator.appName.indexOf("Microsoft") != -1;   
	return (isIE) ? window[movieName] : document[movieName]; 
} 

/**
* this function get an object's coordinates (absolute)
*/
function getObjectCoordinates(obj) 
{
	var curleft = obj.offsetLeft || 0;
	var curtop = obj.offsetTop || 0;
	while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
	}
	return {x:curleft,y:curtop};
}

/**
* example of scroll listener and flash communication (with ExternalInterface addCallback)
*/
function scrollListener () 
{
	/*
	// get flash position
	var flashPositionY = getObjectCoordinates(document.getElementById('myContent')).y;
	
	// get vertical scroll position
	var vscroll = (document.all ? document.documentElement.scrollTop : window.pageYOffset);
	
	// give info to flash
	getFlashMovie("myContent").updateFlashCalculator(flashPositionY, vscroll);  
	*/
}

// uncomment this line to listen to scroll event
//window.onscroll = scrollListener ;