7,8d6 < < var ie = 11; 12,13c10,11 < var elemLeft = 0; < var elemTop = 0; --- > var elemLeft; > var elemTop; 47,48c45,46 < if (context != null) context.fillStyle = '#0000ff'; < if (context != null) context.fillRect(retx, rety, 5, 5); --- > context.fillStyle = '#0000ff'; > context.fillRect(retx, rety, 5, 5); 53,66d50 < function ask() { < var huh=prompt("If you've zoomed your window, please answer Y and then click on London to scale. Then click away at places where you want to go.", ""); < if (huh == null) { < clickno = 1; < //document.getElementById('mypiframe').src = "intair.php?plot=y"; < } else if (huh == "y" || huh == "Y") { < clickno = 0; < } else { < clickno = 1; < //document.getElementById('mypiframe').src = "intair.php?plot=y"; < } < } < < 68,129d51 < < ie = (function(){ // thanks to http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library < < var undef, < v = 3, < div = document.createElement('div'), < all = div.getElementsByTagName('i'); < < while ( < div.innerHTML = '', < all[0] < ); < < return v > 4 ? v : undef; < < }()); < < img = document.getElementById("world"); < if (ie < 9) { < document.getElementById('canvaselement').style.display = 'none'; < document.getElementById('others').style.display = 'none'; < context = null; < document.getElementById('world').style.display = 'block'; < elem = document.getElementById('world'); < // Add event listener for `click` events. < elem.attachEvent('onclick', function(event) { < if (event.clientX || event.clientY) { < x = event.clientX - elemLeft; < y = event.clientY - elemTop; < } else { < x = event.pageX - elemLeft; < y = event.pageY - elemTop; < } < //alert(x + " " + y); < if (clickno == 0) { < londonx = x; < londony = y; < ourlong = eval(0.0 + (x - londonx) / (348.0 * (londonx / london_x)) * 147.325); < ourlat = eval(51.5 + (y - londony) / (257.0 * (londony / london_y)) * (-94.3806)); < } else { < ourlong = eval(0.0 + (x - londonx) / (348.0 * (londonx / london_x)) * 147.325); < ourlat = eval(51.5 + (y - londony) / (257.0 * (londony / london_y)) * (-94.3806)); < } < < elements.push({ < colour: '#ff0000', < width: 5, < height: 5, < top: y, < left: x < }); < < clickno = clickno + 1; < document.getElementById('myiframe').src = "http://www.rjmprogramming.com.au/PHP/Map/map.php?title=Your%20Place%20and%20Airports&label=['Lat',&value='Lon','Name']&data=,[" + ourlat.toFixed(5).replace(/0+$/, "") + "," + ourlong.toFixed(5).replace(/0+$/, "") + ",~Your%20Place~]" < < document.getElementById('mypiframe').src = "intair.php?num=4&lat=" + ourlat + "&long=" + ourlong; < < < }); < < < } else { 131a54 > img = document.getElementById("world"); 134a58,59 > > 137d61 < if (event.pageX || event.pageY) { 140,143d63 < } else { < x = event.clientX - elemLeft; < y = event.clientY - elemTop; < } 168,169c88,89 < if (context != null) context.fillStyle = element.colour; < if (context != null) context.fillRect(element.left, element.top, element.width, element.height); --- > context.fillStyle = element.colour; > context.fillRect(element.left, element.top, element.width, element.height); 179,182d98 < } < < setTimeout(ask, 1000); < 183a100,110 > function ask() { > var huh=prompt("If you've zoomed your window, please answer Y and then click on London to scale. Then click away at places where you want to go.", ""); > if (huh == null) { > clickno = 1; > //document.getElementById('mypiframe').src = "intair.php?plot=y"; > } else if (huh == "y" || huh == "Y") { > clickno = 0; > } else { > clickno = 1; > //document.getElementById('mypiframe').src = "intair.php?plot=y"; > } 185d111 < 186a113,115 > setTimeout(ask, 1000); > > }; 191,192c120,121 <