var vars = [], hash; //set up array for url vars var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); //split url into array of "x=y" strings for(var i = 0; i < hashes.length; i++) //loop through all vars { hash = hashes[i].split('='); //separate the var name from it's value vars.push(hash[0]); //add var to the associative array of vars vars[hash[0]] = hash[1]; //set the var's value } vars['saqid'] = ((vars['saqid']) ? vars['saqid'] : ""); //if we came from smartangler quiz, the saqid will be set. otherwise, make it null so that no hint is displayed document.write(unescape("%3Cscript src='http://smartangler.org/smart_angler_hint.php?q=" + vars['saqid'] + "&c=D6C794&t=024A3F' type='text/javascript'%3E%3C/script%3E")); //print the script tag that will call this very script again, which will in turn run the code below and print the hint box accordingly