// Start Page/Disclaimer Page

// Suzanne Fliege
// PlanSight, LLC

// Code and content of the starting window over map

function createStartPage() {
	openDisclaimerStartPage();
	//openStartWithQuery();
	return false;
}

// *******************************************************************
// Sample Disclaimer Page Starter
// *******************************************************************
function openDisclaimerStartPage() {
	// maximize display layer
	document.getElementById('cxAttributeBottom').style.visibility = "visible";
	document.getElementById('cxAttributeBottom').style.top = headerHeight + "px";
	document.getElementById('cxAttributeBottom').style.width = winWidth + "px";
	document.getElementById('cxAttributeBottom').style.height = (winHeight-headerHeight) + "px";
	document.getElementById('ovHeader').style.visibility = "hidden";
	document.getElementById('cxTOC').style.visibility = "hidden";
	attDisplayMaxed = true;
	var theString = '';
	// setup content and write to the layer
	if (winWidth > 650) {
		var tableWidth = 650;
	} else {
		tableWidth = winWidth - 50;
	}
	theString += '<div align="center"><table width="' + tableWidth + '" cellspacing="0" cellpadding="0">';
	theString += '<tr><td align="center" class="header1">On-Line Mapping Service</td></tr>';
	theString += '<tr><td align="center" class="header1">Welcome to GIS Online!</td></tr>';
	theString += '<tr valign="top"><td align="center" class="toolInfo1">Welcome to This Communities Parcel Mapper!</td></tr>';
	theString += '<tr valign="top"><td><br><br>';
	theString += '<span>This service will enable you to search our <b>county-wide</b> mapping system for a particular property or any other location. You have the option of ';
	theString += 'viewing the County in detail based on a particular address, property identification number (PIN) or by zooming in to an area of interest. ';
	theString += 'This is a Geographic Information Systems (GIS) application brought to you by the <a href="http://co.goodhue.mn.us/">Goodhue County, MN</a>. ';
	theString += 'It was designed by <a href="http://www.plansight.com">PlanSight LLC</a> using <a href="http://www.esri.com/software/arcims/index.html">ArcIMS</a>.</span>';
	theString += '<br><br>';
	theString += '<span>This web service is optimized for Microsoft Internet Explorer (Version 6.0 and newer) or Mozilla Firefox (Netscape 7). ';
	theString += 'A minimum 56K internet connection and a screen resolution of 1024 x 728 are recommended. No guarantee is made that content may be viewable in other browsers and/or display settings.';
	theString += '<br>For questions regarding this service, please contact the County’s GIS Specialist at (555) 555-1212 or <a href="mailto:plansight_suzanne@yahoo.com">email</a>.</span>';
	theString += '<br><br>';
	theString += '</td></tr>';
	theString += '<tr><td class="toolInfo2" align="center">This site uses Pop-ups! If you are using a Pop-Up Blocker, you will need to turn it off.<br><br></td></tr>';
	theString += '<tr valign="top"><td align="center" class="header1">Important Information - Please Read......</td></tr>';
	theString += '<tr valign="top"><td align="center" class="toolInfo2">All information provided is considered part of the public record in accordance with applicable Minnesota Data Practices laws.</td></tr>';
	theString += '<tr valign="top"><td align="center"><table width="' + (tableWidth - 100) + '">';
	theString += '<tr><td class="toolInfo2">Map Disclaimer:</td></tr>';
	theString += '<tr><td class="toolbar">';
	theString += 'This map is neither a legally recorded map nor a survey and is not intended to be used as such.  The County/City does not guarantee the accuracy, current status, or completeness of the material contained ';
	theString += 'herein and is not responsible for any misuse or misrepresentation of this information or its derivatives.  In no event shall The County/City become liable to users of this data for any loss arising from the use or misuse of these maps.';
	theString += '<br>';
	theString += 'The tax parcel data is compiled from official records, including survey plats and deeds, but only contains the information required for The County/City business.  Original recorded source documents located in the county courthouse should be used for legal or survey purposes.';
	theString += '<br>';
	theString += 'The County/City shall remain the exclusive owner of all rights, title, and interest in all specifically copyrighted information on this website. ';
	theString += '<br>';
	theString += '</td></tr>';
	theString += '</table></td></tr>';
	theString += '<tr><td align="center">';
	theString += '<form><input type="submit" onclick="openStartWithQuery();return false;" class="toolInfo1" style="font-size: 14pt;" value="I agree to the Terms of Use"></form><br><br>';
	theString += '</td></tr>';
	theString += '<tr><td class="header1" align="center">mapping application designed by Plansight</td></tr>';
	theString += '<tr><td align="center"><a href="http://www.plansight.com"><img border="0" src="images/CX_Pro_logo.gif"></a></td></tr>';
	theString += '</table></div>';
	updateContent("cxAttributeBottom",theString);
	return false;
}

