(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 main() { jQuery(document).ready (function ($) { $('#trsd_code_1007_1131011d5007').append ('Loading...'); $.getJSON ('http://www.tourradar.com/index.php?c=iframes&m=select_destinations&user=1007&code=1131011d5007&callback=?', function (data) { if (data.status == 'OK') { $('#trsd_code_1007_1131011d5007 #trsd-loading').remove(); var html = '
' + (data.params.title != undefined ? data.params.title : 'Popular Destinations') + '
'; if (i % 3 == 2) { html += ''; } html += '
'; for (var i = 0; i < data.countries.length; i ++) { var dest = data.countries[i]; html += '
'; if (dest.image) { html += ''; } else { html += ''; } html += '
' + dest.name.substr (0, 15) + ' (' + dest.count + ' tours)
'; } html += '
'; $('#trsd_code_1007_1131011d5007').append (html); $('#trsd_code_1007_1131011d5007 *').css ('font-family', 'Arial').css ('font-size', '12px'); $('#trsd_code_1007_1131011d5007 #trsd_tours_border').css ('background', data.params.border).css ('padding', '1px').css ('width', '600px'); $('#trsd_code_1007_1131011d5007 #trsd_pdeals_content').css ('padding', '10px').css ('width', '580px').css ('background', data.params.background); $('#trsd_code_1007_1131011d5007 #trsd_title').css ('margin-bottom', '10px').css ('text-align', 'center'); $('#trsd_code_1007_1131011d5007 #trsd_title b').css ('margin-top', '5px').css ('font-size', '18px'); $('#trsd_code_1007_1131011d5007 #trsd_title').css ('color', data.params.heading); $('#trsd_code_1007_1131011d5007 #trsd_content *').css ('color', data.params.text).css ('text-decoration', 'none'); $('#trsd_code_1007_1131011d5007 #trsd_content td').css ('text-align', 'center'); $('#trsd_code_1007_1131011d5007 #trsd_content .trsd_link img').css ('margin', '4px 0 3px 0'); $('#trsd_code_1007_1131011d5007 #trsd_content a').hover (function() { $(this).css ({'text-decoration': 'underline'}); }, function() { $(this).css ({'text-decoration': 'none'}); }); if (data.params.corners == '1') { $('#trsd_code_1007_1131011d5007 #trsd_tours_border').corner("round 16px"); $('#trsd_code_1007_1131011d5007 #trsd_pdeals_content').corner("round 15px"); } $('#trsd_code_1007_1131011d5007 .trsd_link').click (function() { var trsd_link_id = $(this).attr ('id').substr (5); $('#trsd_code_1007_1131011d5007 #trsd_form_search').val (trsd_link_id); $('#trsd_code_1007_1131011d5007 #trsd_search_form').submit(); }); } else { alert ('TourRadar widget cannot be loaded.'); } }); return false; }); } })();