// 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 enqde(which) 
{
 if (document.enq.realname.value == "")
 {
  alert("Bitte gebe Deinen Namen ein");
  document.enq.realname.focus()
  return false
 }
if (which.indexOf("@")!=-1&&which.indexOf(".")!=-1)
{
}
else
{
alert("Bitte gebe Deine E-mail Adresse ein");
document.enq.email.focus();
return false;
}
}
 
function newsde(which) 
{
 if (document.news.realname.value == "")
 {
  alert("Bitte gebe Deinen Namen ein");
  document.news.realname.focus()
  return false
 }
if (which.indexOf("@")!=-1&&which.indexOf(".")!=-1)
{
}
else
{
alert("Bitte gebe Deine E-mail Adresse ein");
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.divetheworldliveaboards.com/de/de-tauchziele-australien.php">Australien<\/a>'
menu1[2]='<a href="http://www.divetheworldburma.com/de/de-tauchplaetze-burma.htm">Burma<\/a>'
menu1[3]='<a href="http://www.divetheworldliveaboards.com/de/de-tauchziele-fidschi.php">Fidschi<\/a>'
menu1[4]='<a href="http://www.divetheworldindonesia.com/de/de-indonesien-tauchen-tauchplatz.htm">Indonesien<\/a>'
menu1[5]='<a href="http://www.divetheworldindonesia.com/de/de-bali-diving-sites.htm">&nbsp;&nbsp;&nbsp;Bali<\/a>'
menu1[6]='<a href="http://www.divetheworldindonesia.com/de/de-banda-islands-diving-sites.htm">&nbsp;&nbsp;&nbsp;Banda Inseln<\/a>'
menu1[7]='<a href="http://www.divetheworldindonesia.com/de/de-raja-ampat-irian-jaya-diving-sites.htm">&nbsp;&nbsp;&nbsp;Irian Jaya<\/a>'
menu1[8]='<a href="http://www.divetheworldindonesia.com/de/de-komodo-diving-sites.htm">&nbsp;&nbsp;&nbsp;Komodo<\/a>'
menu1[9]='<a href="http://www.divetheworldindonesia.com/de/de-sulawesi-diving-sites.htm">&nbsp;&nbsp;&nbsp;Sulawesi<\/a>'
menu1[10]='<a href="http://www.divetheworldmalaysia.com/de/de-malaysia-tauchplaetze.htm">Malaysia<\/a>'
menu1[11]='<a href="http://www.divetheworldmalaysia.com/de/de-tauchplaetze-layang-scuba.htm">&nbsp;&nbsp;&nbsp;Layang Layang<\/a>'
menu1[12]='<a href="http://www.divetheworldmalaysia.com/de/de-tauchplaetze-sipadan.htm">&nbsp;&nbsp;&nbsp;Sipadan<\/a>'
menu1[13]='<a href="http://www.divetheworldliveaboards.com/de/de-tauchziele-malediven.php">Malediven<\/a>'
menu1[14]='<a href="http://www.divetheworldliveaboards.com/de/de-tauchziele-rotes-meer.php">Rotes Meer<\/a>'
menu1[15]='<a href="http://www.divetheworldthailand.com/de/de-thailand-tauchplaetze.php">Thailand<\/a>'
menu1[16]='<a href="http://www.divetheworldthailand.com/de/de-tauchplaetze-krabi.php">&nbsp;&nbsp;&nbsp;Krabi<\/a>'
menu1[17]='<a href="http://www.divetheworldthailand.com/de/de-tauchplaetze-phi-phi-islands.php">&nbsp;&nbsp;&nbsp;Phi Phi Inseln<\/a>'
menu1[18]='<a href="http://www.divetheworldthailand.com/de/de-tauchplaetze-phuket.php">&nbsp;&nbsp;&nbsp;Phuket<\/a>'
menu1[19]='<a href="http://www.divetheworldthailand.com/de/de-tauchplaetze-tauchen-samui.php">&nbsp;&nbsp;&nbsp;Koh Samui<\/a>'
menu1[20]='<a href="http://www.divetheworldthailand.com/de/de-tauchplaetze-similan-islands.php">&nbsp;&nbsp;&nbsp;Similan Inseln<\/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