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;
	   }
	}
}

//-------------------------------------------
// Added for remote footer call
//--------------------------------------------//
function ajaxRequest(){
 var activexmodes=["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
 if (window.ActiveXObject){

  //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
  for (var i=0; i<activexmodes.length; i++){
   try{
	return new ActiveXObject(activexmodes[i])
   }
   catch(e){
	//suppress error
   }
  }
 }
 else if (window.XMLHttpRequest) // if Mozilla, Safari etc
  return new XMLHttpRequest()
 else
  return false
}

// usage: remote page, local element name, remote element name
function loadElementIntoAnotherElement(fragment_url, local_element_id, remote_element_id) {
	var mygetrequest=new ajaxRequest()
	mygetrequest.open("GET", fragment_url, true)
	mygetrequest.send(null)

	var element = this.document.getElementById(local_element_id)
	element.innerHTML = '<p><em>Loading ...</em></p>'

	if (mygetrequest.overrideMimeType){
	 mygetrequest.overrideMimeType('text/xml')
	}

	mygetrequest.onreadystatechange=function(){
	 if (mygetrequest.readyState==4){
	  if (mygetrequest.status==200){
	   var xmldata=mygetrequest.responseXML //retrieve result as an XML object
	   var footer=xmldata.getElementById(remote_element_id)
		   element.innerHTML = footer.innerHTML
	  }
	  else{
	   alert("An error has occured making the request")
	  }
	 }
	}
}

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 = "";
   }
}