/*
	Copyright DTDigital         :: www.dtdigital.com.au ::
	Unauthorised modification / use is a criminal offence, and
	will be prosecuted to the fullest extent permitted by law.
	All Rights Reserved
*/



NAVarr = new Array("home", "about", "markets", "brokers", "resources", "regions", "guidelinesrules", "contactus",
					"overview", "news", "faqs",
					"howtobuysell", "licences", "assignments", "brokerstools", "vtdtools",
					"whoarethebrokers", "becomingabroker", "feescharges",
					"jobmarket", "businessdirectory", "classifiedads"
					);
if (document.images)
{
	for (var NAVitem in NAVarr)
	{ 
		 for (var NAVicount=0; NAVicount < 2; NAVicount++)
		 { 
				eval("b" + NAVarr[NAVitem] + NAVicount + " = new Image()");
				eval("b" + NAVarr[NAVitem] + NAVicount + ".src = 'Assets/swap_" + NAVarr[NAVitem] + "_" + NAVicount + ".gif'");
		 } 
	} 
}

function BturnOn(imageName)
{
	if (document.images)
	{
		var imageNumber = "";
		if (arguments.length > 1) imageNumber = arguments[1];
		document [imageName + imageNumber].src = eval("b" + imageName + "1.src");
	}
}

function BturnOff(imageName)
{
	if (document.images)
	{
		var imageNumber = "";
		if (arguments.length > 1) imageNumber = arguments[1];
		document [imageName + imageNumber].src = eval("b" + imageName + "0.src");
	}
}

function BturnOnInput(obj,imageName)
{
	if (obj.src)
	{
		obj.src = eval("b" + imageName + "1.src");
	}
}

function BturnOffInput(obj,imageName)
{
	if (obj.src)
	{
		obj.src = eval("b" + imageName + "0.src");
	}
}

function ddRedirect(dd)
{
	if (dd.options[dd.selectedIndex].value != "") self.location = dd.options[dd.selectedIndex].value;
}







//-------------------------- MAP FUNCTIONALITY (welcome.aspx) -------------------------- //

var currentPage = "Home";

function showLocationInFlash(locationTitle, hotSpotX, hotSpotY)
{
	var flashMovie = getFlashMovieObject("markets_map");

	if (flashMovie != null)
	{
		var locationProperties = new Array(locationTitle, hotSpotX, hotSpotY);
		flashMovie.sendTextToFlash(locationProperties);
	}
}

function getFlashMovieObject(movieName)
{
	if (document.getElementById)
	{
		if (document.getElementById(movieName))
		{
			return document.getElementById(movieName);
		}
	}
	
	return null;
}

function hideLocationInFlash()
{
	var flashMovie = getFlashMovieObject("markets_map");
	
	if (flashMovie != null)
	{
		flashMovie.hideFlashLabel();
	}
}
