function isIE() {
	if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1) { return true; }
	else { return false; }
}

function toggle(id) {
	var e = document.getElementById(id);
	var d = "block";
	if (!isIE()) {
		if (e.insertRow) { d = "table"; }
		else if (e.insertCell) { d = "table-row"; }
	}
	if (e.style.display == "none" || e.style.display == "") { e.style.display = d; }
	else { e.style.display = "none"; }
	return;
}

function clearField(field, text) {
	if (field.value == text) { field.value = ""; }
	return;
}

function fontSmall() {
  text = document.getElementById('main'); 
  text.style.fontSize = '.8em'
  return;
}

function fontMedium() {
  text = document.getElementById('main'); 
  text.style.fontSize = '1em'
  return;
}

function fontLarge() {
  text = document.getElementById('main'); 
  text.style.fontSize = '1.2em';
  return;
}


/**
+	fillField()
+
+	@requires
+		isblank()
+
+	@arguments
+		field - the DOM object whose value you wish to fill (will almost always be the self-reference of this)
+		text - the default text of the field
*/
function fillField(field, text) {
	if (isblank(field.value)) { field.value = text; }
	return;
}

// finds if a string is blank (nothing but spaces)
function isblank(x) {
	var blank = true;
	for (i = 0; i < x.length; i++) {
		if (x.charAt(i) != ' ') { blank = false; }
	}
	return blank;
}

// finds if a form value is empty
function isempty(x) {
	if (x == "" || isblank(x)) { return true; }
	else { return false; }
}

// finds if a select box has not been changed
function unchanged(x) {
	if (x.selectedIndex == 0) { return true; }
	else { return false; }
}

function rfcrequired(which){
  var pass=true;
  if (document.images){
    for (i=0;i<which.length;i++){
      var tempobj=which.elements[i];
      if (tempobj.name.substring(tempobj.name.length-4,tempobj.name.length)=="_req"){
        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 {
    if(!which.disclaimer_req.checked){alert("Please Read the disclaimer and check the box below.");
    return false; } 
  return true
  }
}

function contactrequired(which){
  var pass=true;
  if (document.images){
    for (i=0;i<which.length;i++){
      var tempobj=which.elements[i];
      if (tempobj.name.substring(tempobj.name.length-4,tempobj.name.length)=="_req"){
        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
  }
}

//JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com)
//Visit JavaScriptKit.com for free JavaScripts
//This notice must stay intact for legal use

function openpopup(popurl){
var winpops=window.open(popurl,"","width=320,height=280,")
}