window.onload = init;

var durationVar = 1;

if (document.title == "Selling")
{
	var currentSelection = 'overviewtextcontainer';
	var currentButtonSelection = 'linkoverviewbutton';
}
else if (document.title == "Selling - Overview")
{
	var currentSelection = 'overviewtextcontainer';
	var currentButtonSelection = 'linkoverviewbutton';
}
else if (document.title == "Selling - Departments")
{
	var currentSelection = 'departmentstextcontainer';
	var currentButtonSelection = 'linkdepartmentsbutton';
}
else if (document.title == "Selling - Selling Process")
{
	var currentSelection = 'sellingprocesstextcontainer';
	var currentButtonSelection = 'linksellingprocessbutton';
}
else if (document.title == "Selling - Global Marketing")
{
	var currentSelection = 'globalmarketingtextcontainer';
	var currentButtonSelection = 'linkglobalmarketingbutton';
}
else if (document.title == "Selling - Auction Calendar")
{
	var currentSelection = 'auctioncalendartextcontainer';
	var currentButtonSelection = 'linkauctioncalendarbutton';
}

function init()
{
	document.getElementById("linktabcontainerJSOff").style.display = "none";
	document.getElementById("linktabcontainer").style.display = "block";
}

/* Does NOT work in FireFox
function slideEffectFunction(selection, textSelection, xPos, morphWidth, textWidth, buttonID, buttonNumber)
{
		new Effect.Move('textbackground', { x: xPos, y: 45, mode: 'absolute', duration: durationVar });
		new Effect.Move('textcontaineroverlay', { x: xPos, y: 45, mode: 'absolute', duration: durationVar });
		
		Effect.Fade(currentSelection, { duration: 1.0 });
		Effect.Appear(selection, { duration: 1.0 });
		
		Effect.Fade(currentButtonSelection, { duration: 0.2 });
		Effect.Appear(buttonID, { duration: 0.2 });
		
		$('textbackground').morph('width:' + morphWidth + 'px;');
		currentSelection = selection;
		currentButtonSelection = buttonID;
		document.getElementById("linktabblock").style.display = "block";
		//document.getElementById("sellingprocesstext").style.width = textWidth + "px";
		//$(textSelection).morph('width:' + textWidth + 'px;');
		$(textSelection).setStyle({width: textWidth + 'px'});
		
		//Effect.SlideDown('selectiontriangle', { duration: 1.0 });
		//document.getElementById("selectiontriangle").style.left = xPos + 100 + "px";
		setTimeout(blockLinks, 1100);
}
*/

function overviewSlide()
{
		new Effect.Move('textbackground', { x: 242, y: 45, mode: 'absolute', duration: durationVar });
		new Effect.Move('textcontaineroverlay', { x: 242, y: 45, mode: 'absolute', duration: durationVar });
		
		Effect.Fade(currentSelection, { duration: 1.0 });
		Effect.Appear('overviewtextcontainer', { duration: 1.0 });
		
		Effect.Fade(currentButtonSelection, { duration: 0.2 });
		Effect.Appear('linkoverviewbutton', { duration: 0.2 });
		
		$('textbackground').morph('width: 300px;');
		$('textcontaineroverlay').morph('width: 300px;');
		currentSelection = 'overviewtextcontainer';
		currentButtonSelection = 'linkoverviewbutton';
		document.getElementById("linktabblock").style.display = "block";
	
		$('overviewtext').setStyle({width: '260px'});
		
		setTimeout(blockLinks, 1100);
}

function departmentsSlide()
{
		new Effect.Move('textbackground', { x: 371, y: 45, mode: 'absolute', duration: durationVar });
		new Effect.Move('textcontaineroverlay', { x: 371, y: 45, mode: 'absolute', duration: durationVar });
		
		Effect.Fade(currentSelection, { duration: 1.0 });
		Effect.Appear('departmentstextcontainer', { duration: 1.0 });
		
		Effect.Fade(currentButtonSelection, { duration: 0.2 });
		Effect.Appear('linkdepartmentsbutton', { duration: 0.2 });
		
		$('textbackground').morph('width: 300px;');
		$('textcontaineroverlay').morph('width: 300px;');
		currentSelection = 'departmentstextcontainer';
		currentButtonSelection = 'linkdepartmentsbutton';
		document.getElementById("linktabblock").style.display = "block";
	
		$('departmentstext').setStyle({width: '260px'});
		
		setTimeout(blockLinks, 1100);
}

function sellingProcessSlide()
{
		new Effect.Move('textbackground', { x: 500, y: 45, mode: 'absolute', duration: durationVar });
		new Effect.Move('textcontaineroverlay', { x: 500, y: 45, mode: 'absolute', duration: durationVar });
		
		Effect.Fade(currentSelection, { duration: 1.0 });
		Effect.Appear('sellingprocesstextcontainer', { duration: 1.0 });
		
		Effect.Fade(currentButtonSelection, { duration: 0.2 });
		Effect.Appear('linksellingprocessbutton', { duration: 0.2 });
		
		$('textbackground').morph('width: 395px;');
		$('textcontaineroverlay').morph('width: 395px;');
		currentSelection = 'sellingprocesstextcontainer';
		currentButtonSelection = 'linksellingprocessbutton';
		document.getElementById("linktabblock").style.display = "block";
	
		$('sellingprocesstext').setStyle({width: '340px'});
		
		setTimeout(blockLinks, 1100);
}

function globalMarketingSlide()
{
		new Effect.Move('textbackground', { x: 600, y: 45, mode: 'absolute', duration: durationVar });
		new Effect.Move('textcontaineroverlay', { x: 600, y: 45, mode: 'absolute', duration: durationVar });
		
		Effect.Fade(currentSelection, { duration: 1.0 });
		Effect.Appear('globalmarketingtextcontainer', { duration: 1.0 });
		
		Effect.Fade(currentButtonSelection, { duration: 0.2 });
		Effect.Appear('linkglobalmarketingbutton', { duration: 0.2 });
		
		$('textbackground').morph('width: 395px;');
		$('textcontaineroverlay').morph('width: 395px;');
		currentSelection = 'globalmarketingtextcontainer';
		currentButtonSelection = 'linkglobalmarketingbutton';
		document.getElementById("linktabblock").style.display = "block";
	
		$('globalmarketingtext').setStyle({width: '360px'});
		
		setTimeout(blockLinks, 1100);
}

function auctionCalendarSlide()
{
		new Effect.Move('textbackground', { x: 605, y: 45, mode: 'absolute', duration: durationVar });
		new Effect.Move('textcontaineroverlay', { x: 605, y: 45, mode: 'absolute', duration: durationVar });
		
		Effect.Fade(currentSelection, { duration: 1.0 });
		Effect.Appear('auctioncalendartextcontainer', { duration: 1.0 });
		
		Effect.Fade(currentButtonSelection, { duration: 0.2 });
		Effect.Appear('linkauctioncalendarbutton', { duration: 0.2 });
		
		$('textbackground').morph('width: 395px;');
		$('textcontaineroverlay').morph('width: 395px;');
		currentSelection = 'auctioncalendartextcontainer';
		currentButtonSelection = 'linkauctioncalendarbutton';
		document.getElementById("linktabblock").style.display = "block";
	
		$('auctioncalendartext').setStyle({width: '360px'});
		
		setTimeout(blockLinks, 1100);
}

function blockLinks()
{
	document.getElementById("linktabblock").style.display = "none";
}
