/************************************************************************************
	(c) Jason Hahn 2007

	This script was written by Jason Hahn, and is copyrighted material.  Unauthorized use is strictly prohibited.  For more information and pricing please contact us at jason@jasonhahn.com
*************************************************************************************/



function verify() {
var themessage = "You are required to complete the following fields: ";
if (document.myform2.terms.checked == false) {
themessage = themessage + " - Agreement to Workshop Terms";
}

//alert if fields are empty and cancel form submit
if (themessage == "You are required to complete the following fields: ") {
document.myform2.submit();
}
else {
alert(themessage);
return false;
   }
}



function wolfweek() {

var p1 = document.myform2.os0.value;

if (p1 == "NA") {
document.myform2.amount.value = "0";
}
else  if (p1 == "Half Weekend Deposit") {
document.myform2.amount.value = "250.00";
}
else  if (p1 == "Full Weekend Deposit") {
document.myform2.amount.value = "400.00";
}
else  if (p1 == "Half Weekend - Pay in Full") {
document.myform2.amount.value = "525.00";
}
else  if (p1 == "Full Weekend - Pay in Full") {
document.myform2.amount.value = "895.00";
}
else  if (p1 == "Half Weekend - Pay Balance less Deposit") {
document.myform2.amount.value = "275.00";
}
else  if (p1 == "Full Weekend - Pay Balance less Deposit") {
document.myform2.amount.value = "495.00";
}
else  if (p1 == "Day at Desoto Deposit") {
document.myform2.amount.value = "100.00";
}
else  if (p1 == "Day at Desoto - Pay in Full") {
document.myform2.amount.value = "325.00";
}
else  if (p1 == "Day at Desoto - Pay Balance less Deposit") {
document.myform2.amount.value = "225.00";
}

}




function pupweek() {

var p1 = document.myform2.os0.value;

if (p1 == "NA") {
document.myform2.amount.value = "0";
}
else  if (p1 == "Workshop  Deposit") {
document.myform2.amount.value = "300.00";
}
else  if (p1 == "Workshop - Pay in Full") {
document.myform2.amount.value = "695.00";
}
else  if (p1 == "Workshop - Pay Balance less Deposit") {
document.myform2.amount.value = "395.00";
}

}



function cowboy08() {

var p1 = document.myform2.os0.value;

if (p1 == "NA") {
document.myform2.amount.value = "0";
}
else  if (p1 == "All Inclusive Deposit") {
document.myform2.amount.value = "500.00";
}
else  if (p1 == "Workshop Only Deposit") {
document.myform2.amount.value = "500.00";
}
else  if (p1 == "All Inclusive - Pay in Full") {
document.myform2.amount.value = "2195.00";
}
else  if (p1 == "Workshop Only - Pay in Full") {
document.myform2.amount.value = "1895.00";
}
else  if (p1 == "All Inclusive - Pay Balance less Deposit") {
document.myform2.amount.value = "1695.00";
}
else  if (p1 == "Workshop Only - Pay Balance less Deposit") {
document.myform2.amount.value = "1395.00";
}

}



function exposure09() {

var p1 = document.myform2.os0.value;

if (p1 == "NA") {
document.myform2.amount.value = "0";
}
else  if (p1 == "Workshop  Deposit") {
document.myform2.amount.value = "500.00";
}
else  if (p1 == "Workshop - Pay in Full") {
document.myform2.amount.value = "1895.00";
}
else  if (p1 == "Workshop - Pay Balance less Deposit") {
document.myform2.amount.value = "1395.00";
}

}



function birdsofprey() {

var p1 = document.myform2.os0.value;

if (p1 == "NA") {
document.myform2.amount.value = "0";
}

else  if (p1 == "Full Weekend Deposit") {
document.myform2.amount.value = "50.00";
}

else  if (p1 == "Full Weekend - Pay in Full") {
document.myform2.amount.value = "325.00";
}
else  if (p1 == "Full Weekend - Pay Balance less Deposit") {
document.myform2.amount.value = "275.00";
}

}



function horses09() {

var p1 = document.myform2.os0.value;

if (p1 == "NA") {
document.myform2.amount.value = "0";
}
else  if (p1 == "Workshop  Deposit") {
document.myform2.amount.value = "500.00";
}
else  if (p1 == "Workshop - Pay in Full") {
document.myform2.amount.value = "1495.00";
}
else  if (p1 == "Workshop - Pay Balance less Deposit") {
document.myform2.amount.value = "895.00";
}

}



