
var CSSLoader =
{
	CSS_PREFIX : "/app-static/productvergelijker/css/",

	/**
	 * Initialize all the specific CSS imports
	 */
	initialize : function()
	{

		if (UserAgent.isMacFirefox())
		{
			CSSLoader.importCss("ff3mac.css");
		}

		if (UserAgent.isMacSafari())
		{
			CSSLoader.importCss("safariMac.css");
		}

		if (UserAgent.isWindowsFirefox2()) {
			CSSLoader.importCss('ff2windows.css');
		}
		
		if (UserAgent.isIE8()) {			
			CSSLoader.importCss('ie8.css');
		}
		
		if (UserAgent.isChrome()) {
			CSSLoader.importCss('chrome.css');
		}
	},

	/**
	 * This function will add a stylesheet to the header. Setting a
	 * number of attributes necessary to complete the operation. It
	 * will find the CSS in the CSS_PREFIX variable of this class.
	 *
	 * @param styleSheetName	Filename of stylesheet to include
	 *
	 * @return
	 */
	importCss : function(styleSheetName)
	{
		var newLink = $("<link/>");
		newLink
			.attr("rel", "stylesheet")
			.attr("type", "text/css")
			.attr("media", "screen")
			.attr("href", CSSLoader.CSS_PREFIX + styleSheetName);

		$("head").append(newLink);
	}

};

// initialize the CSS loading for specific browsers
$(document).ready(CSSLoader.initialize);