// *******************************************************************
// Sample Query Page Starter
// *******************************************************************
function openStartWithQuery() {
	// maximize display layer
	document.getElementById('cxAttributeBottom').style.visibility = "visible";
	document.getElementById('cxAttributeBottom').style.top = headerHeight + "px";
	document.getElementById('cxAttributeBottom').style.width = winWidth + "px";
	document.getElementById('cxAttributeBottom').style.height = (winHeight-headerHeight) + "px";
	document.getElementById('ovHeader').style.visibility = "hidden";
	document.getElementById('cxTOC').style.visibility = "hidden";
	attDisplayMaxed = true;
	var theString = '';
	// setup content and write to the layer
	if (winWidth > 650) {
		var tableWidth = 650;
	} else {
		tableWidth = winWidth - 50;
	}
	theString += '<div align="center"><table width="' + tableWidth + '" cellspacing="0" cellpadding="0">';
	theString += '<tr><td align="center" class="header1">On-Line Mapping Service</td></tr>';
	theString += '<tr><td align="center" class="header1">Welcome to GIS Online!</td></tr>';
	theString += '<tr valign="top"><td align="center" class="toolInfo1">Welcome to This Community\'s Parcel Mapper!</td></tr>';
	theString += '<tr valign="top"><td><br><br>';
	theString += '<span>This service will enable you to search our <b>county-wide</b> mapping system for a particular property or any other location. You have the option of ';
	theString += 'viewing the County in detail based on a particular address, property identification number (PIN) or by zooming in to an area of interest. ';
	theString += 'This is a Geographic Information Systems (GIS) application brought to you by the <a href="http://co.goodhue.mn.us/">Goodhue County, MN</a>. ';
	theString += 'It was designed by <a href="http://www.plansight.com">PlanSight LLC</a> using <a href="http://www.esri.com/software/arcims/index.html">ArcIMS</a>.</span>';
	theString += '<br><br>';
	theString += '<span>This web service is optimized for Microsoft Internet Explorer (Version 6.0 and newer) or Mozilla Firefox (Netscape 7). ';
	theString += 'A minimum 56K internet connection and a screen resolution of 1024 x 728 are recommended. No guarantee is made that content may be viewable in other browsers and/or display settings.';
	theString += '<br>For questions regarding this service, please contact the County’s GIS Specialist at (555) 555-1212 or <a href="mailto:plansight_suzanne@yahoo.com">email</a>.</span>';
	theString += '<br><br>';
	theString += '</td></tr>';
	theString += '<tr><td class="toolInfo2" align="center">This site uses Pop-ups! If you are using a Pop-Up Blocker, you will need to turn it off.<br><br></td></tr>';
	theString += '<tr valign="top"><td align="center" class="header1">Find a Property:</td></tr>';
	theString += '</table>';
	theString += '<form name="QueryStuff" onsubmit="return false;">';
	theString += '<table width="350" cellspacing="10" cellpadding="0">';
	// pin search
	theString += '<tr><td align="center" colspan="3" class="toolInfo1">Find By Property Tax ID Number</td></tr>';
	theString += '<tr><td class="toolInfo2" align="right">Property ID:</td>';
	theString += '<td align="left"><input type="Text" name="PINQueryString" size="25" maxlength="25" tabindex="1" value=\''+ defaultQueryPin +'\'></td>';
	theString += '<td align="center"><input class="toolInfo1" type="submit" onclick="checkOKtoQuery(\'pin\');return false;" value="Go!" name="submit" tabindex="2" ></td></tr>';
	theString += '<tr><td colspan="3"><hr></td></tr>';
	// address
	theString += '<tr><td align="center" colspan="3" class="toolInfo1">Find By Address</td></tr>';
	theString += '<tr><td class="toolInfo2" align="right">House Number:</td>';
	theString += '<td align="left"><input type="Text" name="NumbQueryString" size="25" maxlength="10" tabindex="3" value=\''+defaultQueryAddress+'\'></td><td></td></tr>';
	theString += '<tr><td class="toolInfo2" align="right">Street Name:</td>';
	theString += '<td align="left"><input type="Text" name="StreetQueryString" size="25" maxlength="35" tabindex="4" value=\''+defaultQueryStreet+'\'></td>';
	theString += '<td align="center"><input class="toolInfo1" type="submit" onclick="checkOKtoQuery(\'address\');return false;" value="Go!" name="submit" tabindex="5" ></td></tr>';
	theString += '<tr><td class="toolInfoSmall" align="center" colspan="3"><i>For Best Results Enter Only Street Name. (ie. "MAIN" instead of "MAIN ST W")</i></td></tr>';
	theString += '<tr><td colspan="3"><hr></td></tr>';
	// owner
	theString += '<tr><td align="center" colspan="3" class="toolInfo1">Find By Owner Name</td></tr>';
	theString += '<tr><td class="toolInfo2" align="right">Owner Name:</td>';
	theString += '<td align="left"><input type="Text" name="OwnerQueryString" size="25" maxlength="50" tabindex="6" value=\'\'></td>';
	theString += '<td align="center"><input class="toolInfo1" type="submit" onclick="checkOKtoQuery(\'owner\');return false;" value="Go!" name="submit" tabindex="7" ></td></tr>';
	theString += '<tr><td class="toolInfoSmall" align="center" colspan="3"><i>Enter all or part of a name. Just last name works best!</i></td></tr>';
	theString += '<tr><td colspan="3"><hr></td></tr>';
	// map
	theString += '<tr><td colspan="3" align="center"><input class="toolInfo1" type="submit" tabindex="0" onclick="closeStartPage();return false;" value="Just Take Me To The Map!" name="submit"></td></tr>';
	theString += '</table></form>';
	theString += '<table width="' + tableWidth + '" cellspacing="0" cellpadding="0">';
	theString += '<tr><td class="header1" align="center">mapping application designed by Plansight</td></tr>';
	theString += '<tr><td align="center"><a href="http://www.plansight.com"><img border="0" src="images/CX_Pro_logo.gif"></a></td></tr>';
	theString += '</table></form></div>';
	updateContent("cxAttributeBottom",theString);
	return false;
}

// send the query
function checkOKtoQuery(theType) {
	if (!waitForMap) {
		if (theType == "address") {
			sendAddressQuery();
		} else if (theType == "owner") {
			sendOwnerQuery();
		} else if (theType == "pin") {
			sendPINQuery();
		}
		closeStartPage();
	} else {
		alert("Please wait a moment so the application can finish loading, then try again.\nThanks for your patience!");
		return false;
	}
}

// maximize the attribute display divs
function startAttDisplayMaxed() {
	updateContent("cxAttributeBottom","");
	//document.getElementById('cxAttributeTop').style.width = winWidth + "px";
	//document.getElementById('cxAttributeBottom').style.width = winWidth + "px";
	attDisplayMaxed = true;
	return false;
}

// close/reset the attribute display divs
function closeStartPage() {
	//setupInputFormSidebar();
	updateContent("cxAttributeBottom","");
	document.getElementById('cxAttributeBottom').style.top = (headerHeight+toolmenuHeight*3+100) + "px";
	document.getElementById('cxAttributeBottom').style.height = (sidebarHeight-100) + "px";
	document.getElementById('cxAttributeBottom').style.width = sidebarWidth + "px";
	document.getElementById('cxAttributeBottom').style.visibility = "hidden";
	document.getElementById('ovHeader').style.visibility = "visible";
	attDisplayMaxed = false;
	showSidebar("cxTOC");
	return false;
}