var arr = window.location.search.substring(1).split(/=/); if(arr[1]) { arr[1] = arr[1].replace('http://',''); } if(arr[1]) { $('body').css('background-image', 'url(//' + arr[1] + ')'); //document.getElementById('th').src = 'https://'+arr[1]; } else { //document.getElementById('th').style.display = 'none'; } function start() { window.location = 'embed-'+arr[0]+'.html?ref_url=' + encodeURIComponent(document.referrer); return false; }