function init (ev) {
	YAHOO.util.Event.addListener('submit_accident','click', visitLink);
	YAHOO.util.Event.addListener('submit_injury','click', visitLink);
}

function visitLink (ev) {
	
	var name = this.id.substring(7, 20);
	var selected = document.getElementById(name+'_select');
	//alert(selected.options[selected.selectedIndex].value);
	
	window.location = selected.options[selected.selectedIndex].value;
}

function check_send(form) {
   if(form.id=='claimForm') {
      gotowhich = ""; // Reset variable
      var element_good = returnGood(); // Copy variable from included validation functions

      if(document.getElementById('question')) {
	 textbox_OK(document.getElementById('question'), document.getElementById('question'), element_good);
      }
      else if(document.getElementById('injuryDescription')) {
	 textbox_OK(document.getElementById('injuryDescription'), document.getElementById('injuryDescription'), element_good);
      }
      textbox_OK(document.getElementById('name'), document.getElementById('name'), element_good);
      textbox_OK(document.getElementById('email'), document.getElementById('email'), element_good);
      textbox_OK(document.getElementById('phone'), document.getElementById('phone'), element_good);


      if(document.getElementById('referral') && document.getElementById('other_referral')) {
	 if(document.getElementById('referral').value=='Other') {
	    textbox_OK(document.getElementById('other_referral'), document.getElementById('other_referral'), element_good);
	 }
      }


      // == Send focus to appropriate element ==============================
      if ( gotowhich != "" ) {
	 gotowhich.focus(); // Go to the first incorrect field
	 window.scrollBy(0, -50); // Then scroll a bit above it. (Disabled for short form)
	 alert('Please check the questions marked and try again.');
	 return false;
      }
      else { // Submit form
	 return true;
      }

   }
}


YAHOO.util.Event.addListener(window, "load", init);
