// break out of frames if we're in them
if (parent.frames.length > 0) {
  parent.location.href = self.document.location
}
function sidebarFlip(type) {
  var obj = document.getElementById('sidebar_'+type);
  var img = document.getElementById('sidebar_'+type+'_image');
  if (obj.style.display=='') {
    obj.style.display='none';
    img.src='images/tree_closed.gif';
  }
  else {
    obj.style.display='';
    img.src='images/tree_open.gif';
  }
  return(false);
}
function showProvInside(fieldName) {
  document.getElementById('provOutside').style.display='none';
  document.getElementById('provInside').style.display='';
  if (document.getElementById('prov_select').value=='--') document.getElementById('prov_select').options[0].selected = true;

	// show only canadian or us provinces depending on the country selected
	var provinces = CountryProvinces[document.getElementById('country_select').value];
	var sProv = document.getElementById('prov_select');
	for (var t=0; t<sProv.options.length; t++) {
		if (provinces[sProv.options[t].value]) {
			sProv.options[t].style.display='';
		}
		else {
			sProv.options[t].style.display='none';
		}
	}

}
function showProvOutside() {
  document.getElementById('provInside').style.display='none';
  document.getElementById('provOutside').style.display='';
  document.getElementById('prov_select').options[1].selected = true;
}
function updateProvinces() {
  // if canada or the usa is selected, show provinces / states
  if (document.getElementById('country_select').value=='CA' || document.getElementById('country_select').value=='US') {
//    alert("country is ca or us, showing inside provinces");
    showProvInside();
    return(true);
  }
  // if another country is selected show the other states field
  if (document.getElementById('country_select').value!='') {
//    alert("country is 'other', showing outside provinces");
    showProvOutside();
    return(true);
  }
  // if no country is selected, but they choose "outside canada/usa" from the provinces, show other prov
  if (document.getElementById('prov_select').value=='--') {
//    alert("province is 'other', showing outside provinces");
    showProvOutside();
    return(true);
  }
  // else show dropdown by default
//  alert("showing inside by default");
  showProvInside();
}
function disableForm() {
  document.form1.submit_cc.disabled=true;
//  document.form1.card_name.disabled=true;
//  document.form1.card_number.disabled=true;
//  document.form1.exp_month.disabled=true;
//  document.form1.exp_year.disabled=true;
}

