function showClosedMessage(){
 document.getElementById('indhold').style.visibility="visible";
 document.getElementById('skygge').style.visibility="visible";
 if(document.getElementById('c')){document.getElementById('c').style.visibility="hidden";}
 if(document.getElementById('R')){document.getElementById('R').style.visibility="hidden";}
 if(document.getElementById('PE')){document.getElementById('PE').style.visibility="hidden";}
 if(document.getElementById('Q51')){document.getElementById('Q51').style.visibility="hidden";}
}
function subwin(s, t, w, h) {
 addWindow = window.open(s,t,"width="+w+",height="+h+",resizable=1,status=1,menubar=0,scrollbars=1,fullscreen=0");
 addWindow.focus() 
}
function SetIndex( indextext ) 
{
var index;
 if ( navigator.appName == 'Netscape'  ) {
  for ( var i = 0; i < document.search.R.options.length; i++ ) {
  if ( indextext == document.search.R.options[i].value ) {
   index = i
  }
}
 document.search.R.options[index].selected=true;
 } else {
 document.search.R.value = indextext;
 }
}
function SetArea( indextext ) 
{
var index;
 if ( navigator.appName == 'Netscape'  ) {
  for ( var i = 0; i < document.searchalpine.R.options.length; i++ ) {
  if ( indextext == document.searchalpine.R.options[i].value ) {
   index = i
  }
}
 document.searchalpine.R.options[index].selected=true;
 } else {
 document.searchalpine.R.value = indextext;
 }
}
function SetIndexRS( indextext ) 
{
 var index;
 if ( navigator.appName == 'Netscape'  ) {
  for ( var i = 0; i < document.search.RS.options.length; i++ ) {
  if ( indextext == document.search.RS.options[i].value ) {
   index = i
  }
 }
 document.search.RS.options[index].selected=true;
 } else {
 document.search.RS.value = indextext;
 }
}
function getSelectedRadio(buttonGroup) {
   // returns the array number of the selected radio button or -1 if no button is selected
   if (buttonGroup[0]) { // if the button group is an array (one button is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            return i
         }
      }
   } else {
      if (buttonGroup.checked) { return 0; }
   }
   return -1;
}
var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1); 

function printPage() {
 if (pr) // NS4, IE5
  window.print()
 else if (da && !mac) // IE4 (Windows)
  vbPrintPage()
}

