function targetopener(mylink) {
	if (! (window.focus && window.opener))return true;
	window.opener.focus();
	window.opener.location.href=mylink.href;
	window.focus();
	return false;
}

function strength_window() {
    var props = "scrollBars=no,resizable=no,toolbar=no,menubar=no,location=no,directories=no, width=510,height=310,left=350,top=50";
    window.open("/strengths/main.html", "strength_win", props).focus();
}

// pops up small window containing url
function small_window( url ) {
    var props = "scrollBars=yes,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width=350,height=200,left=300,top=200";
    window.open( url, "sm_win", props).focus();
}

// pops up medium window containing url
function med_window( url ) {
    var props = "scrollBars=yes,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width=450,height=400,left=300,top=200";
    window.open( url, "med_win", props).focus();
}

// pops up large window containing url
function large_window( url ) {
    var props = "scrollBars=yes,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width=640,height=700,left=300,top=0";
    window.open( url, "lg_win", props).focus();
}

function checkAll(){
   for (var i=0;i<document.forms[0].elements.length;i++)
   {
 	var e=document.forms[0].elements[i];
	if ((e.name != 'allbox') && (e.type=='checkbox'))
	   {
	      e.checked=document.forms[0].allbox.checked;
	   }
	}
}

function hideDiv(element) {
    if (document.getElementById) {
	// W3C standard
	var style2 = document.getElementById(element.id).style;
	style2.display = "none";
   }
   else if (document.all) {
        // old MSIE versions
	var style2 = document.all[element].style;
	style2.display = "block";
   }
   else if (document.layers) {
	// Netscape 4
	var style2 = document.layers[element].style;
	style2.display = "block";
   }
}

function showDiv(element) {
   if (document.getElementById) {
	// W3C standard
	var style2 = document.getElementById(element).style;
	style2.display = "";
   }
   else if (document.all) {
        // old MSIE versions
	var style2 = document.all[element].style;
	style2.display = "";
   }
   else if (document.layers) {
	// Netscape 4
	var style2 = document.layers[element].style;
	style2.display = "";
   }
}

function hideFormFields()
{
	var trNodeList = document.getElementsByTagName('tr');
	var name;
	for (i = 0; i < trNodeList.length; i++) {
		// get name
		if (trNodeList[i].getAttribute('class')){
			// alert(trNodeList[i].getAttribute('class'));
			name = trNodeList[i].getAttribute('class');
		} else {
			// alert(trNodeList[i].className);
			name = trNodeList[i].className
		}

		if (name != null && name == "hideMe") {
			// set visibility
			trNodeList[i].style.display = "none";
		}
	}
}

function showFormFields()
{
	var trNodeList = document.getElementsByTagName('tr');
	var name;
	for (i = 0; i < trNodeList.length; i++) {
		// get name
		if (trNodeList[i].getAttribute('class')){
			// alert(trNodeList[i].getAttribute('class'));
			name = trNodeList[i].getAttribute('class');
		} else {
			// alert(trNodeList[i].className);
			name = trNodeList[i].className
		}

		if (name != null && name == "hideMe") {
			// set visibility
			trNodeList[i].style.display = "";
		}
	}
}

function showOtherTextField(selected, element) {
   if (document.getElementById) {
    if (selected == "Other") {
      document.getElementById('txtOther').style.visibility='visible';
	}
	else document.getElementById('txtOther').style.visibility='hidden';
   }
   else if (document.all) {
        // old MSIE versions
	var style2 = document.all[element].style;
	style2.display = "";
   }
   else if (document.layers) {
	// Netscape 4
	var style2 = document.layers[element].style;
	style2.display = "";
   }
}

function validate_footer() {
  validity = true; // assume valid
  var alertStr = "";
  if (!check_empty(document.forms[0].area_interest.value)) {
  	validity = false;
  	alertStr += "Area of Interest is required.\n";
  }
  if (!check_empty(document.forms[0].first_name.value)) {
  	validity = false;
  	alertStr += "First name is required.\n";
  }

  if (!check_empty(document.forms[0].last_name.value)) {
  	validity = false;
  	alertStr += "Last name is required.\n";
  }

  if (!check_empty(document.forms[0].txtCOC.value)) {
  	validity = false;
  	alertStr += "Country of Citizenship is required.\n";
  }

  if (document.forms[0].DropDownList1.options[this.selectedIndex].value == "--Please select--") {
    	validity = false;
    	alertStr += "Please select How You Heard About Us.\n";
  }

  if (document.forms[0].DropDownList1.options[this.selectedIndex].value == "Other" &&
  		!check_empty(document.forms[0].txtOther.value) ) {
    	validity = false;
    	alertStr += "Please describe how you heard about us.\n";
  }

  if (!check_empty(document.forms[0].email_address.value)) {
    	validity = false;
    	alertStr += "E-mail is required.\n";
  }

  if ( !validity ) {
  	alert ( alertStr );
  }

  return validity;
}