function $(id) {
    if (typeof TT_USE_SPECIAL_DOLLAR_FUNCTION != 'undefined' && TT_USE_SPECIAL_DOLLAR_FUNCTION == true) {
        // is usedBy: KID 430700 (travelscout24)
        if (typeof jQuery != 'undefined' && jQuery) {
            if (jQuery(id).length > 0) {
                return jQuery(id);
            } else {
                if (typeof document.getElementById(id) != 'undefined' && document.getElementById(id) != null) {
                    return document.getElementById(id);
                } else {
                    return jQuery(id);
                }
            }
        } else {
            return document.getElementById(id);
        }
    } else {
        return document.getElementById(id);
    }
}
/**
*@class TTDR is the root namespace where all classes are located.
*The namespaces includes some static functions/properties which are used by
*several classes.They are accessible as static functions/properties e.g. TTDR.DATAPOOLS<br>
*@constructor
*/
function TTDR(){};
/**
*Contains the supported "Datapool" values
*@type Array
*/
TTDR.DATAPOOLS = ['DEPAIRPORT','DESTINATION','HOTELNAMES','POI','VILLAGES','MEALTYPE',
    'FAMILYANDKIDS','ADULTS','CHILDREN','DESTAIRPORT','ROOMTYPE','Regions',
    'DATE','DURATION','SPORTANDLEISURE','STARS','BEACH','WELLNESS','TOUROPERATOR','RAILWAYSTATION'];
// Seng, 2.2.07: VILLAGE removed (VILLAGES is left)

/**
*Checks if a given string is a valid datapool name
*@param {String} datapool
*@return {Bool} returns true if the string is a valid Datapool name
*/
TTDR.isValidDataPool = function(datapool){
  for(var i=0;i<TTDR.DATAPOOLS.length;i++)
    if(TTDR.DATAPOOLS[i]==datapool) return true;
  return false;
};

/**
*Hides all open TTDR suggest-boxes with exception of the optional given div
*@param {String} exception optional
*/
TTDR.hideAllSuggestions = function(exception){
  var exception = exception || "";
  var arDiv = document.getElementsByTagName('DIV');
  for(var i=0;i<arDiv.length;i++){
    if(arDiv[i].id && arDiv[i].id.search(/^div_suggest_/)!=-1 && arDiv[i].id!=exception)
      arDiv[i].style.display = "none";
  }
};

/**
*Extends a destination object with the attributes of a given source object
@param {Object} dest Destination Object
@param {Object} src Source Object
@return the extended Object
*/
TTDR.extend = function(dest,src){
  for(attr in src) dest[attr]=src[attr];
  return dest;
};

