function showHide(id){
   if (document.getElementById && document.getElementById(id)){
      if (document.getElementById(id).style.visibility == "visible"
         || document.getElementById(id).style.display == "block"){
         // hide it
         document.getElementById(id).style.visibility = "hidden";
         document.getElementById(id).style.display = "none";
      }else{
         // show it
         document.getElementById(id).style.visibility = "visible";
         document.getElementById(id).style.display = "block";
      }                      
   }
}

function ChangeImage(imgId, newSrc){   
   document.getElementById(imgId).src=newSrc;
}

function addOption(selectId, txt, val)
{
    var objOption = new Option(txt, val);
    document.getElementById(selectId).options.add(objOption);
}

function agedisplay(amount){
   divcontents='';
   if(amount>0){
     var loop=0;
     divcontents='<b>Udfyld venligst børnenes alder på hjemrejsetidspunktet.</b><br>';
      for(xx=0;xx<amount;xx++){
         //divcontents=divcontents+(xx+1);
         divcontents=divcontents+'&nbsp;&nbsp;<select name="age'+(xx+1)+'" style="font-size:10px"><option value="0">0 år</option><option value="1">1 år</option><option value="2">2 år</option><option value="3">3 år</option><option value="4">4 år</option><option value="5">5 år</option><option value="6">6 år</option><option value="7">7 år</option><option value="8">8 år</option><option value="9">9 år</option><option value="10">10 år</option><option value="11">11 år</option><option value="12">12 år</option><option value="13">13 år</option><option value="14">14 år</option><option value="15">15 år</option><option value="16">16 år</option>';
         if( loop++ == 2 ) {
           loop = 0;
           divcontents=divcontents+'</select><br>';
         }
         else
           divcontents=divcontents+'</select>';
      }
   }
   document.getElementById('age').innerHTML=divcontents;
   
}
