
if (window != top && top.location.href.indexOf('google') <= 0 ) {
    top.location.href = location.href;
}

////////////////////////////////////////////////////////////////////////////////////////////

function showAds(adspace,height,width,search) {
    var dd = new Date();
    var tt = dd.getTime();

    if ( document.location.href.indexOf("domains_for_sale.htm") >= 1
         | document.location.href.indexOf("domain_details.htm") >= 1
         | document.location.href.indexOf("domain.htm") >= 1 ) {
        if ( adspace == 'top_leaderboard' ) {
            document.write('<iframe src="http://affiliate.godaddy.com/ad/5AAEBBABB91C4688DA924D677A286CA3DD08420C651428B9B1BF6BA0B301F917" width="728" height="90" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" hspace="0" allowtransparency="true"></iframe>');
        }
        else {
            document.write('<iframe margin="0" marginWidth="0" marginHeight="0" frameBorder="0" height="'+ height +'" width="'+ width +'" scrolling="no" allowtransparency="true" src="http://www.karr.net/cgi-bin/perl/ads.m?search='+ search +'&adspace='+ adspace +'" name="'+ adspace +'_ad_iframe&time='+ tt +'"></iframe>');
        }
    }
    else {
        document.write('<iframe margin="0" marginWidth="0" marginHeight="0" frameBorder="0" height="'+ height +'" width="'+ width +'" scrolling="no"  allowtransparency="true" src="http://www.karr.net/cgi-bin/perl/ads.m?search='+ search +'&adspace='+ adspace +'" name="'+ adspace +'_ad_iframe&time='+ tt +'"></iframe>');
    }
}

////////////////////////////////////////////////////////////////////////////////////////////

function HandleImgError(imageObj) {
    imageObj.src = "http://www.karr.net/images/fails.gif";
}

////////////////////////////////////////////////////////////////////////////////////////////

function largeVideo(videoObj,id) {
    var element = document.getElementById(id);
    if ( document.location.href.indexOf("videos.htm") >= 1 ) {
        element.height = 342;
        videoObj.width = 456;
        videoObj.height = 342;
        videoObj.zindex = 1000;
    }
    else {
        element.height = 280;
        videoObj.width = 240;
        videoObj.height = 180;
        videoObj.zindex = 1000;
    }
}

////////////////////////////////////////////////////////////////////////////////////////////

function smallVideo(videoObj,id) {
    var element = document.getElementById(id);
    element.height = 140;
    videoObj.width = 120;
    videoObj.height = 90;
}

////////////////////////////////////////////////////////////////////////////////////////////

function LargeThumbshot(imageObj,url) {
    if ( document.location.href.indexOf("www.karr.net") >= 1 ) {
        // imageObj.src = "http://images.thumbshots.com/image.aspx?cid=gti6zoyft%2fk%3d&v=1&w=240&url=" + url;
        imageObj.src = "http://open.thumbshots.org/image.aspx?url=" + url;
    }
}

////////////////////////////////////////////////////////////////////////////////////////////

function SmallThumbshot(imageObj,url) {
    if ( document.location.href.indexOf("www.karr.net") >= 1 ) {
        imageObj.src = "http://open.thumbshots.org/image.aspx?url=" + url;
    }
}

////////////////////////////////////////////////////////////////////////////////////////////

var startcolor = "003399"; // Start color in hexadecimal
var endcolor = "993333"; // End color in hexadecimal

var h="0123456789ABCDEF";
var Fullrgb = "#000000";

