function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// Pop up - checked okay
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
var left = (screen.width - width) / 2;
var top = (screen.height - height) / 2;
if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width='+width+',height='+height+',left='+left+',top='+top+'');
}

function enqit(which) 
{
 if (document.enq.realname.value == "")
 {
  alert("Per favore inserisci il tuo nome");
  document.enq.realname.focus()
  return false
 }
if (which.indexOf("@")!=-1&&which.indexOf(".")!=-1)
{
}
else
{
alert("Per favore inserisci la tua e-mail");
document.enq.email.focus();
return false;
}
}
 
function newsit(which) 
{
 if (document.news.realname.value == "")
 {
  alert("Per favore inserisci il tuo nome");
  document.news.realname.focus()
  return false
 }
if (which.indexOf("@")!=-1&&which.indexOf(".")!=-1)
{
}
else
{
alert("Per favore inserisci la tua e-mail");
document.news.email.focus();
return false;
}
}

function makeArray() 
{
   var minNav3 = (navigator.appName == 'Netscape' && parseInt(navigator.appVersion) >= 3)
   var minIE4 = (navigator.appName.indexOf('Microsoft') >= 0 && parseInt(navigator.appVersion) >= 4)
   var minDOM = minNav3 || minIE4
   var results = new Array()
   if (minDOM) 
   {
      var input = unescape(location.search.substring(1))
      if (input) 
	  {
         var srchArray = input.split('&');
         var tempArray = new Array();
         for (i = 0; i < srchArray.length; i++) 
		 {
            tempArray = srchArray[i].split("=")
            results[tempArray[0]] = tempArray[1]
		 }
      }
   }
   return results
}
var getdata = makeArray()

function populate()
{
document.enq.product.value=getdata["product"];
document.enq.destination.value=getdata["destination"];
document.enq.date.value=getdata["date"];
document.enq.days.value=getdata["days"];
document.enq.nights.value=getdata["nights"];
document.enq.dives.value=getdata["dives"];
document.enq.price.value=getdata["price"];
document.enq.rid.value=getdata["rid"];
document.enq.seasonid.value=getdata["seasonid"];
document.enq.roomid.value=getdata["roomid"];
}

// Destinations worldwide options box

var menu1=new Array()

