<!--
/*
Display sidebar menu items
by Earl A. Zortman (www.earlzortman.com)
*/
function displaySidebar() {
 document.write('<p style="text-align: center;">')
 document.write('<input class="menuBTN" type="button" name="home" value="Home" onclick="window.location=\'index.htm\'" /><br />')
 document.write('<input class="menuBTN" type="button" name="bear" value="Bear Hunts" onclick="window.location=\'bear.htm\'" /><br />')
 document.write('<input class="menuBTN" type="button" name="sheep" value="Sheep Hunts" onclick="window.location=\'sheep.htm\'" /><br />')
 document.write('<input class="menuBTN" type="button" name="goat" value="Goat Hunts" onclick="window.location=\'goat.htm\'" /><br />')
 document.write('<input class="menuBTN" type="button" name="rates" value="Rates" onclick="window.location=\'rates.htm\'" /><br />')
 document.write('<input class="menuBTN" type="button" name="photos" value="Photos" onclick="window.location=\'photos.php\'" title="Photo Galleries" /><br />')
 document.write('<input class="menuBTN" type="button" name="equipment" value="Equipment" onclick="window.location=\'equipment.htm\'" /><br />')
 document.write('<input class="menuBTN" type="button" name="us" value="About Us" onclick="window.location=\'about.htm\'" /><br />')
 document.write('<input class="menuBTN" type="button" name="links" value="Links" onclick="window.location=\'links.htm\'" /><br />')				
 document.write('<input class="menuBTN" type="button" name="contact" value="Contact Us" onclick="window.location=\'contact.htm\'" /></p>')

 document.write('<br /><br /><br /><br /><p class="contact">30235 List Circle<br />Eagle River, AK 99577<br />')
 document.write('Phone: (907) 223-6181<br /> or (907) 622-4259<br />')
 document.write('<a href="mailto:bookram@hotmail.com">bookram@hotmail.com</a></p>')
 
} // end function displaySidebar

/*
Fix the size of the Header Image, overcomes IE not following some CSS rules
by Earl A. Zortman (www.earlzortman.com)
*/
function fixHeaderSize() {
 document.getElementById('imgbg').width=document.body.clientWidth-5
} // end function fixHeaderSize

/*
Advanced Email Check credit-
By JavaScript Kit (http://www.javascriptkit.com)
Over 200+ free scripts here!
INSTRUCTIONS: Ensure you name your form tag, it's the second element in the
							'var str' and email field is the third element
*/
function checkemail(){
  var str=document.getElementById('contact').requiredemail.value
  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
  if (filter.test(str)){
	  testresults=true
  }else{
    alert("Please input a valid email address!")
    testresults=false
  }
  return (testresults)
}
/*
Check required form elements script-
By JavaScript Kit (http://javascriptkit.com)
Over 200+ free scripts here!
NOTE:  Does not work if the form has a fieldset tag
INSTRUCTIONS: Add 'required' in front of the the name elements of the items
							would check
							Add 'onsubmit="return checkrequired(this)" ' to the form tag
*/
function checkrequiredmail(which){
  var pass=true
	if (!checkemail()){
		return false
	}
  if (document.images){
	 for (i=0;i<which.length;i++){
		 var tempobj=which.elements[i]
		 if (tempobj.name.substring(0,8)=="required"){
	 		if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
				 pass=false
				 break
			}
	   }
	 }
  }
  if (!pass){
  	 alert("One or more of the required elements are not completed. Please complete them, then submit again!")
  	 return false
  }
  else{
  		return true
  }
} // end function checkrequired(which)

function checkrequired(which){
  var pass=true
  if (document.images){
	 for (i=0;i<which.length;i++){
		 var tempobj=which.elements[i]
		 if (tempobj.name.substring(0,8)=="required"){
	 		if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
				 pass=false
				 break
			}
	   }
	 }
  }
  if (!pass){
  	 alert("One or more of the required elements are not completed. Please complete them, then submit again!")
  	 return false
  }
  else{
  		return true
  }
} // end function checkrequired(which)
-->