function gradient(string, startcolor, endcolor) {
    startcolor = "0x" + startcolor;
    endcolor = "0x" + endcolor;
    var len = string.length;
    var color;
    var start_red = startcolor >> 16;
    var start_green=(startcolor & 0x00FF00) >> 8;
    var start_blue=startcolor & 0x0000FF;
    var end_red = endcolor >> 16;
    var end_green= (endcolor & 0x00FF00) >> 8;
    var end_blue = endcolor & 0x0000FF;
    var incRed = Math.floor((end_red - start_red) / len);
    var incGreen = Math.floor((end_green - start_green) / len);
    var incBlue = Math.floor((end_blue - start_blue) / len);
    for (var x=0; x < len; x++) {
        if (start_red + incRed >= 0x00 && start_red + incRed <= 0xFF) start_red += incRed;
        if (start_green + incGreen >= 0x00 && start_green + incGreen <= 0xFF) start_green += incGreen;
        if (start_blue + incBlue >= 0x00 && start_blue + incBlue <= 0xFF) start_blue += incBlue;
        color = hex(merge(start_red, start_green, start_blue));
        color = Fullrgb.substring(0, 6 - color.length + 1) + color;
        if ( string.charAt(x).search(/\d/) != -1 ) {
            color = "#336600";
        }
        document.write("<font color=" + color + ">", string.charAt(x), "</font>");
    }
}
function merge(r, g, b) {
    return (r << 16 | g << 8 | b);
}
function hex(c) {
    var temp = "";
    var hexStr = "";
    var remainder, i;
    for ( ; c != 0; c >>= 4) {
        remainder = c % 16;
        hexStr += h.charAt(remainder);
    }
    for (i=5 ; i >= 0; i--)temp += hexStr.charAt(i);return temp;
}

////////////////////////////////////////////////////////////////////////////////////////////

function external(url) {
    // url = 'http://' + url;
    url = 'http://www.karr.net/out.htm?' + url;
    var eu = window.open(url, "externalWin");
    self.blur();
}

////////////////////////////////////////////////////////////////////////////////////////////

function siteSearch(domain,search) {
    var url = 'http://www.google.com/cse?cx=010556040290576196251%3Anbbeenmfgiq&ie=UTF-8&q='+ search +'+site%3A'+ domain;
    var ss = window.open(url, "searchWin");
}

////////////////////////////////////////////////////////////////////////////////////////////


function whoIs(domain) {
    var settings = "height=600,width=800,location=0,menubar=0,statusbar=0,locationbar=0,scrollbars=1,resizable=1";
    var url = 'http://www.karr.net/cgi-sys/whois?query='+ domain +';targetnic=auto';
    var wi = window.open(url, "whoisWin", settings);
}

////////////////////////////////////////////////////////////////////////////////////////////

function domainSearch(domain) {
    var url = 'http://www.dpbolvw.net/interactive?domainToCheck=' + domain + '&checkAvail=1&submit.x=0&submit.y=0&aid=10451087&pid=3517278&url=https%3A%2F%2Fwww.godaddy.com%2Fgdshop%2Fregistrar%2Fsearch.asp%3Fisc%3Dcjcdomsb3';
    var ds =  window.open(url, "domainWin");
}

////////////////////////////////////////////////////////////////////////////////

function showLocationForm() {
    var lf = document.getElementById('change_location');
    lf.style.display = 'block';
}

////////////////////////////////////////////////////////////////////////////////

function remove(bad) {
    var message = "This function is provided for our visitors to help us remove\n" +
        "any inappropriate or irrelevant items from this site.\n\n" +
        "Are you sure you would like to completely remove this item from the page?\n\n" +
        "Click OK to proceed or Cancel to abort\n\n";
    if (!confirm(message)) return;

    var url = "/cgi-bin/perl/clear_cache_item.m?" + bad;

    settings = "height=200,width=200,location=0,menubar=0,statusbar=0,locationbar=0,scrollbars=0,resizable=0";
    var dc = window.open(url, "tempWin", settings);
    var nd = new Date();
    var sse = parseInt(nd.getTime()/1000);

    var url = document.location.href;
    var match = url.indexOf('?');

    if ( match != -1 ) {
        url = url.substring(0,match);
    }

    window.location.replace(url + '?' + sse);
}

////////////////////////////////////////////////////////////////////////////////////////////

function deletionLink(qString) {
    document.write('<div align="center"><font color="#666633">&#9650;</font> <a class="deletion" href="#"');
    document.write(' onclick="javascript:remove(\''+ qString +'\');self.focus();"');
    document.write(' title="Completely remove the preceding image');
    document.write(' and/or description from this web page.">');
    document.write('remove above item</a></div>');
}

////////////////////////////////////////////////////////////////////////////////