menu1[1]='<a href="http://www.dive-the-world.com/it/it-diving-sites-australia.php">Australia<\/a>'
menu1[2]='<a href="http://www.dive-the-world.com/it/it-diving-sites-australia-great-barrier-reef-cairns.php">&nbsp;&nbsp;&nbsp;Cairns<\/a>'
menu1[3]='<a href="http://www.dive-the-world.com/it/it-diving-sites-australia-great-barrier-reef-osprey-reef.php">&nbsp;&nbsp;&nbsp;Osprey Reef<\/a>'
menu1[4]='<a href="http://www.dive-the-world.com/it/it-diving-sites-australia-great-barrier-reef-ribbon-reefs.php">&nbsp;&nbsp;&nbsp;Ribbon Reefs<\/a>'
menu1[5]='<a href="http://www.dive-the-world.com/it/it-diving-sites-burma.php">Birmania<\/a>'
menu1[6]='<a href="http://www.dive-the-world.com/it/it-diving-sites-fiji.php">Fiji<\/a>'
menu1[7]='<a href="http://www.dive-the-world.com/it/it-diving-sites-fiji-koro-sea.php">&nbsp;&nbsp;&nbsp;Bligh Water<\/a>'
menu1[8]='<a href="http://www.dive-the-world.com/it/it-diving-sites-fiji-kadavu.php">&nbsp;&nbsp;&nbsp;Kadavu<\/a>'
menu1[9]='<a href="http://www.dive-the-world.com/it/it-diving-sites-fiji-beqa-lagoon.php">&nbsp;&nbsp;&nbsp;Laguna di Beqa<\/a>'
menu1[10]='<a href="http://www.dive-the-world.com/it/it-diving-sites-fiji-taveuni.php">&nbsp;&nbsp;&nbsp;Taveuni<\/a>'
menu1[11]='<a href="http://www.dive-the-world.com/it/it-diving-sites-fiji-viti-levu.php">&nbsp;&nbsp;&nbsp;Viti Levu<\/a>'
menu1[12]='<a href="http://www.dive-the-world.com/it/it-diving-sites-indonesia.php">Indonesia<\/a>'
menu1[13]='<a href="http://www.dive-the-world.com/it/it-diving-sites-indonesia-bali.php">&nbsp;&nbsp;&nbsp;Bali<\/a>'
menu1[14]='<a href="http://www.dive-the-world.com/it/it-diving-sites-indonesia-banda-islands.php">&nbsp;&nbsp;&nbsp;Isole Banda<\/a>'
menu1[15]='<a href="http://www.dive-the-world.com/it/it-diving-sites-indonesia-raja-ampat.php">&nbsp;&nbsp;&nbsp;Irian Jaya<\/a>'
menu1[16]='<a href="http://www.dive-the-world.com/it/it-diving-sites-indonesia-komodo.php">&nbsp;&nbsp;&nbsp;Komodo<\/a>'
menu1[17]='<a href="http://www.dive-the-world.com/it/it-diving-sites-indonesia-sulawesi.php">&nbsp;&nbsp;&nbsp;Sulawesi<\/a>'
menu1[18]='<a href="http://www.dive-the-world.com/it/it-diving-sites-maldives.php">Maldive<\/a>'
menu1[19]='<a href="http://www.dive-the-world.com/it/it-diving-sites-maldives-ari-atoll-diving-sites.php">&nbsp;&nbsp;&nbsp;Atollo di Ari<\/a>'
menu1[20]='<a href="http://www.dive-the-world.com/it/it-diving-sites-maldives-northern-atolls-diving-sites.php">&nbsp;&nbsp;&nbsp;Atolli del Nord<\/a>'
menu1[21]='<a href="http://www.dive-the-world.com/it/it-diving-sites-maldives-north-male-atoll-diving-sites.php">&nbsp;&nbsp;&nbsp;Atollo di Male Nord<\/a>'
menu1[22]='<a href="http://www.dive-the-world.com/it/it-diving-sites-maldives-south-male-atoll-diving-sites.php">&nbsp;&nbsp;&nbsp;Atollo di Male Sud<\/a>'
menu1[23]='<a href="http://www.dive-the-world.com/it/it-diving-sites-malaysia.php">Malesia<\/a>'
menu1[24]='<a href="http://www.dive-the-world.com/it/it-diving-sites-malaysia-lankayan-island.php">&nbsp;&nbsp;&nbsp;Lankayan<\/a>'
menu1[25]='<a href="http://www.dive-the-world.com/it/it-diving-sites-malaysia-layang-layang.php">&nbsp;&nbsp;&nbsp;Layang Layang<\/a>'
menu1[26]='<a href="http://www.dive-the-world.com/it/it-diving-sites-malaysia-sipadan-island.php">&nbsp;&nbsp;&nbsp;Isola Sipadan<\/a>'
menu1[27]='<a href="http://www.dive-the-world.com/it/it-diving-sites-red-sea.php">Mar Rosso<\/a>'
menu1[28]='<a href="http://www.dive-the-world.com/it/it-diving-sites-red-sea-hurghada.php">&nbsp;&nbsp;&nbsp;Hurghada<\/a>'
menu1[29]='<a href="http://www.dive-the-world.com/it/it-diving-sites-red-sea-sharm-el-sheikh.php">&nbsp;&nbsp;&nbsp;Sharm El Sheikh<\/a>'
menu1[30]='<a href="http://www.dive-the-world.com/it/it-diving-sites-red-sea-south.php">&nbsp;&nbsp;&nbsp;Sud del Mar Rosso<\/a>'
menu1[31]='<a href="http://www.dive-the-world.com/it/it-diving-sites-thailand.php">Tailandia<\/a>'
menu1[32]='<a href="http://www.dive-the-world.com/it/it-diving-sites-thailand-krabi.php">&nbsp;&nbsp;&nbsp;Krabi<\/a>'
menu1[33]='<a href="http://www.dive-the-world.com/it/it-diving-sites-thailand-phi-phi-islands.php">&nbsp;&nbsp;&nbsp;Isole Phi Phi<\/a>'
menu1[34]='<a href="http://www.dive-the-world.com/it/it-diving-sites-thailand-phuket.php">&nbsp;&nbsp;&nbsp;Phuket<\/a>'
menu1[35]='<a href="http://www.dive-the-world.com/it/it-diving-sites-thailand-samui.php">&nbsp;&nbsp;&nbsp;Koh Samui<\/a>'
menu1[36]='<a href="http://www.dive-the-world.com/it/it-diving-sites-thailand-similan-islands.php">&nbsp;&nbsp;&nbsp;Isole Similan<\/a>'
               
var menuwidth='120px' //default menu width
var menubgcolor='white'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"><\/div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu