function popup(mylink, windowname)
{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	window.open(href, windowname, 'width=350,height=350,scrollbars=no');
	return false;
}

function checkUncheckAll(theElement) {
 var theForm = theElement.form, z = 0;
 for(z=0; z < theForm.length;z++){
  if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
  theForm[z].checked = theElement.checked;
  }
 }
}

function toggleEditable(theElement) {
 var theForm = theElement.form, z = 0;
 try
 {
  for(z=0; z < theForm.length;z++){
   if(theElement.checked && theForm[z].name.substring(0,3) == "shp")
   {
  	theForm[z].disabled = true;
   }
   else
   {
	theForm[z].disabled = false;
   }
  }
 }
 catch(err)
 {//theForm was not yet an object.
 }
}

function stateAbbr(o)
{
	o.value=o.value.toUpperCase().replace(/([^A-Z])/g,"")   
}