if (da && !pr && !mac) with (document) {
 writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
 writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
 writeln('Sub window_onunload');
 writeln('  On Error Resume Next');
 writeln('  Set WB = nothing');
 writeln('End Sub');
 writeln('Sub vbPrintPage');
 writeln('  OLECMDID_PRINT = 6');
 writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
 writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
 writeln('  On Error Resume Next');
 writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
 writeln('End Sub');
 writeln('<' + '/SCRIPT>');
}
function redirectAgency() {
pw = prompt("Zum Zugang der Reisebüroseiten, geben Sie bitte den CRS-Kode von NOVASOL ein:","")
if ((pw =="NOSO") || (pw=="noso")) {
document.location.href='http://buro.novasol.de'
}
}
function searchhouse( elm, housenumber, agency, showit )
{
var elementsBeforeCheckboxes = 0
var elementsAfterCheckboxes = 1
var startDatoStr = null;
for (var i = elementsBeforeCheckboxes; i < elm.elements.length-elementsAfterCheckboxes; i++)
{
 if(elm.elements[i].type=='hidden') {continue;}
  if (elm.elements[i].checked)
   {
    startDatoStr = elm.elements[i].value
    var start = i;
    break;
   }
else
   {
    startDatoStr = null;
   }
  }
 for (var i = start; i < elm.elements.length-elementsAfterCheckboxes; i++)
  {
if (elm.elements[i+1].type=='checkbox')
{
   if (!elm.elements[i+1].checked)
    {
     slutDatoStr = elm.elements[i+1].value
     break;
    }
}
else
{
   slutDatoStr = elm.elements[i+1].value
     break;
}
  }
if ( startDatoStr == null  )
{
var url = "/NOV/756.nsf/"+showit+"/house?opendocument&H="+housenumber+"&S="+elm.season.value+"&PE="+elm.people.value+"&A="+agency;
if ( showit == 'x' )
{
subwin(url, housenumber, '750', '440');
}
else
{
location.href = url;
}
} else {
house( housenumber, '-1', startDatoStr, slutDatoStr, elm.people.value, elm.season.value, agency, showit)
}
}
function house(housenumber, price, startdate, enddate, people, season, agency, showit)
{
var url = "/house.nsf/0/ESERVED=LANGUAGEESERVED=SITECODE?opendocument&H="+housenumber+"&P="+price+"&PE="+people+"&SD="+startdate+"&ED="+enddate+"&S="+season+"&A="+agency;
if ( showit == 'x' )
{
url = url + "&_xview"; 
subwin(url, housenumber, '760', '440');
}
else
{
location.href = url;
}
}
function housealpine(housenumber, price, startdate, enddate, people, season, agency, showit)
{
var url = "/NOV/756.nsf/"+showit+"/housealpine?opendocument&H="+housenumber+"&P="+price+"&PE="+people+"&SD="+startdate+"&ED="+enddate+"&S="+season+"&A="+agency;
if ( showit == 'x' )
{
subwin(url, housenumber, '760', '540');
}
else
{
location.href = url;
}
}
function danhouse(housenumber, price, startdate, enddate, people, season, agency, showit)
{
var url = "/house.nsf/0/756NOV?opendocument&H="+housenumber+"&P="+price+"&PE="+people+"&SD="+startdate+"&ED="+enddate+"&S="+season+"&A="+agency;
if ( showit == 'x' )
{
url = url + "&_xview"; 
subwin(url, housenumber, '760', '440');
}
else
{
location.href = url;
}
}
function checkEmail (strng) {
var error="";
if (strng == "") {
 error = "Sie haben keine E-Mail Adresse eingegeben";
}
 var emailFilter=/^.+@.+..{2,3}$/;
 if (!(emailFilter.test(strng))) {
  error = "Bitte eine gültige E-Mail Adresse eingeben";
 }
 else {
  var illegalChars= /[()<>,;:\"[]]/;
  if (strng.match(illegalChars)) {
   error = "Die E-Mail Adresse beinhaltet ungültige Zeichen";
  }
 }
return error;
}
function required(which) {
if (which.FN.value=="") {
alert ("Bitte Name eingeben");
which.FN.focus();
return false;
}
if (which.S.value=="") {
alert ("Bitte Adresse eingeben");
which.S.focus();
return false;
}
if (which.STN.value=="") {
alert ("Bitte Hausnummer eingeben");
which.STN.focus();
return false;
}
if (which.Z.value=="") {
alert ("Bitte Postleitzahl eingeben");
which.Z.focus();
return false;
}
if (which.ZC.value=="") {
alert ("Bitte Stadt eingeben");
which.ZC.focus();
return false;
}
if (which.PH.value=="") {
alert ("Bitte geben Sie Ihre Telefonnummer an");
which.PH.focus();
return false;
}
var EmailOK = checkEmail(which.E.value);
if (!(EmailOK=="")) {
alert (EmailOK);
which.E.focus();
return false;
}
else
return true;
}
function reqfields(which, fn, sn, s, z, zc, co, ph, e, wf, stn) {
if (fn==1) {if (which.FN.value=="") {alert ("Bitte Name eingeben");which.FN.focus();return false;}}
if (sn==1) {if (which.SN.value=="") {alert ("Bitte Name eingeben");which.SN.focus();return false;}}
if (s==1) {if (which.S.value=="") {alert ("Bitte Adresse eingeben");which.S.focus();return false;}}
if (stn==1) {if (which.STN.value=="") {alert ("Bitte Hausnummer eingeben");which.STN.focus();return false;}}
if (z==1) {if (which.Z.value=="") {alert ("Bitte Postleitzahl eingeben");which.Z.focus();return false;}}
if (zc==1) {if (which.ZC.value=="") {alert ("Bitte Stadt eingeben");which.ZC.focus();return false;}}
if (co==1) {if (which.CO[which.CO.selectedIndex].value=='') {alert ("Bitte wählen Sie Ihr Land aus");which.CO.focus();return false;}
else {if (which.CO[which.CO.selectedIndex].value=='000' && which.OC.value=='') {alert ("Bitte geben Sie Ihr Land an");which.OC.focus();return false;}}
if (ph==1) {if (which.PH.value=="") {alert ("Bitte geben Sie Ihre Telefonnummer an");which.PH.focus();return false;}}
if (e==1) {var EmailOK = checkEmail(which.E.value);if (!(EmailOK=="")) {alert (EmailOK);which.E.focus();return false;}else return true;}}
if (wf==1) {if (which.W[which.W.selectedIndex].value=='') {alert ("Bitte sagen Sie uns, wie Sie uns gefunden haben. Vielen Dank!");which.W.focus();return false;}}
return true;
}
function showhouse2( elm, housenumber, price, people, season, a, lang ) {
var elementsBeforeCheckboxes = 0
var elementsAfterCheckboxes = 1
var startDatoStr = null;
// Startdatoen fastlægges
for (var i = elementsBeforeCheckboxes; i < elm.elements.length-elementsAfterCheckboxes; i++)
 {
 if(elm.elements[i].type=='hidden') {continue;}
  if (elm.elements[i].checked)
   {
    startDatoStr = elm.elements[i].value
    var start = i;
    break;
   }
else
   {
    startDatoStr = null;
   }
  }
 for (var i = start; i < elm.elements.length-elementsAfterCheckboxes; i++)
  {
if (elm.elements[i+1].type=='checkbox')
{
   if (!elm.elements[i+1].checked)
    {
     slutDatoStr = elm.elements[i+1].value
     break;
    }
}
else
{
   slutDatoStr = elm.elements[i+1].value
     break;
}
  }
if ( startDatoStr == null  )
{
var url = "/NOV/756.nsf/x/house?opendocument&H="+housenumber+"&O=1&S="+elm.season.value+"&A="+a;
anotherwin =  window.open(url, housenumber, 'width=750,height=440,toolbar=no,scrollbars=yes,resizable=yes');
anotherwin.focus;
} else {
showhouse( housenumber, '756', price, startDatoStr, slutDatoStr, people, 'NOV', '&A='+a)
}
}
function showhouse1(housenumber, language, price, startdate, enddate, people, company, season)
{
 location.href = "/"+company+"/"+language+".nsf/0/house?opendocument&H="+housenumber+"&P="+price+"&SD="+startdate+"&ED="+enddate+"&PE="+people+"&"+ "&S="+season;
}
function showhouse(housenumber, language, price, startdate, enddate, people, company, a)
{
 var season = startdate.substr( startdate.lastIndexOf( '-' )+1 );
// anotherwin =  window.open( "/web/nov.nsf/house?openagent&H="+housenumber+"&P="+price+"&SD="+startdate+"&ED="+enddate+"&PE="+people+"&L=208&S=" + season + "&"+login, housenumber,'width=760,height=440,toolbar=no,status=yes,scrollbars=yes,resizable=yes');
 anotherwin =  window.open( "/"+company+"/"+language+".nsf/x/house?opendocument&H="+housenumer+"&P="+price+"&SD="+startdate+"&ED="+enddate+"&PE="+people+"&"+ "&S=" + season + "&"+a, housenumber,'width=760,height=440,toolbar=no,status=yes,scrollbars=yes,resizable=yes');
 anotherwin.focus;
}
function showMarkers(house_x, house_y, index) {
 // Array to hold coordinats of map cropping geocodes (map_x1,map_y1,map_x2,map_y2)
 var country_map_array = new Array(16);
 country_map_array["denmark"]=  new Array(430000,6055000,747000,6440000); 
 country_map_array["sweden"]=   new Array(239444,6190000,1550556,7810000);
 country_map_array["norway"]=   new Array(142380,6470000,1487619,8100000);
 country_map_array["holland"]=  new Array(100000,5631904,387000,5988095);
 country_map_array["belgium"]=  new Array(41000,5448571,325000,5791429);
 country_map_array["germany"]=  new Array(280000,5260000,930000,6150000);
 country_map_array["austria"]=  new Array(540000,4984444,1120000,5695556);
 country_map_array["hungary"]=  new Array(1040000,4996667,1520000,5613333);
 country_map_array["poland"]=   new Array(840000,5432414,1580000,6287586);
 country_map_array["czechrep"]= new Array(720000,5249746,1220000,5880254);
 country_map_array["slovakia"]= new Array(1070000,5211842,1480000,5738158);
 country_map_array["italy"]=    new Array(300000,4080000,1340000,5320000);
 country_map_array["france"]=   new Array(-550000,4517647,580000,5882353);
 country_map_array["croatia"]=  new Array(850000,4706733,1300000,5253267);
 country_map_array["greece"]=   new Array(1420000,3843636,2360000,5016364);
 country_map_array["spain"]=    new Array(-1255859,3787594,95393,5298646);
 country_map_array["switzerl"]= new Array(265000,5305000,615000,5040000);
 // array of house-geocodes
 var webhouses = new Array(1);
 webhouses[1]= new Array(house_x,house_y); 
 // array of country-maps
 var webmaps = new Array(2);
 for (var loop = 1; loop < webmaps.length; loop++)
 {
 if (index != undefined) {webmaps[loop]= document.getElementById("houseMap_"+ index);
 } else {
  webmaps[loop]= document.getElementById("houseMap_"+loop);
 }
 }
 
 // array of map-markers
 var webmarkers = new Array(2);
 for (var loop = 1; loop < webmarkers.length; loop++)
 {
 if (index != undefined) {webmarkers[loop]= document.getElementById("marker_"+ index);
 } else {
  webmarkers[loop]= document.getElementById("marker_"+loop);
 }
 }
 
 
  
 for (var loop = 1; loop < webmaps.length; loop++)
 {
  //get geomap coordinates
  geomap_coordinates = country_map_array[webmaps[loop].name];
  
  //calculate map-size i geocodes
  geomap_width=(geomap_coordinates[2]-geomap_coordinates[0]);
  geomap_height=(geomap_coordinates[3]-geomap_coordinates[1]);
  
  // calculate number of geocodes per pixel
  geocodes_per_pixel_width = (geomap_width / webmaps[loop].width);
  geocodes_per_pixel_height = (geomap_height / webmaps[loop].height);
  
  // calculate position of marker
  if ((webhouses[loop][0] > 855464 & webhouses[loop][0] < 897022) & (webhouses[loop][1] > 6104899 & webhouses[loop][1] < 6152359)) { //bornholm
   leftmarker = ((webhouses[loop][0] - geomap_coordinates[0])/ geocodes_per_pixel_width)- 47 +"px";
   topmarker = ((geomap_coordinates[3]- webhouses[loop][1])/ geocodes_per_pixel_height)- 64 +"px";
   
  } else if ((webhouses[loop][0] < -1700000 & webhouses[loop][0] > -2200000) & (webhouses[loop][1] > 3100000 & webhouses[loop][1] < 3600000)) { //canary islands
   leftmarker = ((webhouses[loop][0] - geomap_coordinates[0])/ geocodes_per_pixel_width)+ 67 +"px";
   topmarker = ((geomap_coordinates[3]- webhouses[loop][1])/ geocodes_per_pixel_height)- 47 +"px";
   
  } else {
   leftmarker = ((webhouses[loop][0] - geomap_coordinates[0])/ geocodes_per_pixel_width)- 3 +"px";
   topmarker = ((geomap_coordinates[3]- webhouses[loop][1])/ geocodes_per_pixel_height)- 3 +"px";
  }
  //place marker on maplayer, and make in visible
  webmarkers[loop].style.left = leftmarker;
  webmarkers[loop].style.top = topmarker;
  webmarkers[loop].style.visibility = "visible";
 }
}
function showMarker(house_x,house_y) {
 // Array to hold coordinats of map cropping geocodes (map_x1,map_y1,map_x2,map_y2)
 var country_map_array = new Array(16);
 country_map_array["denmark"]=  new Array(430000,6055000,747000,6440000); 
 country_map_array["sweden"]=   new Array(600000,6160000,1190000,7790000);
 country_map_array["norway"]=   new Array(250000,6470000,1380000,8100000);
 country_map_array["holland"]=  new Array(100000,5640000,387000,5980000);
 country_map_array["belgium"]=  new Array(41000,5500000,325000,5740000);
 country_map_array["germany"]=  new Array(280000,5260000,930000,6150000);
 country_map_array["austria"]=  new Array(540000,5180000,1120000,5500000);
 country_map_array["hungary"]=  new Array(1040000,5120000,1520000,5490000);
 country_map_array["poland"]=   new Array(840000,5550000,1580000,6170000);
 country_map_array["czechrep"]= new Array(720000,5410000,1220000,5720000);
 country_map_array["slovakia"]= new Array(1070000,5350000,1480000,5600000);
 country_map_array["italy"]=    new Array(300000,4080000,1340000,5320000);
 country_map_array["france"]=   new Array(-550000,4620000,580000,5780000);
 country_map_array["croatia"]=  new Array(850000,4750000,1300000,5210000);
 country_map_array["greece"]=   new Array(1420000,4000000,2360000,4860000);
 country_map_array["spain"]=    new Array(-1255859,3976475,95393,5109764);
 country_map_array["switzerl"]= new Array(265000,5540000,615000,5040000);
 // array of house-geocodes
 var webhouses = new Array(1);
 webhouses[1]= new Array(house_x,house_y); 
 // array of country-maps
 var webmaps = new Array(2);
 for (var loop = 1; loop < webmaps.length; loop++)
 {
  webmaps[loop]= document.getElementById("houseMap_"+loop);
 }
 
 
 // array of map-markers
 var webmarkers = new Array(2);
 for (var loop = 1; loop < webmarkers.length; loop++)
 {
  webmarkers[loop]= document.getElementById("marker_"+loop);
 }
 
 
 
  
 for (var loop = 1; loop < webmaps.length; loop++)
 { 
  //get geomap coordinates
  geomap_coordinates = country_map_array[webmaps[loop].name];
  
  //calculate map-size i geocodes
  geomap_width=(geomap_coordinates[2]-geomap_coordinates[0]);
  geomap_height=(geomap_coordinates[3]-geomap_coordinates[1]);
  
  // calculate number of geocodes per pixel
  geocodes_per_pixel_width = (geomap_width / webmaps[loop].width);
  geocodes_per_pixel_height = (geomap_height / webmaps[loop].height);
  
  // calculate position of marker
  if ((webhouses[loop][0] > 855464 & webhouses[loop][0] < 897022) & (webhouses[loop][1] > 6104899 & webhouses[loop][1] < 6152359)) { //bornholm
   leftmarker = ((webhouses[loop][0] - geomap_coordinates[0])/ geocodes_per_pixel_width)- 47 +"px";
   topmarker = ((geomap_coordinates[3]- webhouses[loop][1])/ geocodes_per_pixel_height)- 64 +"px";
   
  } else if ((webhouses[loop][0] < -1700000 & webhouses[loop][0] > -2200000) & (webhouses[loop][1] > 3100000 & webhouses[loop][1] < 3600000)) { //canary islands
   leftmarker = ((webhouses[loop][0] - geomap_coordinates[0])/ geocodes_per_pixel_width)+ 67 +"px";
   topmarker = ((geomap_coordinates[3]- webhouses[loop][1])/ geocodes_per_pixel_height)- 47 +"px";
   
  } else {
   leftmarker = ((webhouses[loop][0] - geomap_coordinates[0])/ geocodes_per_pixel_width)- 3 +"px";
   topmarker = ((geomap_coordinates[3]- webhouses[loop][1])/ geocodes_per_pixel_height)- 3 +"px";
  }
  //place marker on maplayer, and make in visible
  webmarkers[loop].style.left = leftmarker;
  webmarkers[loop].style.top = topmarker;
  webmarkers[loop].style.visibility = "visible";
 }
}
function SelectCountry(Country) {
window.location.href = "/NOV/756.nsf/0/" + Country + "searchalpine?OpenDocument";
}

function chgs(c,s){
var URLString = location.href;
oldValue = "S=" + c;
newValue = "S=" + s;
if (URLString.indexOf(oldValue) > 0){
URLString = URLString.replace(oldValue, newValue);} else {
URLString = location.href + "&" + newValue;}
location.replace(URLString);
}
function fbs_click(url) {
u= url + "&WT.mc_id=FB";
t=document.title;
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}

function check_gb_form() {
var error_message = '';
if (document.gb_form.gb_email.value=="") { error_message +='Bitte angeben eine korrekte E-mail Adresse'; ; }
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.gb_form.gb_email.value)==false) { error_message += 'Bitte angeben eine korrekte E-mail Adresse'; }
if(error_message !=''){
alert(error_message);
return false;
}
return true;
}
function openSitemapWindow(URL) {
sitemapWin=window.open(URL,'sitemap','width=815,height=600,directories=no,status=yes,scrollbars=yes,resizable=no,menubar=no,toolbar=no');
}
function VisHusPopup(house) {
url = '/house.nsf/0/756NOV?opendocument&H='+house+'&_xview';
window.open(url,"",'width=775,height=700,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=yes,toolbar=no');
}
function openWindow(URL) {
window.open(URL,"",'width=580,height=460,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=yes,toolbar=no');
}