/**
*@class Main Dreamreader Class. Create an instance of this class in the "head" area of your HTML page.<br>
*Then call the show() method at the position in your HTMl page where you want the input field to appear<br>
*@param {String} name Name of the inputfield (must be unique in the HTML form)
*@param {String} datapool Datapool name from which the suggestions are fetched from
*@constructor
*/
TTDR.DreamReader = function(datapool){
  try{
    if(!datapool || !TTDR.isValidDataPool(datapool))
      throw new TTDR.Exception("InvalidDatapool","'"+datapool+"' is not a valid datapool value.");

    /**
    *The current XMLHttpRequest object
    *@type XMLHttpRequest
    *@private
    */
    this.xmlReq = null;
    /**
    *AJAX Request counter
    *@type Int
    *@private
    */
    this.calls = 0;
    /**
    *the current selected row in the suggestbox (-1 means no row is selected)
    *@type int
    *@private
    */
    this.selRow = -1;
    /**
    *Array of TTDR.Suggestion objects
    *@type Array
    *@private
    */
    this.arSuggestions = [];
    /**
    *Name/ID of the Suggest div
    *@type String
    *@private
    */
    this.suggestDiv = 'div_suggest_'+datapool;
    /**
    *Name/ID of the Suggest iframe
    *@type String
    *@private
    */
    this.suggestFrame = 'ifr_suggest_'+datapool;
    /**
    *Flag indicates whether to block the suggest-box or not
    *@type Bool
    *@private
    */
    this.blockSuggestions = false;
    /**
    *Flag indicates whether to ignore mouse-events or not
    *@type Bool
    *@private
    */
    this.ignoreMouseEvents = false;
    /**
    *Name/ID of the input text field
    *@type String
    *@private
    */
    this.inputFeld = 'input_'+datapool;
    /**
    *The name of the hidden field. (must be unique in the HTML form).
    *Default: equal to datapool name
    *@type String
    */
    this.Name = datapool;
    /**
    *Datapool name from which the suggestions are fetched from
    *@type String
    */
    this.DataPool = datapool;
    /**
    *Flag indicates whether to force the use of a suggestion or not
    *Default is true
    *@type Bool
    */
    this.ForceSuggestions = true;
    /**
    *The initial value of the input text field
    *@type String
    */
    this.InputFieldDefaultValue = '';
    /**
    *Width (px) of the input text field. Default: 185.
    *@type Int
    */
    this.InputFieldWidth = 185;
    /**
    *Width (px) of the suggest-box. Default: 300.
    *@type Int
    */
    this.SuggestBoxWidth = 300;
    /**
    *Height (px) of the suggest-box. Default: 200.
    *@type Int
    */
    this.SuggestBoxHeight = 200;
    /**
    *Line-height (px) of a suggestion. Default: 20.
    *@type Int
    */
    this.SuggestLineHeight = 20;
    /**
    *Font-family of a suggestion. Default: "Verdana".
    *@type Int
    */
    this.SuggestFontFamily = "Verdana";
    /**
    *Font-size (px) of a suggestion. Default: 11.
    *@type Int
    */
    this.SuggestFontSize = 11;
    /**
    *Highlight-color of a suggestion. Default: "#F9D1A2".
    *@type String
    */
    this.SuggestHighlightColor = "#eeeeee";
    /**
    *Maximum number of  characters of a suggestion. Default: 42
    *@type Int
    */
    this.SuggestLength = 60;
    /**
    *Event-handler
    *@type TTDR.EventHandler
    */
    this.EH = new TTDR.EventHandler(this);
    /**
    *The current XMLResponse object
    *@type TTDR.Ajax.Response
    */
    this.XMLResponse = new TTDR.Ajax.Response();
    /**
    *The current TTDR.Ajax.Request object
    *@type TTDR.Ajax.Request
    */
    this.XMLRequest = new TTDR.Ajax.Request(this);
  }catch(e){
    alert("TT DreamReader Exception!\n\n"+e.name+": "+e.message);
  }
};
TTDR.DreamReader.prototype = {

  /**
  *Fills the container and adds keyboard event-handlers to the input text-field
  *@throws TTDR.Exception
  */
  init: function(){
    var strHTML = '<input type="hidden" name="'+this.Name+'" id="'+this.Name+'" value="">'
                 +'<input type="text" name="'+this.inputFeld+'" id="'+this.inputFeld+'"  autocomplete="off" value="'+this.InputFieldDefaultValue+'"><br>'
                 +'<div id="'+this.suggestDiv+'" style="display:none;"><iframe name="'+this.suggestFrame+'" id="'+this.suggestFrame+'" src="'+file_path+'booking/jt_tour2/city/result_ttdr.html" frameborder="0" framespacing="0" border="0"></iframe></div>';
                 
    var ttdrbox = $('TTDR_'+this.DataPool);

    try{
      if(ttdrbox){
        ttdrbox.innerHTML = strHTML;

        // Eventhandler setzen
        TTDR.extend($(this.inputFeld),{
          onkeydown:  this.EH.handleOnKeyDown,
          onkeypress: this.EH.handleOnKeyPress,
          onkeyup:    this.EH.handleOnKeyUp,
          onfocus:    this.EH.handleOnFocus
        });

        // Styles setzen
        TTDR.extend($(this.inputFeld).style,{
          width:       this.InputFieldWidth+"px",
          fontFamily:  this.SuggestFontFamily,
          fontSize:    this.SuggestFontSize+"px"
        });
        
        TTDR.extend($(this.suggestDiv).style,{
          position:        "absolute",
          zIndex:          "100",
          height:          this.SuggestBoxHeight+"px",
          backgroundColor: "#FFF"
        });

        TTDR.extend($(this.suggestFrame).style,{
          width:  this.SuggestBoxWidth+"px",
          height: this.SuggestBoxHeight+"px"
        });
        
        if(navigator.appName.indexOf("Microsoft")==-1)
          $(this.suggestFrame).style.border = "1px solid #000";
        else
          $(this.suggestFrame).style.border = "none";

      }else{
        throw new TTDR.Exception("MissingContainer","'TTDR_"+this.DataPool+"' not found!");
      }
    }catch(e){
      alert("TT DreamReader Exception!!\n\n"+e.name+": "+e.message);
    }
  },
  
  /**
  *Opens the Suggestbox
  */
  showSuggestions: function(){

    var sdiv   = $(this.suggestDiv);
    var sframe = $(this.suggestFrame);
    var sfrdiv = frames[this.suggestFrame].document.getElementById('suggestions');
    var strRes = "";
    var cntErg = this.arSuggestions.length;

    TTDR.hideAllSuggestions(this.suggestDiv);

    // Style-Anpassungen
    if(cntErg<=Math.floor(this.SuggestBoxHeight/this.SuggestLineHeight)){
      sdiv.style.height   = (cntErg*this.SuggestLineHeight+2)+"px";
      sframe.style.height = (cntErg*this.SuggestLineHeight+2)+"px";
      sfrdiv.style.width  = (this.SuggestBoxWidth-2)+"px";
    }else{
      sdiv.style.height   = this.SuggestBoxHeight+"px";
      sframe.style.height = this.SuggestBoxHeight+"px";
      sfrdiv.style.width  = (this.SuggestBoxWidth-20)+"px";
    }

    TTDR.extend(frames[this.suggestFrame].document.getElementsByTagName('body')[0].style,{
      margin:0,
      padding:0,
      color:"#000",
      backgroundColor:"#FFF"
    });
    
    if(navigator.appName.indexOf('Microsoft')!=-1)
      frames[this.suggestFrame].document.getElementsByTagName('body')[0].style.border="1px solid #000";

    for(var i=0;i<cntErg;i++)
      strRes += this.arSuggestions[i].toHTML();
      
    if(sdiv){
      sfrdiv.innerHTML = strRes;

      // Add mouse-event handlers and Styles to the div elements
      var arSug = frames[this.suggestFrame].document.getElementsByTagName('div');
      for(var i=0;i<arSug.length;i++){
        if(arSug[i].id.search(/^sugrow_/)==-1)
          continue;
        arSug[i].onmouseover = this.EH.sugOnMouseOver;
        arSug[i].onclick     = this.EH.sugOnClick;
        
        TTDR.extend(arSug[i].style,{
          height:      this.SuggestLineHeight+"px",
          cursor:      "pointer",
          whiteSpace:  "nowrap"
        });

        TTDR.extend(arSug[i].firstChild.style,{
          display:     "block",
          width:       (this.SuggestBoxWidth-30)+"px",
          lineHeight:  this.SuggestLineHeight+"px",
          fontFamily:  this.SuggestFontFamily,
          fontSize:    this.SuggestFontSize+"px",
          paddingLeft: "3px",
          cursor:      "pointer",
          overflow:    "hidden",
          whiteSpace:  "nowrap"
        });
      }
      
      //preselect first entry
      this.selRow=0;
      this.selectRow();
      
      // show suggest-box
      sdiv.style.display="block";
    }
  },
  
  /**
  *Hides the suggest-box
  */
  hideSuggestions: function(){
    this.arSuggestions = [];
    this.selRow=-1;
    $(this.suggestDiv).style.display="none";
  },
  
  /**
  *Sets the cursor to the end of an input-field
  */
  positioniereCursor: function(){
    var input = $(this.inputFeld);
    var pos = input.value.length;
    input.focus();
    if(typeof(document.selection)!='undefined') {
      input.select();
      var range = document.selection.createRange();
      range.move('character',pos);
      range.select();
    }else if(typeof(input.selectionStart)!='undefined'){
      input.selectionStart = pos;
      input.selectionEnd = pos;
    }
  },

  /**
  *Updates the hidden-field value
  */
  updateData: function(){
    try{
      var val = this.XMLResponse[this.DataPool];
      if(typeof(val)=='undefined')
        throw new TTDR.Exception("DatapoolError","'"+this.DataPool+"' was not found in XMLResponse!");

      if(typeof(val)=='string'){
        $(this.Name).value = val;
      }else{
            //alert(this.XMLResponse['HOTELNAMES'].hotelname);
        var strVal = "";
        for(var i=0;i<val.length;i++){
          if(val[i].toString)
            strVal += val[i].toString();
          else
            strVal += val[i];
            
          if(i<(val.length-1))
            strVal += "@@";
        }
        $(this.Name).value = strVal;
      }
    }catch(e){
      alert("TT DreamReader Exception!!\n\n"+e.name+": "+e.message);
    }
  },

  /**
  *Selects a Row from the suggestion-list
  */
  selectRow: function(){
    var sframe = frames[this.suggestFrame];
    var row = sframe.document.getElementById('sugrow_'+this.selRow);
    if(row){
      for(var i=0;i<this.arSuggestions.length;i++)
        sframe.document.getElementById('sugrow_'+i).style.backgroundColor = "transparent";
      row.style.backgroundColor = this.SuggestHighlightColor;
    }
  }
};