function refreshCache() {
    var message = "Are you sure you would like to refresh the local cache of this page?\n\n" +
        "Click OK to proceed or Cancel to abort\n\n";
    if (!confirm(message)) return;

    var ko = new Date();
    var ji = ko.getTime();
    var secs = parseInt(ji / 1000);
    if ( document.location.href.indexOf('?') <= 0 ) {
        window.location.replace(document.location.href + '?' + secs );
    }
}

////////////////////////////////////////////////////////////////////////////////

function availableWidth(search) {
    var winW;

    var nd = new Date();
    var gt = nd.getTime();

    if ( parseInt(navigator.appVersion) > 3 ) {
        if ( navigator.appName == "Netscape" ) {
            winW = window.innerWidth;
        }
        if ( navigator.appName.indexOf("Microsoft") != -1) {
            winW = document.body.offsetWidth;
        }
    }

    var usedSpace = 20 + 160 + 20 + 20 + 728 + 20 + 20 + 0 + 20;
    var availableSpace = winW - usedSpace;

    if ( availableSpace > 0 ) {
        document.write('<iframe margin="0" marginWidth="0" marginHeight="0" frameBorder="0" height="680" width="' + availableSpace + '" scrolling="no" allowTransparency src="http://www.karr.net/cgi-bin/perl/ads.m?adspace=right_available_space&search=' + search + '&width=' + availableSpace + '&time=' + gt +'" name="right_available_space_iframe"></iframe>');
    }
}

////////////////////////////////////////////////////////////////////////////////

function hide_supplemental() {
    var supplemental = document.getElementById('supplemental');
    var mainContent = document.getElementById('main_content');
    supplemental.style.display = 'none';
    mainContent.style.width = '728px';
}

////////////////////////////////////////////////////////////////////////////////

