// ***************************************************************************************************************************************
// Function :: Used to display Scroller Window / tray according to the Browser
function DispSliderWindow(strWeekendSubType)
{	
	//if (navigator.appName == "Microsoft Internet Explorer")
	//{
	//	document.getElementById('SliderWindow').innerHTML = strJsIEWindow;
	//}
	//else //(navigator.appName == "Netscape")
	//{
		//document.getElementById('SliderWindow').innerHTML = strJsFFWindow;
		ResetPositionsOfWindows();
	//}
}
// ***************************************************************************************************************************************
// Function :: Check selected Tab and reset Windows accordingly
function TabSelection(strTabName)
{
	if (strOperStatus == "Completed")
	{
		if ((strTabName == "previous") || (strTabName == "next"))
		{
			if ((intCurrWindow == arrWeekendSlides[1]) && (strTabName == "previous"))
			{
				strTabName = "UKWeekends";
			}
			else if (((intCurrWindow + 1) == arrWeekendSlides[1]) && (strTabName == "next"))
			{
				strTabName = "AbroadWeekends";
			}
			else if ((intCurrWindow == arrWeekendSlides[2]) && (strTabName == "previous"))
			{
				strTabName = "AbroadWeekends";
			}
			else if (((intCurrWindow + 1) == arrWeekendSlides[2]) && (strTabName == "next"))
			{
				strTabName = "InspiredWeekends";
			}
		}
		else if (strTabName == "UKWeekends")
		{
			intCurrWindow = arrWeekendSlides[0];
		}
		else if (strTabName == "AbroadWeekends")
		{
			intCurrWindow = arrWeekendSlides[1];
		}
		else if (strTabName == "InspiredWeekends")
		{
			intCurrWindow = arrWeekendSlides[2];
		}
		
		DispTab(strTabName);
		ResetPositionsOfWindows();
	}
}
// ***************************************************************************************************************************************
// Function :: Check selected Tab and reset Windows accordingly
function DispTab(strSelTabName)
{
	if (strSelTabName == "UKWeekends")
	{
		document.getElementById('ScrollTabHeading').innerHTML = "Scroll to view Exciting UK " + strSelWeekend + " Weekend locations";
		
		document.getElementById('TabUKWeekends').className = "WeekendType";
		document.getElementById('TabAbroadWeekends').className = "WeekendType" + strSelWeekend;
		document.getElementById('TabInspiredWeekends').className = "WeekendType" + strSelWeekend;
		
		document.getElementById('LnkUKWeekends').className = "TabHeadingOn";
		document.getElementById('LnkAbroadWeekends').className = "TabHeadingOff";
		document.getElementById('LnkInspiredWeekends').className = "TabHeadingOff";
	}
	else if (strSelTabName == "AbroadWeekends")
	{
		document.getElementById('ScrollTabHeading').innerHTML = "Scroll to view Exciting " + strSelWeekend + " Weekend locations Abroad";
		
		document.getElementById('TabUKWeekends').className = "WeekendType" + strSelWeekend;
		document.getElementById('TabAbroadWeekends').className = "WeekendType";
		document.getElementById('TabInspiredWeekends').className = "WeekendType" + strSelWeekend;
		
		document.getElementById('LnkUKWeekends').className = "TabHeadingOff";
		document.getElementById('LnkAbroadWeekends').className = "TabHeadingOn";
		document.getElementById('LnkInspiredWeekends').className = "TabHeadingOff";
	}
	else if (strSelTabName == "InspiredWeekends")
	{
		document.getElementById('ScrollTabHeading').innerHTML = "Scroll to view Exciting ";
		if (strSelWeekend == "Stag")
		{
			document.getElementById('ScrollTabHeading').innerHTML += "MAX";
		}
		else
		{
			document.getElementById('ScrollTabHeading').innerHTML += "Inspired";
		}
		document.getElementById('ScrollTabHeading').innerHTML += " Weekend locations";
		
		document.getElementById('TabUKWeekends').className = "WeekendType" + strSelWeekend;
		document.getElementById('TabAbroadWeekends').className = "WeekendType" + strSelWeekend;
		document.getElementById('TabInspiredWeekends').className = "WeekendType";
		
		document.getElementById('LnkUKWeekends').className = "TabHeadingOff";
		document.getElementById('LnkAbroadWeekends').className = "TabHeadingOff";
		document.getElementById('LnkInspiredWeekends').className = "TabHeadingOn";
	}
}
// ***************************************************************************************************************************************
// Function :: Used to reset positions of all Windows according to the current Tab selection
function ResetPositionsOfWindows()
{
	for (intCounter = 1; intCounter <= intTotalWindows; ++intCounter)
	{
		document.getElementById("SlideWindow" + intCurrWindow).style.left = 0 + "px";
		if (intCounter < intCurrWindow)
		{
			document.getElementById("SlideWindow" + intCounter).style.left = -648 + "px";
		}
		else if (intCounter > intCurrWindow)
		{
			document.getElementById("SlideWindow" + intCounter).style.left = 648 + "px";
		}
	}
}
// ***************************************************************************************************************************************
// Function :: Validate operation, mark windows to be slided and get started with sliding
function StartSliding(strOperation)
{
	if (strOperStatus == "Completed")
	{
		// Mark if this move is going to change Tab
		TabSelection(strOperation);
		
		if (strOperation == "previous")
		{
			if (intCurrWindow == 1)
			{
				alert("You are already viewing the first window.");
			}
			else
			{
				strWindowOne = "SlideWindow" + intCurrWindow;
				intCurrWindow = intCurrWindow - 1;
				strWindowTwo = "SlideWindow" + intCurrWindow;
				
				LRSlideWindows();
				strOperStatus = "Incomplete";
			}
		}
		else if (strOperation == "next")
		{
			if (intCurrWindow == intTotalWindows)
			{
				alert("You are already viewing the last window.");
			}
			else
			{
				strWindowOne = "SlideWindow" + intCurrWindow;
				intCurrWindow = intCurrWindow + 1;
				strWindowTwo = "SlideWindow" + intCurrWindow;
				
				RLSlideWindows();
				strOperStatus = "Incomplete";
			}
		}
	}
}
// ***************************************************************************************************************************************
// Function :: Used to slides winodws one after another from left to right
function LRSlideWindows()
{
	if (parseFloat(document.getElementById(strWindowOne).style.left) < 648)
	{
		document.getElementById(strWindowOne).style.left = parseFloat(document.getElementById(strWindowOne).style.left) + 10 + "px";
		document.getElementById(strWindowTwo).style.left = parseFloat(document.getElementById(strWindowTwo).style.left) + 10 + "px";
		var delay = setTimeout("LRSlideWindows()", 0);
	}
	else
	{
		strOperStatus = "Completed";
	}
}
// ***************************************************************************************************************************************
// Function :: Used to slides winodws one after another from right to left
function RLSlideWindows()
{
	if (parseFloat(document.getElementById(strWindowOne).style.left) > -648)
	{
		document.getElementById(strWindowOne).style.left = parseFloat(document.getElementById(strWindowOne).style.left) - 10 + "px";
		document.getElementById(strWindowTwo).style.left = parseFloat(document.getElementById(strWindowTwo).style.left) - 10 + "px";
		var delay = setTimeout("RLSlideWindows()", 0);
	}
	else
	{
		strOperStatus = "Completed";
	}
}
// ***************************************************************************************************************************************