﻿function fbs_click(u, t) {
    //u = location.href;
    //t = document.title;
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
    return false;
}

String.prototype.toUpperCaseForTurkish = function () {
    var str = [];
    for (var i = 0; i < this.length; i++) {
        var ch = this.charCodeAt(i);
        var c = this.charAt(i);
        if (ch == 105) str.push('İ');
        else if (ch == 305) str.push('I');
        else if (ch == 287) str.push('Ğ');
        else if (ch == 252) str.push('Ü');
        else if (ch == 351) str.push('Ş');
        else if (ch == 246) str.push('Ö');
        else if (ch == 231) str.push('Ç');
        else if (ch >= 97 && ch <= 122)
            str.push(c.toUpperCase());
        else
            str.push(c);
    }
    return str.join('');
}

String.prototype.toLowerCaseForTurkish = function () {
    var str = [];
    for (var i = 0; i < this.length; i++) {
        var ch = this.charCodeAt(i);
        var c = this.charAt(i);
        if (ch == 304) str.push('i');
        else if (ch == 73) str.push('ı');
        else if (ch == 286) str.push('ğ');
        else if (ch == 220) str.push('ü');
        else if (ch == 350) str.push('ş');
        else if (ch == 214) str.push('ö');
        else if (ch == 199) str.push('ç');
        else if (ch >= 65 && ch <= 90)
            str.push(c.toLowerCase());
        else
            str.push(c);
    }
    return str.join('');
}

function initAddThis() {
    addthis.init();
}
function ReinitializeAddThis() {
    if (window.addthis) {
        window.addthis.ost = 0;
        window.addthis.ready();
    }
}
