// opens url on current page
function gotoURL (url)
{
	window.location.href = url;
}
// sets a random banner at the top of page
function setRandomBanner()
{	
	// var randomnumber=Math.floor(Math.random()*11)
	// where 11 dictates that the random number will fall between 0-10. 
	// To increase the range to, say, 100, simply change 11 to 101 instead.
	var imgPath;
	var imgTitle;
	var bannerTextLeftPosition = "50px";
	var randomNum = Math.floor(Math.random()*6);
	
	switch(randomNum)
	{
		case 1:
			imgPath = "images/banners/bg_tosca.jpg";
			imgTitle = "Tosca";
			break;
		case 2:
			imgPath = "images/banners/bg_pollock.jpg";
			imgTitle = "Jackson Pollock";
			break;
		case 3:
			imgPath = "images/banners/bg_porkies.jpg";
			imgTitle = "Big Creek River";
			//bannerTextLeftPosition = "350px";
			break;
		case 4:
			imgPath = "images/banners/bg_sunset.jpg";
			imgTitle = "Ketchikan";
			break;
		case 5:
			imgPath = "images/banners/bg_rockymnts.jpg";
			imgTitle = "Rockies";
			break;
		default:
			imgPath = "images/banners/bg_me.jpg";
			imgTitle = "Great Barrier";
			break;
	}
	document.getElementById("banner").style.background="url(" + imgPath + ")";
	document.getElementById("banner").title = imgTitle;
	document.getElementById("bannerText").style.left = bannerTextLeftPosition;
}

// highlights the selected control
function setHiLite (element, bordColor)
{
	if (bordColor == null) bordColor = "#00FF66";
	element.style.borderColor=bordColor;
}

// removes highlight
function removeHiLite (element)
{
	element.style.borderColor="";
}

// auto-heights the passed-in iframe
function autoIframe(frameId){
	try{
		frame = document.getElementById(frameId);
		innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
		objToResize = (frame.style) ? frame.style : frame;
		objToResize.height = innerDoc.body.scrollHeight + 10;
	}
	catch(err){
		window.status = err.message;
	}
}

function fnGetToTopLink()
{	
	return "<div align='right' style='position:relative; right:40px;'>" +
				"<a style='font-size:10px; font-style:normal; font-family:Verdana, Arial, Helvetica, sans-serif;' href='#abTop' title='Scroll To Top'>" +
					"top &uarr;</a>" +
			"</div>"
}