function translateForm() {
    document.write('<form action="http://translate.google.com/translate" method="get" accept-charset="utf-8">\n');
    document.write('<input type="hidden" name="hl" value="en" />\n');
    document.write('<input type="hidden" name="sl" value="auto" />\n');
    document.write('<select name="tl" onchange="this.form.submit()">\n');
    document.write('<option value="" title="Translate Page Into...">Translate Page Into...</option>\n');
    document.write('<option value="af" title="Afrikaans">Afrikaans</option>\n');
    document.write('<option value="sq" title="Shqip">Albanian</option>\n');
    document.write('<option value="ar" title="&#1575;&#1604;&#1604;&#1594;&#1577; &#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;">Arabic</option>\n');
    document.write('<option value="hy" title="&#1344;&#1377;&#1397;&#1381;&#1408;&#1381;&#1398;">Armenian</option>\n');
    document.write('<option value="az" title="Az&#601;rbaycan">Azerbaijani</option>\n');
    document.write('<option value="eu" title="Euskara">Basque</option>\n');
    document.write('<option value="be" title="&#1041;&#1077;&#1083;&#1072;&#1088;&#1091;&#1089;&#1082;&#1072;&#1103;">Belarusian</option>\n');
    document.write('<option value="bg" title="&#1073;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080; &#1077;&#1079;&#1080;&#1082;">Bulgarian</option>\n');
    document.write('<option value="ca" title="Catal&#224;">Catalan</option>\n');
    document.write('<option value="zh-CN" title="&#20013;&#25991;">Chinese \(Simplified\)</option>\n');
    document.write('<option value="zh-TW" title="&#21556;&#26041;&#35328;">Chinese \(Traditional\)</option>\n');
    document.write('<option value="hr" title="Hrvatski">Croatian</option>\n');
    document.write('<option value="cs" title="&#268;e&#353;tina">Czech</option>\n');
    document.write('<option value="da" title="Dansk">Danish</option>\n');
    document.write('<option value="nl" title="Nederlands">Dutch</option>\n');
    document.write('<option value="en" title="English">English</option>\n');
    document.write('<option value="et" title="Eesti">Estonian</option>\n');
    document.write('<option value="tl" title="">Filipino</option>\n');
    document.write('<option value="fi" title="Suomi">Finnish</option>\n');
    document.write('<option value="fr" title="fran&#231;ais">French</option>\n');
    document.write('<option value="gl" title="">Galician</option>\n');
    document.write('<option value="ka" title="&#4325;&#4304;&#4320;&#4311;&#4323;&#4314;&#4312;">Georgian</option>\n');
    document.write('<option value="de" title="Deutsch">German</option>\n');
    document.write('<option value="el" title="&#917;&#955;&#955;&#951;&#957;&#953;&#954;&#940;">Greek</option>\n');
    document.write('<option value="ht" title="Krey&#242;l ayisyen">Haitian Creole</option>\n');
    document.write('<option value="iw" title="&#1506;&#1489;&#1512;&#1497;&#1514;">Hebrew</option>\n');
    document.write('<option value="hi" title="&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;">Hindi</option>\n');
    document.write('<option value="hu" title="Magyar">Hungarian</option>\n');
    document.write('<option value="is" title="Islenska">Icelandic</option>\n');
    document.write('<option value="id" title="Bahasa Indonesia">Indonesian</option>\n');
    document.write('<option value="ga" title="Gaeilge">Irish</option>\n');
    document.write('<option value="it" title="Italiano">Italian</option>\n');
    document.write('<option value="ja" title="&#26085;&#26412;&#35486;">Japanese</option>\n');
    document.write('<option value="ko" title="&#54620;&#44397;&#50612;">Korean</option>\n');
    document.write('<option value="la" title="Latina">Latin</option>\n');
    document.write('<option value="lv" title="Latvie&#353;u">Latvian</option>\n');
    document.write('<option value="lt" title="Lietuvi&#371;">Lithuanian</option>\n');
    document.write('<option value="mk" title="&#1084;&#1072;&#1082;&#1077;&#1076;&#1086;&#1085;&#1089;&#1082;&#1080;">Macedonian</option>\n');
    document.write('<option value="ms" title="Bahasa Melayu">Malay</option>\n');
    document.write('<option value="mt" title="Malti">Maltese</option>\n');
    document.write('<option value="no" title="Norsk">Norwegian</option>\n');
    document.write('<option value="fa" title="&#1601;&#1575;&#1585;&#1587;&#1740;">Persian</option>\n');
    document.write('<option value="pl" title="Polski">Polish</option>\n');
    document.write('<option value="pt" title="Portugu&#234;s">Portuguese</option>\n');
    document.write('<option value="ro" title="Limba rom&#226;n&#259;">Romanian</option>\n');
    document.write('<option value="ru" title="&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; &#1103;&#1079;&#1099;&#1082;">Russian</option>\n');
    document.write('<option value="sr" title="&#1057;&#1088;&#1087;&#1089;&#1082;&#1080;">Serbian</option>\n');
    document.write('<option value="sk" title="Sloven&#269;ina">Slovak</option>\n');
    document.write('<option value="sl" title="sloven&#353;&#269;ina">Slovenian</option>\n');
    document.write('<option value="es" title="Espa&#241;ol">Spanish</option>\n');
    document.write('<option value="sw" title="Kiswahili">Swahili</option>\n');
    document.write('<option value="sv" title="Svenska">Swedish</option>\n');
    document.write('<option value="th" title="&#3616;&#3634;&#3625;&#3634;&#3652;&#3607;&#3618;">Thai</option>\n');
    document.write('<option value="tr" title="T&#252;rk&#231;e">Turkish</option>\n');
    document.write('<option value="uk" title="&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;">Ukrainian</option>\n');
    document.write('<option value="ur" title="&#1575;&#1585;&#1583;&#1608;">Urdu</option>\n');
    document.write('<option value="vi" title="ti&#7871;ng Vi&#7879;t">Vietnamese</option>\n');
    document.write('<option value="cy" title="Cymraeg">Welsh</option>\n');
    document.write('<option value="yi" title="">Yiddish</option>\n');
    document.write('</select>\n');
    document.write('<input type="hidden" name="u" value="' + document.location.href + '" />\n');
    document.write('<br />\n');
    document.write('</form>\n');
}

////////////////////////////////////////////////////////////////////////////////

function pageWidth() { return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null; }
function pageHeight() { return  window.innerHeight != null ? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null; }
function posLeft() { return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0; }
function posTop() { return typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0; }
function posRight() { return posLeft()+pageWidth(); }
function posBottom() { return posTop()+pageHeight(); }
