// JavaScript Document

// Function to control the tab navigation 
function preloadimages()
{
	if (document.images)
		{
			preload_image1 = new Image();
			preload_image2 = new Image();
			preload_image3 = new Image();
			// set image url
			preload_image1.src = "site/images/tabs_water.gif";
			preload_image2.src = "site/images/tabs_wildlife.gif";
			preload_image3.src = "site/images/tabs_land.gif";
		}
}
function tabNav(mode)
{
	var tabs = document.getElementById('tabnav');
	var triptych1 = document.getElementById('triptych1');
	var triptych2 = document.getElementById('triptych2');
	var triptych3 = document.getElementById('triptych3');
	var whitemarker = document.getElementById('whitemarker');
	var pagetxt = document.getElementById('pagetxt');
	
	switch(mode)
	{
		case 0 : 
		{
			tabs.style.backgroundImage = "url(site/images/transparency.gif)" ;
			triptych1.style.backgroundImage = "url(site/images/triptych_water.jpg)";
			triptych2.style.backgroundImage = "url(site/images/triptych_wildlife.jpg)";
			triptych3.style.backgroundImage = "url(site/images/triptych_land.jpg)";
			triptych1.innerHTML = "";
			triptych2.innerHTML = "";
			whitemarker.style.visibility = "hidden";
			pagetxt.innerHTML = "<p>When people care about a region, they have a stake in what goes on there. Teck American is working to provide the public with clear information regarding the health of this unique environment.</p>";
			break;
		}
		case 1 : 
		{
			tabs.style.backgroundImage = "url(site/images/tabs_water.gif)" ;
			triptych1.style.backgroundImage = "url(site/images/triptych_wildlife.jpg)";
			triptych2.style.backgroundImage = "url(site/images/triptych_land.jpg)";
			triptych3.style.backgroundImage = "url(site/images/triptych_water.jpg)";
			triptych1.innerHTML = "<img src=\"site/images/transparency.gif\" width=\"108\" height=\"228\" />";
			triptych2.innerHTML = "<img src=\"site/images/transparency.gif\" width=\"108\" height=\"228\" />";
			whitemarker.style.visibility = "visible";
			pagetxt.innerHTML = "The waters of the Upper Columbia River are part of the third longest river in the continental U.S. and form a vital part of the history and hydrology of this region.";
			break;
		}
		case 2 : 
		{
			tabs.style.backgroundImage = "url(site/images/tabs_wildlife.gif)" ;
			triptych1.style.backgroundImage = "url(site/images/triptych_land.jpg)";
			triptych2.style.backgroundImage = "url(site/images/triptych_water.jpg)";
			triptych3.style.backgroundImage = "url(site/images/triptych_wildlife.jpg)";
			triptych1.innerHTML = "<img src=\"site/images/transparency.gif\" width=\"108\" height=\"228\" />";
			triptych2.innerHTML = "<img src=\"site/images/transparency.gif\" width=\"108\" height=\"228\" />";
			whitemarker.style.visibility = "visible";
			pagetxt.innerHTML = "The land and water of the Upper Columbia River form an ecosystem that is host to a diverse population of wildlife, from microscopic organisms, to numerous species of fish, birds, mammals and more.";
			break;
		}
		case 3 : 
		{
			tabs.style.backgroundImage = "url(site/images/tabs_land.gif)" ;
			triptych1.style.backgroundImage = "url(site/images/triptych_water.jpg)";
			triptych2.style.backgroundImage = "url(site/images/triptych_wildlife.jpg)";
			triptych3.style.backgroundImage = "url(site/images/triptych_land.jpg)";
			triptych1.innerHTML = "<img src=\"site/images/transparency.gif\" width=\"108\" height=\"228\" />";
			triptych2.innerHTML = "<img src=\"site/images/transparency.gif\" width=\"108\" height=\"228\" />";
			whitemarker.style.visibility = "visible";
			pagetxt.innerHTML = "The Upper Columbia River is a unique and special place with historical, cultural, economical, and recreational significance for the people of this region. ";
			break;
		}
	}
}

// Function to move the orange indicator on text menu.
function showtxtindicator(mode)
{
	var obj = document.getElementById('textlinkindicator');
	switch(mode)
	{
		case 0 : obj.style.top = "5px";break;
		case 1 : obj.style.top = "24px";break;
		case 2 : obj.style.top = "43px";break;
		case 3 : obj.style.top = "62px";break;
		case 4 : obj.style.top = "81px";break;
		case 5 : obj.style.top = "100px";break;
		case 6 : obj.style.top = "119px";break;
		case 7 : obj.style.top = "138px";break;
		case 8 : obj.style.top = "158px";break;
	}
}

function loginmouseover(mode)
{
	var submitbutton = document.getElementById('submit');
	var loginwarning = document.getElementById('loginwarning');
	if (mode == 1)
	{
		loginwarning.style.visibility="visible";
	}
	else if (mode == 0)
	{
		loginwarning.style.visibility="hidden";	
	}
	
}

function loginSubmit(){
	var obj = document.getElementById('RegisteredLoginForm_LoginForm');
	obj.submit();
}
