var arr,dep,dateformat,length
function checkValues(){if($j('#hotelIDList').val()!=undefined)$j('#hotelid').val($j('#hotelIDList option:selected').val());arr=$j('#arrdate').val();dep=$j('#depdate').val();dateformat=$j('#dateformat').val();arr=arr.replace(/\./g,'/');dep=dep.replace(/\./g,'/');arr=arr.replace(/\-/g,'/');dep=dep.replace(/\-/g,'/');dateformat=dateformat.replace(/\./g,'/');dateformat=dateformat.replace(/\-/g,'/');if(dateformat=='d/m/Y'){var date=new Array();date=arr.split("/");arr=date[1]+"/"+date[0]+"/"+date[2];date=dep.split("/");dep=date[1]+"/"+date[0]+"/"+date[2]};var nrChildren;for(var i=1;i<=$j('#rooms option:selected').val();i++){nrChildren='';for(var j=1;j<=$j('#children'+i+' option:selected').val();j++)nrChildren+=","+$j("#childrenage"+j+"r"+i+" option:selected").val()};return true}
function openShadowbox(formular){checkValues();$j(document).ready(function(){var url=$j('#tx_c3quickreservationform').attr('action')+'?hotelid='+jQuery('#hotelid').val()+'&lang='+jQuery('#lang').val()+'&arrdate='+arr+'&depdate='+dep,nrChildren;for(var i=1;i<=$j('#rooms option:selected').val();i++){nrChildren='';for(var j=1;j<=$j('#children'+i+' option:selected').val();j++)nrChildren+=","+$j("#childrenage"+j+"r"+i+" option:selected").val();url+='&ra'+i+'='+$j('#persons'+i).val()+nrChildren};console.log(url);Shadowbox.open({player:'iframe',width:925,height:624,content:url})})};
