function init(){
var naV = navigator.appName

var stest = navigator.appVersion
	if (stest.indexOf("Safari") > -1)
{
	naV = "Safari"
}

	if (stest.indexOf("Chrome") > -1)
{
	naV = "Chrome"
}

switch (naV)
{
case "Chrome" :
		break;
case "Safari" :
		break;
case "Opera" :
		document.getElementById('chat').style.left  = "-26px";
		break;
case "Netscape" :
		break;
case "Microsoft Internet Explorer" :
/*		document.getElementById('mbut1').style.lineHeight = "22px";
		document.getElementById('mbut2').style.lineHeight = "22px";
		document.getElementById('mbut3').style.lineHeight = "22px";
		document.getElementById('mbut4').style.lineHeight = "22px";
		document.getElementById('mbut5').style.width = "102px";
		document.getElementById('mbut5').style.lineHeight = "22px";
		document.getElementById('chat').style.left  = "-38px";
		document.getElementById('chat').style.top = "3px";*/
		break;
default:
		break;
}
}

function menuon(men,caller)
{
document.getElementById(men).style.visibility = "visible"
if (caller!=="nil")
{
colourchange(caller,'on')
}
}
function menuoff(men,page,caller)
{
document.getElementById(men).style.visibility = "hidden"
if (caller!=="nil")
{
colourchange(caller,'off')
}
if (page !== 'none')
{
top.location.href = page
}
}
function colourchange(did,state)
{
var oncol='white';
var dtest = did.charAt(0);
if (dtest=='d')
{
	oncol='#eeeeee'
}

if (state == 'on')
{
colour = oncol
} else {
colour = 'transparent'
}
document.getElementById(did).style.background = colour
}

  function initmap() {
    var myLatlng = new google.maps.LatLng(53.746741, -0.429066);
    var myOptions = {
      zoom: 16,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.HYBRID
    };
   map = new google.maps.Map(document.getElementById("map_canvas"),
        myOptions);
   places = [
  ['Turkish Riviera Travel', 53.746741, -0.429066, 'images/googlemap.png' , '<table class="infowindow"><tr><td><B>Turkish Riviera Travel Ltd</B><BR>Lindsay House, 15/17 Springfield Way, Anlaby, East Yorkshire, HU10 6RJ<BR>Tel: 01482 502004<BR>Email: <a href="mailto:info@turkishrivieratravel.co.uk" class="a">info@turkishrivieratravel.co.uk</a><BR>Website: <a href="http://www.turkishrivieratravel.co.uk" target="_blank" class="a">www.turkishrivieratravel.co.uk</a><BR><a href="http://maps.google.co.uk/maps?daddr=53.746741,-0.429875" target="_blank" class="a">Get Directions</a></td></tr></table>']
];
     drawall(0)
  }

function drawall(bubnum) {
  marker = new Array();
  infoBoxes = new Array();
for (var i = 0; i < places.length; i++) {
    var venues = places[i];
    var myLatLng = new google.maps.LatLng(venues[1], venues[2]);
    marker[i] = new google.maps.Marker({
        position: myLatLng,
        map: map,
        icon:  venues[3],
        title: venues[0]
    });
infoBoxes[i] = new google.maps.InfoWindow({
    content: venues[4]});
marker[i]._index = i;
google.maps.event.addListener(marker[i], 'click', function() {
  infoBoxes[this._index].open(map,marker[this._index])});	

if (i==bubnum){
 infoBoxes[i].open(map,marker[i]);
}
}
}

function initpics(pcount,cpic)
{
newImg = new Array()
for (i = 1; i <= pcount; i++)
{

    newImg[i]= new Image();
	if(i < 10)
	{
	newImg[i].src=cpic+"0"+i+".jpg"; 
	} else {
	newImg[i].src=cpic+i+".jpg"; 
	}
}
}
function picon(pic,num,ptxt)
{
change =  "url(" + pic + ")";
var height = newImg[num].height;
var width = newImg[num].width;
var left = ((570-width)/2);
var top = ((450-height)/2);
var ptxttop = height+top-17;
	document.getElementById("showpic").style.width = width+"px";
	document.getElementById("showpic").style.height = height+"px";
	document.getElementById("showpic").style.left = left+"px";
	document.getElementById("showpic").style.top = top+"px";
	document.getElementById("showpic").style.backgroundImage = change;
	document.getElementById("showpic").style.display = "block";
if (ptxt !== "")
{
	document.getElementById("showpicb").style.width = width+"px";
	document.getElementById("showpicb").style.left = left+"px";
	document.getElementById("showpicb").style.top = ptxttop+"px";
	document.getElementById("showpicb").style.display = "block";

	document.getElementById("showpictext").style.width = width+"px";
	document.getElementById("showpictext").style.left = left+"px";
	document.getElementById("showpictext").style.top = ptxttop+"px";
	document.getElementById("showpictext").innerHTML = ptxt;
	document.getElementById("showpictext").style.display = "block";
}
}

function picoff()
{
	document.getElementById("showpic").style.display = "none";
	document.getElementById("showpictext").style.display = "none";
	document.getElementById("showpicb").style.display = "none";
}

function newTab(lat,lon)
{
var pcode = document.getElementById("pcode").value;
var open_link = window.open('','_blank');
open_link.location="http://maps.google.co.uk/maps?saddr="+pcode+"&daddr=53.746741,-0.429875";

}

function checkmail()
{
document.mailform.submit()
}
