(function(){
 var ds=typeof GODSurfer_skin=='string'?GODSurfer_skin:'';
 var h=78;
 var w=52;
if(ds=='compact'){h=35;w=250;}
else if(ds=='icon'){h=100;w=50;}
var u=typeof GODSurfer_url=='string'?GODSurfer_url:(typeof GODSurfer_URL=='string'?GODSurfer_URL:window.location.href);
//alert(u);
u = u.replace("http://", "");

var str = "<iframe src='http://www.godsurfer.com/tools/surfit.php?u="+urlencode(u)+
(typeof digg_title=='string'?('&t='+escape(GODSurfer_title)):'')+
(typeof digg_window=='string'?('&w='+escape(GODSurfer_window)):'')+
(ds?('&s='+ds):'')+"' height='"+h+"' width='"+w+"' frameborder='0' scrolling='no'></iframe>";

document.write(str);
})()

function urlencode(str) {
    var hexStr = function (dec) {
        return '%' + dec.toString(16).toUpperCase();
    };
 
    var ret = '',
            unreserved = /[\w.-]/; // A-Za-z0-9_.- // Tilde is not here for historical reasons; to preserve it, use rawurlencode instead
    str = (str+'').toString();
 
    for (var i = 0, dl = str.length; i < dl; i++) {
        var ch = str.charAt(i);
        if (unreserved.test(ch)) {
            ret += ch;
        }
        else {
            var code = str.charCodeAt(i);
            // Reserved assumed to be in UTF-8, as in PHP
            if (code === 32) {
                ret += '+'; // %20 in rawurlencode
            }
            else if (code < 128) { // 1 byte
                ret += hexStr(code);
            }
            else if (code >= 128 && code < 2048) { // 2 bytes
                ret += hexStr((code >> 6) | 0xC0);
                ret += hexStr((code & 0x3F) | 0x80);
            }
            else if (code >= 2048 && code < 65536) { // 3 bytes
                ret += hexStr((code >> 12) | 0xE0);
                ret += hexStr(((code >> 6) & 0x3F) | 0x80);
                ret += hexStr((code & 0x3F) | 0x80);
            }
            else if (code >= 65536) { // 4 bytes
                ret += hexStr((code >> 18) | 0xF0);
                ret += hexStr(((code >> 12) & 0x3F) | 0x80);
                ret += hexStr(((code >> 6) & 0x3F) | 0x80);
                ret += hexStr((code & 0x3F) | 0x80);
            }
        }
    }
    return ret;
}