// ------------------------------------------------------------------
// Aqua Sirius Tourplanung
// ipg-0-main-inc-a1.js     (c) Lobatec            Start Okt 2008/hk
//
// ------------------------------------------------------------------
// 21.09.08 neu
// 23.01.09 -b2: diverse Korrekturen, -main-inc-b2.php
//          ok raus, wieder rein
// 10.02.09 -c1: Übergang auf MySQL, -main-inc-c1.php
// 11.04.09 -c2: Aufruf über wzlid, Aktualisierung bei Schiffseingabe, -main-inc-c2.php
// 04.06.09 -c3: reicht "?wzlid13" einfach via way durch wie Vorl an main-inc-c3
// 04.06.09 -c4: Dialog+
// 13.06.09 -c5: Werbeleiste
// 04.07.09      &params-Fehler
// 10.07.09 -c6: Abstand-Fehler im Ctrl-Fenster IE7
// 12.08.09 -c7: geodat-Hitscount begrenzen
// 12.09.09 -c8: Elwis einbinden
// 21.09.09 -c9: Elwis-Korrekturen
// 13.10.09 -d1: Anl-Eingabe in edt
// 09.12.09 -d2: pdf-Print-Ausgabe
// 27.01.10 -d3
// 22.02.10 -d4: edit Warnungen 
// 08.05.10 -d4: u/p im Paramter
// 21.08.10 -d5: anlid parallel zu wzlid
//
// ----------------------------------------------------

function AqsTplg(sc,way,params)
{
  if (ok(document.location.href))
  {
    way = way.replace(/way\=/,"");
    way = way.replace(/tour\=/,"");
    if (sc == "") sc = "aqs";
    
    document.getElementById("AqsTplgC").innerHTML = 
      "<iframe src='http://www.aquasirius.de/NeuDes/ipg-0-main-inc-d5.php?sc=" + sc + "&way=" + way + "&" + params + "' name='AqsTplgFrame' " +
              "style='width:100%; height:2000px; margin:0; overflow:hidden;' scrolling='no' frameborder='0'></iframe>";
  }
  else
  {
    document.getElementById("AqsTplgC").innerHTML = "<p>Der Dienst ist für diese Seite<br>nicht lizenziert<p>";
  }
}
   
// ----------------------------------------------------
// ----------------------------------------------------
function AqsTplgHelp(x)
{    
  supwin(x);
}               

// ----------------------------------------------------
// ----------------------------------------------------
function AqsTplgHelp2()
{    
  supwin("");
}               

// ----------------------------------------------------
// ----------------------------------------------------
function supwin(x)
{
  var y = "";
  if (x != "")
  {    
    y = "?t=" + x;
  }
  window.open ("http://www.aquasirius.de/NeuDes/ipg-02-supwin-01.php" + y ,
               "AquaSiriusSupport","width=400,height=500,left=10,top=10,resizable=yes,scrollbars=yes");
}               