function goLogin(loginpath) {
  window.location = "/appserver/Redirect?action=safe&basehref="+location.hostname+"&destination="+loginpath;
}

          function login(){
              $("#loginreply").html("<img src='/site/_img/ajax-loader.gif' alt='' />")
              $.post("/appserver/BureauWebsite/CheckSession", $("#loginform").serialize(), function(reply){
                  if(reply=="true"){
                      var ref = document.referrer;
                      if(ref != null && ref.indexOf("BureauWebsite")!=-1){
                          window.location = document.referrer;
                      }else{
                        window.location = "/appserver/Redirect?action=safe&basehref=&destination=https://safe.novasol.com/login/agency.html?F=A&A="+loginform.account.value;
                      }
                  }else{
                      setReply("loginreply","Falsches Passwort oder Agenturnummer","red");
                  }
              }, "text");
              return false;
          }

          function agencySendPassword(){
              $.post("/appserver/BureauWebsite/SendPassword", {"email":$("#email").val(),"COM":"NOV","L":"756","account":$("#account").val()}, function(reply){
                  if(reply=="true"){
                    setReply("sendEmailReply","E-mail wurde versendet","green");
                  }else{
                    setReply("sendEmailReply","Fehler! E-mail Adresse und Agenturnummer stimmen nicht überein. Das Passwort wird nur an die bei uns registrierte E-mail Adresse geschickt.","red")
                  }
              }, "text");
              return false;
          }

          function setReply(id,text,color){
            $("#"+id).html(text);
            $("#"+id).css("color",color);
            $("#"+id).fadeIn("slow");
            setTimeout('$("#'+id+'").fadeOut("slow");','5000');
          }

function setOption(v, key) {
 if (v) {
  for (var loop = 0; loop < v.length; loop++) {
   if (v[loop].value == key) {
    v[loop].selected = true;
   }
  }
 }
}

function chkSelect(f){
  pe=f.PE.options[document.search.PE.options.selectedIndex].value;
  if (f.C.type=="hidden") {
    c = f.C.value;
  } else {
    c = f.C.options[document.search.C.options.selectedIndex].value;
  }
  if (!pe||!c){
   alert("Bitte wählen Sie ein Reiseziel und Anzahl Personen.");
   return false;
  }
}

function doSubmit(f) {
 if (cookielist['A']) {
  if (f.A) {   
   f.A.value = cookielist['A'];
  }
 }
  if(f.name == 'search') {
   if(chkSelect(f) == false){
    return;
  }
   f.action = '/result.nsf/0/756nov';
   f.submit();
  }
  else if (f.name == 'housesearch'){
   go2house(f.house.value, 'NOV');
   return false;
  } else {
    f.submit();
  }
} 
function doAdvSearch() {
 if (cookielist['A']) {
  if (document.search.A) {   
   document.search.A.value = cookielist['A'];
  }
 }
 if (cookielist['F']) {
  if (document.search.A) {   
   document.search.A.value = cookielist['A'];
  }
 }
 document.search.action = '/search.nsf/0/756novCON';
 document.search.submit();
} 
function validateStartDate( theform )
{
 var s1 = theform.SD.value.indexOf( '-' );
 var s2 = theform.SD.value.lastIndexOf( '-' );
 var e1 = theform.ED.value.indexOf( '-' );
 var e2 = theform.ED.value.lastIndexOf( '-' );
 var sy = Math.abs(theform.SD.value.substr(s2+1,s2+5));
 var sm = Math.abs(theform.SD.value.substring(s1+1,s2));
 var sd = Math.abs(theform.SD.value.substr(0,s1));
 var ey = Math.abs(theform.ED.value.substr(e2+1,e2+5));
 var em = Math.abs(theform.ED.value.substring(e1+1,e2));
 var ed = Math.abs(theform.ED.value.substr(0,e1));
 var temp = new Date( sy, sm-1, sd+7);
 // Netscape JS fix
 var zY = temp.getYear() < 1999 ? temp.getYear() + 1900 : temp.getYear();
 theform.ED.value = temp.getDate() + "-" + eval(temp.getMonth()+1) + "-" + zY; 
}
function subcal(s) {
 addWindow = window.open(s,"calendar","width=203,height=140,resizable=1,status=0,menubar=0,scrollbars=0,fullscreen=0");
 addWindow.focus() 
}
function makeLink(f,dateField,country) {
 findValue = document.forms[f].elements[dateField].value.split('-');
 myMonth = findValue[1];
 myYear = findValue[2];
 var calname = f;
 if (calname.search(/alpine/) > -1) {
  subcal('/search.nsf/0/calendaralpine756?opendocument&dateField='+dateField+'&m='+myMonth+'&y='+myYear+'&formname='+f+'&country='+country)
 } else {
  subcal('/search.nsf/0/756novcalendar?opendocument&dateField='+dateField+'&m='+myMonth+'&y='+myYear+'&formname='+f+'&country='+country)
 }
}
function getCookie(v, value, param_list) {
 var the_cookie = ' '+document.cookie;
 var broken_cookie = the_cookie.split(";");
 var cookiestring="";
 var search_for; 
 for (var loop = 0; loop < broken_cookie.length; loop++) {
  search_for = v+'=';
  if (search_for == broken_cookie[loop].substring(1,v.length+2)) {
   cookiestring = broken_cookie[loop].substring(v.length+2,broken_cookie[loop].length);
  }
 }
 if (value.length>1) {
  if (cookiestring.length>1) {
   cookiestring= cookiestring+'&'+value;
  } else {
   cookiestring= value;
  }
 }
 var valuesets = cookiestring.split('&');
 for (var loop1 = 0; loop1 < valuesets.length; loop1++) {
  if (valuesets[loop1].indexOf('=')>0) {
   var broken_info = valuesets[loop1].split("=");
   param_list[broken_info[0]] = broken_info[1];
  }
 }
}
function setCookie( param, value, e ) {
 var merged_value = "";
 var cookielist = new Array();
 getCookie(param, value, cookielist);

 for (key in validParametersArray) {
  if (cookielist[validParametersArray[key]]) {
   merged_value=merged_value+validParametersArray[key]+"="+cookielist[validParametersArray[key]]+"&";
  }
 }

 var expires = new Date();
 var domain = "";
 expires.setTime( expires.getTime() + e*60*60*1000 );
 var domainset = document.domain.split(".");
 if (domainset.length > 1) {
  domain = domainset[domainset.length-2]+"."+domainset[domainset.length-1];
 }
 var curCookie = param + "=" + merged_value + ((expires) ? "; expires=" + expires.toGMTString() : "") + "; path=/; domain="+domain;
 document.cookie = curCookie;
}

function deleteCookie(cookiename) {
  var cookie_date = new Date ( );
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookiename+"=;expires=" + cookie_date.toGMTString();
}

function go2house(housenumber, site) {
 if ((housenumber.length == 6 && site=="NOV")  || ( housenumber.length >4 &&  housenumber.length <7 && site=="DAN")) {
  var url = "/house.nsf/0/756"+site+"?opendocument&H="+housenumber;

   if (cookielist['A']) {
     url = url + "&A="+cookielist['A'];
   }
 location.href = url;
  } else if (housenumber.length == 6 && site=="CUE") {
  var url = "/appserver/ConsumerWebsite/ShowHouse?L=756&THEME=CON&COM="+site+"&H="+housenumber;

   if (cookielist['A']) {
     url = url + "&A="+cookielist['A'];
   }
 location.href = url;
 } else {
  var errDesc = "Bitte geben Sie eine 6-stellige NOVASOL Hausnummer ein (z.B. EBL102)"
  alert(errDesc)
 }
}

function go2result(theform) {
 var houselist = "";
 var housearray = document.getElementsByName("HQ");

 for (var count = 0; count  < housearray.length; count++) {
  if (housearray[count].value) {
   if (housearray[count].value.length == 6 ) {
    houselist = houselist + "^"+housearray[count].value;
   } else {
    houselist = "";
    break;
   }
  }
 }

 if (houselist.length>6) {
  houselist = houselist.substring(1,houselist.length);
 }

 if (!houselist){
  var errDesc = "Bitte geben Sie eine 6-stellige NOVASOL Hausnummer ein (z.B. EBL102)"
  alert(errDesc)
 } else {
  var url = "/result.nsf/0/list756nov?opendocument";
  url =url + "&SD="+theform.SD.value;
  url =url + "&ED="+theform.ED.value;
  url =url + "&HQ="+houselist;
  url =url + "&RTYPE=HOUSELIST";
  if (cookielist['A']) {
   url = url + "&A="+cookielist['A'];
  }
  location.href = url;
 }
}
function switchform(formtype) {
 if (formtype=='multiple') {
  document.getElementById("housesearch").style.display="none";
  document.getElementById("housesearchmultiple").style.display="inline";
 } else {
  document.getElementById("housesearch").style.display="inline";
  document.getElementById("housesearchmultiple").style.display="none";
 }
}

