
String.prototype.stripHtml = function() {
    val = this;
    val = val.replace(/<[^>]+>/gim, "");
    val = val.replace(/<\/[^>]+>/gim, "");
    val = val.replace(/&nbsp;/gim, "");
    return val;
}

String.prototype.ltrim = function() {
    return this.replace(/^\s+/,"");
}

String.prototype.rtrim = function() {
    return this.replace(/\s+$/,"");
}

String.prototype.trim = function() {
    return this.replace(/^\s*([\S\s]*?)\s*$/, '$1');
}

String.prototype.isNumeric = function() {
    return isFinite( (this * 1.0) );
}


function Write(str) {
    document.write(str);
}

function showPhoto(src) {
    var wnd = window.open('/image.php?src='+src+'&mode=nodownload', "photo", "menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=200,height=200");
    wnd.focus();
}

function setHome(a,url) {
    try {
        a.style.behavior = 'url(#default#homepage)';
        a.setHomePage(url || 'http://'+document.domain);
    }
    catch(е) {
        alert('Ваш браузер не поддерживает соответствующие функции. Пожауйста измените настройки Вашего браузера.');
    }
    return false
}