// 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">Welcome to City of Novi<br>Internet Mapping Portal!</td></tr>';
	theString += '<tr valign="top"><td><br><br>';
	theString += '<span>This service will enable you to search our <b>City-wide</b> mapping system for a particular property or any other location. You have the option of ';
	theString += 'viewing the City of Novi 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="www.cityofnovi.org">City of Novi, MI</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><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"><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 one.  This map is a compilation of records, information, and data located in various city, county, state, and federal offices and other sources regarding the area shown, and is to be used for reference purposes only.  However, much of the data was not compiled or created by the City of Novi.  The City of Novi makes no warranty, express or implied, that the Geographic Information Systems (GIS) Data used to prepare this map are error free, and the City of Novi does not represent that the GIS Data can be used for navigational, tracking, or any other purpose requiring exacting measurement of distance or direction or precision in the depiction of geographic features.  The City of Novi makes no warranty, express or implied, as to the accuracy, completeness, or usefulness of the information presented.  Official records should be used as a primary information source for verification of the information provided on these pages.  Users are advised that any use of this information is at their own risk.';
	theString += '<br><br>The City of Novi will not be liable for any claims, actions, damages, or judgments of any kind whatsoever arising out of the use or misuse of the information contained in this mapping site.  Independent verification of all information contained on this web site should be obtained by any user.';
	theString += '<br><br>The City of Novi, its employees, agents, and personnel, disclaims, and shall not be held liable for, any and all damage, loss, or liability, whether direct, indirect, or inconsequential, which arises or may arise from this web site information or the use thereof by any person or entity.';
	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>city-wide</b> mapping system for a particular property or any other location. You have the option of ';
	theString += 'viewing the City 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>.';
	theString += '</span><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>.';
	theString += '</span><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"></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="1" 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" value=\''+defaultQueryStreet+'\'></td>';
	theString += '<td align="center"><input class="toolInfo1" type="submit" onclick="checkOKtoQuery(\'address\');return false;" value="Go!" name="submit"></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 Taxpayer Name</td></tr>';
	theString += '<tr><td class="toolInfo2" align="right">Taxpayer Name:</td>';
	theString += '<td align="left"><input type="Text" name="OwnerQueryString" size="25" maxlength="50" tabindex="1" value=\'\'></td>';
	theString += '<td align="center"><input class="toolInfo1" type="submit" tabindex="2" onclick="checkOKtoQuery(\'owner\');return false;" value="Go!" name="submit"></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" 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*(CustomSidebarMenuCount+2)+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;
}