
$(document).ready(function(){$("#nrFemije").change(function(){var nrfemije=$("select[name=nrFemije]").val();var gjuha=$("input[name='gj']");var gj=gjuha.val();$.ajax({url:"/php/femijeflights.php",type:"GET",data:'gj='+gj+'&nrfemije='+nrfemije,cache:false,success:function(data){if(data!="")
{$('#flightschildsage').html(data);}
else{if(gj=="gj1"){alert('Ndodhi nje gabim. Ju lutemi te provoni perseri');}else{alert('Sorry, unexpected error. Please try again later.');}}}});return false;});$("input[name='lloji']").change(function(){var lloji=$("input[name='lloji']:checked").val();var gjuha=$("input[name='gj']");var gj=gjuha.val();if(lloji=="vajtje-ardhje")
{$('#dataedaljesinput').html('<script type="text/javascript">jQuery(document).ready(function () {$("input#flightscheckout").simpleDatepicker({ startdate: 2010, enddate: 2015 });});</script><input id="flightscheckout"  class="searchinput" name="datamberritjes" type="text" readonly="readonly" />');if(gj=="gj1")
{$('#vajtjeardhje').html('<b>Vajtje / Ardhje</b>');$('#vetemvajtje').html('Vetem Vajtje');$('#dataedaljeslabel').html('Data e mb&euml;rritjes');}
else
{$('#vajtjeardhje').html('<b>Roundtrip</b>');$('#vetemvajtje').html('One way');$('#dataedaljeslabel').html('Returning');}}
else if(lloji=="vetem-vajtje")
{$('#dataedaljesinput').html('');$('#dataedaljeslabel').html('');if(gj=="gj1")
{$('#vetemvajtje').html('<b>Vetem Vajtje</b>');$('#vajtjeardhje').html('Vajtje / Ardhje');}
else
{$('#vetemvajtje').html('<b>One way</b>');$('#vajtjeardhje').html('Roundtrip');}}
return false;});$('#search').click(function(){var vendnisja=$('input[name=vendnisja]').val();var vendmberritja=$('input[name=vendmberritja]').val();var datanisjes=$('input[name=datanisjes]').val();var datamberritjes=$('input[name=datamberritjes]').val();var nrFemije=$('select[name=nrFemije]').val();var lloji=$("input[name='lloji']:checked").val();var gjuha=$('input[name=gj]');var gj=gjuha.val();if(vendnisja==''){if(gj=="gj1"){alert('Kujdes! Vendi i nisjes nuk duhet lene bosh');}
else{alert('Attention! Leaving from must be field before you can proceed');}
return false;}
if(vendmberritja==''){if(gj=="gj1"){alert('Kujdes! Mberritja nuk duhet lene bosh');}
else{alert('Attention! Going to must be field before you can proceed');}
return false;}
if(datanisjes==''){if(gj=="gj1"){alert('Kujdes! Data e nisjes nuk duhet lene bosh');}
else{alert('Attention! Departing must be field before you can proceed');}
return false;}
if(lloji=="vajtje-ardhje")
{if(datamberritjes==''){if(gj=="gj1"){alert('Kujdes! Data e kthimit nuk duhet lene bosh');}
else{alert('Attention! Returning must be field before you can proceed');}
return false;}}
for(i=1;i<=nrFemije;i++)
{var dita=$('select[name=dita'+i+']').val();var muaji=$('select[name=muaji'+i+']').val();var viti=$('select[name=viti'+i+']').val();if(dita==0){if(gj=="gj1"){alert('Kujdes! Dita nuk duhet lene bosh');}
else{alert('Attention! Day must be field before you can proceed');}
return false;}
if(muaji==0){if(gj=="gj1"){alert('Kujdes! Muaji nuk duhet lene bosh');}
else{alert('Attention! Month must be field before you can proceed');}
return false;}
if(viti==0){if(gj=="gj1"){alert('Kujdes! Viti nuk duhet lene bosh');}
else{alert('Attention! Year must be field before you can proceed');}
return false;}}});});