function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function resizeMe(){
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }

    window.moveTo(screen.width/2-(myWidth/2),screen.height/2-(myHeight/2));
    window.focus();
}

function showPic(id, nr){
	for (var i = 1; i<=3; i++) {
		if (document.getElementById('img_'+i+nr)) {
			document.getElementById('img_'+i+nr).style.display='none';
		}
	}
	if(document.getElementById('img_'+id+nr)){
		document.getElementById('img_'+id+nr).style.display='block';
	}
}

var kalenderCallback = function(data)
{
  if (data != null && typeof data == 'object') alert(DWRUtil.toDescriptiveString(data, 2));
  else  {
      DWRUtil.setValue('kalender_div_tag', DWRUtil.toDescriptiveString(data, 1));
//      DWRUtil.setValue('kalender_div_tag2', DWRUtil.toDescriptiveString(data, 1));
  }
}

  function setDate(data){
      if(window.setSelection){
          setSelection(data);
      }//else fail silently
  }

  function setDatum(datum){
      DWRUtil.setValue('zoeken_datum',datum);
  }

  function setBudget(budget){
      DWRUtil.setValue('zoeken_budget',budget);
  }

  function setRegio(regio){
      DWRUtil.setValue('zoeken_regio',regio);
  }

  function setStad(stad){
      DWRUtil.setValue('zoeken_stad',stad);
  }

  function setWeekendType(weekend_type){
      DWRUtil.setValue('zoeken_weekend_type',weekend_type);
  }

  function setAantalResultaten(aantal_resultaten){
      DWRUtil.setValue('aantal_div_tag', aantal_resultaten);
  }

  function setTrefwoorden(trefwoorden){
      DWRUtil.setValue('zoeken_trefwoorden', trefwoorden);
  }

  function Trim(s)
  {
    return( s.replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') );   // example: str=str.trim();
  }

  var selectStedenCallback = function(data)
  {
      var form = window.document.searchForm;
      var zoeken_stad = form.zoeken_stad;
      zoeken_stad.options.length = 0;
      for (var i=0;i<data.length;i++){
        var row = data[i];
        zoeken_stad.options[i]= new Option(row[1],row[0]);
      }
      //alert(DWRUtil.toDescriptiveString(data, 2));
  }

  var getAantalCallback = function(data)
  {
    if (data != null && typeof data == 'object') alert(DWRUtil.toDescriptiveString(data, 2));
    else  {
        var resultaat = DWRUtil.toDescriptiveString(data, 1);
        DWRUtil.setValue('aantal_div_tag', resultaat);
    }
  }

  function updateAantalArrangementen(defaultText)
  {
        var form = window.document.searchForm;
        var zoeken_datum = form.zoeken_datum;
        var zoeken_budget = form.zoeken_budget;
        var zoeken_regio = form.zoeken_regio;
        var zoeken_stad = form.zoeken_stad;
        var zoeken_weekend_type = form.zoeken_weekend_type;
        WeekendeskAJAXAdapter.getAantal(zoeken_datum.options[zoeken_datum.selectedIndex].value,
            zoeken_budget.options[zoeken_budget.selectedIndex].value,
            zoeken_regio.options[zoeken_regio.selectedIndex].value,
            zoeken_stad.options[zoeken_stad.selectedIndex].value,
            zoeken_weekend_type.options[zoeken_weekend_type.selectedIndex].value,
            getAantalCallback);
  }

   function updateAantalArrangementenTrefwoord()
  {
        var form = window.document.searchForm;
        var zoeken_datum = form.zoeken_datum;
        var zoeken_budget = form.zoeken_budget;
        var zoeken_regio = form.zoeken_regio;
        var zoeken_stad = form.zoeken_stad;
        var zoeken_weekend_type = form.zoeken_weekend_type;
        var zoeken_trefwoorden = form.zoeken_trefwoorden;
        WeekendeskAJAXAdapter.getAantal(zoeken_datum.options[zoeken_datum.selectedIndex].value,
            zoeken_budget.options[zoeken_budget.selectedIndex].value,
            zoeken_regio.options[zoeken_regio.selectedIndex].value,
            zoeken_stad.options[zoeken_stad.selectedIndex].value,
            zoeken_weekend_type.options[zoeken_weekend_type.selectedIndex].value,
            zoeken_trefwoorden.value,
            getAantalCallback);
        zoeken_datum.selectedIndex = 0;
        zoeken_budget.selectedIndex = 0;
        zoeken_regio.selectedIndex = 0;
        zoeken_stad.selectedIndex = 0;
        zoeken_weekend_type.selectedIndex = 0;
  }





