/* generated Fri Jan 27 15:36:05 EST 2012 */

if(typeof R9==="undefined"){R9=new Object()}R9.form={_getFormType:function(a){if(typeof a.tab!=="undefined"){return a.tab.value}else{return"unknown"}},_getUseCompareTo:function(a){if(typeof a.doCompareTo!=="undefined"){if(a.doCompareTo.value===true||a.doCompareTo.value==="true"){return true}}return false},_checkFormPopulated:function(a){if(typeof a=="undefined"||typeof a.value=="undefined"||a.value.length==0){return false}return true},_setDisabledImage:function(a){jq(a).attr("src","/images/v425116/button/redesign/a-search-button-fd-disabled.de..png").prop("disabled",true)},_dateFormat:"dd.mm.yy",_grabDate:function(b,a){if(typeof b!=="undefined"){return jq.datepicker.parseDate(R9.form._dateFormat,b)}else{if(typeof a!=="undefined"){return jq.datepicker.parseDate(R9.form._dateFormat,a)}else{return null}}},_submit:function(d,a){if(a(d)===false){return false}jq(d).find(".searchbutton").unbind("mouseup").unbind("mousedown");window.setTimeout("R9.form._setDisabledImage('.searchbtn input')",1);Profiler.markSearchStart();if(R9.form._getUseCompareTo(d)===true){R9.CompareTo.launch(d)}var e=generateSearchUrl(d);var c=jq(d).attr("action");var b=null;if(R9.form._useInServlet(d)){if(e!=null){b=R9.form._getInServletLink(d,e)}else{b=R9.form._getInServletLink(d,c+"?"+jq(d).serialize())}}else{if(e!=null){b=e}else{b=null}}if(b!=null){if(jq(d).attr("target")=="_blank"){window.open(b)}else{document.location.href=b}return false}return true},_useInServlet:function(a){if(typeof a.useInLink!="undefined"&&a.useInLink.value=="true"){return true}return false},_getInServletLink:function(b,a){return R9.form._getInServletLinkPrefix(b)+encodeURI(a)},_getInServletLinkPrefix:function(b){var a="";var c="";if(typeof b.ai!="undefined"&&typeof b.ai.value!="undefined"){a=b.ai.value}if(typeof b.p!="undefined"&&typeof b.p.value!="undefined"){c=b.p.value}return"/in?a="+encodeURI(a)+"&p="+encodeURI(c)+"&url="},_compareToCallback:function(b){var a=jq(this).closest("form").get(0);R9.form._smartboxPopulate(a,this,b);R9.CompareTo.smartboxCallback(a)},_smartboxCallback:function(b){var a=jq(this).closest("form").get(0);R9.form._smartboxPopulate(a,this,b)},_smartboxPopulate:function(c,a,d){var b=R9.form._getFormType(c);if(b==="flights"){if(jq(a).is("input[name=origin]")){c.origincode.value=d.id}else{if(jq(a).is("input[name=destination]")){c.destcode.value=d.id}}}else{if(b==="hotels"){c.citycode.value=d.id;if(typeof c.hid!="undefined"){c.hid.value=d.hid||""}if(typeof c.lmid!="undefined"){c.lmid.value=d.lmid||""}}else{if(b==="cars"){if(jq(a).is("input[name=location]")){c.citycode1.value=d.id}else{if(jq(a).is("input[name=location2]")){c.citycode2.value=d.id}}}else{if(b==="vacations"){if(jq(a).is("input[name=origin]")){c.origincode.value=d.id}else{if(jq(a).is("input[name=destination]")){c.destcode.value=d.id}}}}}}}};R9.form.flight={_oneWayToggle:function(a){var b=a.target;var c=jq(b).closest("form");if(b.value==="y"){jq(c).find(".roundTripSection").hide()}else{if(b.value==="n"){jq(c).find(".roundTripSection").show()}else{if(b.value==="m"){document.location.href="/flights?mc=y"}}}R9.form.flight._updateFlexOptions(c)},_updateFlexOptions:function(a){if(jq(a).find("input[name=dtFlexCat]:checked").val()=="weekend"){R9.form.flight._clickFlexOption(a,"exact")}},_clickFlexOption:function(b,a){jq(b).find("input[name=dtFlexCat]").each(function(){if(jq(this).val()==a){jq(this).click()}})},_flexDateClick:function(a){var b=a.target;var c=jq(b).closest("form");c.find(".flexDateLink").hide();c.find(".flexDateType").show();R9.form.flight._clickFlexOption(c,"plusminusthree");return false},_flexTypeToggle:function(b){var c=b.target;var d=jq(c).closest("form");var a=".flexAwarePlusminusthree";if(c.value==="exact"){a=".flexAwareExact"}else{if(c.value==="weekend"){a=".flexAwareWeekend"}}R9.form.flight._showCorrectFlexType(d,a);return true},_showCorrectFlexType:function(b,a){b.find(".flexAware").hide();b.find(a).show()},_setFlexValues:function(b,a){jq(b).find("select[name=depart_date_flex] option[value="+a+"]").prop("selected",true);jq(b).find("select[name=return_date_flex] option[value="+a+"]").prop("selected",true)},_hasFlexDates:function(a){if(typeof a.depart_date_flex!=="undefined"){return true}else{return false}},_getSharedFlightSwitchParams:function(a){var b="";b+="origin="+a.origin.value;b+="&origincode="+a.origincode.value;b+="&destination="+a.destination.value;b+="&destinationcode="+a.destcode.value;if(typeof a.nearbyO!=="undefined"&&typeof a.nearbyD!=="undefined"){b+="&nearbyO="+((document.flights.nearbyO.checked)?"y":"n");b+="&nearbyD="+((document.flights.nearbyD.checked)?"y":"n")}return b},_cabinChange:function(a){var b=a.target},_flexDatesChange:function(a){var b=a.target;R9.form.flight._toggleFlexSection(b)},_toggleFlexSection:function(a){if(jq(a).is(":checked")){jq(a).closest("form").find(".flexdateinputs").show()}else{jq(a).closest("form").find(".flexdateinputs").hide()}},_check:function(b){var a="";if(R9.form._checkFormPopulated(b.origin)===false){a="Geben Sie bitte einen Flughafen f\u00FCr \u201Evon\u201C ein."}else{if(R9.form._checkFormPopulated(b.destination)===false){a="Geben Sie bitte einen Flughafen f\u00FCr \u201Enach\u201C ein."}else{if(R9.form._checkFormPopulated(b.depart_date)===false){a="Geben Sie bitte ein Abflugdatum ein."}else{if(R9.form._checkFormPopulated(b.return_date)===false&&jq(b).find("input:radio[name=oneway]:checked").val()==="n"){a="Geben Sie bitte ein Datum f\u00FCr den R\u00FCckflug ein."}else{if(b.origincode.value===b.destcode.value){a="Geben Sie bitte eindeutige Flugh\u00E4fen f\u00FCr \u201Evon\u201C und \u201Enach\u201C ein."}}}}}if(a.length>0){alert(a);return false}else{return true}},_submit:function(a){var b=a.target;if(R9.form.flight._hasFlexDates(b)){if(jq(b).find("input[name=dtFlexCat]:checked").val()!=="plusminusthree"){R9.form.flight._setFlexValues(b,"exact")}}return R9.form._submit(b,R9.form.flight._check)},init:function(d,c,b,a){if(R9.form._getUseCompareTo(d)===true){jq(d.origin).smartbox({callback:R9.form._compareToCallback,searchType:"air"});jq(d.destination).smartbox({callback:R9.form._compareToCallback,searchType:"air"});R9.CompareTo.init(d)}else{jq(d.origin).smartbox({callback:R9.form._smartboxCallback,searchType:"air"});jq(d.destination).smartbox({callback:R9.form._smartboxCallback,searchType:"air"})}var f=jq(d).find("input[name=depart_date]");var e=jq(d).find("input[name=return_date]");c=R9.form._grabDate(c,f.val());b=R9.form._grabDate(b,e.val());if(typeof a=="undefined"){a=2}R9.dp.doublePicker({selector:f,altField:jq(d).find(".depart_date_label"),defaultDate:c,numberOfMonths:a},{selector:e,altField:jq(d).find(".return_date_label"),defaultDate:b,numberOfMonths:a});jq(d.oneway).click(R9.form.flight._oneWayToggle);if(typeof d.cabin!=="undefined"){jq(d.cabin).click(R9.form.flight._cabinChange)}if(R9.form.flight._hasFlexDates(d)){jq(d).find(".flexDateLink").click(R9.form.flight._flexDateClick);jq(d.dtFlexCat).click(R9.form.flight._flexTypeToggle);R9.form.flight._setFlexValues(d,"plusminusthree")}jq(d).submit(R9.form.flight._submit).attr("method","post")}};R9.form.hotel={_emptyGuestList:function(a){while(a.options.length){a.options[0]=null}},_fillGuestList:function(a,b,f,g,j){var d=a.find("[name=guestsOptionPostfixSingular]").val();var e=a.find("[name=guestsOptionPostfixPlural]").val();if(typeof d=="undefined"){d=""}if(typeof e=="undefined"){e=""}var h;for(i=f;i<=g;i++){var c;if(i==1){c=new Option(i+" "+d,i)}else{c=new Option(i+" "+e,i)}h=b.length;b.options[h]=c;if(j==i){b.selectedIndex=h}}if(b.length>0&&b.selectedIndex<0){b.selectedIndex=0}},_updateRoomsGuests:function(b){var c=b.target;var d=jq(c).closest("form");var e=d.find("select[name=guests]");R9.form.hotel._emptyGuestList(e.get(0));var a=jq(c).val();if(a=="1"){R9.form.hotel._fillGuestList(d,e.get(0),1,4,0)}else{if(a=="2"){R9.form.hotel._fillGuestList(d,e.get(0),1,8,0)}}},_clearDates:function(a){var b=a.target;var c=jq(b).closest("form");jq(c).find("input[name=checkin_date]").val("");jq(c).find("input[name=checkout_date]").val("");jq(c).find(".checkin_date_label").html("tt.mm.jjjj");jq(c).find(".checkout_date_label").html("tt.mm.jjjj")},_check:function(b){var a="";if(R9.form._checkFormPopulated(b.othercity)===false){a="Geben Sie bitte eine Stadt ein."}else{if(R9.form._checkFormPopulated(b.checkin_date)===false){a="Geben Sie bitte ein g\u00FCltiges Check-in-Datum ein."}else{if(R9.form._checkFormPopulated(b.checkout_date)===false){a="Geben Sie bitte ein g\u00FCltiges Check-out-Datum ein."}}}if(a.length>0){alert(a);return false}else{return true}},_submit:function(a){var b=a.target;return R9.form._submit(b,R9.form.hotel._check)},init:function(e,c,d,a){if(R9.form._getUseCompareTo(e)===true){jq(e.othercity).smartbox({callback:R9.form._compareToCallback,searchType:"hotel"});R9.CompareTo.init(e)}else{jq(e.othercity).smartbox({callback:R9.form._smartboxCallback,searchType:"hotel",smartUrl:"/f/smarty"})}var f=jq(e).find("input[name=checkin_date]");var b=jq(e).find("input[name=checkout_date]");c=R9.form._grabDate(c,f.val());d=R9.form._grabDate(d,b.val());if(typeof a=="undefined"){a=2}R9.dp.doublePicker({selector:f,altField:jq(e).find(".checkin_date_label"),defaultDate:c,numberOfMonths:a},{selector:b,altField:jq(e).find(".checkout_date_label"),defaultDate:d,numberOfMonths:a});jq(e.rooms).change(R9.form.hotel._updateRoomsGuests).change();jq(".clearDates").click(R9.form.hotel._clearDates);jq(e).submit(R9.form.hotel._submit).attr("method","post")}};R9.form.car={_oneWayToggle:function(a){var b=a.target;var c=jq(b).closest("form");if(b.value==="y"){jq(c).find(".roundTripSection").hide();jq(c).find(".oneWaySection").show()}else{if(b.value==="n"){jq(c).find(".roundTripSection").show();jq(c).find(".oneWaySection").hide()}}},_check:function(b){var a="";if(R9.form._checkFormPopulated(b.citycode1)===false&&R9.form._checkFormPopulated(b.location)===false){a="Geben Sie bitte einen Abholort ein."}else{if(R9.form._checkFormPopulated(b.pickup_date)===false){a="Geben Sie bitte ein Abholdatum ein."}else{if(R9.form._checkFormPopulated(b.dropoff_date)===false){a="Geben Sie bitte ein gültiges Rückgabedatum ein."}}}if(a.length>0){alert(a);return false}else{return true}},_submit:function(a){var b=a.target;return R9.form._submit(b,R9.form.car._check)},init:function(f,e,c,b){if(R9.form._getUseCompareTo(f)===true){jq(f.location).smartbox({callback:R9.form._compareToCallback,searchType:"car"});if(typeof f.location2!=="undefined"){jq(f.location2).smartbox({callback:R9.form._compareToCallback,searchType:"car"})}R9.CompareTo.init(f)}else{jq(f.location).smartbox({callback:R9.form._smartboxCallback,searchType:"car"});if(typeof f.location2!=="undefined"){jq(f.location2).smartbox({callback:R9.form._smartboxCallback,searchType:"car"})}}var d=jq(f).find("input[name=pickup_date]");var a=jq(f).find("input[name=dropoff_date]");e=R9.form._grabDate(e,d.val());c=R9.form._grabDate(c,a.val());if(typeof b=="undefined"){b=2}R9.dp.doublePicker({selector:d,altField:jq(f).find(".pickup_date_label"),defaultDate:e,numberOfMonths:b},{selector:a,altField:jq(f).find(".dropoff_date_label"),defaultDate:c,numberOfMonths:b});if(typeof f.oneway!=="undefined"){jq(f.oneway).click(R9.form.car._oneWayToggle)}jq(f).submit(R9.form.car._submit).attr("method","post")}};R9.form.vacation={_displayChildAges:function(a){var d=a.target;var b=parseInt(jq(d).val());var e=jq(d).closest("form");if(b<1){e.find(".childAgeTitle").hide()}else{e.find(".childAgeTitle").show()}var c=0;for(c=1;c<4;c++){if(c<=b){e.find(".childAge"+c).show()}else{e.find(".childAge"+c).hide()}}},_check:function(b){var a="";if(R9.form._checkFormPopulated(b.origin)===false){a="Geben Sie bitte einen Flughafen f\u00FCr \u201Evon\u201C ein."}else{if(R9.form._checkFormPopulated(b.destination)===false){a="Geben Sie bitte einen Flughafen f\u00FCr \u201Enach\u201C ein."}else{if(R9.form._checkFormPopulated(b.depart_date)===false){a="Geben Sie bitte ein Abflugdatum ein."}else{if(R9.form._checkFormPopulated(b.return_date)===false){a="Geben Sie bitte ein Datum f\u00FCr den R\u00FCckflug ein."}}}}if(a.length>0){alert(a);return false}else{return true}},_submit:function(a){var b=a.target;return R9.form._submit(b,R9.form.vacation._check)},init:function(c,b,a){if(R9.form._getUseCompareTo(c)===true){jq(c.origin).smartbox({callback:R9.form._compareToCallback,searchType:"air"});jq(c.destination).smartbox({callback:R9.form._compareToCallback,searchType:"air"});R9.CompareTo.init(c)}else{jq(c.origin).smartbox({callback:R9.form._smartboxCallback,searchType:"air"});jq(c.destination).smartbox({callback:R9.form._smartboxCallback,searchType:"air"})}var e=jq(c).find("input[name=depart_date]");var d=jq(c).find("input[name=return_date]");b=R9.form._grabDate(b,e.val());a=R9.form._grabDate(a,d.val());R9.dp.doublePicker({selector:e,altField:jq(c).find(".depart_date_label"),defaultDate:b},{selector:d,altField:jq(c).find(".return_date_label"),defaultDate:a});jq(c.kids).change(R9.form.vacation._displayChildAges).change();jq(c).submit(R9.form.vacation._submit).attr("method","post")}};

;var jsck_commonsearchform_de_de="v425";
/* et=1, mt=4, c=p4, i=sparkle002, v=R114, cc=none, r=none */

