﻿/**
 * static object that handles page logic
 * @class 
 * @constructor
 * @param {jQuery} $ Reference to the jQuery object
 */
var HomeMain = function($) {

	/**
	* @namespace Private methods and variables
	*/
	var priv = {
		initFlashBanner : function(){
			if (swfobject.hasFlashPlayerVersion("9.0.0")) {
				var pathPrefix = Resource.GetText("path_prefix");
				var so = new swfobject.embedSWF(
					pathPrefix + "/images/header.swf", 
					"flash-banner", 
					"949", 
					"364", 
					"9.0.0",
					pathPrefix + "/images/expressInstall.swf", 
					//Content for the banner is provided by the banner-content.xml file in the language specific resource file
					{
						xml: pathPrefix + "/images/" + Resource.GetText("site_identifier") + "/banner-content.xml",
						path: pathPrefix + "/"
					}, 
					{wmode : "transparent"}
				);
			}
			else {
				$("#flash-banner img").fadeIn(200);
			}
		}
		
    };
	/** @scope Main */
	return {

		/**
		* Initializes the logic for the current page
		* to be called on $(document).ready
		*/
		OnReady: function() {
			//initialize the flashbanner
			priv.initFlashBanner();
			
			//initialize the countrymap
			var mapWrapper = new MapWrapper({"mapElement" : $("#map").get(0)});
		}
	};
} (jQuery);
