// Start Page/Disclaimer Page

// Suzanne Fliege
// PlanSight, LLC

// 6-29-2007 - turn on disclaimer page

// 8-7-2007: Turn off find by owner

// 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 the Charter Township of Waterford<br>Internet Mapping Portal!</td></tr>';
	theString += '<tr valign="top"><td><br><br>';
	theString += '<span>This service will enable you to search our <b>Township-wide</b> mapping system for a particular property or other location. You have the option of ';
	theString += 'viewing Waterford Twp 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.twp.waterford.mi.us">Waterford Twp, 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, some of the data was not compiled or created by the Township.  The Charter Township of Waterford makes no warranty, expressed or implied, that the Geographic Information Systems (GIS) data used to prepare this map are error free, and the Township 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 Charter Township of Waterford makes no warranty, expressed 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 Charter Township of Waterford 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 Charter Township of Waterford, 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">Welcome to the Charter Township of Waterford<br>Internet Mapping Portal!</td></tr>';
	//theString += '<tr valign="top"><td><br><br>';
	//theString += '<span>This service will enable you to search our <b>Township-wide</b> mapping system for a particular property or any other location. You have the option of ';
	//theString += 'viewing the Township 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://www.twp.waterford.mi.us/">Waterford Twp, MI</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 Townships’s GIS Specialist at (248) 674-6227 or <a href="mailto:lpoisson@twp.waterford.mi.us">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="Begin Search by Property ID" 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="Begin Search by Address" 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="Begin Search by Owner Name" 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="Take Me Directly To The Waterford Township 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;
}