function VisHusPopup(house) {
url = '/house.nsf/0/756NOV?opendocument&H='+house+'&_xview';
window.open(url,"",'width=775,height=700,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=yes,toolbar=no');
}
function setAdvSearchValues(){
   for (element in advcookielist) { 
      changevalue = true;
      collection = document.getElementsByName(element);
      if (collection.length > 0) {
         for (counter in validParametersArray) {
            if (validParametersArray[counter] == element) {
               changevalue = false;
            }
         }
         if (changevalue) {
            if (collection[0].type == "checkbox") {
               collection[0].checked = true;
            } else if (collection[0].type == "text") {
               collection[0].value = advcookielist[element];
            } else if (collection[0].type == "select-one") {
               setOption(collection[0] , advcookielist[element]);
            }
         }
      }
   }
}
function setFieldValues(){

var cgiString = location.search;
if (cgiString.length > 1) {
var qstringlist = new Array();

 var valuesets = cgiString.substring(1, cgiString.length).split('&');
 for (var loop1 = 0; loop1 < valuesets.length; loop1++) {
  if (valuesets[loop1].indexOf('=')>0) {
   var broken_info = valuesets[loop1].split("=");
   qstringlist[broken_info[0]] = broken_info[1];
  }
 }

   for (element in qstringlist) { 
      collection = document.getElementsByName(element);
      if (collection.length > 0) {
         if (collection[0].type == "checkbox" && qstringlist[element] == "Y") {
            collection[0].checked = true;
         } else if (collection[0].type == "text") {
            collection[0].value = unescape(unescape(qstringlist[element]));
         } else if (collection[0].type == "textarea") {
            collection[0].value = unescape(unescape(qstringlist[element]));
         } else if (collection[0].type == "select-one") {
            setOption(collection[0] , unescape(qstringlist[element]));
         }
      }
   }
}
}

    function LatLng(lat, lng) {
      this.lat = lat;
      this.lng = lng;
          
      this.toUTM = convertToUTM;
      this.toUTM32 = convertToUTM32;
          
      this.toString = LatLngToString;
    }
    
    function LatLngToString() {
      return "Lat, Long: (" + this.lat + ", " + this.lng + ")";
    }
    
    function UTMRef(easting, northing, zone, southhemi) {
      this.easting  = easting;
      this.northing = northing;
      this.southhemi = southhemi;
      this.zone  = zone;
        
      this.toLatLng = convertFromUTM;
        
      this.toString = UTMRefToString;
    }
    
    
    function UTMRefToString() {
      var reply = this.lngZone + " " + this.easting + " " + this.northing;
      if(this.southhemi){
        reply += " southern hemisphere";
      }
      return reply;
    }
    
    var pi = 3.14159265358979;

    /* Ellipsoid model constants (actual values here are for WGS84) */
    var sm_a = 6378137.0;
    var sm_b = 6356752.314;
    var sm_EccSquared = 6.69437999013e-03;

    var UTMScaleFactor = 0.9996;


    /*
    * DegToRad
    *
    * Converts degrees to radians.
    *
    */
    function DegToRad (deg)
    {
        return (deg / 180.0 * pi)
    }




    /*
    * RadToDeg
    *
    * Converts radians to degrees.
    *
    */
    function RadToDeg (rad)
    {
        return (rad / pi * 180.0)
    }




    /*
    * ArcLengthOfMeridian
    *
    * Computes the ellipsoidal distance from the equator to a point at a
    * given latitude.
    *
    * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
    * GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
    *
    * Inputs:
    *     phi - Latitude of the point, in radians.
    *
    * Globals:
    *     sm_a - Ellipsoid model major axis.
    *     sm_b - Ellipsoid model minor axis.
    *
    * Returns:
    *     The ellipsoidal distance of the point from the equator, in meters.
    *
    */
    function ArcLengthOfMeridian (phi)
    {
        var alpha, beta, gamma, delta, epsilon, n;
        var result;

        /* Precalculate n */
        n = (sm_a - sm_b) / (sm_a + sm_b);

        /* Precalculate alpha */
        alpha = ((sm_a + sm_b) / 2.0)
           * (1.0 + (Math.pow (n, 2.0) / 4.0) + (Math.pow (n, 4.0) / 64.0));

        /* Precalculate beta */
        beta = (-3.0 * n / 2.0) + (9.0 * Math.pow (n, 3.0) / 16.0)
           + (-3.0 * Math.pow (n, 5.0) / 32.0);

        /* Precalculate gamma */
        gamma = (15.0 * Math.pow (n, 2.0) / 16.0)
            + (-15.0 * Math.pow (n, 4.0) / 32.0);
    
        /* Precalculate delta */
        delta = (-35.0 * Math.pow (n, 3.0) / 48.0)
            + (105.0 * Math.pow (n, 5.0) / 256.0);
    
        /* Precalculate epsilon */
        epsilon = (315.0 * Math.pow (n, 4.0) / 512.0);
    
    /* Now calculate the sum of the series and return */
    result = alpha
        * (phi + (beta * Math.sin (2.0 * phi))
            + (gamma * Math.sin (4.0 * phi))
            + (delta * Math.sin (6.0 * phi))
            + (epsilon * Math.sin (8.0 * phi)));

    return result;
    }



    /*
    * UTMCentralMeridian
    *
    * Determines the central meridian for the given UTM zone.
    *
    * Inputs:
    *     zone - An integer value designating the UTM zone, range [1,60].
    *
    * Returns:
    *   The central meridian for the given UTM zone, in radians, or zero
    *   if the UTM zone parameter is outside the range [1,60].
    *   Range of the central meridian is the radian equivalent of [-177,+177].
    *
    */
    function UTMCentralMeridian (zone)
    {
        var cmeridian;

        cmeridian = DegToRad (-183.0 + (zone * 6.0));
    
        return cmeridian;
    }



    /*
    * FootpointLatitude
    *
    * Computes the footpoint latitude for use in converting transverse
    * Mercator coordinates to ellipsoidal coordinates.
    *
    * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
    *   GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
    *
    * Inputs:
    *   y - The UTM northing coordinate, in meters.
    *
    * Returns:
    *   The footpoint latitude, in radians.
    *
    */
    function FootpointLatitude (y)
    {
        var y_, alpha_, beta_, gamma_, delta_, epsilon_, n;
        var result;
        
        /* Precalculate n (Eq. 10.18) */
        n = (sm_a - sm_b) / (sm_a + sm_b);
         
        /* Precalculate alpha_ (Eq. 10.22) */
        /* (Same as alpha in Eq. 10.17) */
        alpha_ = ((sm_a + sm_b) / 2.0)
            * (1 + (Math.pow (n, 2.0) / 4) + (Math.pow (n, 4.0) / 64));
        
        /* Precalculate y_ (Eq. 10.23) */
        y_ = y / alpha_;
        
        /* Precalculate beta_ (Eq. 10.22) */
        beta_ = (3.0 * n / 2.0) + (-27.0 * Math.pow (n, 3.0) / 32.0)
            + (269.0 * Math.pow (n, 5.0) / 512.0);
        
        /* Precalculate gamma_ (Eq. 10.22) */
        gamma_ = (21.0 * Math.pow (n, 2.0) / 16.0)
            + (-55.0 * Math.pow (n, 4.0) / 32.0);
         
        /* Precalculate delta_ (Eq. 10.22) */
        delta_ = (151.0 * Math.pow (n, 3.0) / 96.0)
            + (-417.0 * Math.pow (n, 5.0) / 128.0);
         
        /* Precalculate epsilon_ (Eq. 10.22) */
        epsilon_ = (1097.0 * Math.pow (n, 4.0) / 512.0);
         
        /* Now calculate the sum of the series (Eq. 10.21) */
        result = y_ + (beta_ * Math.sin (2.0 * y_))
            + (gamma_ * Math.sin (4.0 * y_))
            + (delta_ * Math.sin (6.0 * y_))
            + (epsilon_ * Math.sin (8.0 * y_));
        
        return result;
    }



    /*
    * MapLatLonToXY
    *
    * Converts a latitude/longitude pair to x and y coordinates in the
    * Transverse Mercator projection.  Note that Transverse Mercator is not
    * the same as UTM; a scale factor is required to convert between them.
    *
    * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
    * GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
    *
    * Inputs:
    *    phi - Latitude of the point, in radians.
    *    lambda - Longitude of the point, in radians.
    *    lambda0 - Longitude of the central meridian to be used, in radians.
    *
    * Outputs:
    *    xy - A 2-element array containing the x and y coordinates
    *         of the computed point.
    *
    * Returns:
    *    The function does not return a value.
    *
    */
    function MapLatLonToXY (phi, lambda, lambda0, xy)
    {
        var N, nu2, ep2, t, t2, l;
        var l3coef, l4coef, l5coef, l6coef, l7coef, l8coef;
        var tmp;

        /* Precalculate ep2 */
        ep2 = (Math.pow (sm_a, 2.0) - Math.pow (sm_b, 2.0)) / Math.pow (sm_b, 2.0);
    
        /* Precalculate nu2 */
        nu2 = ep2 * Math.pow (Math.cos (phi), 2.0);
    
        /* Precalculate N */
        N = Math.pow (sm_a, 2.0) / (sm_b * Math.sqrt (1 + nu2));
    
        /* Precalculate t */
        t = Math.tan (phi);
        t2 = t * t;
        tmp = (t2 * t2 * t2) - Math.pow (t, 6.0);

        /* Precalculate l */
        l = lambda - lambda0;
    
        /* Precalculate coefficients for l**n in the equations below
           so a normal human being can read the expressions for easting
           and northing
           -- l**1 and l**2 have coefficients of 1.0 */
        l3coef = 1.0 - t2 + nu2;
    
        l4coef = 5.0 - t2 + 9 * nu2 + 4.0 * (nu2 * nu2);
    
        l5coef = 5.0 - 18.0 * t2 + (t2 * t2) + 14.0 * nu2
            - 58.0 * t2 * nu2;
    
        l6coef = 61.0 - 58.0 * t2 + (t2 * t2) + 270.0 * nu2
            - 330.0 * t2 * nu2;
    
        l7coef = 61.0 - 479.0 * t2 + 179.0 * (t2 * t2) - (t2 * t2 * t2);
    
        l8coef = 1385.0 - 3111.0 * t2 + 543.0 * (t2 * t2) - (t2 * t2 * t2);
    
        /* Calculate easting (x) */
        xy[0] = N * Math.cos (phi) * l
            + (N / 6.0 * Math.pow (Math.cos (phi), 3.0) * l3coef * Math.pow (l, 3.0))
            + (N / 120.0 * Math.pow (Math.cos (phi), 5.0) * l5coef * Math.pow (l, 5.0))
            + (N / 5040.0 * Math.pow (Math.cos (phi), 7.0) * l7coef * Math.pow (l, 7.0));
    
        /* Calculate northing (y) */
        xy[1] = ArcLengthOfMeridian (phi)
            + (t / 2.0 * N * Math.pow (Math.cos (phi), 2.0) * Math.pow (l, 2.0))
            + (t / 24.0 * N * Math.pow (Math.cos (phi), 4.0) * l4coef * Math.pow (l, 4.0))
            + (t / 720.0 * N * Math.pow (Math.cos (phi), 6.0) * l6coef * Math.pow (l, 6.0))
            + (t / 40320.0 * N * Math.pow (Math.cos (phi), 8.0) * l8coef * Math.pow (l, 8.0));
    
        return;
    }
    
    
    
    /*
    * MapXYToLatLon
    *
    * Converts x and y coordinates in the Transverse Mercator projection to
    * a latitude/longitude pair.  Note that Transverse Mercator is not
    * the same as UTM; a scale factor is required to convert between them.
    *
    * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
    *   GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
    *
    * Inputs:
    *   x - The easting of the point, in meters.
    *   y - The northing of the point, in meters.
    *   lambda0 - Longitude of the central meridian to be used, in radians.
    *
    * Outputs:
    *   philambda - A 2-element containing the latitude and longitude
    *               in radians.
    *
    * Returns:
    *   The function does not return a value.
    *
    * Remarks:
    *   The local variables Nf, nuf2, tf, and tf2 serve the same purpose as
    *   N, nu2, t, and t2 in MapLatLonToXY, but they are computed with respect
    *   to the footpoint latitude phif.
    *
    *   x1frac, x2frac, x2poly, x3poly, etc. are to enhance readability and
    *   to optimize computations.
    *
    */
    function MapXYToLatLon (x, y, lambda0, philambda)
    {
        var phif, Nf, Nfpow, nuf2, ep2, tf, tf2, tf4, cf;
        var x1frac, x2frac, x3frac, x4frac, x5frac, x6frac, x7frac, x8frac;
        var x2poly, x3poly, x4poly, x5poly, x6poly, x7poly, x8poly;
     
        /* Get the value of phif, the footpoint latitude. */
        phif = FootpointLatitude (y);
         
        /* Precalculate ep2 */
        ep2 = (Math.pow (sm_a, 2.0) - Math.pow (sm_b, 2.0))
              / Math.pow (sm_b, 2.0);
         
        /* Precalculate cos (phif) */
        cf = Math.cos (phif);
         
        /* Precalculate nuf2 */
        nuf2 = ep2 * Math.pow (cf, 2.0);
         
        /* Precalculate Nf and initialize Nfpow */
        Nf = Math.pow (sm_a, 2.0) / (sm_b * Math.sqrt (1 + nuf2));
        Nfpow = Nf;
         
        /* Precalculate tf */
        tf = Math.tan (phif);
        tf2 = tf * tf;
        tf4 = tf2 * tf2;
        
        /* Precalculate fractional coefficients for x**n in the equations
           below to simplify the expressions for latitude and longitude. */
        x1frac = 1.0 / (Nfpow * cf);
        
        Nfpow *= Nf;   /* now equals Nf**2) */
        x2frac = tf / (2.0 * Nfpow);
        
        Nfpow *= Nf;   /* now equals Nf**3) */
        x3frac = 1.0 / (6.0 * Nfpow * cf);
        
        Nfpow *= Nf;   /* now equals Nf**4) */
        x4frac = tf / (24.0 * Nfpow);
        
        Nfpow *= Nf;   /* now equals Nf**5) */
        x5frac = 1.0 / (120.0 * Nfpow * cf);
        
        Nfpow *= Nf;   /* now equals Nf**6) */
        x6frac = tf / (720.0 * Nfpow);
        
        Nfpow *= Nf;   /* now equals Nf**7) */
        x7frac = 1.0 / (5040.0 * Nfpow * cf);
        
        Nfpow *= Nf;   /* now equals Nf**8) */
        x8frac = tf / (40320.0 * Nfpow);
        
        /* Precalculate polynomial coefficients for x**n.
           -- x**1 does not have a polynomial coefficient. */
        x2poly = -1.0 - nuf2;
        
        x3poly = -1.0 - 2 * tf2 - nuf2;
        
        x4poly = 5.0 + 3.0 * tf2 + 6.0 * nuf2 - 6.0 * tf2 * nuf2
         - 3.0 * (nuf2 *nuf2) - 9.0 * tf2 * (nuf2 * nuf2);
        
        x5poly = 5.0 + 28.0 * tf2 + 24.0 * tf4 + 6.0 * nuf2 + 8.0 * tf2 * nuf2;
        
        x6poly = -61.0 - 90.0 * tf2 - 45.0 * tf4 - 107.0 * nuf2
         + 162.0 * tf2 * nuf2;
        
        x7poly = -61.0 - 662.0 * tf2 - 1320.0 * tf4 - 720.0 * (tf4 * tf2);
        
        x8poly = 1385.0 + 3633.0 * tf2 + 4095.0 * tf4 + 1575 * (tf4 * tf2);
         
        /* Calculate latitude */
        philambda[0] = phif + x2frac * x2poly * (x * x)
         + x4frac * x4poly * Math.pow (x, 4.0)
         + x6frac * x6poly * Math.pow (x, 6.0)
         + x8frac * x8poly * Math.pow (x, 8.0);
         
        /* Calculate longitude */
        philambda[1] = lambda0 + x1frac * x
         + x3frac * x3poly * Math.pow (x, 3.0)
         + x5frac * x5poly * Math.pow (x, 5.0)
         + x7frac * x7poly * Math.pow (x, 7.0);
         
        return;
    }




    /*
    * LatLonToUTMXY
    *
    * Converts a latitude/longitude pair to x and y coordinates in the
    * Universal Transverse Mercator projection.
    *
    * Inputs:
    *   lat - Latitude of the point, in radians.
    *   lon - Longitude of the point, in radians.
    *   zone - UTM zone to be used for calculating values for x and y.
    *          If zone is less than 1 or greater than 60, the routine
    *          will determine the appropriate zone from the value of lon.
    *
    * Outputs:
    *   xy - A 2-element array where the UTM x and y values will be stored.
    *
    * Returns:
    *   The UTM zone used for calculating the values of x and y.
    *
    */
    function LatLonToUTMXY (lat, lon, zone, xy)
    {
        MapLatLonToXY (lat, lon, UTMCentralMeridian (zone), xy);

        /* Adjust easting and northing for UTM system. */
        xy[0] = xy[0] * UTMScaleFactor + 500000.0;
        xy[1] = xy[1] * UTMScaleFactor;
        if (xy[1] < 0.0)
            xy[1] = xy[1] + 10000000.0;

        return zone;
    }
    
    
    
    /*
    * UTMXYToLatLon
    *
    * Converts x and y coordinates in the Universal Transverse Mercator
    * projection to a latitude/longitude pair.
    *
    * Inputs:
    * x - The easting of the point, in meters.
    * y - The northing of the point, in meters.
    * zone - The UTM zone in which the point lies.
    * southhemi - True if the point is in the southern hemisphere;
    *               false otherwise.
    *
    * Outputs:
    * latlon - A 2-element array containing the latitude and
    *            longitude of the point, in radians.
    *
    * Returns:
    * The function does not return a value.
    *
    */
    function UTMXYToLatLon (x, y, zone, southhemi, latlon)
    {
        var cmeridian;
         
        x -= 500000.0;
        x /= UTMScaleFactor;
         
        /* If in southern hemisphere, adjust y accordingly. */
        if (southhemi)
        y -= 10000000.0;
          
        y /= UTMScaleFactor;
        
        cmeridian = UTMCentralMeridian (zone);
        MapXYToLatLon (x, y, cmeridian, latlon);
         
        return;
    }
    
    function convertToUTM ()
    {
        var xy = new Array(2);
        
        if (isNaN (parseFloat (this.lng))) {
            alert ("Please enter a valid longitude in the lon field.");
            return false;
        }
        
        var lon = parseFloat(this.lng);

        if ((lon < -180.0) || (180.0 <= lon)) {
            alert ("The longitude you entered is out of range.  " +
                   "Please enter a number in the range [-180, 180).");
            return false;
        }

        if (isNaN (parseFloat (this.lat))) {
            alert ("Please enter a valid latitude in the lat field.");
            return false;
        }
        
        var lati = parseFloat(this.lat);
        
        if ((lati < -90.0) || (90.0 < lati)) {
            alert ("The latitude you entered is out of range.  " +
                   "Please enter a number in the range [-90, 90].");
            return false;
        }

        // Compute the UTM zone.
        zone = Math.floor ((lon + 180.0) / 6) + 1;

        zone = LatLonToUTMXY (DegToRad (lati), DegToRad (lon), zone, xy);
        
        return new UTMRef(xy[0], xy[1], zone, lati < 0);
    }
    
    /**
     *  Converts a longitude latitude to the UTM set of the chosen zone. Returns a size two array with the easting and northing.
     */         
    function convertToUTM32 (longitude, latitude)
    {
        var xy = new Array(2);
        
        if (isNaN (parseFloat (this.lng))) {
            alert ("Please enter a valid longitude in the lon field.");
            return false;
        }

        lon = parseFloat (this.lng);

        if ((lon < -180.0) || (180.0 <= lon)) {
            alert ("The longitude you entered is out of range.  " +
                   "Please enter a number in the range [-180, 180).");
            return false;
        }

        if (isNaN (parseFloat (this.lat))) {
            alert ("Please enter a valid latitude in the lat field.");
            return false;
        }

        lat = parseFloat (this.lat);

        if ((lat < -90.0) || (90.0 < lat)) {
            alert ("The latitude you entered is out of range.  " +
                   "Please enter a number in the range [-90, 90].");
            return false;
        }

        // Compute the UTM zone.
        zone = 32;

        zone = LatLonToUTMXY (DegToRad (lat), DegToRad (lon), zone, xy);

        return new UTMRef(xy[0], xy[1], zone, lat < 0);
    }
    
    /**
     * Returns a given UTM coordinate as a Longitude Latitude coordinate set as an array of size two
     */         
    function convertFromUTM (){
        latlon = new Array(2);
        
        if (isNaN (parseFloat (this.easting))) {
            alert ("Please enter a valid easting in the x field.");
            return false;
        }

        if (isNaN (parseFloat (this.northing))) {
            alert ("Please enter a valid northing in the y field.");
            return false;
        }

        if (isNaN (parseInt (this.zone))) {
            alert ("Please enter a valid UTM zone in the zone field.");
            return false;
        }

        if ((this.zone < 1) || (60 < this.zone)) {
            alert ("The UTM zone you entered is out of range.  " +
                   "Please enter a number in the range [1, 60].");
            return false;
        }

        UTMXYToLatLon (this.easting, this.northing, this.zone, this.southhemi, latlon);

        return new LatLng(RadToDeg(latlon[0]),RadToDeg(latlon[1]));
    }