function hahn1on1() {

var p1 = document.myform2.os0.value;

if (p1 == "NA") {
document.myform2.amount.value = "0";
}
else  if (p1 == "Day at Desoto - Deposit") {
document.myform2.amount.value = "100.00";
}
else  if (p1 == "Day at Desoto - Full Day - Pay in Full") {
document.myform2.amount.value = "375.00";
}
else  if (p1 == "Day at Desoto - Full Day - Pay Balance less Deposit") {
document.myform2.amount.value = "375.00";
}
else  if (p1 == "Day at Desoto - Half Day - Pay in Full") {
document.myform2.amount.value = "375.00";
}
else  if (p1 == "Day at Desoto - Half Day - Pay Balance less Deposit") {
document.myform2.amount.value = "375.00";
}


}



/*
Honeymoon Island
Dunedin, FL
Jason
One-on-one, by arrangement, February - April (intermediate +)
$375 - full day, $225 - ½ day, $340 - additional consecutive full days, $100 deposit

Hillsborough River
Tampa, FL
Jason
One-on-one, by arrangement, year round
$375 - full day, $225 - ½ day, $340 - additional consecutive full days, $100 deposit

Myakka River
Sarasota, FL
Jason
One-on-one, by arrangement, mid September - May
$395 - full day, $245 - ½ day, $355 - additional consecutive full days, $100 deposit

Everglades
Everglades, FL 
     East (Anhinga Trail, Flamingo, Pa-Ha-Okie)
     West (Shark Valley, Big Cypress Refuge, Corkscrew Swamp Sanctuary)
Jason
One-on-one, by arrangement, November - April
$595 - full day, $450 - additional consecutive full days, $200 deposit
*/

/*

function dynamicSelect(id1, id2) {
 	// Feature test to see if there is enough W3C DOM support
 	if (document.getElementById && document.getElementsByTagName) {
  		// Obtain references to both select boxes
  		var sel1 = document.getElementById(id1);
  		var sel2 = document.getElementById(id2);
  		// Clone the dynamic select box
  		var clone = sel2.cloneNode(true);
  		// Obtain references to all cloned options
  		var clonedOptions = clone.getElementsByTagName("option");
  		// Onload init: call a generic function to display the related options in the dynamic select box
  		refreshDynamicSelectOptions(sel1, sel2, clonedOptions);
  		// Onchange of the main select box: call a generic function to display the related options in the dynamic select box
  		sel1.onchange = function() {
   			refreshDynamicSelectOptions(sel1, sel2, clonedOptions);
  		};
 	}
}

function refreshDynamicSelectOptions(sel1, sel2, clonedOptions) {
 	// Delete all options of the dynamic select box
 	while (sel2.options.length) {
  		sel2.remove(0);
 	}
 	// Create regular expression objects for "select" and the value of the selected option of the main select box as class names
 	var pattern1 = /( |^)(select)( |$)/;
 	var pattern2 = new RegExp("( |^)(" + sel1.options[sel1.selectedIndex].value + ")( |$)");
 	// Iterate through all cloned options
 	for (var i = 0; i < clonedOptions.length; i++) {
  		// If the classname of a cloned option either equals "select" or equals the value of the selected option of the main select box
  		if (clonedOptions[i].className.match(pattern1) || clonedOptions[i].className.match(pattern2)) {
 	 		 // Clone the option from the hidden option pool and append it to the dynamic select box
  		 	sel2.appendChild(clonedOptions[i].cloneNode(true));
  		}
 	}
}

// Multiple onload function created by: Simon Willison
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

// addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);
addLoadEvent(function() {
dynamicSelect("pda-brand", "pda-type");
});
*/




// function switchDiv()
//  this function takes the id of a div
//  and calls the other functions required
//  to show that div
//
function switchDiv(div_id)
{
  var style_sheet = getStyleObject(div_id);
  if (style_sheet)
  {
    hideAll();
    changeObjectVisibility(div_id,"visible");
  }
  else 
  {
    alert("sorry, this only works in browsers that do Dynamic HTML");
  }
}

// function hideAll()
//  hides a bunch of divs
//
function hideAll()
{
   changeObjectVisibility("ez","hidden");
   changeObjectVisibility("full","hidden");
   changeObjectVisibility("superduper","hidden");
}

// function getStyleObject(string) -> returns style object
//  given a string containing the id of an object
//  the function returns the stylesheet of that object
//  or false if it can't find a stylesheet.  Handles
//  cross-browser compatibility issues.
//
function getStyleObject(objectId) {
  // checkW3C DOM, then MSIE 4, then NN 4.
  //
  if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId).style;
   }
   else if (document.all && document.all(objectId)) {  
	return document.all(objectId).style;
   } 
   else if (document.layers && document.layers[objectId]) { 
	return document.layers[objectId];
   } else {
	return false;
   }
}

function changeObjectVisibility(objectId, newVisibility) {
    // first get a reference to the cross-browser style object 
    // and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
}
