            function CheckDate(dataId1,dataId2,curData)
            {
                var data1 = document.getElementById(dataId1);
                var data2 = document.getElementById(dataId2);
                var arr1 = new Array(3);
                arr1 = data1.value.split(".");
                var dInt1 = parseInt(arr1[2]+arr1[1]+arr1[0]);
                var arr2 = new Array(3);
                arr2 = data2.value.split(".");
                var dInt2 = parseInt(arr2[2]+arr2[1]+arr2[0]);

                if(curData == 1)
                {
                    if(dInt1 > dInt2)
                        data2.value = data1.value;
                }
                else
                {
                    if(dInt1 > dInt2)
                        data1.value = data2.value;
                }
            }
            function selectCity(hotelReservationId,langId)
            {
                var selectOne = document.getElementById(hotelReservationId + "_selectOne");
                var selectTwo = document.getElementById(hotelReservationId + "_selectTwo");
                var buttRes = document.getElementById(hotelReservationId + "_buttRes");
                var selVal = selectOne.options[selectOne.selectedIndex].value;
                selectTwo.length = 1;
                //selectTwo.disabled=true;
                buttRes.disabled=true;
                //if(selVal != "0")
                //{
                    Sys.Net.WebServiceProxy.invoke('/hotels/hotel.asmx', 'GetHotelsByCity', false,{"cityId":selVal,"langId":langId} , SucceededCallbackReserv, FailedCallbackReserv,hotelReservationId); 
                //}
            }
            function SucceededCallbackReserv(result,hotelReservationId)
            {
                if(result != null){
                    var selectTwo = document.getElementById(hotelReservationId + "_selectTwo");
                    var buttRes = document.getElementById(hotelReservationId + "_buttRes");
                    for(var i=0; i<result.length ; i++) 
                    {
                        var nv = result[i];
                        var opt=document.createElement('option');
                        opt.text=nv.name;
                        opt.value=nv.value;
                        //opt.selected=nv.selected;
                        try
                        {
                            selectTwo.add(opt,null); // standards compliant
                        }
                        catch(ex)
                        {
                            selectTwo.add(opt); // IE only
                        }        
                    }
                    //selectTwo.disabled=false;
                }
            }
            function FailedCallbackReserv(error)
            {
                // Display the error.  
                alert(error.get_message());  
            } 
            
            function selectHotel(hotelReservationId)
            {
                var selectTwo = document.getElementById(hotelReservationId + "_selectTwo");
                var buttRes = document.getElementById(hotelReservationId + "_buttRes");
                var selVal = selectTwo.options[selectTwo.selectedIndex].value;
                if(selVal != "" &&  selVal != "0") 
                {
                    buttRes.disabled=false;
                } else {
                    buttRes.disabled=true;
                }
            }   
//            function hotelReserv(hotelReservationId)
//            {
//                //var resUrl='https://karyonres.travel/listRoomTypes.do?action=Select&propertyCode=';
//                var resUrl='?action=Select&propertyCode=';
//                var selId = document.getElementById(hotelReservationId + "_selectTwo");
//                var selVal = selId.options[selId.selectedIndex].value;
//                if(selVal != "" &&  selVal != "0") 
//                {
//                    resUrl += selVal;
//                    
//                    selId = document.getElementById(hotelReservationId + "_data1");
//                    selVal = selId.value;
//                    var sel3 = new Array();
//                    sel3 = selVal.split('.');
//                    resUrl += "&inDate=" + sel3[1] + "/" + sel3[0] + "/" +  sel3[2];
//                    
//                    selId = document.getElementById(hotelReservationId + "_data2");
//                    selVal = selId.value;
//                    sel3 = new Array();
//                    sel3 = selVal.split('.');                    
//                    resUrl += "&outDate=" + sel3[1] + "/" + sel3[0] + "/" +  sel3[2];;
//                    
//                    selId = document.getElementById(hotelReservationId + "_selectAdult");
//                    selVal = selId.options[selId.selectedIndex].value;                    
//                    resUrl += "&adults=" + selVal;
//                    
//                    selId = document.getElementById(hotelReservationId + "_selectChild");
//                    selVal = selId.options[selId.selectedIndex].value;                    
//                    resUrl += "&children=" + selVal;
//                    
//                    selId = document.getElementById(hotelReservationId + "_selectRoom");
//                    selVal = selId.options[selId.selectedIndex].value;                    
//                    resUrl += "&rooms=" + selVal;
//                    
//                    //resUrl += "&cid=022607000184";
//                    resUrl += "&cid=051608000280";
//                    
//                    //window.open(resUrl);
//                   // window.location.href=resUrl;
//                   gokaryon(resUrl);
//                }
//            }   
            function hotelReserv(hotelReservationId)
            {  
                var resUrl='?request&modus=quick-res&spr=d&hotel_id=';
                var selId = document.getElementById(hotelReservationId + "_selectTwo");
                var selVal = selId.options[selId.selectedIndex].value;
                if(selVal != "" &&  selVal != "0") 
                {
                    //selVal='quellenhofbadenbaden';
                    resUrl += selVal;
                                        
                    selId = document.getElementById(hotelReservationId + "_data1");
                    selVal = selId.value;
                    var sel3 = new Array();
                    sel3 = selVal.split('.');
                    
                    resUrl += "&anktt="+sel3[0]+"&ankmm="+sel3[1]+"&ankjj="+sel3[2];
                    var d1 = new Date();
                    d1.setFullYear(sel3[2],sel3[1]-1,sel3[0]);
                    var t1 = d1.getTime();
                    
                    selId = document.getElementById(hotelReservationId + "_data2");
                    selVal = selId.value;
                    sel3 = new Array();
                    sel3 = selVal.split('.'); 
                     
                    var d2 = new Date();
                    d2.setFullYear(sel3[2],sel3[1]-1,sel3[0]);
                    var t2 = d2.getTime();
                    
                    var minutes = 1000*60;
                    var hours = minutes*60;
                    var days = hours*24;
                    var dayInt=(t2-t1)/days;                
                    resUrl += "&tage="+dayInt;
                    
                    selId = document.getElementById(hotelReservationId + "_selectAdult");
                    selVal = selId.options[selId.selectedIndex].value;                    
                    resUrl += "&anzahl_erw="+selVal;
                    
                    selId = document.getElementById(hotelReservationId + "_selectChild");
                    selVal = selId.options[selId.selectedIndex].value;                    
                    resUrl += "&kind_alter1=14&anzahl_kind1=" + selVal;
                    
                    selId = document.getElementById(hotelReservationId + "_selectRoom");
                    selVal = selId.options[selId.selectedIndex].value; 
                    //&anzahlez=3&anzahldz=2                   
                    resUrl += "&anzahlez=" + selVal;
                    
                   gokaryon(resUrl);
                }
            }     
              
            if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();                        	    


