(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 ('
');
$.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 = '
';
for (var i = 0; i < data.countries.length; i ++) {
var dest = data.countries[i];
html += '
| ';
if (i % 3 == 2) {
html += '||
| '; } html += ' |