// ----------------------------------------------------
// ----------------------------------------------------
function ok(h)
{
  //alert (h);
  if (h.toLowerCase().indexOf("127.0.0.1") > 0) return true;
  if (h.toLowerCase().indexOf("pc007") > 0) return true;
  if (h.toLowerCase().indexOf("fts") > 0) return true;
  if (h.toLowerCase().indexOf("vww-") > 0) return true;
  if (h.toLowerCase().indexOf("aquasirius") > 0) return true;
  if (h.toLowerCase().indexOf("blue") > 0) return true;
  if (h.toLowerCase().indexOf("nicols") > 0) return true;
  if (h.toLowerCase().indexOf("demo.") > 0) return true;
  if (h.toLowerCase().indexOf("wvw-") > 0) return true;
  if (h.toLowerCase().indexOf("wassersport-verband") > 0) return true;
  if (h.toLowerCase().indexOf("unruh") > 0) return true;
  if (h.toLowerCase().indexOf("seenland") > 0) return true;
  if (h.toLowerCase().indexOf("fb-") > 0) return true;
  if (h.toLowerCase().indexOf("yachtferien.eu") > 0) return true;
  if (h.toLowerCase().indexOf("ych-") > 0) return true;
  if (h.toLowerCase().indexOf("heinzig") > 0) return true;
  if (h.toLowerCase().indexOf("uaw-") > 0) return true;
  if (h.toLowerCase().indexOf("urlaub-auf-dem-wasser") > 0) return true;
  if (h.toLowerCase().indexOf("saar") > 0) return true;
  if (h.toLowerCase().indexOf("roemer") > 0) return true;
  if (h.toLowerCase().indexOf("faw-") > 0) return true;
  if (h.toLowerCase().indexOf("ferien-auf-dem-wasser") > 0) return true;
  if (h.toLowerCase().indexOf("bootsurlaub") > 0) return true;
  if (h.toLowerCase().indexOf("schulz-") > 0) return true;
  if (h.toLowerCase().indexOf("mym") > 0) return true;
  if (h.toLowerCase().indexOf("marina-lanke") > 0) return true;
  if (h.toLowerCase().indexOf("riveryacht") > 0) return true;
  if (h.toLowerCase().indexOf("arlt") > 0) return true;
  if (h.toLowerCase().indexOf("schroeder") > 0) return true;
  return false;
}  


// ---------------------------------------------------------------
// ---------------------------------------------------------------
function AqsTempl(sc,params) // startit2(sc)    // AqS
{
  ta = gettags("div").concat(gettags("img")).concat(gettags("a")).concat(gettags("p")).concat(gettags("span"));
  ta.sort();
  var loaderUrl = "http://www.aquasirius.de/NeuDes/ipg-47-templs-d1.php?sc=" + sc;
  //alert (loaderUrl+ "&ids=" + ta.join(";"));
  var loader1 = new net.ContentLoader(loaderUrl + "&ids=" + ta.join(";"),gottempls);
}
function gottempls()
{
  resp = this.req.responseText;
  //alert (resp);
  var prefix = "<" + "?xml version='1.0' encoding='ut" + "f-8' ?" + ">";
  xmlVorlagenInfo = getXMLDocument(); xmlVorlagenInfo.async = "false";
  xmlVorlagenInfo.loadXML (prefix + resp); 
  
  var xmlVorlagenRoots = xmlVorlagenInfo.getElementsByTagName("aqs");
  var xmlM0xx = xmlVorlagenRoots[0].childNodes;
    
  for (i=0; i<xmlM0xx.length; i++)
  {
    id = xmlM0xx[i].tagName;
    aqsname = xmlM0xx[i].getElementsByTagName("aqsname")[0].firstChild.data;
    aqssub = xmlM0xx[i].getElementsByTagName("aqssub")[0].firstChild.data;
    aqstext = xmlM0xx[i].getElementsByTagName("aqstext")[0].firstChild.data;
    aqsimg = xmlM0xx[i].getElementsByTagName("aqsimg")[0].firstChild.data; 
    if (document.getElementById(id+"_aqsname")) document.getElementById(id+"_aqsname").innerHTML = aqsname; 
    if (document.getElementById(id+"_aqstext")) document.getElementById(id+"_aqstext").innerHTML = aqstext; 
    if (document.getElementById(id+"_aqssub"))  document.getElementById(id+"_aqssub").innerHTML = aqssub; 
    //if (document.getElementById(id+"_aqsimg"))  document.getElementById(id+"_aqsimg").alt = "Hi"; //aqsname; 
    if (document.getElementById(id+"_aqsimg"))  document.getElementById(id+"_aqsimg").src = aqsimg; 
  }  
}  
function gettags(s)
{
  mtags = new Array();
  var j = 0;
  a = document.getElementsByTagName (s);
  for (i=0; i<a.length; i++)
  {
    if (a[i].id != "")
    {
      if (a[i].id.substr(4,4) == "_aqs")
      {
        mtags[j] = a[i].id;
        j++;
      }  
    }  
  }  
  return mtags;
}


