// Start Page/Disclaimer Page

// Suzanne Fliege
// PlanSight, LLC

// Code and content of the starting window over map

function createStartPage() {
	openDisclaimerStartPage();
	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";
	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 valign="top"><td><br>';
	theString += '<span>This interactive map allows the user to view data specific to the City of Roseville such as city zoning, land use, parks designations and trails as well as links to property tax and ';
	theString += 'value data updated daily from Ramsey County. Also includes a wide variety of other local datasets such as: demographics, development opportunities, topography and land cover. ';
	theString += 'Aerial imagery from 1940, 1953, 1974, 1985, 1996, 2000, 2003, 2006, and 2009 is also available.</span>';
	theString += '<br><span>This is a Geographic Information Systems (GIS) application brought to you by the Ramsey County GIS Users Group and the City of Roseville. ';
	theString += 'It was designed by <a href="http://www.plansight.com">PlanSight LLC</a> using <a href="http://www.esri.com/software/arcims/">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><br>';
	theString += '</td></tr>';
	theString += '<tr><td class="toolInfo2" align="center">This site uses pop-ups for some links and help documents!<br>If you are using a Pop-Up Blocker, you will need to turn it off to view these documents.<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 += 'Maps and documents made available to the public by the Ramsey County GIS Users Group (RCGISUG) are not legally recorded maps nor ';
	theString += 'surveys and are not intended to be used as such. The maps and documents are created as part of a Geographic Information System ';
	theString += '(GIS) that compiles records, information, and data from various city, county, state and federal sources. The source data may ';
	theString += 'contain errors. Additionally, maps and documents prepared by the GIS from multiple sources, even if derived from data that is error ';
	theString += 'free, may not be reliable due to differences in the databases or computer programs of the source materials. RCGISUG has attempted ';
	theString += 'to include more specific clarifications or advisories on the specific documents or maps however, none of the maps or documents ';
	theString += 'should be used for navigational, tracking or any other purpose requiring exacting measurement of distance or direction or ';
	theString += 'precision in the depiction of geographic features. If errors or discrepancies are found please contact (651) 792-7044. The ';
	theString += 'preceding disclaimer is provided pursuant to Minnesota Statutes §466.03, Subd. 21 (2000), and the RCGISUG shall not be liable for ';
	theString += 'any damages or claims that arise out of the user\'s access to, or use of the maps, documents and data provided.';
	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>';
	theString += '</td></tr>';
	theString += '<tr><td class="header1" align="center">Data Provided Courtesy of</td></tr>';
	theString += '<tr><td align="center"><a href="http://www.ramseygis.org"><img border="0" src="clientspecific/rgis.gif" height="60"></a>';
	theString += '<a href="http://www.co.ramsey.mn.us"><img border="0" src="clientspecific/ramseyco.jpg" ></a></td></tr>';
	theString += '<tr><td class="toolbar" align="center">';
	theString += '<b>Ramsey County base mapping and property records data</b> is current as of July 1, 2010. Questions regarding County parcel data should be directed to: Chris Ulrich (651) 266-7176 <a href="mailto:christina.ulrich@co.ramsey.mn.us">email</a><br>';
	theString += '<b>Ramsey County residential and commercial data</b> is current as of July 2010.<br>';
	theString += '<b>Aerial imagery</b> was captured in April 2006.<br>';
	theString += '<b>Historical aerial images</b> were captured in 1940, 1953, 1974, 1985, 2003, and 2006.';
	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() {
	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 class="toolInfo2" align="center"><br>This site uses pop-ups for some links and help documents!<br>If you are using a Pop-Up Blocker, you will need to turn it off to view these documents.<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" tabindex="2" 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 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="1" value=\'\'></td>';
	theString += '<td align="center"><input class="toolInfo1" type="submit" 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" style="font-size: 14pt;" 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">&nbsp;</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;
}