/* Coords is in UTM32 */
function placeMapMarkers(coordFormat,coord1,coord2,counter){
    
    if (coordFormat == "latlng") {
     var latlng = new LatLng(coord2,coord1);
     var umt32 = latlng.toUTM32();     
     coord1 = umt32.easting;
     coord2 = umt32.northing;
    }
    
                var h=new Array(16);
                h.c208=new Array(430000,6055000,747000,6440000);
                h.c752=new Array(239444,6190000,1550556,7810000);
                h.c578=new Array(142380,6470000,1487619,8100000);
                h.c528=new Array(100000,5631904,387000,5988095);
                h.c056=new Array(41000,5448571,325000,5791429);
                h.c280=new Array(280000,5260000,930000,6150000);
                h.c040=new Array(540000,4984444,1120000,5695556);
                h.c348=new Array(1040000,4996667,1520000,5613333);
                h.c616=new Array(840000,5432414,1580000,6287586);
                h.c203=new Array(720000,5249746,1220000,5880254);
                h.c703=new Array(1070000,5211842,1480000,5738158);
                h.c380=new Array(300000,4080000,1340000,5320000);
                h.c250=new Array(-550000,4517647,580000,5882353);
                h.c191=new Array(850000,4706733,1300000,5253267);
                h.c300=new Array(1420000,3843636,2360000,5016364);
                h.c724=new Array(-1255859,3787594,95393,5298646);
                h.c756=new Array(265000,5540000,615000,5040000);
                var map = document.getElementById("houseMap_"+counter);
                var dot = document.getElementById("marker_"+counter);

                geomap_coordinates=h[map.alt];
                geomap_width=(geomap_coordinates[2]-geomap_coordinates[0]);
                geomap_height=(geomap_coordinates[3]-geomap_coordinates[1]);
                geocodes_per_pixel_width=(geomap_width/map.width);
                geocodes_per_pixel_height=(geomap_height/map.height);
                if( (coord1>855464 && coord1<897022) && (coord2>6104899 && coord2<6152359) ){
                    leftmarker=((coord1-geomap_coordinates[0])/geocodes_per_pixel_width)-47+"px";
                    topmarker=((geomap_coordinates[3]-coord2)/geocodes_per_pixel_height)-64+"px";
                }else{
                    if((coord1<-1700000 && coord1>-2200000) && (coord2>3100000 && coord2<3600000)){
                        leftmarker=((coord1-geomap_coordinates[0])/geocodes_per_pixel_width)+67+"px";
                        topmarker=((geomap_coordinates[3]-coord2)/geocodes_per_pixel_height)-47+"px";
                    }else{
                        leftmarker=((coord1-geomap_coordinates[0])/geocodes_per_pixel_width)-4+"px";
                        topmarker=((geomap_coordinates[3]-coord2)/geocodes_per_pixel_height)-11+"px";
                    }
                }
                dot.style.left=leftmarker;
                dot.style.top=topmarker;
                dot.style.visibility="visible";
            }

