var fpToolsPath = './lib/dashboard/';
var dashboardScriptPath = './lib/dashboard/';
var dashboardEnableDock = true;
var dashboardCookieControl = true;
var dashboardContainer = document.createElement("DIV") ;
dashboardContainer.id = "fpDashboard";
dashboardContainer.style.zIndex = "-1";
var enableDashboard = true;
var showInitStatus = false;
var externalGoogleMaps = 'ABQIAAAALBeawp8SVKY56xh0Rf52phTxuyHHXL-21DTMFHONcoSoc_eUjRSqQD2oT4zp6JwAQMlA4NrVPW7M5Q';


document.getElementsByClassName = function(tag, elemClass)
	{
	var elementsList = [];
	for(var i=0; i < document.getElementsByTagName(tag).length; i++)
		{
		if(document.getElementsByTagName(tag)[i].className == elemClass) elementsList.push(document.getElementsByTagName(tag)[i]);
		}
	return elementsList;
	}

var showCase = [];
showCase = 
	{
	tempPos		: 0,
	scrollPos	: 0,
	timer		: false,

	init : function()
		{
		var promotions = document.getElementsByClassName("DIV", "promotionLarge");
		if(promotions.length < 1) return false;
		showCase.timer = setInterval('showCase.change(document.getElementsByClassName(\'div\', \'scrollContainer\')[0], 1)', 5000);
		document.getElementsByClassName("DIV", "promotionContainer")[0].onmouseover = function() {clearInterval(showCase.timer);};
		document.getElementsByClassName("DIV", "promotionContainer")[0].onmouseout = function() {clearInterval(showCase.timer); showCase.timer = setInterval('showCase.change(document.getElementsByClassName(\'div\', \'scrollContainer\')[0], 1)', 5000);};
		},

	change: function(elem, direction, orientation)
		{
		var promotions = document.getElementsByClassName("DIV", "promotionLarge");
		if(promotions.length <= 2)
			{
			clearInterval(showCase.timer);
			return false;
			}
		if(!direction) direction = 1;
		showCase.scrollPos+=direction;

		if(showCase.scrollPos >= promotions.length) showCase.scrollPos = 0;
		if(showCase.scrollPos < 0) showCase.scrollPos =  promotions.length-1;
		if(!orientation)
			{
			fpTools.animate.init({obj:elem, styleProperty: animate._x, startValue:(showCase.tempPos)*-960, endValue:(-960*showCase.scrollPos), iteration:5, speed:30})
			}
		else	{
			fpTools.animate.init({obj:elem, styleProperty: animate._y, startValue:(showCase.tempPos)*-960, endValue:(-960*showCase.scrollPos), iteration:5, speed:30})
			}
		var counterContainer = document.getElementsByClassName("DIV", "promoCountHolder")[0];
		showCase.tempPos = showCase.scrollPos;
		}
	}


window.onload = function()
	{
	showCase.init();
	}


function mailingList(formData)
	{
	var submitData = '';
	var formAction = formData.getAttribute("action");
	for(var i=0; i <formData.elements.length; i++)
		{
		submitData+= "&"+formData.elements[i].name + "=" + formData.elements[i].value;
		}
	submitData = submitData.slice(1,submitData.length);

	fixedPointAjaxFramework.addToLine([formAction, $("mailingListContainer"), true, false, submitData, 'get']);
	return false;
	}
