(function() { var jQuery = null; var jCorner = null; if (!jQuery || window.jQuery.fn.jquery < '1.4.2') { var script_tag = document.createElement ('script'); script_tag.setAttribute ("type","text/javascript"); script_tag.setAttribute ("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"); script_tag.onload = loadJQueryCorner; script_tag.onreadystatechange = function () { // Same thing but for IE if (this.readyState == 'complete' || this.readyState == 'loaded') { loadJQueryCorner(); } }; // Try to find the head, otherwise default to the documentElement (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag); } else { // The jQuery version on the window is the one we want to use jQuery = window.jQuery; loadJQueryCorner(); } function loadJQueryCorner() { if (!jCorner) { var script_tag = document.createElement ('script'); script_tag.setAttribute ("type","text/javascript"); script_tag.setAttribute ("src", "http://www.tourradar.com/include/js/jquery-corner.js"); script_tag.onload = scriptLoadHandler; script_tag.onreadystatechange = function () { // Same thing but for IE if (this.readyState == 'complete' || this.readyState == 'loaded') { scriptLoadHandler(); } }; // Try to find the head, otherwise default to the documentElement (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag); } else { // The jQuery version on the window is the one we want to use jCorner = window.jQuery.fn.corner; jQuery.fn.corner = window.jQuery.fn.corner; scriptLoadHandler(); } } function scriptLoadHandler() { // Restore $ and window.jQuery to their previous values and store the // new jQuery in our local jQuery variable jQuery = window.jQuery.noConflict(true); // Call our main function main(); } function load_countries (country_preselected) { if (jQuery('#trse_continent').val() > 0) { jQuery('#trse_code_1007_07b0883c2fc2 #trse_country option:first').html ('-- Please wait... --'); jQuery('#trse_code_1007_07b0883c2fc2 #trse_country').attr ('disabled', true); jQuery.getJSON ('http://www.tourradar.com/index.php?c=iframes&m=select_tours_ajax&user=1007&cont=' + jQuery('#trse_continent').val() + '&callback=?', function (data) { if (data.status == 'OK') { jQuery('#trse_country option:not(:first)').remove(); for (var i = 0; i < data.countries.length; i ++) { jQuery('#trse_country').append (''); } jQuery('#trse_country option:first').html ('-- All countries --'); jQuery('#trse_country').attr ('disabled', false); } else { alert ('ERROR! Try again later.'); } }); } else { jQuery('#trse_country option:first').html ('-- Choose continent first --'); jQuery('#trse_country option:not(:first)').remove(); jQuery('#trse_country').attr ('disabled', true); } } function main() { jQuery(document).ready (function () { jQuery('#trse_code_1007_07b0883c2fc2').append ('Loading...'); jQuery.getJSON ('http://www.tourradar.com/index.php?c=iframes&m=select_tours&user=1007&code=07b0883c2fc2&callback=?', function (data) { if (data.status == 'OK') { jQuery('#trse_code_1007_07b0883c2fc2 #trse-loading').remove(); jQuery('#trse_code_1007_07b0883c2fc2').append ('
' + (data.params.title != undefined ? data.params.title : 'Advanced Tour Search') + '
' + /**/ '
Region
Country
Duration
Budget ' + data.currency + '
Departs
 
'); for (var i = 0; i < data.continents.length; i ++) { jQuery('#trse_code_1007_07b0883c2fc2 #trse_continent').append (''); } for (var i = 0; i < data.parameters.trip_length.length; i ++) { var trse_var = data.parameters.trip_length[i]; jQuery('#trse_code_1007_07b0883c2fc2 #trse_length').append (''); } for (var i = 0; i < data.parameters.trip_price.length; i ++) { var trse_var = data.parameters.trip_price[i]; jQuery('#trse_code_1007_07b0883c2fc2 #trse_price').append (''); } for (var i = 0; i < data.parameters.trip_month.length; i ++) { var trse_var = data.parameters.trip_month[i]; jQuery('#trse_code_1007_07b0883c2fc2 #trse_month').append (''); } jQuery('#trse_code_1007_07b0883c2fc2 *').css ('font-family', 'Arial'); jQuery('#trse_code_1007_07b0883c2fc2 #trse_tours_border').css ('background', data.params.border).css ('padding', '1px').css ('width', '300px'); jQuery('#trse_code_1007_07b0883c2fc2 #trse_main_content').css ('background', data.params.background).css ('padding', '10px').css ('width', '280px').css ('height', '190px'); jQuery('#trse_code_1007_07b0883c2fc2 #trse_title').css ('margin-bottom', '10px').css ('text-align', 'center').css ('font-size', '18px'); jQuery('#trse_code_1007_07b0883c2fc2 #trse_title b').css ('margin-top', '5px').css ('color', data.params.heading); jQuery('#trse_code_1007_07b0883c2fc2 #trse_search_form table td').css ('font-size', '12px').css ('color', data.params.text); jQuery('#trse_code_1007_07b0883c2fc2 #trse_search_form table tr').attr ('height', '33px'); if (data.params.corners > 0) { jQuery('#trse_code_1007_07b0883c2fc2 #trse_tours_border').corner("round 16px"); jQuery('#trse_code_1007_07b0883c2fc2 #trse_main_content').corner("round 15px"); } jQuery('#trse_code_1007_07b0883c2fc2 #trse_continent').change (function() { load_countries (0); }); if (data.params.continent) { jQuery('#trse_code_1007_07b0883c2fc2 #trse_continent').val (data.params.continent); } if (data.params.country) { load_countries (data.params.country); } if (data.params.length) { jQuery('#trse_code_1007_07b0883c2fc2 #trse_length').val (data.params.length); } } else { alert ('TourRadar widget cannot be loaded.'); } }); return false; }); } })();