var slider_interval = 1; var from_miles_value = 0; var from_miles_min = 0; var from_miles_max = 150; var to_miles_value = 0; var to_miles_min = 0; var to_miles_max = 150; function downloadJSAtOnload(srcname) { var element = document.createElement("script"); //element.src = "deferredfunctions.js"; element.src = srcname; document.body.appendChild(element); } function changecurrency(selectedlanguage) { var selectedlanguage = selectedlanguage; for(var i = 0; i < document.getElementById('currencylist').options.length; i ++) { if(document.getElementById('currencylist').options[i].title == selectedlanguage) { document.getElementById('currencylist').selectedIndex = i; assigncurrencyvalue(document.getElementById('currencylist').options[i].value); break; } } } function assigncurrencyvalue(selectedcurrency) { document.getElementById('fldcurrency').value = selectedcurrency; } $(function() { /*code for slider for from apt starts here*/ downloadJSAtOnload("js_n/functions_flight_mainpage.js"); downloadJSAtOnload("http://www.travelspec.com/sres/maps11/include/fmPTP.js"); downloadJSAtOnload("js_n/calendarTimeValidate.js"); downloadJSAtOnload("js_n/en/calender2.js"); downloadJSAtOnload("js_n/jquery.ui.touch-punch.min.js"); //calling function change currency in order to assign currency value to the hidden variable fldcurrency changecurrency(selected_lang); //fetching location based on lat/lon //fetchlocation(); $('#from_slider').slider( { disabled: true, step: parseInt(slider_interval), slide: function( event, ui ) { document.getElementById('from_miles_val').innerHTML = ui.value+' '+miles; document.getElementById('from_miles').value = ui.value; if(countryflag == '0') { document.getElementById('from_miles_val').innerHTML = Math.ceil(parseInt(ui.value) * 1.609344)+' '+kms; } } }); document.getElementById('from_miles').value = parseInt(from_miles_value); document.getElementById('from_miles_val').innerHTML = parseInt(from_miles_value)+' '+miles; if(countryflag == '0') { document.getElementById('from_miles_val').innerHTML = Math.ceil(parseInt(from_miles_value) * 1.609344)+' '+kms; } /*code for slider for from apt ends here*/ /*code for slider for to apt starts here*/ $('#to_slider').slider( { disabled: true, step: parseInt(slider_interval), slide: function( event, ui ) { document.getElementById('to_miles_val').innerHTML = ui.value+' '+miles; document.getElementById('to_miles').value = ui.value; if(countryflag == '0') { document.getElementById('to_miles_val').innerHTML = Math.ceil(parseInt(ui.value) * 1.609344)+' '+kms; } } }); document.getElementById('to_miles_val').innerHTML = parseInt(to_miles_value)+' '+miles; document.getElementById('to_miles').value = parseInt(to_miles_value); if(countryflag == '0') { document.getElementById('to_miles_val').innerHTML = Math.ceil(parseInt(to_miles_value) * 1.609344)+' '+kms; } /*code for slider for to apt ends here*/ $("#languagelist").msDropdown(); $('#currencylist').msDropdown({showIcon:false}); $('#fourdrop').selectbox();//for seattype //$(".inline1").colorbox({inline:true, width:"780px", height:"550px"}); //$(".inline6").colorbox({inline:true, width:"680px", height:"600px"});//#simplemodal-container });