function search_va (form) {
	day_from = form.choice_date_from_day.options[form.choice_date_from_day.selectedIndex].value;
	month_from = form.choice_date_from_monthyear.options[form.choice_date_from_monthyear.selectedIndex].value;
	day_to = form.choice_date_to_day.options[form.choice_date_to_day.selectedIndex].value;
	month_to = form.choice_date_to_monthyear.options[form.choice_date_to_monthyear.selectedIndex].value;
	category = form.choice_category.options[form.choice_category.selectedIndex].value;
	
	if (form.choice_free_search.value != "Suchwort")
		freesearch = form.choice_free_search.value;
	else
		freesearch = "";
	
	url = "http://event.toubiz.de/blasierland/default/index.php?search_action=1&choice_date_from_day=" + day_from + "&choice_date_from_monthyear=" + month_from + "&choice_date_to_day=" + day_to + "&choice_date_to_monthyear=" + month_to + "&choice_category=" + category + "&choice_free_search=" + freesearch;
	//alert(url);
	popup(800,600,url);
}

function search_toubiz_2 (form) {
    
    timesearch = 0;
    choice_house_category = form.choice_house_category.options[form.choice_house_category.selectedIndex].value;
    choice_dateinput_arrival = form.datepicker_von.value;
    choice_dateinput_departure = form.datepicker_bis.value;
    choice_arrival_period = "default%23arrival_period%23yes";
    
    if (choice_dateinput_arrival != "" && choice_dateinput_arrival != "Anreisedatum" && choice_dateinput_departure != "" && choice_dateinput_departure != "Abreisedatum") {
        
        url = "http://www3.toubiz.de/blasierland/default/search.php?search_action=1&search_new=1&choice_arrival_period=" +choice_arrival_period+ "&choice_dateinput_arrival=" + choice_dateinput_arrival + "&choice_dateinput_departure=" + choice_dateinput_departure + "&choice_house_category=" + choice_house_category + "&sort=tip";
        
        popup(1000,800,url);
        
    } else {
        
        alert("Bitte geben Sie ein Anreisedatum und ein Abreisedatum ein!")
            
    }
    
}

function search_toubiz (form) {
	
	timesearch = 0;
	choice_house_category = form.choice_house_category.options[form.choice_house_category.selectedIndex].value;
	choice_arrival_day = form.choice_arrival_day.options[form.choice_arrival_day.selectedIndex].value;
	choice_arrival_month = form.choice_arrival_month.options[form.choice_arrival_month.selectedIndex].value;
	choice_arrival_year = form.choice_arrival_year.options[form.choice_arrival_year.selectedIndex].value;
	choice_departure_day = form.choice_departure_day.options[form.choice_departure_day.selectedIndex].value;
	choice_departure_month = form.choice_departure_month.options[form.choice_departure_month.selectedIndex].value;
	choice_departure_year = form.choice_departure_year.options[form.choice_departure_year.selectedIndex].value;	
	
	choice_dateinput_arrival = choice_arrival_day+'.'+choice_arrival_month+'.'+choice_arrival_year;
	choice_dateinput_departure =  choice_departure_day+'.'+choice_departure_month+'.'+choice_departure_year;
	
	if (choice_arrival_day != "")
		timesearch = timesearch + 1;
	if (choice_arrival_month != "")
		timesearch = timesearch + 1;
	if (choice_arrival_year != "")
		timesearch = timesearch + 1;
	if (choice_departure_day != "")
		timesearch = timesearch + 1;
	if (choice_departure_month != "")
		timesearch = timesearch + 1;
	if (choice_departure_year != "")
		timesearch = timesearch + 1;				

	
	if (timesearch == 6) {
		
		choice_arrival_period = "default%23arrival_period%23yes";
		
		url = "http://www3.toubiz.de/blasierland/default/search.php?search_action=1&search_new=1&choice_arrival_period=" + choice_arrival_period + "&choice_dateinput_arrival=" + choice_dateinput_arrival + "&choice_dateinput_departure=" + choice_dateinput_departure + "&sort=random";
		
		popup(950,750,url);
		
	} else if (timesearch < 6 && timesearch != 0) {
		
		alert("Bitte geben einen korrekten Anreise- und Abreisetag an!")
			
    } else {
    	
    	choice_arrival_period = "default%23arrival_period%23no";
    	
		url = "http://www3.toubiz.de/blasierland/default/search.php?search_action=1&search_new=1&choice_arrival_period=" +choice_arrival_period+ "&choice_house_category=" + choice_house_category + "&sort=random";			    	
		
		popup(950,750,url);
	
	}
	
}

function popup(w,h,ziel) {
  h = h - 20; var x=0, y=0, parameter="";
  if (w < screen.availWidth || h < screen.availHeight) {
    x = (screen.availWidth - w - 12) / 2;
    y = (screen.availHeight - h - 104) / 2;
    if (window.opera) y = 0; // Opera positioniert unter den Symbolleisten
    if (x<0 || y<0) { x=0; y=0; }
    else parameter = "width=" + w + ",height=" + h + ",";
  }
  parameter += "left=" + x + ",top=" + y;
  parameter += ",menubar=0,location=0,toolbar=0,status=0";
  parameter += ",resizable=1,scrollbars=1";
  var Fenster = window.open(ziel,"",parameter);
  if (Fenster) Fenster.focus();
  return !Fenster;
}

