//black
var light = "#ffffff"
var medium = "#858585"
var dark = "#000000"
var light_dark = "url('/Extras/gradients/white_black23.jpg')"
var light_dark_over = "url('/Extras/gradients/white_black23_over.jpg')"
var light_dark_over_b = "#474747"
var image_border = "#c7c7c7";
var text_color_dark = "black";
var text_color_light = "white";

/*
//red
var light = "#ffffff"
var medium = "#ff8585"
var dark = "#ff0000"
var light_dark = "url('/Extras/gradients/white_red23.jpg')"
var light_dark_over = "url('/Extras/gradients/white_red23_over.jpg')"
var light_dark_over_b = "#ff4848"
var image_border = "#c7c7c7";
var text_color_dark = "ff0000";
var text_color_light = "white";
*/
/*
//blue
var light = "#ffffff"
var medium = "#418ae6"
var dark = "#0000ff"
var light_dark = "url('/Extras/gradients/white_blue23.jpg')"
var light_dark_over = "url('/Extras/gradients/white_blue23_over.jpg')"
var light_dark_over_b = "#2e62ed"
var image_border = "#c7c7c7";
var text_color_dark = "0000ff";
var text_color_light = "white";
*/

var _page_name = ""
var _item_name = ""
var _advertisement = ""

//preload images
if (document.images) 
{
	img1 = new Image();
	img2 = new Image();
	img1.src = "/Extras/gradients/white_black23.jpg";
	img2.src = "/Extras/gradients/white_black23_over.jpg";
}
		
function Initialize()
{

	var values = document.getElementById('menu').getElementsByTagName("td");
	var page = ""
	var item = ""

		/*
	document.getElementById('advertising').innerHTML = '';
	
	if((screen.width < 900) && (pName == "Photos"))		
		document.getElementById('advertising').innerHTML = '';
		*/
			
	for(var a=0; a<values.length && _page_name != null; a++)
	{
		page = values[a].firstChild;
		page = page.firstChild.nodeValue;
		
		if(page == _page_name)
		{
			values[a].style.backgroundImage = "none";
			values[a].style.backgroundColor = dark;
			values[a].style.borderBottomWidth = "0"
			values[a].id = "mSelect"
			break
		}
		
	}
	
	values = document.getElementById('list').getElementsByTagName("div");
	
	for(var b=0; b<values.length && _item_name != null; b++)
	{
		item = values[b].firstChild.firstChild.nodeValue
		
		if(item == _item_name)
		{
			values[b].style.color = medium
			values[b].style.backgroundColor = light
			values[b].id = "iSelect"
			break
		}
		
	}
	
	
	AddMEvents()
	AddIEvents(_page_name)
}


function AddMEvents()
{

	var items = document.getElementById('menu').getElementsByTagName("td");


	for(var a=0; a < items.length-1; a++)
	{

		items[a].onmouseover = function(){	
			if(this.id != "mSelect")
			{
				this.style.backgroundImage = light_dark_over
				this.style.backgroundColor = light_dark_over_b
			}
		}
		
		items[a].onmouseout = function(){
	
			if(this.id != "mSelect")
			{	
				this.style.backgroundImage = light_dark
				this.style.backgroundColor = dark
			}
		
		}
		
		
		items[a].onclick = function()
		{
	
			var page= this.firstChild;
			page = page.firstChild.nodeValue;
			
		

			switch(page)
			{
			
				case "Home":
				{
					location.href="index.shtml"
					break
				}
				
				case "Photos":
				{	
					location.href="Photos_all.shtml"
					break
				}
				
				case "Videos":
				{	
					location.href="Videos_all.shtml"
					break
				}

			
			}
	
		}

	}
	
}

