// 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 Beltrami County<br>Internet Mapping Portal!</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="www.co.beltrami.mn.us">Beltrami County, MN</a>.</span>';
	theString += '<br><br>';
	theString += '<span><font color="#FF0000">Users are not viewing live data; instead, information is updated monthly on the system or as it becomes available to the Beltrami County GIS Department.  All information displayed within this system is considered a geographic representation of information and should not be used as certified survey results.  If individuals have property boundary issues, they are advised to contact a private licensed land surveyor and obtain an official survey of the property in question.  </font></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.</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"><table width="' + (tableWidth - 100) + '">';
	theString += '<tr><td class="toolInfo2">Map Disclaimer:</td></tr>';
	theString += '<tr><td class="toolbar">';
	theString += 'Beltrami County makes no representation or warranties expressed or implied, with respect to the reuse of data provided herewith, regardless of its format or the means of transmission. There is no guarantee or representation to the user as to the accuracy, currency, suitability, or reliability of this data for any purpose.  The user accepts the data ‘ as is’, and assumes all risks associated with its use.  By accepting this data, the user to agrees not to transmit this data or provide access to it or any part of it another party. Beltrami County assumes no responsibility for the actual or consequential damage incurred as a result of any user’s reliance on this data.';
	theString += '<br><br>Beltrami County 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.  <span><font color="#FF0000">Independent verification of all information contained on this web site should be obtained by any user.  </font></span>';
	theString += '<br><br>Beltrami County, 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 += '<form><input type="submit" onclick="closeStartPage();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 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>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="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 Novi City 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;
}