var reportEnvelope;
var reportMode;
function writePropertyReport(){
	Win1 = parent.ASPFrame;
	Win1.document.open();
	var w=Win1.document.writeln;
	w('<html>');
	w('<body onload="document.rsc_prop.submit()">');
	w('<form action="asp/rsc_PropReport.asp" name="rsc_prop" method="post">');
	w('<input type="hidden" name="qsr" value="'+queryStartRecord+'">');
	w('<input type="hidden" name="sqs" value="'+setQueryString+'">');
	w('<input type="hidden" name="sm" value="'+reportMode+'">');
	w('<input type="hidden" name="se" value="'+reportEnvelope+'">');
	w('<input type="hidden" name="ht" value="www.mimapsmackay.com.au">');
	w('</form>');
	w('</body>');
	w('</html>');
	Win1.document.close();
}
var inmenu=false;
function propertyReport(newReport) {
	reportEnvelope = selectEnvelope;
	reportMode = selectionMode;
	if (newReport != "moreData")
		queryStartRecord=0;
	//Selection Layer can ONLY be the Active Layer because when the Active Layer is changed, the selection set
	// is reset to null
	SelectionLayer = lyrNm[actLyrIndex];
	if ((SelectionLayer==LandlyrNm)&&(selectCount>0)){
		writePropertyReport();		
	}else{
		alert("This report is for reporting on Land selections only - You MUST have the 'Current Land' query option checked in the Table of Contents and a number of Current Land parcels selected to generate this report.  For reporting on all other layers, including Council Land, use the Feature Report option.");
		parent.MenuFrame.menEvent=true;
	}
}

// request more records to display
function getMorePropertyData(startRecord) {
	queryStartRecord = startRecord;
	propertyReport("moreData");
}

function writeFeatureReport(){
	Win1 = parent.ASPFrame;
	Win1.document.open();
	var w=Win1.document.writeln;
	w('<html>');
	w('<body onload="document.rsc_oth.submit()">');
	w('<form action="asp/rsc_OtherReport.asp" name="rsc_oth" method="post">');
	w('<input type="hidden" name="qsr" value="'+queryStartRecord+'">');
	w('<input type="hidden" name="sqs" value="'+setQueryString+'">');
	w('<input type="hidden" name="li" value="'+ActLyr+'">');
	w('<input type="hidden" name="ms" value="'+mapSv+'">');
	w('<input type="hidden" name="nm" value="'+lyrNm[actLyrIndex]+'">');
	w('<input type="hidden" name="sm" value="'+reportMode+'">');
	w('<input type="hidden" name="se" value="'+reportEnvelope+'">');
	w('<input type="hidden" name="ht" value="www.mimapsmackay.com.au">');
	w('</form>');
	//w('<input type="button" name="submit" value="submit" onclick="document.rsc_oth.submit()"');
	w('</body>');  
	w('</html>');
	Win1.document.close();
}

function featureReport(newReport) {
	reportEnvelope = selectEnvelope;
	reportMode = selectionMode;
	if (newReport != "moreData")
		queryStartRecord=0;
	//Selection Layer can ONLY be the Active Layer because when the Active Layer is changed, the selection set
	// is reset to null
	SelectionLayer = lyrNm[actLyrIndex];
	if (SelectionLayer!=LandlyrNm){
		if (selectCount>0){
			writeFeatureReport();
		}else{
			alert("You MUST have a current selection to perform this function.");
			parent.MenuFrame.menEvent=true;
		}
	}else{
		alert("Please use the Land Report when reporting on the Current Land layer."); 
		parent.MenuFrame.menEvent=true;
	}
 }

function MCCwritePropertyReport(){ 
	Win1 = parent.ResultsFrame;
	//Win1 = window.open("","FormWindow","width=483,height=600,scrollbars=no,resizable=yes");
	Win1.document.open();
	var w=Win1.document.writeln;
	w('<html>');
	w('<body onload="document.rsc_prop.submit()">');
	w('<form action="asp/MCC_PropReport.asp" name="rsc_prop" method="post">');
	w('<input type="hidden" name="qsr" value="'+queryStartRecord+'">');
	w('<input type="hidden" name="sqs" value="'+setQueryString+'">');
	w('<input type="hidden" name="sm" value="'+reportMode+'">');
	w('<input type="hidden" name="se" value="'+reportEnvelope+'">');
	w('<input type="hidden" name="ht" value="www.mimapsmackay.com.au">'); 
	w('</form>');
	w('</body>');
	w('</html>');
	Win1.document.close();
}