function AddIEvents(page)
{

	var items = document.getElementById('list').getElementsByTagName("div");

   
	for(var a=0; a<items.length; a++)
	{
	
	
		items[a].onmouseover = function()
		{	
			if(this.id != "iSelect")
			{
				this.style.color = medium
				this.style.backgroundColor = light
			
			}
		}
		
		items[a].onmouseout = function()
		{
	
			if(this.id != "iSelect")
			{	
				this.style.color = light
				this.style.backgroundColor = medium	
			}
		
		}
		
		items[a].onclick = function()
		{
		
	
			var item = this.firstChild.firstChild.nodeValue
			/*
			if (screen.width < 1024)
				document.getElementById('advertising').innerHTML = '';
			else
				document.getElementById('advertising').innerHTML = '<!--#include virtual="Advertising.html"-->';
			*/
			switch(page)
			{
				case "Home":
				{
					switch(item)
					{
						case "Welcome":
						{
							location.href="index.shtml"
							break
						}
						case "About Me":
						{
							location.href="Home_aboutme1.shtml"
							break
						}
						case "Services":
						{
							location.href="Home_services.shtml"
							break
						}
						case "Contact":
						{
							location.href="Home_contact.shtml"
							break
						}
						case "Tips and Tricks":
						{
							location.href="Home_tipsandtricks.shtml"
							break
						}
						case "Derbies in Nipigon":
						{
							location.href="Home_derbiesinnipigon1.shtml"
							break
						}
						case "Fishing & Hunting Forums & Links":
						{
							location.href="Home_fishingforums.shtml"
							break
						}
						case "Recommendations":
						{
							location.href="Home_recommend.shtml"
							break
						}
						case "Shorelunch with a bear":
						{
							location.href="Home_shorelunch.shtml"
							break
						}
						case "The spoon we got back":
						{
							location.href="Home_spoon.shtml"
							break
						}
						
					}
				
					break
				}
				case "Photos":
				{
					switch(item)
					{
						case "All":
						{
							location.href="Photos_all.shtml"
							break
						}
						case "Fish":
						{
							location.href="Photos_fish.shtml"
							break
						}
						case "Ice Fishing":
						{
							location.href="Photos_ice_fishing.shtml"
							break
						}
						case "Nipigon Destinations":
						{
							location.href="Photos_nipigon_destinations.shtml"
							break
						}
						case "Wildlife":
						{
							location.href="Photos_wildlife.shtml"
							break
						}
						case "Scenic":
						{
							location.href="Photos_scenic.shtml"
							break
						}
						
					}
				
					break
				
				}
				case "Videos":
				{
					switch(item)
					{
						case "All":
						{
							location.href="Videos_all.shtml"
							break
						}
						case "Wildlife":
						{
							location.href="Videos_wildlife.shtml"
							break
						}
						case "Ice Fishing":
						{
							location.href="Videos_icefishing.shtml"
							break
						}
						case "Fishing":
						{
							location.href="Videos_fishing.shtml"
							break
						}
					}
				
					break
				
				}
			
				
				
			}
		}

	}
		
}

function chooseList()
{
	switch(_page_name)
		{
			case "Home":
			{
				document.write("<br/>")
				document.write("<div id='list'>") 
					document.write("<h1>Main</h1>")
					document.write("<div>")
						document.write("<p>Welcome</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>About Me</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>Services</p>")
					document.write("</div>")	
					document.write("<div>")
						document.write("<p>Contact</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>Tips and Tricks</p>")
					document.write("</div>")	
					document.write("<div>")
						document.write("<p>Derbies in Nipigon</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>Fishing & Hunting Forums & Links</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>Recommendations</p>")
					document.write("</div>")				
									
					document.write("<br/>")
					document.write("<h1>Stories</h1>")		
					document.write("<div>")
						document.write("<p>Shorelunch with a bear</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>The spoon we got back</p>")
					document.write("</div>")
				document.write("</div>")
				break
			}
			case "Photos":
			{
				document.write("<br/>")
				document.write("<div id='list'>") 
					document.write("<h1>Categories</h1>")
					document.write("<div>")
						document.write("<p>All</p>")
					document.write("</div>")	
					document.write("<div>")
						document.write("<p>Fish</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>Ice Fishing</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>Nipigon Destinations</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>Wildlife</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>Scenic</p>")
					document.write("</div>")
					
				document.write("</div>")
				break
			}
			
			case "Videos":
			{
				document.write("<br/>")
				document.write("<div id='list'>") 
					document.write("<h1>Categories</h1>")
					document.write("<div>")
						document.write("<p>All</p>")
					document.write("</div>")	
					document.write("<div>")
						document.write("<p>Wildlife</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>Ice Fishing</p>")
					document.write("</div>")
					document.write("<div>")
						document.write("<p>Fishing</p>")
					document.write("</div>")
				document.write("</div>")
				break
			}
		
		}
}