function isElementInArray (arr, searchFor){
 for(var i = 0; i < arr.length; i++) {
  if (arr[i] == searchFor) {
   return true;
  }
 }
 return false;
}
// this function convert a date of type dd-mm-yyyy or yyyy-mm-dd from one to another
function convertDate_dd_mm_yyyyOryyyy_mm_dd (date, seperator){
var dateArr = date.split(seperator);
if (dateArr.length = 3) {
  return dateArr[2]+ '-' + dateArr[1] + '-' + dateArr[0];   
} else { 
 return false;
} 
} 
function EOSsearchParameters() {
// pic up the search parameters in map form
var args = getArgs(); 
//the delimeter characther used in the return string 
var delimeterChar = ',';
var rsStr = ''; 

// the array of parameters where we just take the value of the parameter. All other characters are converted
// to have the value 0 or 1.

var parameterArrayDates = ['SD','ED'];
var parameterArrayValue = ['C','R','SD','ED','PE','K','QE1','Q50','Q54','P','Q51','Q52','Q67','Q00'];

// all the parameters that we test for having a value
var parameterArray = ['C','R','SD','ED','PE','K','QE1','Q50','Q54','P','Q51','Q52','Q67','Q00','Q01','Q45','Q02','Q03','Q06','Q05','Q30','Q10','Q04','Q38','Q09','Q29','Q08','Q31','Q13','Q15','Q12','Q26','Q32'];

// run through the array of all parameters
for(var i = 0; i < parameterArray.length; i++) {
var searchParameter = parameterArray[i];
// search to see if the parameter is of type "Value" or type "0 or 1" 
 if (isElementInArray(parameterArrayValue,searchParameter)) { 
 // here we the value of the parameter (can be empty) 
  if (eval('args.' + parameterArray[i])) {
   if (isElementInArray(parameterArrayDates,searchParameter)) {
                                  rsStr = rsStr + convertDate_dd_mm_yyyyOryyyy_mm_dd (eval('args.' + parameterArray[i]),'-');     
   } else {
    rsStr = rsStr + eval('args.' + parameterArray[i]);
   }
  } else {
   rsStr = rsStr;
  }
   rsStr = rsStr + delimeterChar;
 } else { // here we know that the return value is 0 or 1
   if (eval('args.' + parameterArray[i])) { 
  // If we have the parameter we return 1   
    rsStr = rsStr + '1';
  } else {
  // here we don't have the parameter 
   rsStr = rsStr + '0';
  }
   rsStr = rsStr + delimeterChar;
 } // end if
 
} // end for
      return rsStr.substring(0,rsStr.lastIndexOf(delimeterChar));
} // end function
function EOSParam(value){
      if(value){
        return value;
      }
      return "";
    }
function EOSDateFormat(date){
      dateArray = date.split("-");
      if(dateArray.length<3) return date;
      return dateArray[2]+"-"+dateArray[1]+"-"+dateArray[0];
    }
function EOSProfiling(params){
      HEIAS_T=Math.random(); HEIAS_T=HEIAS_T*10000000000000000000;
      var shop_id=EOSParam(params.shop_id);
      var newsletter_flag=EOSParam(params.newsletter_flag);
      var catalogorder_flag=EOSParam(params.catalogorder_flag);
      var catalogorder_name=EOSParam(params.catalogorder_name);
      var product_recommendation=EOSParam(params.product_recommendation);
      var user_searchkeywords=EOSParam(params.user_searchkeywords);
      var order_article=EOSParam(params.order_article);
      var customer_zip=EOSParam(params.customer_zip);
      var product_onsale=EOSParam(params.product_onsale);
      var product_id=EOSParam(params.product_id);
      var wishlist_article=EOSParam(params.wishlist_article);
      var travel_start_date=EOSDateFormat(EOSParam(params.travel_start_date));
      var travel_end_date=EOSDateFormat(EOSParam(params.travel_end_date));
      var travel_kids=EOSParam(params.travel_kids);
      var travel_adults=EOSParam(params.travel_adults);
      var travel_hotel_category=EOSParam(params.travel_hotel_category);
      
      var HEIAS_SRC='https://ads.heias.com/x/heias.ret.px.fr/?PX=HT|' + HEIAS_T + '|n|5723|cus|6593|pb|1|customer_zip|' + customer_zip + '|order_article|' + order_article + '|shop_id|' + shop_id + '|newsletter_flag|' + newsletter_flag + '|catalogorder_flag|' + catalogorder_flag + '|catalogorder_name|' + catalogorder_name + '|product_recommendation|' + product_recommendation + '|user_searchkeywords|' + user_searchkeywords + '|product_onsale|' + product_onsale + '|product_id|' + product_id + '|wishlist_article|' + wishlist_article + '|travel_start_date|' + travel_start_date + '|travel_end_date|' + travel_end_date + '|travel_kids|' + travel_kids + '|travel_adults|' + travel_adults + '|travel_hotel_category|' + travel_hotel_category + '';

      document.write('<div id="px_div_' + HEIAS_T + '" style="position: absolute; left:0; top:0; width:0px; height:0px;"><iframe id="px_fr_'+HEIAS_T+'" name="px_fr_'+HEIAS_T+'" src="' + HEIAS_SRC + '" allowtransparency="true" framespacing="0" frameborder="no" scrolling="no" width="1" height="1"></iframe></div>');
    }
function EOSCheckOut(params){
      HEIAS_T=Math.random(); HEIAS_T=HEIAS_T*10000000000000000000;
  
      var order_article=EOSParam(params.order_article);
      var order_id=EOSParam(params.order_id);
      var order_total=EOSParam(params.order_total);
      var order_payment_method=EOSParam(params.order_payment_method);
      var customer_status=EOSParam(params.customer_status);
      var customer_zip=EOSParam(params.customer_zip);
      var travel_start_date=EOSDateFormat(EOSParam(params.travel_start_date));
      var travel_end_date=EOSDateFormat(EOSParam(params.travel_end_date));
      var travel_kids=EOSParam(params.travel_kids);
      var travel_adults=EOSParam(params.travel_adults);
      var travel_hotel_category=EOSParam(params.travel_hotel_category);
            
      document.write('<scr' + 'ipt language="JavaScript" type="text/javascript" src="https://ads.heias.com/x/heias.cpa/count.px.js/?PX=HT|' + HEIAS_T + '|cus|6593|pb|1|order_article|' + order_article + '|order_payment_method|' + order_payment_method + '|order_id|' + order_id + '|order_total|' + order_total + '|customer_status|' + customer_status + '|customer_zip|' + customer_zip + '|travel_start_date|' + travel_start_date + '|travel_end_date|' + travel_end_date + '|travel_kids|' + travel_kids + '|travel_adults|' + travel_adults + '|travel_hotel_category|' + travel_hotel_category + '"><\/scr' + 'ipt>');
    }

function checkSession(allowanonymous) {
  if(document.cookie.indexOf("agencySession=")!=-1) {
    if(allowanonymous) {
      jQuery("#mainmenu_login").html("Reisebüro");
      jQuery("#mainmenu_login").attr("href","https://safe.novasol.com/login/agency.html");
    } else {
      jQuery.post("/appserver/BureauWebsite/CheckSession", {"COM":"NOV","L":"756"}, function(reply){ 
        if(reply=="false"){ 
          window.location = "http://www.novasol.ch"; 
        } else {
          jQuery("#mainmenu_login").html("Reisebüro");
          jQuery("#mainmenu_login").attr("href","https://safe.novasol.com/login/agency.html");
        }
      });
    }
  } else {  
    if(!allowanonymous) {
      window.location = "http://www.novasol.ch"; 
    }
  }
}


