/** **************************************************************************lp.jsInteractive Local PlanNorth KestevenVer 2 30/02 *****************************************************************************/		//********Get the Browser and version.var isNav = (navigator.appName.indexOf("Netscape")>=0)var isIE = false								var isNav4 = falsevar isIE4 = falsevar is5up = falseif (isNav) {											//Netscape								if (parseFloat(navigator.appVersion)<5) {			//Netscape 4.x or older		isNav4=true		} 	else {						//Netscape 5 +		is5up = true	}} else {							//Internet Explorer	isIE4=true	isIE=true}//*********Jump menu for map indexfunction MM_jumpMenu(targ,selObj,restore){   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");  if (restore) selObj.selectedIndex=0;}//*********Opens new window for copyright etc.....function openWindow(theURL){		if(theURL == "copyright.htm"){			winName =  "Copyright"			wid = "650"			hi = "200"		}		else if(theURL == "how_to_use.htm"){			winName =  "How_to_use"			wid = "830"			hi = "630"		}				features = "toolbar=yes,scrollbars=yes,resizable=yes,width=" + wid + ",height=" + hi		window.open(theURL,winName,features)}//*********Opens new window relevant map keyfunction openKey() {	//Get the name/number of the inset	var cmdString = parent.document.location.search	var theName =  cmdString.substring(1,(cmdString.length - 4)).toUpperCase()	//Set the relevant key to display.	if(theName == "INSET_038"){		var thekey = "key1.htm"		var theheight = "520"		var thewidth = "640"	}	else if(theName == "INSET_052"){		var thekey = "key2.htm"		var theheight = "550"		var thewidth = "640"	}	else if(theName == "PROPOSAL"){		var thekey = "key4.htm"		var theheight = "600"		var thewidth = "640"	}	else{		var thekey = "key3.htm"		var theheight = "700"		var thewidth = "640"	}	features = "scrollbars=yes,resizable=yes,width=" + thewidth + ",height="+ theheight	window.open(thekey,"key",features)}//*********Moves the Layer (locator box) on the overview map.function movelayer(theNum,x,y) {	//IE ajust (check this out)	if (isNav == false) {					x = x + 2		y = y + 10	}		//Get the layer		var name = "loclayer" + String(theNum)  	var layer = getLayer(name)		//Move it  	if (isNav4){    	layer.moveTo(x, y)	}	else {    	layer.left = x + "px"   		layer.top  = y + "px"	}}//**********Gets the layer name (4 locator box)function getLayer(name) {	if (isNav4){	   	return(document.layers[name])	}	else if (isIE4) {		layer = eval('document.all.' + name + '.style') 	    return(layer)	} 	else if (is5up) {		var theObj = document.getElementById(name)			return theObj.style	}	else{	   	 return(null)	}}//**********Updates the main map from the main overview mapfunction updatemap(e){	//Function not implemented.}//**********Updates the main map from the inset overview mapfunction updatemap2(e){	//Get the current overview image.	var cmdString = parent.document.location.search	var sep	for (n=0;n<  cmdString.length; n++){		var teststring = cmdString.substring(n,(n + 1))		if(teststring == "_"){			sep = n		}	}	var theName = cmdString .substring(1 ,sep)			// Insert output from 'navarray.txt' below			//Set up the array for required info about each inset maps.	//Map name,origin X of overview inset frame,origin Y of overview inset frame,width of overview inset frame,blx of map grid,bly of map grid,trx of map grid,try of map grid,Grid Size,Grid Overlap,no. of rows,no. of cols	var theinsetsmaps = new Array (70)	theinsetsmaps[0] = new Array("inset_010",500332,366264,2546.6,500200,366600,503200,368800,600,200,5,7)	theinsetsmaps[1] = new Array("inset_024",514269,342092,1227.62,514400,342000,515400,343400,400,200,6,4)	theinsetsmaps[2] = new Array("inset_064",505339,334309,1365.09,505400,334200,506600,335800,400,200,7,5)	theinsetsmaps[3] = new Array("inset_051",493365,370465,2161.37,493200,370800,495800,372600,600,200,4,6)	theinsetsmaps[4] = new Array("inset_019",489359,369324,1365.09,489400,369200,490600,370800,400,200,7,5)	theinsetsmaps[5] = new Array("inset_041",484314,366334,1365.09,484400,366200,485600,367800,400,200,7,5)	theinsetsmaps[6] = new Array("inset_022",487018,366424,1370.08,487200,366400,488200,367800,400,200,6,4)	theinsetsmaps[7] = new Array("inset_060",490079,364802,1365.09,490200,364800,491400,366200,400,200,6,5)	theinsetsmaps[8] = new Array("inset_053",493113,363946,1302.65,493200,363800,494400,365400,400,200,7,5)	theinsetsmaps[9] = new Array("inset_013",498220,368853,1364.79,498200,369000,499600,370200,400,200,5,6)	theinsetsmaps[10] = new Array("inset_009",497053,366358,2161.74,497200,366200,499000,368600,400,200,11,8)	theinsetsmaps[11] = new Array("inset_011",505745,368713,682.544,505600,368800,506600,369400,400,200,2,4)	theinsetsmaps[12] = new Array("inset_044",504809,365594,1365.09,505000,365400,506000,367000,400,200,7,4)	theinsetsmaps[13] = new Array("inset_037",505319,363653,1365.09,505200,363800,506800,365000,400,200,5,7)	theinsetsmaps[14] = new Array("inset_021",505749,362200,1501.52,506000,362000,507000,363800,400,200,8,4)	theinsetsmaps[15] = new Array("inset_007",506192,359458,1365.09,506400,359400,507400,361000,400,200,7,4)	theinsetsmaps[16] = new Array("inset_047",506284,357463,1370.08,506200,357600,507800,358800,400,200,5,7)	theinsetsmaps[17] = new Array("inset_034",509981,360147,682.546,510000,360000,510600,361000,400,200,4,2)	theinsetsmaps[18] = new Array("inset_033",511626,359186,1365.09,511600,359400,513000,360400,400,200,4,6)	theinsetsmaps[19] = new Array("inset_062",511354,357762,1363.08,511400,357600,512600,359200,400,200,7,5)	theinsetsmaps[20] = new Array("inset_065",512363,355857,1372.08,512400,355800,513600,357400,400,200,7,5)	theinsetsmaps[21] = new Array("inset_006",514254,354098,1899.11,514200,354200,516200,355800,400,200,7,9)	theinsetsmaps[22] = new Array("inset_059",518852,355498,1365.09,519000,355400,520200,357000,400,200,7,5)	theinsetsmaps[23] = new Array("inset_015",520401,353975,682.546,520400,353800,521000,354800,400,200,4,2)	theinsetsmaps[24] = new Array("inset_039",514513,351969,1361.08,514600,351800,515800,353400,400,200,7,5)	theinsetsmaps[25] = new Array("inset_054",516771,348997,1345.08,516600,349200,518200,350200,400,200,4,7)	theinsetsmaps[26] = new Array("inset_025",496549,361605,1365.08,496600,361600,497800,363000,400,200,6,5)	theinsetsmaps[27] = new Array("inset_016",496792,359919,1380.08,497000,359800,498000,361400,400,200,7,4)	theinsetsmaps[28] = new Array("inset_008",497815,358423,1375.08,498000,358400,499000,359800,400,200,6,4)	theinsetsmaps[29] = new Array("inset_036",497520,356117,2317.91,497800,356000,499600,358600,600,200,6,4)	theinsetsmaps[30] = new Array("inset_003",491815,361966,1365.09,491800,362000,493200,363200,400,200,5,6)	theinsetsmaps[31] = new Array("inset_058",487469,360516,2893.88,487400,360800,490400,363000,600,200,5,7)	theinsetsmaps[32] = new Array("inset_057",486234,362309,1364.64,486400,362200,487400,363800,400,200,7,4)	theinsetsmaps[33] = new Array("inset_004",490433,359260,1362.08,490600,359200,491600,360800,400,200,7,4)	theinsetsmaps[34] = new Array("inset_042",488135,358401,1360.08,488000,358600,489600,359600,400,200,4,7)	theinsetsmaps[35] = new Array("inset_014",490025,357339,1365.08,490200,357200,491200,358800,400,200,7,4)	theinsetsmaps[36] = new Array("inset_005",486928,353141,1366.08,487000,353000,488200,354600,400,200,7,5)	theinsetsmaps[37] = new Array("inset_012",490933,353517,1365.09,491000,353400,492200,355000,400,200,7,5)	theinsetsmaps[38] = new Array("inset_030",494557,351570,1363.08,494600,351400,495800,353000,400,200,7,5)	theinsetsmaps[39] = new Array("inset_068",495910,353336,1501.52,496000,353200,497200,355000,400,200,8,5)	theinsetsmaps[40] = new Array("inset_002",504720,354348,1360.08,504600,354400,506200,355600,400,200,5,7)	theinsetsmaps[41] = new Array("inset_018",507518,354267,1359.08,507400,354400,509000,355600,400,200,5,7)	theinsetsmaps[42] = new Array("inset_020",507514,352323,1356.08,507400,352400,509000,353600,400,200,5,7)	theinsetsmaps[43] = new Array("inset_046",506775,349715,2450.26,506600,350000,509600,351800,600,200,4,7)	theinsetsmaps[44] = new Array("inset_017",502410,349297,1365.09,502400,349400,503800,350600,400,200,5,6)	theinsetsmaps[45] = new Array("inset_031",504914,347924,1501.52,505000,347800,506200,349600,400,200,8,5)	theinsetsmaps[46] = new Array("inset_029",508793,344723,1927.12,509000,344600,510600,346800,400,200,10,7)	theinsetsmaps[47] = new Array("inset_023",511493,346582,1387.08,511600,346400,512800,348000,400,200,7,5)	theinsetsmaps[48] = new Array("inset_028",513100,339867,1365.09,513000,340000,514600,341200,400,200,5,7)	theinsetsmaps[49] = new Array("inset_040",501825,346223,669.04,501800,346200,502400,347000,400,200,3,2)	theinsetsmaps[50] = new Array("inset_055",502109,344675,1381.04,502000,344800,503600,346000,400,200,5,7)	theinsetsmaps[51] = new Array("inset_045",503393,343478,1366.15,503600,343400,504600,345000,400,200,7,4)	theinsetsmaps[52] = new Array("inset_049",504819,342107,1361.01,505000,342000,506000,343600,400,200,7,4)	theinsetsmaps[53] = new Array("inset_048",509153,340177,682.546,509000,340200,510000,340800,400,200,2,4)	theinsetsmaps[54] = new Array("inset_043",506247,337417,1365.09,506400,337400,507400,338800,400,200,6,4)	theinsetsmaps[55] = new Array("inset_061",508280,335411,1365.79,508400,335400,509600,336800,400,200,6,5)	theinsetsmaps[56] = new Array("inset_056",512490,336924,1367.08,512600,336800,513800,338400,400,200,7,5)	theinsetsmaps[57] = new Array("inset_069",499542,342423,1366.19,499400,342600,501000,343600,400,200,4,7)	theinsetsmaps[58] = new Array("inset_001",510783,349712,1364.99,511000,349600,512000,351200,400,200,7,4)	theinsetsmaps[59] = new Array("inset_067",504658,370079,682.544,504600,370000,505400,370800,400,200,3,3)	theinsetsmaps[60] = new Array("inset_050",490902,370282,2860.48,490800,370600,493800,372800,400,200,10,14)	theinsetsmaps[61] = new Array("inset_038",491668,364815,4310.26,491600,364800,496000,369000,400,200,20,21)	theinsetsmaps[62] = new Array("inset_063",495431,363154,3575,495800,363000,498800,366800,600,200,9,7)	theinsetsmaps[63] = new Array("inset_066",500525,368620,2860.18,500400,369000,503400,371200,400,200,10,14)	theinsetsmaps[64] = new Array("inset_027",501839,368569,2161.52,501800,368800,504200,370600,400,200,8,11)	theinsetsmaps[65] = new Array("inset_035",506019,360518,2058.14,506000,360800,508200,362400,400,200,7,10)	theinsetsmaps[66] = new Array("inset_026",513000,342880,2199.67,513000,343200,515200,344800,400,200,7,10)	theinsetsmaps[67] = new Array("inset_052",504799,344025,4310.87,504600,344000,509200,348200,400,200,20,22)	theinsetsmaps[68] = new Array("inset_032",513841,341000,1365.09,514000,341000,515000,342400,400,200,6,4)		theinsetsmaps[69] = new Array("proposals",481000,333000,42000,482000,333000,522000,376000,4000,1000,14,13)		// ^^^^Insert output from 'navarray.txt' above ^^^^^^^^^					//Define the current overview.		for(i=0;i<70;i++){		if(theName == theinsetsmaps[i][0]){			var useIndex = i		}	}		var imageWidth = 200 																		//Width of inset overview image in pixels	var pixpermetre =  theinsetsmaps[useIndex][3] / imageWidth	theinsetsmaps[useIndex][2] = theinsetsmaps[useIndex][2] + theinsetsmaps[useIndex][3]		//Make origin top left	//Get user clicked location x,y (pixels).	if(is5up){		var theX = e.pageX					var theY = e.pageY	}	else{		var theX = event.offsetX					var theY =  event.offsetY	}	//Convert to real world metres.	theX = Number(theX) * pixpermetre		theY = Number(theY) * pixpermetre   	theX =  theinsetsmaps[useIndex][1] + theX	theY =  theinsetsmaps[useIndex][2] - theY	//Define if user has clicked in the map area	var outSideX = "false"	var outSideY = "false"		if((theX >= theinsetsmaps[useIndex][6]) | (theX <= theinsetsmaps[useIndex][4])){		outSideX = "true"			}	if((theY >= theinsetsmaps[useIndex][7]) | (theY <= theinsetsmaps[useIndex][5])){		outSideY = "true"	}	//Define the new map image to load in.	if((outSideX == "true") | (outSideY == "true")){					//alert("outside the area")	}	else{		var distx = theX - theinsetsmaps[useIndex][4]		var disty = theY - theinsetsmaps[useIndex][5]				var gridcnt = theinsetsmaps[useIndex][8]  		var thecol = 1  		while (gridcnt < distx){			thecol = thecol + 1			gridcnt = gridcnt + (theinsetsmaps[useIndex][8] - theinsetsmaps[useIndex][9])  		}	 		var gridcnt = theinsetsmaps[useIndex][8]  		var therow = 1  		while (gridcnt < disty){			therow = therow + 1			gridcnt = gridcnt + (theinsetsmaps[useIndex][8] - theinsetsmaps[useIndex][9])  		}							var theTileNo =  ((therow -1) * theinsetsmaps[useIndex][11]) + thecol		//Adjust the tile number to agree with the standard "###"		if(theTileNo < 10){			theTileNo = "00" + theTileNo		}		else if(theTileNo < 100){			theTileNo = "0" + theTileNo		}		else{			theTileNo = String(theTileNo)		}				//Update main map		var theNewHTML = "map_htm/" + theName + "/" + theName + "_" + theTileNo + ".htm"		eval("parent.frames.map.location= '"+ theNewHTML +"'")	}	}//*********Define the document that is loaded in the written frame (When opened from the contents page).function getDoc(){	//Get the document name.	var cmdString = parent.mainFrame.document.location		var theStart = String(cmdString).indexOf("/written/")	var theEnd = String(cmdString).indexOf("#")				if(theEnd != -1){		var theDoc =  String(cmdString).substring((theStart + 9),theEnd)	}	else{		var theDoc =  String(cmdString).substring((theStart + 9),(String(cmdString).length))	}			//Define the title to print to the window	if(theDoc == "cpt1.htm"){		var theTitle = "INTRODUCTION"	}	else if(theDoc == "cpt2.htm"){		var theTitle = "OBJECTIVES AND STRATEGY"	}	else if(theDoc == "cpt3.htm"){		var theTitle = "CORE POLICIES"	}	else if(theDoc == "cpt4.htm"){		var theTitle = "HOUSING"	}	else if(theDoc == "cpt5.htm"){		var theTitle = "THE ECONOMY"	}	else if(theDoc == "cpt6.htm"){		var theTitle = "RETAIL, SERVICES AND ENTERTAINMENT"	}	else if(theDoc == "cpt7.htm"){		var theTitle = "TRANSPORT"	}	else if(theDoc == "cpt8.htm"){		var theTitle = "RECREATION, SPORT AND TOURISM"	}	else if(theDoc == "cpt9.htm"){		var theTitle = "DEVELOPMENT IN THE COUNTRYSIDE"	}	else if(theDoc == "cpt10.htm"){		var theTitle = "LANDSCAPE AND WILDLIFE"	}	else if(theDoc == "cpt11.htm"){		var theTitle = "THE HISTORIC ENVIRONMENT"	}	else if(theDoc == "cpt12.htm"){		var theTitle = "Appendix 1. Criteria for defining Settlement Curtilages"	}	else if(theDoc == "cpt13.htm"){		var theTitle = "Appendix 2. Parishes in North Kesteven forming part of the Lincoln Policy Area"	}	else if(theDoc == "cpt14.htm"){		var theTitle = "Appendix 3. Housing  Allocations"	}	else if(theDoc == "cpt15.htm"){		var theTitle = "Appendix 4. Land identified for employment development by Policies E1 and E2"	}	else if(theDoc == "cpt16.htm"){		var theTitle = "Appendix 5. Criteria  for defining Sleaford Town Centre and main shopping frontage"	}	else if(theDoc == "cpt17.htm"){		var theTitle = "Appendix 6. Parking Standards"	}	else if(theDoc == "cpt18.htm"){		var theTitle = "Appendix 7. Green Wedges"	}	else if(theDoc == "cpt19.htm"){		var theTitle = "Appendix 8. Sites of Special Scientific Interest"	}		else if(theDoc == "cpt20.htm"){		var theTitle = "Appendix 9. County Wildlife Sites and Local Nature Reserves"	}	else if(theDoc == "cpt21.htm"){		var theTitle = "Appendix 10. Scheduled Ancient Monuments"	}	else if(theDoc == "cpt22.htm"){		var theTitle = "Appendix 11. Conservation Areas"	}	else if(theDoc == "cpt23.htm"){		var theTitle = "Appendix 12. Register of Parks and Gardens of Special Historic Interest"	}	else if(theDoc == "../ws_contents.htm"){		var theTitle = "CONTENTS"	}		//Set window title and re-load the footer frame.	parent.document.title = theTitle	parent.bottomFrame.location = "written_footer.htm?" + theDoc		}//*********Opens written statement - from contents.function openWritten(theMap){														theURL = "written/written_frame.htm?" + theMap  		winName =  "Written"		features = "toolbar=no,scrollbars=yes,resizable=yes,width=650,height=600"		window.open(theURL,winName,features)}/************END of Script*/