(function() { var rg_widget_url = "https://www.hoppa.com/en/widget" // Localize jQuery variable var jQuery; /******** Load jQuery if not present *********/ if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.7.1') { var script_tag = document.createElement('script'); script_tag.setAttribute("type","text/javascript"); script_tag.setAttribute("src", "https://www.hoppa.com/js/jquery-1.8.2.min.js"); if (script_tag.readyState) { script_tag.onreadystatechange = function () { // For old versions of IE if (this.readyState == 'complete' || this.readyState == 'loaded') { scriptLoadHandler(); } }; } else { // Other browsers script_tag.onload = 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 jQuery = window.jQuery; main(); } /******** Called once jQuery has loaded ******/ 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(); } /******** Our main function ********/ function main() { jQuery(document).ready(function($) { // We can use jQuery 1.4.2 here var randid = "abc" + 1 + Math.floor(Math.random() * 100000); var tragetelement = $("#rh-widget-container"); var scriptSrc = $('script[src*=script]').attr('src'); //alert(scriptSrc) //var ctry = gup_resorthoppa_widget_qs( 'ctry', scriptSrc ); //var gty = gup_resorthoppa_widget_qs('gty', scriptSrc); //var display = gup_resorthoppa_widget_qs('display', scriptSrc); //var theme = gup_resorthoppa_widget_qs('theme', scriptSrc); //var rst = gup_resorthoppa_widget_qs('rst', scriptSrc); //var tdat = gup_resorthoppa_widget_qs('tdat', scriptSrc); //var rdat = gup_resorthoppa_widget_qs('rdat', scriptSrc); //var Adu = gup_resorthoppa_widget_qs('Adu', scriptSrc); //var Chi = gup_resorthoppa_widget_qs('Chi', scriptSrc); //var Inf = gup_resorthoppa_widget_qs('Inf', scriptSrc); //var Rty = gup_resorthoppa_widget_qs('Rty', scriptSrc); //var Typ = gup_resorthoppa_widget_qs('Typ', scriptSrc); //var tfdt = gup_resorthoppa_widget_qs('tfdt', scriptSrc); //var tfps = gup_resorthoppa_widget_qs('tfps', scriptSrc); //if(tfdt=='FALSE' && tfps=='FALSE'){ // var ht = "238"; //} //else if(tfps=='FALSE'){ // var ht = "480"; //} //else if(tfdt=='FALSE'){ // var ht = "302"; //} //else{ // ht="560"; //} var rg_widget_url = "https://www.hoppa.com/en/widget" htm = $('