function generateAreaOptions (countrycode) {
var select = document.search.R;
select.options.length=1;

var arealist = new Array();arealist["752"] = "^MITTEL-SCHWEDEN|MELSV^- Stockholm/Mälardalen|S43^- Värmland/Dalsland|S45^- Dalarna|S46^NORD-SCHWEDEN|NORSV^- Nord-Schweden|S49^SÜD-SCHWEDEN|SYDSV^- Schonen|S01^- Halland|S02^- Blekinge|S03^- Småland|S04^- Västergötland mit Göteborg|S07^- Bohuslän|S08^- Östergötland/Närke|S09^- Öland|S41^GOTLAND|S42"; arealist["100"] = "^BOURGAS|BBURG^- Sonnenstrand - Küste nördlich von  Bourgas|BGS^- Schwarzmeerküste Bourgas Süd|BGZ^VARNA|BVARN^- Schwarzmeerküste Varna Süd|BGM^- Nördliche Schwarzmeerküste|BGN^- Varna und Umgebung|BGV"; arealist["040"] = "^MITTELÖSTERREICH|CENTR^- Salzburgerland|ASA^ÖSTLICHES ÖSTERREICH|EASTH^- Burgenland|ABU^NÖRDLICHES ÖSTERREICH|NORTH^- Niederösterreich|ANO^- Oberösterreich|AOE^SÜDLICHES ÖSTERREICH|SOUTH^- Kärnten|AKA^- Steiermark|AST^WESTLICHES ÖSTERREICH|WESTH^- Tirol|ATI^- Voralberg|AVO"; arealist["616"] = "^MITTELPOLEN|CEPOL^- Westliche Seen/Wielkopolska|PPW^NÖRDLICHES POLEN|NOPOL^- Pommern/Kaschubische Schweiz|PKA^- Masurische Seenplatte|PMA^- Die Ostseeküste|PPO^- Rowy|PRO^SÜDLICHES POLEN|SOPOL^- Beskidengebirge/Hohe Tatra|PPG^- Sudetengebirge|PPZ"; arealist["280"] = "^Ganz DEUTSCHLAND|TYSKL^- Harz & Harzumland|DAN^- Bayern|DBA^- Brandenburg|DBB^- Berlin|DBE^- Bodensee|DBO^- Schwarzwald|DBW^- Kurhessisches Bergland|DHE^- Lüneburger Heide|DLH^- Mecklenburg Küste|DMK^- Rügen|DMR^- Usedom|DMU^- Mecklenburg-Vorpommern|DMV^- Niedersachsen-Nord|DNS^- Sauerland|DNW^- Mosel/Eifel/Hunsrück|DRP^- Vogtland/Erzgebirge/Sachsen|DSA^- Schleswig-Holstein|DSH^- Thüringen|DTH^- Unteres Saaletal|DUS^- Weserbergland|DWE^- Westerwald|DWW"; arealist["056"] = "^Ganz BELGIEN|BELG^- Die Belgischen Ardennen|BAR^- Limburg|BLI^- Flandern|BVA^- Flämisch Brabant|BVB"; arealist["208"] = "^BORNHOLM|BORNH^- Balka, Dueodde, Sømarken|I50^- Südwestbornholm|I53^- Nordbornholm/Allinge, Sandvig|I55^- Ostbornholm/Neksø, Snogebæk|I57^FANØ|FANO^- Fanø|M21^FÜNEN, LANGELAND, TÅSINGE|FYN^- Langeland & Tåsinge|G10^- Fünen|G51^LIMFJORD|LIMFJ^- Limfjord|L50^LOLLAND, FALSTER, MØN|LOLL^- Falster|K05^- Lolland|K10^- Falster, Marielyst|K11^- Møn|K30^NORDJÜTLAND|NORDJ^- Skagen & Tannisbucht|A01^- Nördliche Westküste/Jammerbucht|A03^- Nördliche Ostküste/Hou, Hals|A16^NORDWESTJÜTLAND|NORVJ^- Nördliche Westküste/Vorupør|B01^- Jammerbucht/Thorup|B60^OSTJÜTLAND|OSTJ^- Mols/Ebeltoft|D01^- Osthimmerland|D60^- Norddjursland/Fjellerup Strand|D70^- Ostjütland, Juelsminde, Vejle/Fredericia Geb.|D80^RØMØ|ROMO^- Rømø|R10^- Südliches Wattenmeer/Arrild Ferieby|S10^SEELAND|SJELL^- Nordseeland, Hornbæk, Gilleleje|E01^- Helsingør|E01X^- Nordwestseeland, Sejerøbucht|E16^- Westseeland|E20^- Südseeland|K50^- Südostseeland|K51^SÜDJÜTLAND|SONDJ^- Südliche Ostküste, Hejlsminde|F02^- Als|F09^DIE WESTKÜSTE|VESTK^- Holmsland Klit Nord/Søndervig|C01^- Fjand, Vrist, Vejlby Klit, Thorsminde|C71^- Ringkøbing Fjord Nord|C81^- Blåvand, Vejers, Ho, Grærup, Mosevrå|P32^- Houstrup, Jegum, Henne Strand, Lønne|P42^- Ringkøbing Fjord Süd, Bork Havn|P52^- Holmsland Klit Süd, Bjerregård|P62^- Kvie Sø|P85"; arealist["528"] = "^Ganz HOLLAND|HOLLA^- Die Küstenregion|HKU^MITTEL HOLLAND|MIDTH^- Gelderland|HGE^- Overijssel|HOV^- Utrecht|HUT^NÖRDLICHES HOLLAND|NORDH^- Drenthe|HDR^- Friesland|HFR^- Groningen|HGR^- Nord-Holland|HNH^SüDLICHES HOLLAND|SYDLH^- Limburg|HLI^- Nord-Brabant|HNB"; arealist["203"] = "^Ganz TSCHECHIEN|TJEK^- Böhmerwald|TBB^- Riesengebirge - Isergebirge|TBG^- Mittelböhmen|TBM^- Nordböhmen|TBN^- Ostböhmen|TBO^- Prag|TBP^- Südböhmen|TBS^- Die Umgebung Prags|TBU^- Westböhmen|TBW^- Das Beskidengebirge|TMB^- Bömisch-Mährische Höhe/Hochland|TMH^- Nordmähren|TMN^- Süd- und Mittelmähren|TMS"; arealist["352"] = "^ISLAND|ISLAN^- Ost|ICE^- Nord|ICN^- Süd|ICS^- West|ICW"; arealist["250"] = "^AQUITAINE|FAQUI^- Dordogne|FAD^- Gironde|FAG^- Landes|FAL^- Pyrénées Atlantiques|FAP^- Lot et Garonne|FAT^ATLANTIQUE|FATLA^- Charente Maritime|FCH^- Vendée|FVE^BRETAGNE|FBR^- Côte d´Amor|FBC^- Finistére|FBF^- Ille et Vilaine|FBI^- Loire Atlantique|FBL^- Morbihan|FBM^CENTRE-LOIRE|FCELO^- Centre|FEC^CÕTE D`AZUR|FCOTE^- Alpes Maritimes|FCA^- Var|FCV^KORSIKA|FKORS^- Korsika|FKO^LANGUEDOC-ROUSSILLON|FLANG^- Aude|FLA^- Gard|FLG^- Hérault|FLH^- Lozère|FLL^- Pyrénées Orientales|FLP^NORMANDIE|FNORM^- Calvados|FNC^- Manche|FNM^- Orne|FNO^- Seine Maritimes|FNS^PROVENCE-DRÔME-ARDÈCHE|FPROV^- Alpes de haute Provence|FPA^- Bouches du Rhône|FPB^- Drôme|FPD^- Vaucluse|FPV^- Ardèche|FRA^MIDI-PYRÉNÉES|FPYRE^- Lot|FML"; arealist["246"] = "^FINNLAND|FINLA^- Finnische Seenplatten|SLA^- Nord|SNA^- Süd|SSA^- West|SWA"; arealist["348"] = "^PLATTENSEE (BALATON)|UBALA^- Plattensee südwest (Balaton)|UBF^- Plattensee Nord (Balaton)|UBN^- Plattensee Süd (Balaton)|UBS^- Plattensee West (Balaton)|UBW^Ganz UNGARN|UNGAR^- Budapest|UBP^- Tata Gebiet|UBU^- Donauinsel|UDI^- Donauknie|UDK^- Neusiedlersee|UFT^- Velencer See|UHB^- Mátra/Bükk|UMB^- Theissee|UTS^- Zalakaros|UWZ"; arealist["703"] = "^Ganz SLOWAKEI|SLOV^- Mittelslowakei|TSM^- Ostslowakei/Slowakisches Erzebirge|TSO^- Hohe Tatra/Niedere Tatra/Spiss|TST^- Westslowakei|TSW"; arealist["756"] = "^SCHWEIZ|SCHWE^- SCHWYZ|ZCE^- GRAUBÜNDEN|ZGR"; arealist["191"] = "^MITTE DALMATIEN|DALMM^- Insel Brac|CDB^- Insel Hvar|CDH^- Insel Vis|CDK^- Insel Ciovo|CDM1^- Insel Drvenik Veli|CDM2^- Insel Drvenik Mali|CDM3^- Makarska|CDM4^- Omis|CDM5^- Split|CDM6^- Trogir|CDM7^- Insel Solta|CDO^NORD DALMATIEN|DALMN^- Biograd|CDN1^- Nin|CDN2^- Starigrad Paklenica|CDN3^- Insel Vir|CDN4^- Zadar|CDN5^- Insel Dugi Otok|CDU1^- Insel Rivanj|CDU10^- Insel Ist|CDU2^- Insel Iz|CDU3^- Insel Molat|CDU4^- Insel Pasman|CDU5^- Insel Rava|CDU6^- Insel Ugljan|CDU8^- Drnis|CDV1^- Insel Prvic|CDV10^- Insel kaprije|CDV2^- Insel Krapanj|CDV3^- Insel Murter|CDV4^- Primosten|CDV5^- Rogoznica|CDV6^- Sibenik|CDV7^- Vodice|CDV8^- Insel Zlarin|CDV9^SÜD DALMATIEN|DALMS^- Dubrovnik Riviera|CDD^- Halbinsel Peljesac|CDP^- Neretva Delta|CDR^- Insel Korcula|CDS^ISTRIEN|ISTRI^- Premantura|CIA^- Banjole|CIB^- Porec|CIE1^- Vrsar|CIE2^- Fazana|CIF1^- Barbariga|CIF2^- Ostküste|CIK^- Rabac|CIK1^- Labin|CIK2^- Krnica|CIK3^- Duga Uvala|CIK4^- Istrien hinterland|CIL^- Barban|CIL1^- Ucka|CIL10^- Visnjan|CIL11^- Vodnjan|CIL12^- Zminj|CIL13^- Bale|CIL14^- Buje|CIL2^- Buzet|CIL3^- Kanfanar|CIL4^- Motovun|CIL5^- Pazin|CIL6^- Sv. Lovrec|CIL7^- Svetvincenat|CIL8^- Tinjan|CIL9^- Medulin|CIM^- Pula|CIP^- Umag & Novigrad|CIU^- Umag|CIU1^- Novigrad|CIU2^- Rovinj|CIV^- Liznjan|CIZ^KVARNER BUCHT|KVARN^- Gorski Kotar|CKB1^- Lika|CKB2^- Crikvenica|CKC^- Krk|CKK^- Insel Cres|CKL1^- Insel Losinj|CKL2^- Insel Ilovik|CKL3^- Insel Susak|CKL4^- Novi Vinodolski|CKN^- Opatija|CKO^- Pag|CKP^- Rab|CKR^- Senj und Küste abwärts|CKV^- Karlobag|CKV1^- Senj|CKV2"; arealist["724"] = "^KANARISCHEN INSELN|CANAR^- Fuerteventura|EFU^- Gran Canaria|EGR^- El Hierro|EHI^- Lanzarote|ELA^- La Palma|EPA^- Teneriffa|ETE^Mallorca|EML^FESTLAND|ESPAN^- Costa del Sol/Andalusien|EAN^- Costa Blanca|EBL^- Costa Brava|ECB^- Costa Calida|ECC^- Costa Dorada|EDO"; arealist["578"] = "^HORDLAND|HORDA^- Süd-Hordland|N18^- Hardanger|N19^- Nord-Hordland|N20^TRØNDELAG|MIDTN^- Nord-Trøndelag|N38NT^- Süd-Trøndelag|N38ST^MØRE UND ROMSDAL|MORO^- Sunnmøre|N27^- Romsdal|N28^- Nordmøre|N29^GEBIRGS-NORWEGEN|MOUNT^- Hedmark|N30^- Oppland|N31^- Buskerud Nord|N33^- Telemark und Innerer Agder|N35^NORD-NORWEGEN|NORDN^- Nordland mit Lofoten|N39NO^- TromsÖ|N39TR^OSLOFJORD UND UMGEBUNG|OSLOF^- Akershus|N37AK^- Buskerud Sør|N37BU^- Østfold|N37OF^- Vestfold|N37VF^ROGALAND|ROGA^- Süd-Rogaland|N15^- Ryfylke|N16^- Nord-Rogaland|N17^SOGN UND FJORDANE|SOFJ^- Ydre Sogn|N21^- Midt Sogn|N22^- Indre Sogn|N23^- Sunnfjord|N24^- Ydre Nordfjord|N25^- Indre Nordfjord|N26^SüD-NORWEGEN|SOUTN^- Inland|N34^- Küste|N36"; arealist["792"] = "^TÜRKEI|TYRKI^- Südliche Ägäis und Lykische Küste|TLK^- Nördliche und Mittlere Ägäis|TMA^- Türkische Küste|TRV"; arealist["380"] = "^BASILICATA|IBASI^- Ionische Küste|IBJ^- Tyrrhenische Küste|IBT^EMILIA-ROMAGNA|IEMIL^- Emilia-Romagna Hinterland|IEC^- Emilia-Romagna Küste|IEK^FRIAUL|IFRIA^- Friaul Landschaft|IFC^- Friaul - Adria Küste|IFK^KALABRIEN|IKALA^- Kalabrien|IKK^KAMPANIEN|IKAMP^- Amalfi Küste|IKA^- Cilento/Salerno Bucht|IKC^- Gaeta und Baia|IKG^- Sorrento Küste|IKS^LATIUM|ILATI^- Rom|IRO^- Latium Landschaft|IRU^LIGURIEN|ILIGU^- Ligurien|ILL^MARKEN|IMARK^- Marken|IMM^NORDITALIENISCHEN SEEN|INORD^- Gardasee|IVG^- Lago Maggiore|IVM^APULIEN|IPUGL^- Apulien|ISA^SARDINIEN|ISARD^- Sardinien|ISD^SIZILIEN|ISIZI^- Sizilien|ISS^TOSKANA|ITOSC^- Arezzo/Cortona und Umgebung|ITA^- Florenze|ITB^- Chianti|ITC^- Florenz und Umgebung|ITF^- Grosseto und Umgebung|ITG^- Lucca und Umgebung|ITL^- San Gimignano und Volterra|ITN^- Pisa und Umgebung|ITP^- Siena und Umgebung|ITS^- Montecatini/Pistoia und Umgebung|ITT^TOSKANA KÜSTE|ITOSK^- Elba insel|ITE^- Etruskerküste|ITK^- Argentario/Maremma|ITM^- Versilia|ITV^UMBRIEN|IUMBR^- Perugia und Umgebung|IUP^- Spoleto und Umgebung|IUS^- Trasimeno See|IUT^VENETIEN|IVE^- Hinterland Venetiens|IVC^- Küste Venetiens|IVK^- Venedig|IVV"; arealist["300"] = "^Korfu|GCF^Chios|GCH^Zypern|GCY^Kreta|GKR^Lesbos|GLE^FESTLAND|GMAIN^- Athen|GAT^- Chalkidiki|GHA^- Peloponnes|GPE^KYKLADEN|KYKLA^- Kea|GKK^- Paros|GKP^- Syros|GKS^THESSALIEN|THESS^- Pilion|GPI^- Thessalien|GTH"; optionlist = arealist[countrycode].substring(1).split("^");
for (i=0; i<optionlist.length; i++){
valueset = optionlist[i].split("|");
select.options[i+1]=new Option(valueset[0],valueset[1],true,false);
}
}