/**
*@class Contains all event-handling methods<br>
*@constructor
*@param {TTDR.DreamReader} dr Reference to a TTDR.DreamReader object
*@requires TTDR.DreamReader
*/
TTDR.EventHandler = function(dr){

  /**
  *Reference to a {@link TTDR.DreamReader} object
  *@private
  *@type TTDR.DreamReader
  */
  var pDr = dr;
  
  /**
  *onKeyDown-handler
  *@param {event} e keyboard-event
  *@type void
  */
  this.handleOnKeyDown = function(e){
    var e        = e || window.event;
    var charCode = e.which?e.which:e.keyCode;
    var sugbox   = $(pDr.suggestDiv);
    var sfrdoc   = frames[pDr.suggestFrame].document;

    // ignore mouse-events from now on
    pDr.ignoreMouseEvents = true;
    
    switch(charCode){

      case 38: // Pfeil hoch
        if(sugbox.style.display=="block"){
          if(pDr.selRow>0){
            pDr.selRow--;pDr.selectRow();
            if(frames[pDr.suggestFrame].document.body.scrollTop > 20*pDr.selRow)
              frames[pDr.suggestFrame].scrollTo(0,20*pDr.selRow);
          }
        }
        if(e.preventDefault)
          e.preventDefault();
        else
          return false;
        break;
        
      case 40: // Pfeil runter
        if(sugbox.style.display=="block"){
          if(pDr.selRow < (pDr.arSuggestions.length-1)){
            pDr.selRow++;pDr.selectRow();
            if(frames[pDr.suggestFrame].document.body.scrollTop < -180+20*pDr.selRow)
              frames[pDr.suggestFrame].scrollTo(0,-180+20*pDr.selRow);
          }
        }
        if(e.preventDefault)
          e.preventDefault();
        else
          return false;
        break;
        
      case 34: // Bild runter
      case 35: // Ende
        if(sugbox.style.display=="block"){
          pDr.selRow = pDr.arSuggestions.length-1;
          pDr.selectRow();
          if(pDr.selRow>=10)
            frames[pDr.suggestFrame].scrollTo(0,20*pDr.selRow+2);
        }
        break;
        
      case 33: // Bild rauf
      case 36: // Pos1
        if(sugbox.style.display=="block"){
          if(pDr.selRow>0){
            pDr.selRow=0;pDr.selectRow();
            frames[pDr.suggestFrame].scrollTo(0,0);
          }
        }
        break;
        
      case 27: // Esc
        if(sugbox.style.display=="block")
          pDr.hideSuggestions();
        if(e.preventDefault)
          e.preventDefault();
        else
          return false;
        break;
    }
  }
  
  /**
  *Disable submiting the form by clicking &lt;enter&gt;
  *@param {event} e keyboard-event
  *@type void
  */
  this.handleOnKeyPress = function(e){
    var e        = e || window.event;
    var charCode = e.which?e.which:e.keyCode;

    switch(charCode){
      case 13: // Enter
        if(e.preventDefault)
          e.preventDefault();
        else
          return false;
        break;
    }
  };

  /**
  *onKeyUp-handler. Initiates a new AJAX request if no stupid key is pressed
  *@param {event} e keyboard-event
  *@type void
  */
  this.handleOnKeyUp = function(e){

    var e = e || window.event;
    var charCode = e.which?e.which:e.keyCode;
    var sugbox  = $(pDr.suggestDiv);
    var suglist = frames[pDr.suggestFrame].document.getElementById('suggestions');

    // donīt ignore mouse-events anymore
    pDr.ignoreMouseEvents = false;
    
    switch(charCode){
      case 9:  // Tab
      case 16: // Shift
      case 32: // Space
      case 37: // Pfeil links
      case 39: // Pfeil rechts
        pDr.hideSuggestions();
        break;
      case 27: // Esc
      case 33: // Bild rauf
      case 34: // Bild runter
      case 35: // Ende
      case 36: // Pos1
      case 38: // Pfeil hoch
      case 40: // Pfeil runter
        break;
      case 13: // Enter
      
        if($(pDr.inputFeld).value=="" || sugbox.style.display!="block" || pDr.selRow==-1){
          //if(document.forms.bengine['IFFVillage']) document.forms.bengine['IFFVillage'].value = ''; // !!! Zuruecksetzen der ortsabhaengigen Hotelnamen !!!
          if(e.stopPropagation)
            e.stopPropagation();
          if(e.preventDefault)
            e.preventDefault();
          else
            return false;
          break;
        }
        var aktSuggest = pDr.arSuggestions[pDr.selRow];
        var selItem    = aktSuggest.vorschlag;
        var selKat     = aktSuggest.kategorie;
        var nPos       = aktSuggest.strpos;

        if(nPos>1)
          $(pDr.inputFeld).value = $(pDr.inputFeld).value.substr(0,nPos)+selItem;
        else
          $(pDr.inputFeld).value = selItem;
          
        pDr.arSuggestions = [];
        pDr.XMLResponse['SUGGESTIONS'] = [];
        pDr.selRow=-1;
        pDr.blockSuggestions = true;
        
        if(sugbox.style.display=="block")
          pDr.hideSuggestions();
        if(typeof(pDr.XMLResponse[selKat])=='string')
          pDr.XMLResponse[selKat] = selItem;
        else
          pDr.XMLResponse[selKat].push(selItem);

        pDr.XMLRequest.doXMLRequest();
        pDr.updateData();
        if(e.stopPropagation) e.stopPropagation();
        if(e.preventDefault){
          e.preventDefault();
        }else{
          return false;
        }
        break;
        
      default:
        if($(pDr.inputFeld).value==""){
          //if(document.forms.bengine['IFFVillage']) document.forms.bengine['IFFVillage'].value = ''; // !!! Zuruecksetzen der ortsabhaengigen Hotelnamen !!!
          pDr.hideSuggestions();
          pDr.updateData();
          break;
        }
        if(!pDr.ForceSuggestions){
          $(pDr.Name).value = $(pDr.inputFeld).value;
        }
        pDr.calls++;
        window.setTimeout(pDr.XMLRequest.doXMLRequest,TTDR.Ajax.Delay);
    }
  };
  
  this.handleOnFocus = function(){
    TTDR.hideAllSuggestions();
    if(this.value==pDr.InputFieldDefaultValue){
      this.value = "";
      if(document.forms.bengine.input_DESTINATION.value == ''){
        document.forms.bengine.IFFVillage.value = '';
      }
    }
  };
  
  /**
  *calls the {@link TTDR.DreamReader#selectRow} method
  */
  this.sugOnMouseOver = function(){
    if(pDr.ignoreMouseEvents) return;
    pDr.selRow = this.id.replace(/(sugrow_)(.+)/,"$2");
    pDr.selectRow();
  };

  /**
  *Selects a suggestions (by mouseclick), and initiates a new AJAX-request
  */
  this.sugOnClick = function(){
    var id      = this.id.replace(/(sugrow_)(.+)/,"$2");
    var selItem = pDr.arSuggestions[id].vorschlag;
    var selKat  = pDr.arSuggestions[id].kategorie;
    var nPos    = pDr.arSuggestions[id].strpos;

    if(nPos>1)
      $(pDr.inputFeld).value = $(pDr.inputFeld).value.substr(0,nPos)+selItem;
    else
      $(pDr.inputFeld).value = selItem;
    pDr.positioniereCursor();
    pDr.arSuggestions = [];
    pDr.selRow=-1;
    pDr.blockSuggestions = true;
    pDr.XMLRequest.doXMLRequest();
  };
  
  /**
  *AJAX Response Handler function
  */
  this.handleXMLResponse = function(){
    if(pDr.xmlReq.readyState == 4){
      if(pDr.xmlReq.status == 200 || pDr.xmlReq.status == 304){
        if(pDr.xmlReq.responseText=="")
          pDr.EH.onAjaxError();
        else
          pDr.EH.onAjaxSuccess();
      }else{
        pDr.EH.onAjaxError();
      }
    }
  };
  
  /**
  *Called after successful completion of an AJAX request
  */
  this.onAjaxSuccess = function(){

    pDr.XMLResponse = new TTDR.Ajax.Response(pDr.xmlReq.responseXML);

    // Donīt update non-forced fields with empty results
    if(!(!pDr.ForceSuggestions && pDr.XMLResponse[pDr.DataPool]==''))
      pDr.updateData();

    pDr.arSuggestions = [];
    
    if(pDr.XMLResponse['SUGGESTIONS'].length>0 && pDr.blockSuggestions==false){
      for(var i=0;i<pDr.XMLResponse['SUGGESTIONS'].length;i++)
        pDr.arSuggestions[i] = new TTDR.Ajax.Response.Suggestion(pDr.XMLResponse['SUGGESTIONS'][i],i,pDr);
      pDr.showSuggestions();
    }else{
      pDr.hideSuggestions();
    }
    pDr.blockSuggestions = false;
  };
  
  /**
  *Called when an error occurs during the AJAX request
  *(e.g Server is not availible or server returns an empty result).
  */
  this.onAjaxError = function(){};
};

