/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function goMain(action) {
    var main = parent.mainFrame;
    var top=parent.topFrame;
    top.document.getElementById('loadMsg').style.display='';
    main.location=action;
}
function goNew(action){
    window.open(action);
    return;
}
function goDel(action){
    var msg = confirm('您确定要删除此栏目么？删除之后所有栏目下数据都将丢失!');
    if(msg){
        goMain(action);
        return;
    }else{
        return;
    }
}

function GetCookie(name){
    var searchname=name+"=";
    var offset=document.cookie.indexOf(searchname);
    if(offset==-1) return false;
    var start=offset+searchname.length;
    var end=document.cookie.indexOf(";",start);
    if(end==-1) end=document.cookie.length;
    var value=unescape(document.cookie.substring(start,end));
    return value;
}

function SetCookie(name,value,Minutes){
    var exp = new Date();
    exp.setTime(exp.getTime() + Minutes*60000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}

function clientSearch(){
    var searchForm = document.searchForm;
    var searchValue = searchForm.searchValue.value;
    var searchType = searchForm.searchType.value;
//    searchValue = searchValue.trim();
    if(!searchValue){
        alert('请输入查找内容！');
        document.getElementById("searchValue").focus();
    }else{
        switch(searchType){
            case "product":
                searchForm.action="/client_product.php";
                searchForm.submit();
                break;
            case "article":
                searchForm.action="/client_article.php";
                searchForm.submit();
                break;
            default:
                alert("default");
                break;
        }
    }
}