function nmtrack() {
   function getElementsByClass(searchClass,node,tag) { var classElements = new Array(); if ( node == null ) node = document; if ( tag == null ) tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); for (i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { classElements[j] = els[i]; j++; }} return classElements;}
   function getInnerText(el) { if (!el) return ""; var txt = ""; for (var i=0; i<el.childNodes.length; i++) { switch (el.childNodes.item(i).nodeType) { case 1: txt += getInnerText(el.childNodes.item(i)); break; case 3: txt += el.childNodes.item(i).nodeValue; break; } } return txt; }
   function trim(str){ return str.replace(/^[\s\xA0]+|[\s\xA0]+$/g, '');}

   try{
   var cid = 'novasol';
   var nm_title = ''; 
   if(nm_title == '') {

      var bc = [];
      var navPathArea = document.getElementById('navPathArea');
      var cl = getElementsByClass('currentLocation');
      if(navPathArea != null) {
         var links = navPathArea.getElementsByTagName('a');
         for(var i = 0; i <links.length; i++)
            bc[bc.length] = links[i].innerHTML;

         var currentLocation = navPathArea.getElementsByTagName('span');
         bc[bc.length] = currentLocation[currentLocation.length-1].innerHTML;
      } else if(cl.length > 0) {

         bc = getInnerText(bc[0]).split(' > ');
      } else if(new String(document.location).indexOf('/booking') != -1) {
      
         bc[bc.length] = 'Home'; bc[bc.length] = 'Booking';
         var step = getElementsByClass('BOKSTPsteptable');
         var active = step[0].getElementsByTagName('b')[0].parentNode.parentNode.getElementsByTagName('img')[0].alt;
         bc[bc.length] = 'Step ' + active;
      }

      var bc2 = []; for(var i = 1; i < bc.length; i++) bc2[bc2.length] = trim(bc[i]); nm_title = bc2.join(' > ');
   }
   var loc=new String(window.document.location);var loc2=loc;try{var toploc=new String(top.document.location);loc2=toploc.indexOf('nm_extag')!=-1?toploc:loc2;}catch(e){} if(nm_title=='')nm_title=document.title;
   var ref = ''; var c = document.cookie; 
   if( c.indexOf('nm_exref')!=-1 ){var ca = c.split(';');for( i = 0; i < c.length; i++ ){var item = new String(ca[i]);var idx = item.indexOf('nm_exref');if( idx!=-1 )ref = new String(item.substr( idx+9 ));}document.cookie='nm_exref=';}
   if( ref == '' ){ ref=document.referrer;try{ref=top.document.referrer;}catch(e){}}
   var begext=loc2.indexOf('nm_extag='); var ext='';if( begext!=-1){ begext+=9;var endext=loc2.indexOf('&',begext); ext=endext==-1?loc2.substr(begext):loc2.substr(begext,endext-begext); ext=encodeURIComponent(ext);}
   nm_title=encodeURIComponent(nm_title);loc=encodeURIComponent(loc);ref=encodeURIComponent(ref);ext=encodeURIComponent(ext);
   if(nm_title.length>250)nm_title=nm_title.slice(0,246)+'...';if(loc.length>800)loc=loc.slice(0,796)+'...';if(ref.length>800)ref=ref.slice(0,796)+'...';
   var script = document.createElement('SCRIPT');
   script.language = 'javascript';
   script.src = 'http'+(document.location.protocol=='https:'?'s':'')+'://'+cid+'.netminers.dk/tracker/dispatch.aspx?action=log'+'&n='+Math.random()+'&nav='+loc+'&cid='+cid+(ref.length>0?('&ref='+ref):'') +'&ti1='+nm_title+'&ext='+ext;
   document.getElementsByTagName('body')[0].appendChild( script );
   }catch(e){}
}
  function googleAreaMapInitialize(area) {
        var coords = new Array();
        coords["191"] = new Array(45.1667 , 15.5 , 5 ); // Croatia
        coords["250"] = new Array(46 , 2  , 5 ); // France
        coords["300"] = new Array(39 , 22 , 5 );  // Greece
        coords["380"] = new Array(42.8333 , 12.8333 , 5 );  // Italy
        coords["724"] = new Array(40 , -4 , 5);  // Spain
    
        var areacoords = coords[area];

        if (areacoords) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(areacoords[0], areacoords[1]), areacoords[2]);
        map.disableDragging();
        
//        var point = new GLatLng(areacoords[0],areacoords[1]);
//        map.addOverlay(new GMarker(point));
     }
    }


/*
  This javascript code runs through all elements with the class 'inputtext' and sets each value to be equal to its title. Text color is set to a light gray.
  When focus is on the element, to default text is removed and the color is set to black.
  When focus on the element is lost, the code checks to see if the element is empty or equal to its title, in which case the text is again set to the title and the color to a light gray.
*/
jQuery(document).ready(function(){
jQuery(".inputtext").focusin(function(){
    if(jQuery(this).val()==jQuery(this).attr("title")){
        jQuery(this).val("");
    }
});
jQuery(".inputtext").focusout(function(){
    if(jQuery(this).val()=="" || jQuery(this).val()==jQuery(this).attr("title")){
        jQuery(this).val(jQuery(this).attr("title"));
        jQuery(this).css("color","#999");
    }
});
jQuery(".inputtext").each(function(){
    jQuery(this).val(jQuery(this).attr("title"));
    jQuery(this).css("color","#999");
});
jQuery(".inputtext").keydown(function(){
    jQuery(this).attr('style','');
});
});
function encodeStr(str) {
var string;
if (encodeURIComponent) {
    string = encodeURIComponent(str);
} else {
    string = escape(str);
}
return string;
}
