// NCC Exponare Functions

function gisFeedback(){
	feedbackURL = "../feedback.htm";
	window.open(feedbackURL,"NapierGISFeedback","scrollbars=NO,width=600,height=450");
}

function dataFeedback(tab,rec){
	feedbackURL = "../feedbackdata.php?tab=" + tab + "&rec=" + rec;
	window.open(feedbackURL,"NapierGISFeedback","scrollbars=NO,width=600,height=450");
}

function gisServiceRequest(){
	feedbackURL = "../ServiceRequest.php?x=" + document.exponare_x + "&y=" + document.exponare_y;
	window.open(feedbackURL,"NapierGISServiceRequest","scrollbars=NO,width=600,height=470");
}

function gisGraffitiRequest(){
	feedbackURL = "https://www.gis.napier.govt.nz/Exponare/Authorised/GraffitiRequest.aspx?x=" + document.exponare_x + "&y=" + document.exponare_y;
	//feedbackURL = "../Authorised/GraffitiRequest.aspx?x=" + document.exponare_x + "&y=" + document.exponare_y;
	window.open(feedbackURL,"NapierGISGraffitiRequest","scrollbars=YES,width=850,height=750");
}

function googleDirectionsGo(ToVal,FromX,FromY){
	if(document.getElementById("googleDirectionsTo"+ToVal).value!=""){
		var radioGrp = document.getElementsByName("googleDirectionsShowIn"+ToVal);
		if (radioGrp[0].checked) {
			//Google Maps
			myURL = "http://maps.google.co.nz/maps?saddr="+FromY+","+FromX+"&daddr="+document.getElementById("googleDirectionsTo"+ToVal).value+"&ie=UTF8&";
			window.open(myURL,"googleDirectionsResult");
		}
		if (radioGrp[1].checked) {
			//Google Earth
			myURL = "http://maps.google.co.nz/maps?saddr="+FromY+","+FromX+"&daddr="+document.getElementById("googleDirectionsTo"+ToVal).value+"&ie=UTF8&output=kml";
			window.open(myURL);
		}
		if (radioGrp[2].checked) {
			//GIS.Napier
			document.getElementById("saddr").value = FromY+","+FromX;
			document.getElementById("daddr").value = document.getElementById("googleDirectionsTo"+ToVal).value;
			__doPostBack('btnGEDirections','');
		}
	} else {
		alert("Please enter a \"To\" address!");
	}
}


function toolbarButtonOver(id){
	document.getElementById(id).className = "ButtonTEO";
}
function toolbarButtonOut(id){
	document.getElementById(id).className = "ButtonTE";
}