function chooseAd()
{


	switch(_advertisement)
		{
			case "Recommended":
			{
				document.write('<table cellspacing="0" cellpadding="0" style="height:100%; border-style: solid; border-color: #858585; border-width:1 1 1 1">')
					document.write('<tr>')
						document.write('<td valign=top style="width:100%; ">')
							document.write('<table cellspacing="0" cellpadding="0" >')
								document.write('<tr>')
									document.write('<td style="text-align:center;">')
									document.write('<br/>')
									document.write('<h2 style="margin:0 10 1 10; ">')
									document.write('Links to Recommended Outfitters')
									document.write('</h2>')
									document.write('<br/>')
									document.write('</td>')
								document.write('</tr>')
							
								document.write('<tr>')
									document.write('<td valign=top style="width:100%; text-align:center;">')
										document.write('<a href="http://www.goldenhookcamp.com">')
											document.write('<img style="margin:0 0 10 0;border-style:none; width:140" src="/Extras/pictures/ghlogo.gif" ></img>')
										document.write('</a>')
									document.write('</td>')
								document.write('</tr>')
								document.write('<tr>')
									document.write('<td valign=top style="width:100%; text-align:center;">')
										document.write('<a href="http://www.hardcorefishing.org">')
											document.write('<img style="margin:0 0 10 0;border-style:none; width:140" src="/Extras/pictures/barry_logo_white.jpg" ></img>')
										document.write('</a>')
									document.write('</td>')
								document.write('</tr>')								
								document.write('<tr>')
									document.write('<td valign=top style="width:100%; text-align:center;">')
										document.write('<a href="Home_gravelriverresort.shtml">')
											document.write('<img style="margin:0 0 10 0; border-color:#555555; border-width:1 1 1 1; width:140" src="/Extras/pictures/gravel_river_resort.jpg" ></img>')
										document.write('</a>')
									document.write('</td>')
								document.write('</tr>')
								document.write('<tr>')
									document.write('<td valign=top style="width:100%; text-align:center;">')
										document.write('<a href="http://www.pinecrestmotel.ca/">')
											document.write('<img style="margin:0 0 10 0; border-color:#555555; border-width:1 1 1 1; width:140" src="/Extras/pictures/pinecrestmotel.jpg" ></img>')
										document.write('</a>')
									document.write('</td>')
								document.write('</tr>')
								document.write('<tr>')
									document.write('<td valign=top style="width:100%; text-align:center; ">')
										document.write('<a href="http://www.mmjjjigflies.com">')
											document.write('<img style="width:140;  border-width:1 1 1 1;" src="/Extras/pictures/mightymitch.jpg" alt="Mighty Mitch & Jungle Joe-Jig Flies"></img>')

										document.write('</a>')
										document.write('<br/>')
										document.write('<br/>')
										document.write('<br/>')
										document.write('<br/>')
										document.write('<br/>')
										document.write('<br/>')
										document.write('<br/>')
										document.write('<br/>')
										document.write('<br/>')
										document.write('<br/>')
										document.write('<br/>')
										document.write('<br/>')
									document.write('</td>')
								document.write('</tr>')	
							document.write('</table>')
						document.write('</td>')
					document.write('</tr>')	
				document.write('</table>')
				
				break
			}
		
		}
}


function resAdvertisement(name)
{
	
		if(screen.width < 1200)
		{
			_advertisement = ""
			return
		}

		switch(name)
		{
			case "Recommended":
			{
				_advertisement = "Recommended"
				break
			}
		}
		
		
}