$(document).ready(function(){
$("div").css("cursor","default");
load('divBristolMap','Bristollatitude','Bristollngtude'); switchquestions('divBristol');
window.onunload = GUnload;
});
function switchquestions(theid){
var thearray= new Array("divBristol", "divLondon", "divEdinburgh", "divCardiff");
for(i=0; i<thearray.length; i++){
if(thearray[i] == theid){
document.getElementById(theid).style.display="block";
}else{
document.getElementById(thearray[i]).style.display="none";
}
}
}
function switchIntMap(theid){
var thearray= new Array("divUKInt", "divBritishVI", "divCyprus", "divSeychelles", "divChannelJersey");
for(i=0; i<thearray.length; i++){
if(thearray[i] == theid){
document.getElementById(theid).style.display="block";
}else{
document.getElementById(thearray[i]).style.display="none";
}
}
}
function init() {
// quit if this function has already been called
if (arguments.callee.done) return;
// flag this function so we don't do the same thing twice
arguments.callee.done = true;
switchquestions('divBristol');
switchIntMap('divUKInt');
load('divBristolMap','Bristollatitude','Bristollngtude','divBristolAddress')
};
/* for Mozilla */
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", init, false);
}
/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
document.write("<script defer src=office-locations.js><"+"/script>");
/*@end @*/
/* for other browsers */
/* window.onload = init;*/
function load(mapID, latlng, lngtudeID, divAddress) {
var tmpMapID = document.getElementById(mapID);
var tmpLatlng = document.getElementById(latlng).innerHTML;
var tmpLngtude = document.getElementById(lngtudeID).innerHTML;
var tmpMapAddress = document.getElementById(divAddress).innerHTML;
if (GBrowserIsCompatible()) {
var map = new GMap2(tmpMapID);
map.setCenter(new GLatLng(tmpLatlng,tmpLngtude), 16);
map.setMapType(G_NORMAL_MAP);
map.addControl(new GSmallMapControl());
map.addControl(new GScaleControl());
map.addControl(new GMapTypeControl());
map.addControl(new GOverviewMapControl());
var marker = new GMarker(new GLatLng(tmpLatlng,tmpLngtude));
map.addOverlay(marker);
marker.openInfoWindowHtml(tmpMapAddress);
}
}