var windowName = null;
var url = null;
var myWindow = null;
var saveWindow = new Array();
var i = 0



//example for calling popWindow would be 
//onClick="popWindow("/assessor/help.html","HelpWindow")
function popWindow(url,windowName) {

myWindow=window.open(url,windowName,"HEIGHT=450,WIDTH=400,scrollbars,resizable,dependent");

myWindow.moveTo(255,5)
saveWindow[i] = myWindow
i++;

if (myWindow || myWindow.open) {
myWindow.focus();
	}

}

function popTestWindow(url,windowName) {

myWindow=window.open(url,windowName,"HEIGHT=450,WIDTH=400,location,scrollbars,resizable,dependent,screenX=555,screenY=4");
myWindow.moveTo(250, 5)
saveWindow[i] = myWindow
i++;

if (myWindow || myWindow.open) {
myWindow.focus();
	}

}


function popMap(url,windowName) {

myWindow=window.open(url,windowName,"HEIGHT=410,WIDTH=420,toolbar,dependent");
myWindow.moveTo(10, 10)
saveWindow[i] = myWindow
i++;

if (myWindow || myWindow.open) {
myWindow.focus();

	}
}	
	//JJ   11.05.2003 -- re SFProspector Biz detail
function popMapToLowerCorner(url,windowName,ht,wt) {

myWindow=window.open(url,windowName,"HEIGHT=410,WIDTH=420,toolbar=no,status=no,menubar=no,dependent");
myWindow.moveTo(wt+110,ht+110);
//alert(ht + " " + wt);
saveWindow[i] = myWindow;
i++;

if (myWindow || myWindow.open) {
myWindow.focus();

	}
 
}

function popWindowSize(url,windowName,h,w) {

myWindow=window.open(url,windowName,"HEIGHT="+h+",WIDTH="+w+",dependent,resizable");
saveWindow[i] = myWindow
i++;

if (myWindow || myWindow.open) {
myWindow.focus();

	}

 
}

function popWindowVar(url,windowName,h,w,corner) {

if (screen.width) {
	screenX= screen.width
	screenY= screen.height
}

else {
//can't get screen size so put it in the left corner as default
	corner="UL"
	
}


if (corner == "CTR") {
	scrX = (screenX/2)-25
	scrY = "10"
}




if (corner == "UL") {
	scrX = "10"
	scrY = "10"
}

if (corner == "LR") {
	scrX = screenX-w
	scrY = screenY-h-50
}

if (corner == "LL") {
	scrX = 10
	scrY = screenY-h-50
}

if (corner == "UR") {
	scrX = screenX-w
	scrY = 10
}

myWindow=window.open(url,windowName,"HEIGHT="+h+",WIDTH="+w+",toolbar,scrollbars,resizable,statusbar");
myWindow.moveTo(scrX, scrY)
saveWindow[i] = myWindow
i++;

if (myWindow || myWindow.open) {
myWindow.focus();
	}

}




function popMapVar(url,windowName,h,w,corner) {

if (screen.width) {
	screenX= screen.width
	screenY= screen.height
}

else {
//can't get screen size so put it in the left corner as default
	corner="UL"
	
}


if (corner == "CTR") {
	scrX = screenX/2
	scrY = screenY/2
}




if (corner == "UL") {
	scrX = "10"
	scrY = "10"
}

if (corner == "LR") {
	scrX = screenX-w
	scrY = screenY-h-50
}

if (corner == "LL") {
	scrX = 10
	scrY = screenY-h-50
}

if (corner == "UR") {
	scrX = screenX-w
	scrY = 10
}

myWindow=window.open(url,windowName,"HEIGHT="+h+",WIDTH="+w+",resizable=1,scrollbars=1");
myWindow.moveTo(scrX, scrY)
saveWindow[i] = myWindow
i++;

if (myWindow || myWindow.open) {
myWindow.focus();
	}

}
//-->
//you can use this function attached to a button
//be sure to use <body onUnload="closeMe()"> in your body tag
//this will close any window that was spawned from the original window
//if the user leaves the page
//in the case where want to keep the window open, pass the name


function closeMe(exceptWind) {

	for(i=0; i<saveWindow.length; i++) {
	if(saveWindow[i]) {
		if (saveWindow[i].name != exceptWind) {
		saveWindow[i].close()
			}
		}
	}
}


function checkAddressInput() {

	var checkString = document.address.fulladdress.value
	
	if (checkString) {
		chSpace1 = checkString.charAt(0)
	
		if (chSpace1 == " ") {
		alert("You have a space at the beginning of your address.\nPlease delete it.")
		return false;
		}
	count = 0; 
	var stnumber
	var street
	var chFirst
	var chLast
	
	
	//parse the string first make sure there's no spaces at the beginning
	
	
	
	
	//if we there's no spaces, parse and check
	splitString = checkString.split(" ")
	stnumber = splitString[0]
	street = splitString[1]
	last = splitString[2]
	
	//make an array of impermissiable street names

	var streetArray = new Array(11)
	streetArray[0] = "Ave"
	streetArray[1] = "AVE"
	streetArray[2] = "AVENUE"
	streetArray[3] = "Avenue"
	streetArray[4] = "St"
	streetArray[5] = "ST"
	streetArray[6] = "Street"
	streetArray[7] = "STREET"
	streetArray[8] = "BLVD"
	streetArray[9] = "Blvd"
	streetArray[10] = "Boulevard"
	
	
	
	
	//regular expressions to match
	number = new RegExp()
	letter = new RegExp()
	
	number = /\d/
	letter = /[a-zA-Z]/
	
	//loop through the street array
if (last) {
	for (i = 0; i < streetArray.length; i++) {
		if(last == streetArray[i]) {
		alert("Please don't enter the street type "+last+" after the street name.")
		return false;
		}
	
	}

   //check for a period in last place which would indicate street abbrev
   chLast = last.charAt(last.length-1)
   if (chLast == ".") {
   alert("Please don't enter the street type "+last+" after the street name.")
		return false;
   }
}  

if (street) {
        chFirst = street.charAt(0)
		chLast = street.charAt(street.length-1)
        // ENSURE CHARACTER IS AN ALPHA OR NUMERIC CHARACTER
		
        if (chLast.match(number)) {
		
		
		alert("Please be sure to include complete names for numbered streets and avenues.\n" +
		"For example, 1ST, 2ND, 3RD, 4TH will yield results\n" +
		"\nAlso, FOURTH, FIFTH will not yield the results desired.")
		
		return false;
        
    	}
}		
	newString = ""
	

    // check to make sure streetno is a number
    for (i = 0; i < stnumber.length; i++) {
        ch = stnumber.substring(i, i+1);

        // ENSURE CHARACTER IS AN ALPHA OR NUMERIC CHARACTER
        if ((ch >= "0" && ch <= "9") || (ch == ".")){

            newString += ch;
			
        }
    }

    if (stnumber != newString) {
      alert("You can only use numbers for street addresses.\nLetters and other punctuation including spaces is not allowed.")
        // no submission til fixed!
       return false;
     }
	else {
	return true;
	}
 
}}


//-->