/**
*@class A basic exception class.<br>
*@param {String} errName name of the exception
*@param {String} errMessage Message of the exception
*@constructor
*/
TTDR.Exception = function(errName,errMessage){
  /**
  *Name of the Exception e.g. InvalidDatapool
  *@type String
  */
  this.name = errName;
  /**
  *Error message
  *@type String
  */
  this.message = errMessage;
}

/**
*@class The TTDR.Ajax class can't be created. Itīs used as a Namespace
*for the AJAX classes and the static AJAX communication properties<br>
*/
TTDR.Ajax = function(){};
/**
*Method for the AJAX Request (GET or POST)
*@type String
*/
TTDR.Ajax.Method='GET';
/**
*URL of the Dreamreader Communication Script
*@type String
*/
TTDR.Ajax.Url = file_path+'booking/jslib/ttdr/suggest.php?port='+port;
/**
*Delay (in milliseconds) after a Request is started.
*@type INT
*/
TTDR.Ajax.Delay = 0;

/**
*@class This class defines the Datastructure and methods to handle the AJAX XML response<br>
*@constructor
*@param xmlDoc XML document (optional)
*/
TTDR.Ajax.Response = function(xmlDoc){
  if(xmlDoc){
    this.MEALTYPE        = this.getXMLValue(xmlDoc.getElementsByTagName('MEALTYPE')[0]);
    this.SUGGESTIONS     = this.getXMLItems(xmlDoc.getElementsByTagName('SUGGESTION')[0]);
    this.SPORTANDLEISURE = this.getXMLItems(xmlDoc.getElementsByTagName('SPORTANDLEISURE')[0]);
    this.BEACH           = this.getXMLItems(xmlDoc.getElementsByTagName('BEACH')[0]);
    this.ROOMTYPE        = this.getXMLValue(xmlDoc.getElementsByTagName('ROOMTYPE')[0]);
    this.WELLNESS        = this.getXMLItems(xmlDoc.getElementsByTagName('WELLNESS')[0]);
    this.STARS           = this.getXMLValue(xmlDoc.getElementsByTagName('STARS')[0]);
    this.FAMILYANDKIDS   = this.getXMLItems(xmlDoc.getElementsByTagName('FAMILYANDKID')[0]);
    this.ADULTS          = this.getXMLValue(xmlDoc.getElementsByTagName('ADULTS')[0]);
    this.CHILDREN        = this.getXMLValue(xmlDoc.getElementsByTagName('CHILDREN')[0]);
//    this.DEPAIRPORT      = this.getXMLValue(xmlDoc.getElementsByTagName('DEPAIRPORT')[0]);
    this.DEPAIRPORT      = this.getXMLItems(xmlDoc.getElementsByTagName('DEPAIRPORTS')[0]);  // Seng, 2.2.07: field can have multiple hits
    this.DESTAIRPORT     = this.getXMLValue(xmlDoc.getElementsByTagName('DESTAIRPORT')[0]);
    this.DESTINATION     = this.getXMLDestinations(xmlDoc.getElementsByTagName('DESTINATION')[0]);
    this.VILLAGES        = this.getXMLVillages(xmlDoc.getElementsByTagName('VILLAGE')[0]);
    this.DATE            = this.getXMLValue(xmlDoc.getElementsByTagName('DATE')[0]);
    this.DURATION        = this.getXMLValue(xmlDoc.getElementsByTagName('DURATION')[0]);
    this.HOTELNAMES      = this.getXMLHotelnames(xmlDoc.getElementsByTagName('HOTEL')[0]);
//    this.HOTELNAMES      = this.getXMLHotel(xmlDoc.getElementsByTagName('HOTEL')[0]);  // Seng: 2.2.07: additional IFF-code
    this.TOUROPERATOR    = this.getXMLItems(xmlDoc.getElementsByTagName('TOUROPERATOR')[0]);
    this.RAILWAYSTATION  = this.getXMLRailwaystations(xmlDoc.getElementsByTagName('RAILWAYSTATION')[0]);
    this.POI             = this.getXMLPOIs(xmlDoc.getElementsByTagName('POI')[0]);
  }
};
TTDR.Ajax.Response.prototype = {
  /**
  *@type String
  */
  MEALTYPE: '',
  /**
  *@type Array
  */
  SUGGESTIONS: new Array(),
  /**
  *@type Array
  */
  SPORTANDLEISURE: new Array(),
  /**
  *@type Array
  */
  BEACH: new Array(),
  /**
  *@type String
  */
  ROOMTYPE: '',
  /**
  *@type Array
  */
  WELLNESS: new Array(),
  /**
  *@type String
  */
  STARS: '',
  /**
  *@type String
  */
  FAMILYANDKIDS: '',
  /**
  *@type String
  */
  ADULTS: '',
  /**
  *@type String
  */
  CHILDREN: '',
  /**
  *@type String
  */
  DEPAIRPORT: '',
  /**
  *@type String
  */
  DESTAIRPORT: '',
  /**
  *@type Array
  */
  DESTINATION: new Array(),
  /**
  *@type Array
  */
  VILLAGES: new Array(),
  /**
  *@type String
  */
  DATE: '',
  /**
  *@type String
  */
  DURATION: '',
  /**
  *@type Array
  */
  HOTELNAMES: new Array(),
  /**
  *@type Array
  */
  POI: new Array(),
  /**
  *@type Array
  */
  TOUROPERATOR: new Array(),
  /**
  *@type Array
  */
  RAILWAYSTATION: new Array(),
    
  /**
  *@param {node} node a XML Node
  *@return {Array} The "ITEM"-Childnode Values of a given XML-Node as an Array of Strings
  */
  getXMLItems: function(node){
    if(!node || !node.childNodes || node.childNodes.length==0)
      return [];
    var arRes  = [];
    var strVal = "";

    for(var i=0;i<node.childNodes.length;i++){
      if(node.childNodes[i].nodeName=='ITEM'){
        strVal = node.childNodes[i].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
        strVal = strVal.replace(/'/g,"ī");
        if(strVal!="")
          arRes.push(strVal);
      }
    }
    return arRes;
  },

  /**
  *@param {node} node XML node
  *@return {String} value of the given XML-node
  */
  getXMLValue: function(node){
    if(!node || !node.firstChild)
      return "";
      
    var strVal = node.firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
    strVal = strVal.replace(/'/g,"ī");
    return strVal;
  },
  
  /** Seng, 2.2.07, added
  *@param {node} node a XML Node
  *@return the childs <HOTELNAME> and <IFF> of a given XML-Node as String
  */
  getXMLHotel: function(node){
    if(!node || !node.childNodes || node.childNodes.length==0)
      return "";
    var hotelname = "";
    var iff       = "";
    var res       = "";
    var lat       = "";
    var lon       = "";
    var citytravel = "";
    
    for(var i=0;i<node.childNodes.length;i++){
    	var subnode = node.childNodes[i];
      if(subnode.nodeName=='HOTELNAME'){
      	hotelname = this.getXMLValue(subnode);
      } else if (subnode.nodeName=='IFF'){
      	iff = this.getXMLValue(subnode);
      } else if (subnode.nodeName=='LAT'){
      	lat = this.getXMLValue(subnode);
      } else if (subnode.nodeName=='LONG'){
      	lon = this.getXMLValue(subnode);
      } else if (subnode.nodeName=='CITYTRAVEL'){
      	citytravel = this.getXMLValue(subnode);
      }
    }
    
    res = (new TTDR.Ajax.Response.Hotel(hotelname,iff,lat,lon,citytravel)).toString();
    return res;
  },
  
  /**
  *@param {node} node XML node
  *@return {Array} Array of {@link TTDR.Ajax.Response.Destination} objects
  */
  getXMLHotelnames: function(node){
    if(!node || !node.childNodes || node.childNodes.length==0){
      return [];
    }

    var arRes        = [];
    var hnname       = "";
    var hniff        = "";
    var hndlclist    = "";
    var hntopregion  = "";
    var hniffort     = "";
    var hnlat        = "";
    var hnlon        = "";
    var hncitytravel = "";

    for(var j=0;j<node.childNodes.length;j++){
      if(node.childNodes[j].nodeName=='HOTELNAME'){
        hnname = node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
        hnname = hnname.replace(/'/g,"ī");
      }else if(node.childNodes[j].nodeName=='IFF'){
        hniff = node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
      }else if(node.childNodes[j].nodeName=='DLCLIST'){
        hndlclist = node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
      }else if(node.childNodes[j].nodeName=='TOPREGION'){
        hntopregion = node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
      }else if(node.childNodes[j].nodeName=='IFFORT'){
        hniffort = node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
      }else if(node.childNodes[j].nodeName=='LAT'){
        hnlat = node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
      }else if(node.childNodes[j].nodeName=='LONG'){
        hnlon = node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
      }else if(node.childNodes[j].nodeName=='CITYTRAVEL'){
        hncitytravel = node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
      }
    }
    if(hnname!=""){
      arRes[arRes.length] = new TTDR.Ajax.Response.Hotelnames(hnname,hniff,hndlclist,hntopregion,hniffort,hnlat,hnlon,hncitytravel);
      if(document.forms.bengine['shotel']) document.forms.bengine['shotel'].value = hnname;
      if(document.forms.bengine['IFF']) document.forms.bengine['IFF'].value = hniff;
      flagEnter = 'true';
    }
    //alert("ttdr.js:\hnname -> "+hnname+"\nhniff -> "+hniff+"\nhndlclist-> "+hndlclist+"\ncitytravel -> "+hncitytravel);
    return arRes;
  },
  
  /**
  *@param {node} node XML node
  *@return {Array} Array of {@link TTDR.Ajax.Response.Destination} objects
  */
  getXMLDestinations: function(node){
    if(!node || !node.childNodes || node.childNodes.length==0){
      return [];
    }
    var arRes  = [];

    for(var i=0;i<node.childNodes.length;i++){
      if(node.childNodes[i].nodeName=='ITEM'){

        var destname        = "";
        var desttopregs     = "";
        var destaktion      = "";
        var destvalue       = "";
        var dlclist         = "";   // Seng, 2.2.07, new element added
        var fewotopreg      = "";   // Seng, 2.2.07, new element added
        var attributes      = "";   // Seng, 2.2.07, new element added
        var subnode         = node.childNodes[i];
        var destudr         = "";
        var destlat         = "";
        var destlon         = "";
        var destcitytravel  = "";
        
        for(var j=0;j<subnode.childNodes.length;j++){
          if(subnode.childNodes[j].nodeName=='DESTINATIONNAME'){
            destname = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
            destname = destname.replace(/'/g,"ī");
          }else if(subnode.childNodes[j].nodeName=='TOPREGIONIDS'){
            desttopregs = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='VALUE'){
            destvalue = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='UDR'){
            destudr = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='LAT'){
            destlat = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='LONG'){
            destlon = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='CITYTRAVEL'){
            destcitytravel = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='DLCLIST'){
            dlclist = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }/*else if(subnode.childNodes[j].nodeName=='TOPREGIONIDSFEWO'){
            fewotopreg = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='ATTRIBUTES'){
            attributes = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }*/
        }
        if(destname!="" && destvalue!=""){
          arRes[arRes.length] = new TTDR.Ajax.Response.Destination(destname,destaktion,destvalue,desttopregs,dlclist,fewotopreg,attributes,destudr,destlat,destlon,destcitytravel);
          if(document.forms.bengine['IFFVillage']) document.forms.bengine['IFFVillage'].value = destvalue;
          flagEnter = 'true';
        }
      }
    }
    //alert("ttdr.js:\n1: "+destname+"\n2: "+destaktion+"\n3: "+destvalue+"\n4: "+desttopregs+"\n"+dlclist+"\n"+fewotopreg+"\n"+attributes+"\n"+destudr+"\n"+destlat+"\n"+destlon+"\n"+destcitytravel);
    return arRes;
  },

  /**
  *@param {node} node XML node
  *@return {Array} Array of {@link TTDR.Ajax.Response.POI} objects
  */
  getXMLPOIs: function(node){
   if(!node || !node.childNodes || node.childNodes.length==0){
      return [];
    }
    var arRes  = [];

    for(var i=0;i<node.childNodes.length;i++){
      if(node.childNodes[i].nodeName=='ITEM'){
    
        var poiName              = "";
        var poiIffort            = "";
        var poiTopregion         = "";
        //var poiTopregionName     = "";
        //var poiTopregionFewo     = "";
        //var poiTopregionNameFewo = "";
        var poiVillage           = "";
        var poiLat               = "";
        var poiLon               = "";
        var poiCitytravel        = "";
        var subnode              = node.childNodes[i];
        
        for(var j=0;j<subnode.childNodes.length;j++){
          if(subnode.childNodes[j].nodeName=='POINAME'){
            poiName = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
            poiName = poiName.replace(/'/g,"ī");
          }else if(subnode.childNodes[j].nodeName=='IFFORT'){
            poiIffort = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='TOPREGIONIDLAPA'){
            poiTopregion = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }/*else if(subnode.childNodes[j].nodeName=='TOPREGIONNAMELAPA'){
            poiTopregionName = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='TOPREGIONIDFEWO'){
            poiTopregionName = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='TOPREGIONNAMEFEWO'){
            poiTopregionName = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }*/else if(subnode.childNodes[j].nodeName=='VILLAGE'){
            poiVillage = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
            poiVillage = poiVillage.replace(/'/g,"ī");
          }else if(subnode.childNodes[j].nodeName=='LAT'){
            poiLat = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='LONG'){
            poiLon = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='CITYTRAVEL'){
            poiCitytravel = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }
        }
        if(poiName != "" && document.bengine.POI){
          //arRes[arRes.length] = new TTDR.Ajax.Response.POI(poiName,poiIffort,poiTopregion,poiVillage,poiLat,poiLon,poiCitytravel);
          document.bengine.POI.value = poiName+"|"+poiIffort+"|"+poiTopregion+"|"+poiVillage+"|"+poiLat+"|"+poiLon+"|"+poiCitytravel;
          if(document.forms.bengine['IFFVillage']) document.forms.bengine['IFFVillage'].value = poiIffort;
          //document.bengine.POI.value = poiName+"|"+poiIffort+"|"+poiTopregion+"|"+poiTopregionName+"|"+poiTopregionFewo+"|"+poiTopregionNameFewo+"|"+poiVillage+"|"+poiLat+"|"+poiLon+"|"+poiCitytravel;
          flagEnter = 'true';
        }
      }
    }
    return arRes;
  },
  
  /**
  *@param {node} node XML-node
  *@return {Array} Array of {@link TTDR.Ajax.Response.Village} objects
  */
  getXMLVillages: function(node){
    if(!node || !node.childNodes || node.childNodes.length==0)
      return [];
    var arRes  = [];
    var strVal = "";

    for(var i=0;i<node.childNodes.length;i++){
      if(node.childNodes[i].nodeName=='ITEM'){

        var ortname    = "";
        var ortaktion  = "2";  // Seng, 2.2.07, always "2" for villages.
        var orttopreg  = "";
        var ortiff     = "";
        var dlclist    = "";   // Seng, 2.2.07, new element added 
        var fewotopreg = "";   // Seng, 2.2.07, new element added
        var subnode    = node.childNodes[i];

        for(var j=0;j<subnode.childNodes.length;j++){
          if(subnode.childNodes[j].nodeName=='VILLAGENAME'){
            ortname = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
            ortname = ortname.replace(/'/g,"ī");
     //   }else if(subnode.childNodes[j].nodeName=='ACTION'){
     //     ortaktion = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='TOPREGIONID'){
            orttopreg = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='VALUE'){
            ortiff = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }/*else if(subnode.childNodes[j].nodeName=='DLCLIST'){
            dlclist = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='TOPREGIONIDSFEWO'){
            fewotopreg = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }*/
        }

        if(ortname!="")
          arRes[arRes.length] = new TTDR.Ajax.Response.Village(ortname,ortaktion,orttopreg,ortiff,dlclist,fewotopreg);
      }
    }
    return arRes;
  },
  
  /**
  *@param {node} node XML-node
  *@return {Array} Array of {@link TTDR.Ajax.Response.Railwaystation} objects
  */
  getXMLRailwaystations: function(node){
    if(!node || !node.childNodes || node.childNodes.length==0)
      return [];
    var arRes  = [];
    var strVal = "";

    for(var i=0;i<node.childNodes.length;i++){
      if(node.childNodes[i].nodeName=='ITEM'){

        var id      = "";
        var country = "";
        var rname   = "";
        var subnode = node.childNodes[i];

        for(var j=0;j<subnode.childNodes.length;j++){
          if(subnode.childNodes[j].nodeName=='ID'){
            id = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='COUNTRYID'){
            country = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }else if(subnode.childNodes[j].nodeName=='NAME'){
            rname = subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
          }
        }

        if(id!="")
          arRes[arRes.length] = new TTDR.Ajax.Response.Railwaystation(id,country,rname);
      }
    }
    return arRes;
  }
  
};

/**
*@class Suggestion<br>
*@param {String} strSuggestion semicolon seperated Suggestion parameters
*@param {Int} id Index in the Suggestion array
*@param {TTDR.Dreamreader} pDr Reference to the TTDR.DreamReader object
*@constructor
*/
TTDR.Ajax.Response.Suggestion = function(strSuggestion,id,pDr){
  /**
  *@ignore
  */
  var arTmp = strSuggestion.split(';');
  
  /**
  WIEDER RAUSNEHMEN!!
  */
  if(arTmp[1]=="VILLAGE") arTmp[1]="VILLAGES";

  /**
  *Suggestion label. This label is the option which the user sees in the List
  *@type String
  */
  this.vorschlag = arTmp[0];
  /**
  *The corresponding Datapool
  *@type String
  */
  this.kategorie = arTmp[1];
  /**
  *Start string position for the replace
  *@type Int
  */
  this.strpos = arTmp[2];
  /**
  *The Index position in the Suggestions Array
  *@type Int
  */
  this.id = id;

  /**
  *generates the HTML output for a suggestion
  *@return {String} HTML output
  */
  this.toHTML = function(){
    var strErg = '<div id="sugrow_'+this.id+'" class="divSuggestion"><span>'+this.vorschlag.trim(pDr.SuggestLength)+'</span></div>';
    return strErg;
  };
};


/**
*@class Hotelnames represents a "Hotel"<br>
*@param {String} name Name of the Hotel
*@constructor
*/
TTDR.Ajax.Response.Hotelnames = function(name,iff,dlclist,topregion,iffort,lat,lon,citytravel){
  /**
  *Name of the Hotel
  *@type String
  */
  this.name    = name;
  /**
  *IFF of the Hotel
  *@type String
  */
  this.iff    = iff;
  /**
  *semicolon seperated list DLCs
  *@type String
  */
  this.dlclist = dlclist;
  /**
  *topRegion of the Hotel
  *@type String
  */
  this.topregion    = topregion;
  /**
  *IFFOrt of the Hotel
  *@type String
  */
  this.iffort    = iffort;
  /**
  *Lat
  *@type String
  */
  this.lat = lat;
  /**
  *Lon
  *@type String
  */
  this.lon = lon;
  /**
  *CitytTravel-Indicator
  *@type Boolean
  */
  this.citytravel = citytravel;
  
  this.toString = function(){
    return  this.name+"|"+this.iff+"|"+this.dlclist+"|"+this.topregion+"|"+this.iffort+"|"+this.lat+"|"+this.lon+"|"+this.citytravel;
  };
};


/**
*@class Destination represents a "Reiseziel"<br>
*@param {String} name Name of the Destination
*@param {Int} daction Indicator whether 'value' is a topRegion-list or an IFFOrt-list
*@param {String} value semicolon seperated list of either topRegion or IFFOrt values
*@constructor
*/
TTDR.Ajax.Response.Destination = function(name,daction,value,topregs,dlclist,fewotopreg,attributes,udr,lat,lon,citytravel){
  /**
  *@ignore
  */
  var arTmp    = daction.split(';');
  /**
  *Name of the Destination
  *@type String
  */
  this.name    = name;
  /**
  *Indicator whether the value property is a topRegion list or an IFFOrt list
  *@type Int
  */
  this.daction = arTmp[1];
  /**
  *semicolon seperated list of either topRegion or IFFOrt values
  *@type String
  */
  var tmp_value = value.split(";")[0] || '';
  this.value = tmp_value;
  /**
  *semicolon seperated list of either topRegion or IFFOrt values
  *@type String
  */
  this.topregions = topregs;
  /**
  *semicolon seperated list DLCs (not used yet)
  *@type String
  */
  this.dlclist = dlclist;
  /**
  *topregID for FEWO (not used yet)
  *@type String
  */
  this.fewotopreg = fewotopreg;
  /**
  *attributes (not used yet)
  *@type String
  */
  this.attributes = attributes;
  /**
  *UDR
  *@type String
  */
  this.udr = udr;
  /**
  *Lat
  *@type String
  */
  this.lat = lat;
  /**
  *Lon
  *@type String
  */
  this.lon = lon;
  /**
  *CitytTravel-Indicator
  *@type Boolean
  */
  this.citytravel = citytravel;
  
  this.toString = function(){
    return  this.name+"|"+this.daction+"|"+this.value+"|"+this.topregions+"|"+this.dlclist+"|"+this.fewotopreg+"|"+this.attributes+"|"+this.udr+"|"+this.lat+"|"+this.lon+"|"+this.citytravel;
  };
};


/**
*@class POIs represents a "Points of interest"<br>
*@param {String} name Name of the POI
*@constructor
*/
TTDR.Ajax.Response.POI = function(name,iffort,topregion,village,lat,lon,citytravel){
  /**
  *Name of the POI
  *@type String
  */
  this.name    = name;
  /**
  *IFFORt
  *@type String
  */
  this.iffort = iffort;
  /**
  *topRegion
  *@type String
  */
  this.topregion = topregion;
  /**
  *Village
  *@type String
  */
  this.village = village;
  /**
  *Lat
  *@type String
  */
  this.lat = lat;
  /**
  *Lon
  *@type String
  */
  this.lon = lon;
  /**
  *CitytTravel-Indicator
  *@type Boolean
  */
  this.citytravel = citytravel;
  
  this.toString = function(){
    return  this.name+"|"+this.iffort+"|"+this.topregion+"|"+this.village+"|"+this.lat+"|"+this.lon+"|"+this.citytravel;
  };
};


/**
*@class Village represents a "Reiseort"<br>
*@param {String} name Name of the Village
*@param {Int} vaction Indicator which value to use (topRegion or IFFOrt)
*@param {Int} topregion topRegion Code of the Village
*@param {Int} iffort IFFOrt Code of the Village
*@constructor
*/
TTDR.Ajax.Response.Village = function(name,vaction,topregion,iffort,dlclist,fewotopreg){
  /**
  *The name of the Village
  *@type String
  */
  this.name = name;
  /**
  *Indicates which value to use (topRegion or IFFOrt)
  *@type Int
  */
  this.vaction = vaction;
  /**
  *topRegion Code for the Village
  *@type Int
  */
  this.topregion = topregion;
  /**
  *IFFOrt Code for the Village
  *@type Int
  */
  this.iffort = iffort;
  /**
  *semicolon seperated list DLCs (not used yet)
  *@type String
  */
  this.dlclist = dlclist;
  /**
  *topregID for FEWO (not used yet)
  *@type String
  */
  this.fewotopreg = fewotopreg;  
  
  this.toString = function(){
    return  this.name+"|"+this.vaction+"|"+this.topregion+"|"+this.iffort+"|"+this.dlclist+"|"+this.fewotopreg;
  };
};

/**
*@class Railwaystation represents a "Bahnhof"<br>
*@param {Int} id Railwaystation-ID
*@param {Int} country Country-ID of the country of the Railwaystation
*@param {String} rname Name of the Railwaystation
*@constructor
*/
TTDR.Ajax.Response.Railwaystation = function(id,country,rname){
  /**
  *Railwaystation-ID
  *@type Int
  */
  this.id = id;
  /**
  *Country-ID
  *@type Int
  */
  this.country = country;
  /**
  *Name
  *@type String
  */
  this.rname = rname;

  this.toString = function(){
    return  this.id+"|"+this.country+"|"+this.rname;
  };
};

/**
*@class Hotel represents a "Hotel"<br>
*@param {String} hotelname, name of the hotel
*@param {Int} iff IFF-Code of the hotel
*@constructor
*/
TTDR.Ajax.Response.Hotel = function(hotelname,iff,lat,lon,citytravel){
  /**
  *name of the hotel
  *@type String
  */
  this.hotelname = hotelname;
  /**
  *IFF-Code of the hotel
  *@type Int
  */
  this.iff = iff;
  
  this.lat = lat;
  this.lon = lon;
  this.citytravel = citytravel;

  this.toString = function(){
    return  this.hotelname+"|"+this.iff+"|"+this.lat+"|"+this.lon+"|"+this.citytravel;
  };
};

/**
*@constructor
*@param {TTDR.DreamReader} dr Reference to a {@link TTDR.DreamReader} object
*/
TTDR.Ajax.Request = function(dr){
  /**
  *Reference to a {@link TTDR.DreamReader} object
  *@private
  *@type TTDR.DreamReader
  */
  var pDr = dr;
  
  /**
  *Execute AJAX Request
  */
  this.doXMLRequest = function(){
    pDr.calls--;
    if(pDr.calls>0 || $(pDr.inputFeld).value==''){
      if(document.forms.bengine['IFFVillage']) document.forms.bengine['IFFVillage'].value = ''; // !!! Zuruecksetzen der ortsabhaengigen Hotelnamen !!!
      return;
    }
    var xmlRequest = false;
    try{
      xmlRequest = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
      try{
        xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
      }catch(e){
        xmlRequest = false;
      }
    }
    if(!xmlRequest && typeof(XMLHttpRequest)!='undefined') {
      xmlRequest = new XMLHttpRequest();
    }
    if(xmlRequest){
      pDr.xmlReq = xmlRequest;
      if(document.forms.bengine['IFFVillage'] && document.forms.bengine['IFFVillage'].value != ''){
        pDr.xmlReq.open('GET',TTDR.Ajax.Url+'?datapools='+pDr.DataPool+'&userinput='+escape($(pDr.inputFeld).value)+'&IFFVillage='+document.forms.bengine['IFFVillage'].value,true);
      }
      else{
        pDr.xmlReq.open('GET',TTDR.Ajax.Url+'?datapools='+pDr.DataPool+'&userinput='+escape($(pDr.inputFeld).value),true);
      }
      pDr.xmlReq.onreadystatechange = pDr.EH.handleXMLResponse;
      pDr.xmlReq.send(null);
    }
  };
};

/**
*Addon for the JS core String Class - trims a String if itīs longer
*then a given maxchar value<br>
*@param {Int} maxchar maximum allowed length of the string
*@returns {String} the trimmed String
*@addon
*/
String.prototype.trim = function(maxchar){
  var strRet = this;
  try{
  if(this.length>maxchar)
    strRet = this.substr(0,maxchar-3)+"...";
  }catch(e){
    strRet = "";
  }
  return strRet;
}
