function CountryChoice(form) // select the country to display from the drop down list
{
	var myindex=form.CountryBox.selectedIndex // get info from the form
	showLink(form.CountryBox.options[myindex].value); // display links in new window
}

function displayLinks() // create the code to show the drop down list
{
	clearScreen() // clear the screen;

	isLinksLayerDisplayed=true; // flag stating state of the link layers are displayed

	var tempList = '' // initialize the drop down list to null

	// -- links --

	// -- layer for a background to the link window
	tempList+="<div id='divlinkBckGnd' style='POSITION: absolute; VISIBILITY: visible;";
	tempList+=" TOP: 0px; LEFT: 0px; WIDTH: 100px; HEIGHT: 100px;";
	tempList+=" z-Index: 100; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);'>";
	tempList+="<table id='divBckGndTable' background='images/index/olive.green.jpg'><tr>";
	tempList+="<td><center>&nbsp</center></td></tr></table>";
	tempList+="</div>";

	// -- link through the picture
	tempList+="<div id='linkPicture' style='POSITION: absolute; VISIBILITY: visible;";
	tempList+=" TOP: 100px; LEFT: 100px; WIDTH: 360px; z-Index: 200;'>";
	tempList+="<center><P class='"+css_feature+"'>Click on the map to see the links from the different continents.</p>";
	tempList+="<img id='GlobalPic' src='images/links/world-map-sm.gif' border='0' width='360'><br>";
	tempList+="</div>";


	// -- layer for additional information --	
	tempList+="<div id='linkadd' style='POSITION: absolute; VISIBILITY: visible;";
	tempList+=" TOP: 100px; LEFT: 100px; WIDTH: 100px; z-Index: 200;'>";
	tempList+="<center><P class='"+css_feature+"'>If you would like to add your link to this page please";
	tempList+=" <BR><A HREF=\"mailto:wahmbearz@shaw.ca?subject='adding links'\">Email me.</A></P>"
	tempList+="<a href='http://www.topteddybears.co.uk/topsites/in.php?id=wahmbear' target='_blank'>";
	tempList+="<img border='0' src='images/links/topteddybears.gif'></a>";
	tempList+="</div>";

	// -- layer for north american links --

	tempList+="<div id='linkNorthAm' style='POSITION: absolute; VISIBILITY: visible;";
	tempList+=" TOP: 100px; LEFT: 100px; WIDTH: 100px; z-Index: 300;'>";
	tempList+="<center><a class='"+css_maplink+"' href='javascript:showLink(\"nsa\")'";
	tempList+=" onmouseover='highRegion(\"nsa\")' onmouseout='lowRegion(\"nsa\")'>";
	tempList+="North and South America</a></center>"
	tempList+="</div>";

	// -- layer for european links --

	tempList+="<div id='linkEurope' style='POSITION: absolute; VISIBILITY: visible;";
	tempList+=" TOP: 100px; LEFT: 100px; WIDTH: 100px; z-Index: 300;'>";
	tempList+="<center><a class='"+css_maplink+"' href='javascript:showLink(\"europe\")'";
	tempList+=" onmouseover='highRegion(\"europe\")' onmouseout='lowRegion(\"europe\")'>";
	tempList+="Europe</a></center>"
	tempList+="</div>";

	// -- layer for asian links --

	tempList+="<div id='linkAsia' style='POSITION: absolute; VISIBILITY: visible;";
	tempList+=" TOP: 100px; LEFT: 100px; WIDTH: 100px; z-Index: 300;'>";
	tempList+="<center><a class='"+css_maplink+"' href='javascript:showLink(\"asia\")'";
	tempList+=" onmouseover='highRegion(\"asia\")' onmouseout='lowRegion(\"asia\")'>";
	tempList+="Asia</a></center>"
	tempList+="</div>";

	// -- layer for australian links --
	
	tempList+="<div id='linkAustralia' style='POSITION: absolute; VISIBILITY: visible;";
	tempList+=" TOP: 100px; LEFT: 100px; WIDTH: 100px; z-Index: 300;'>";
	tempList+="<center><a class='"+css_maplink+"' href='javascript:showLink(\"ocean\")'";
	tempList+=" onmouseover='highRegion(\"ocean\")' onmouseout='lowRegion(\"ocean\")'>";
	tempList+="Australia and Oceana</a></center>";
	tempList+="</div>";

	// -- layer for all links --
	
	tempList+="<div id='linkAllLinks' style='POSITION: absolute; VISIBILITY: visible;";
	tempList+=" TOP: 100px; LEFT: 100px; WIDTH: 100px; z-Index: 300;'>";
	tempList+="<center><a class='"+css_maplink+"' href='javascript:showLink(\"ShowAllLinks\")'";
	tempList+=" onmouseover='highRegion(\"alllinks\")' onmouseout='lowRegion(\"alllinks\")'>";
	tempList+="All Links</a></center>";
	tempList+="</div>";


	// -- layer for web rings --
	tempList+="<div id='linkWebrings' style='POSITION: absolute; VISIBILITY: visible;";
	tempList+=" TOP: 100px; LEFT: 100px; WIDTH: 100px; z-Index: 300;'>";
	tempList+="<center><a class='"+css_maplink+"' href='javascript:showLink(\"webrings\")'";
	tempList+=" onmouseover='highRegion(\"webrings\")' onmouseout='lowRegion(\"webrings\")'>";
	tempList+="Webrings</a></center>";
	tempList+="</div>";


	// -- link through the drop down buttons
	tempList+="<div id='linkDisplay' style='POSITION: absolute; VISIBILITY: visible;";
	tempList+=" TOP: 100px; LEFT: 100px; WIDTH: 300px; z-Index: 200;'>";
	tempList+="<P class='"+css_feature+"'>To Quickly find links from the country of interest use the drop down list</P><BR>";
	tempList+="<form id='SelectCountry'>";
	tempList+="<select name='CountryBox' ID=Select1>";
	tempList+="<option value='ShowAllLinks'>Show All Links";
	tempList+="<option value='Canada'>Canada";
	tempList+="<option value='UnitedStates'>United States";
	tempList+="<option value='Australia'>Australia";
	tempList+="<option value='NewZealand'>New Zealand";
	tempList+="<option value='UnitedKindom'>United Kindom";
	tempList+="<option value='HongKong'>Hong Kong";
	tempList+="<option value='Sweden'>Sweden";
	tempList+="<option value='Germany'>Germany";
//	tempList+="<option value='Denmark'>Denmark";
	tempList+="<option value='Other'>Other";
	tempList+="</select>";
	tempList+="&nbsp&nbsp&nbsp&nbsp<INPUT TYPE='BUTTON' VALUE='Show Links' onClick='CountryChoice(this.form)'>";
	tempList+="</FORM>";
	tempList+="</div>";

	// layer for the link button (now in a different spot then gallery button
	// -- close button --
	tempList+="<div id='divLinkButton' style='POSITION: absolute; VISIBILITY: hidden;";
	tempList+=" TOP: 100px; LEFT: 100px; z-Index: 300';>";
	tempList+="<table><tr><td id='closeLinkButton' align='center'>";
	tempList+="&nbsp</td></tr></table>";
	tempList+="</div>";

	// write out the information to the page
	linkCanvas = GetObject('linkLayer'); // get the reference to the layer
	writeInfo(linkCanvas,tempList); // write the info out
	
	adjustLinkLayers(); // adjust the size and position of the link layers
}

