/*
	Author: Aden Narkowicz, SCT
	Description: Used to select a range, from .thirdlevel navigation, on the Our Wine page. Called from flash.
*/


/*
	Called by flash when range is set, selects the menu item by comparing the url
*/
function selectRange(url)
{
	$("#navigation .thirdlevel li").each(function(){
		if($(this).children("a").attr("href").indexOf(url) >= 0){
			$(this).addClass("selected");
		}else{
			$(this).removeClass("selected");
		}
	});
}

/*
	Sends a call to flash via ExternalInterface to change the range
*/
function setRange(url)
{
	getFlashMovie('flashcontent').setRangeViaExternalInterface(url);
}

/*
	Returns the proper address for the Flash movie depending on browser
*/
function getFlashMovie(movieName)
{
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}