<!-- Begin
//box moving  


sortitems = 1;  // Automatically sort items within lists? (1 or 0)

function move(source1, source2, func,sfunc ) {
var dupflag = 0;   //check for duplicates in function list
for(var j=0; j<func.options.length; j++){
  if(func.options[j].value == source1.value){
  	dupflag = 1;
	}
}
if(dupflag == 0){
for(var i=0; i<source1.options.length; i++) {
if(source1.options[i].selected && source1.options[i].value != "") {
var no = new Option();
no.value = source1.options[i].value;
no.text = source1.options[i].text;
func.options[func.options.length] = no;
//source1.options[i].value = "";
//source1.options[i].text = "";
   }
}
}
for(var i=0; i<source2.options.length; i++) {
if(source2.options[i].selected && source2.options[i].value != "") {
var no = new Option();
no.value = source2.options[i].value;

no.text = source2.options[i].text;
sfunc.options[sfunc.options.length] = no;
//source2.options[i].value = "";
//source2.options[i].text = "";
   }
}
//BumpUp(source2);
//BumpUp(source1);
if (sortitems) SortD(tbox);


	
if ( navigator.appName == 'Netscape') {
if (parseInt(navigator.appVersion) < 4) {
window.history.go(0);
}
else {   	
if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
window.history.go(0);
            }
         }
      }
}

function move2(source1, func) {
for(var i=0; i<source1.options.length; i++) {
if(source1.options[i].selected && source1.options[i].text != "") {
var no = new Option();
no.value = source1.options[i].text;
no.text = source1.options[i].text;
func.options[func.options.length] = no;

//source1.options[i].value = "";
//source1.options[i].text = "";
   }
}

//BumpUp(source2);
//BumpUp(source1);
if (sortitems) SortD(tbox);

//if ( navigator.appName == 'Netscape') {
//if (parseInt(navigator.appVersion) < 4) {
//window.history.go(0);
//}
//else {   	
//if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
//window.history.go(0);
//            }
  //       }
    //}
}

function moveinput(sourceValue, sourceText, func, refreshee) {

var dupflag = 0;   //check for duplicates in function list
for(var j=0; j<func.options.length; j++){
  if(func.options[j].value == sourceValue){
  	dupflag = 1;
	}
}//for

if(func.options[0] != null && (func.options[0].value == "ALL" || func.options[0].value == "Select Only Cities" || func.options[0].value == "Select Only Civil Towns") && (sourceValue != "ALL" || func.options[0].value == "Select Only Cities" || sourceValue == "Select Only Civil Towns") && sourceValue != func.options[0].value){
	removeAll(func); 
}//if

if((sourceValue == "ALL" || sourceValue == "Select Only Cities" || sourceValue == "Select Only Civil Towns") && dupflag == 0){
	removeAll(func);  
}//if

if(sourceValue != "" && dupflag == 0 && sourceValue != "Select Civil Town" && sourceValue != "Select city" && sourceValue != "Select a County") {
	
if ( navigator.appName == 'Netscape') {
	
	var no = new Option();
	no.value = sourceValue;
	no.text = sourceText;
	func.options[func.options.length] = no;
	
}//if ( navigator.appName == 'Netscape')
else{
	if(refreshee == 'opener'){
		func.options.add(opener.document.createElement("OPTION"),0);
		func.options[0].text = sourceText;
    	func.options[0].value = sourceValue;
	}
	else{
		func.options.add(window.document.createElement("OPTION"),0);
		func.options[0].text = sourceText;
    	func.options[0].value = sourceValue;
		
	}
}//else

//source1.options[i].value = "";
//source1.options[i].text = "";
 

//BumpUp(source2);
//BumpUp(source1);
if (sortitems) SortD(func);

//if (navigator.appName == 'Netscape') {
//	if (parseInt(navigator.appVersion) < 4) {
//		if(refreshee == 'opener'){
//			window.opener.history.go(0);
//		}
//		else
//			window.history.go(0);
//	}
	//else {   	

//	if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
//		if(refreshee == 'opener')
//			window.opener.history.go(0);
//		else
//			window.history.go(0);
        
    //}if (navigator.platform == 'Win32'...
	//}else { 
//}if ( navigator.appName == 'Netscape')

}//if(sourceValue != "" && dupflag == 0...
}//fucntion






function BumpUp(box)  {
for(var i=0; i<box.options.length; i++) {
if(box.options[i].value == "")  {
for(var j=i; j<box.options.length-1; j++)  {
box.options[j].value = box.options[j+1].value;
box.options[j].text = box.options[j+1].text;
}
var ln = i;
break;
   }
}
if(ln < box.options.length)  {
box.options.length -= 1;
BumpUp(box);
   }
}

function SortD(box)  {
var temp_opts = new Array();
var temp = new Object();
for(var i=0; i<box.options.length; i++)  {
temp_opts[i] = box.options[i];
}
for(var x=0; x<temp_opts.length-1; x++)  {
for(var y=(x+1); y<temp_opts.length; y++)  {
if(temp_opts[x].text > temp_opts[y].text)  {
temp = temp_opts[x].text;
temp_opts[x].text = temp_opts[y].text;
temp_opts[y].text = temp;
temp = temp_opts[x].value;
temp_opts[x].value = temp_opts[y].value;
temp_opts[y].value = temp;
      }
   }
}
for(var i=0; i<box.options.length; i++)  {
box.options[i].value = temp_opts[i].value;
box.options[i].text = temp_opts[i].text;
   }
}

function remove(func){
	for(var i=0; i<func.options.length; i++) {
		if(func.options[i].selected && func.options[i].value != "") {
			func.options[i].value = "";
			func.options[i].text = "";
		}
	}
  BumpUp(func);
}

function removeAll(func){
	for(var i=0; i<func.options.length; i++) {
		if(func.options[i].value != "") {
			func.options[i].value = "";
			func.options[i].text = "";
		}
	}
	BumpUp(func);
}

function highlight(boxlist){
	
	//convert , to @ for architect, linktext, and photo caption
	
	
	
	//highlight the multiple select boxes for submittal
	for (var i=0; i < boxlist.length; i++) {
		for(var j=0; j<boxlist[i].options.length; j++) {
			boxlist[i].options[j].selected = true;
		}
	}

}
function clearvals(form){
	removeAll(form.citylist);
	removeAll(form.civillist);
	form.histName.value = "";
	form.nrListName.value = "";
	form.address.value = "";
	form.styleForm.selectedIndex = 0;
	form.architect.value = "";
	form.resType.selectedIndex = 0;
	form.wallMat.selectedIndex = 0;
	form.strucSys.selectedIndex = 0;
	form.cnstdate.value = "";
	form.cnstdate2.value = "";
	form.mapCode.value = "";
	form.ahiNo.value = "";
	form.cultaff.value = "";
	form.township.value = "";
}