function getLinkLayers() // get the pointers to the various link layers
{
	// get pointers to the layer on the page
	lnkbkgDiv=GetObject('divlinkBckGnd');
	pictDiv=GetObject('linkPicture');
	GlobeDiv=GetObject('GlobalPic');
	BckGndTableDiv=GetObject('divBckGndTable');
	addDiv=GetObject('linkadd');
	webDiv=GetObject('linkWebrings');
	northAmDiv=GetObject('linkNorthAm');
	europeDiv=GetObject('linkEurope');
	asiaDiv=GetObject('linkAsia');
	austrDiv=GetObject('linkAustralia');
	allLnkDiv=GetObject('linkAllLinks');
	dispDiv=GetObject('linkDisplay');
	displinkTtle=GetObject('divTitle');
	dispLinks=GetObject('divMain');
	dispclsBttn=GetObject('divButton');
	disLinkButton=GetObject('divLinkButton');
}


function highRegion(region) // highlight region of interest
{
	switch(region)
	{
		case 'nsa': // process links for north america
			dispInfo('Links from the North America Continent'); // display message for links
			showLinkBack('linkNorthAm') // show the highlighted background
			break;
		case 'europe':
			dispInfo('Links from Europian Continent'); // display message for links
			showLinkBack('linkEurope') // show the highlighted background
			break;
		case 'asia':
			dispInfo('Links from the Asian Continent'); // display message for links
			showLinkBack('linkAsia') // show the highlighted background
			break;
		case 'ocean':
			dispInfo('Links from across Oceana'); // display message for links
			showLinkBack('linkAustralia') // show the highlighted background
			break;
		case 'alllinks':
			dispInfo('Links from around the world'); // display message for links
			showLinkBack('linkAllLinks') // show the highlighted background
			break;
		case 'webrings':
			dispInfo('Look at the Various Web Rings associated with this site.'); // display message for links
			showLinkBack('linkWebrings') // show the highlighted background
			break;
	}
}

function lowRegion(region)
{
	switch(region)
	{
		case 'nsa': // process links for north america
			delInfo(); // display message for links
			hideLinkBack('linkNorthAm') // hide the highlighted background
			break;
		case 'europe':
			delInfo(); // display message for links
			hideLinkBack('linkEurope') // hide the highlighted background
			break;
		case 'asia':
			delInfo(); // display message for links
			hideLinkBack('linkAsia') // hide the highlighted background
			break;
		case 'ocean':
			delInfo(); // display message for links
			hideLinkBack('linkAustralia') // hide the highlighted background
			break;
		case 'alllinks':
			delInfo(); // display message for links
			hideLinkBack('linkAllLinks') // hide the highlighted background
			break;
		case 'webrings':
			delInfo(); // display message for links
			hideLinkBack('linkWebrings') // hide the highlighted background
			break;
	}
}

function showLinkBack(layer) // show the highlighted background
{
	bkgdLink = GetObject(layer); // get the reference to the layer
	bkgdLink.style.backgroundColor='#66CC66'; // set the back ground to white
}

function hideLinkBack(layer) // hide the highlighted background
{
	bkgdLink = GetObject(layer); // get the reference to the layer
	bkgdLink.style.backgroundColor='transparent'; // change the background back to transparent
}

function refreshLinks() // refreshes the links page
{
	clearLink_page();
	showLinks_page();
}
