﻿var AMV8Vantage = {}

AMV8Vantage.init = function()
{

	if(typeof JJ != "undefined")
	{
		if(typeof JJ.Components.DatePicker == "function")
		{
			JJ.Components.DatePicker.convertInputs("date");
		}
	}

	if(typeof sIFR == "function")
	{
		sIFR.setup();
		
		if(AMV8Vantage.locale().toLowerCase() != "ja-jp")
		{
			//sIFR.replaceElement(named({sSelector:"body.contact h1", sFlashSrc:"./content/flash/sifr-optima.swf", sColor:"#ffffff", sLinkColor:"#ffffff", sHoverColor:"#ffffff", sWmode:"transparent"}));
			// prefix of ../ is because this is called from the admin site
			sIFR.replaceElement(named({sSelector:"h1", sFlashSrc:"../content/flash/sifr-optima.swf", sColor:"#c7b964", sLinkColor:"#c7b964", sHoverColor:"#c7b964", sWmode:"transparent"}));
		}

	}

	if(typeof AMV8Vantage.Contact != "undefined")
	{
		AMV8Vantage.Contact.init();
	}

	if(typeof AMV8Vantage.ForwardFriend != "undefined")
	{
		AMV8Vantage.ForwardFriend.init();
	}

}

AMV8Vantage.locale = function()
{
	return document.getElementsByTagName("html")[0].lang;
}

if(typeof EventDispatcher != "undefined")
{
	EventDispatcher.addListener("app.init", AMV8Vantage.init);
}
