﻿function dosearch(form) {
    var _form = document.forms[form];
    var keywords = _form.elements["kw"].value;
    if (document.getElementById(decodeURI(_form.elements["kw"].value)) == "") {
        alert("没有输入关键字");
        _form.elements["kw"].focus();
        return false;
    }

    _form.action = "/Search/Default.aspx";
    _form.submit();

    return false;
}

function hasPraise(id) {
    var tmpString;
    var allcookie = document.cookie.split('; ');
    for (var i = 0; i < allcookie.length; i++) {
        var arr = allcookie[i].split('=');
        var cookiename = arr[0];
        if (cookiename == 'Paris_praise') {
            tmpString = arr[1];
        }
    }

    if (tmpString != null && tmpString.indexOf(type + "_" + id) > -1) {
        return true;
    }
    return false;
}

function subscription(id, flag) { var selKey = document.getElementById(id).value, url = "/common/Login.aspx?" + (flag ? "book=y&" : "") + "keyword="; window.location = url + selKey; }

function addFav() {   //加入收藏夹   
    if (document.all) {
        window.external.addFavorite('http://www.gxbali.com', '南宁巴黎婚纱');
    }
    else if (window.sidebar) {
        window.sidebar.addPanel('南宁巴黎婚纱', 'http://www.gxbali.com', "");
    }
}
function SetHome(obj) {
    try {
        obj.style.behavior = 'url(#default#homepage)';
        obj.setHomePage('http://www.gxbali.com');
    } catch (e) {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            } catch (e) {
                alert("抱歉，此操作被浏览器拒绝！\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
            };
        } else {
            alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您需要手动将'http://www.gxbali.com/'设置为首页。");
        };
    };
};


document.oncontextmenu = new Function("event.returnValue=false");
document.onselectstart = new Function("event.returnValue=false");
