function clickclear(thisfield, defaulttext) {
    if (thisfield.value == defaulttext) {
        thisfield.value = "";
    }
}
function clickrecall(thisfield, defaulttext) {
    if (thisfield.value == "") {
        thisfield.value = defaulttext;
    }
}
function onClickDDBJARSA(){
    var theForm = document.forms["ddbj_arsa"];
    var URL     = "http://arsa.ddbj.nig.ac.jp/arsa/search/HPDDBJSearch";
    var Word    = theForm.keyword.value;
    var Lang    = theForm.lang.value;
    if( Word.length <= 1 || Word == "keywords" ) {
        if( Lang == "ja" ) {
            alert( "検索条件は2文字以上のキーワードを指定して下さい。" );
        } else {
            alert( "Please enter search conditions using keywords of two or more characters." );
        }
    } else {
        theForm.action = URL;
        theForm.method = "POST";
        theForm.submit();
    }
}
function onClickAllDBARSA(){
    var theForm = document.forms["alldb_arsa"];
    var URL     = "http://arsa.ddbj.nig.ac.jp/arsa/search/HPAllDBSearch";
    var Word    = theForm.keyword.value;
    var Lang    = theForm.lang.value;
    if( Word.length <= 1 || Word == "keywords" ) {
        if( Lang == "ja" ) {
            alert( "検索条件は2文字以上のキーワードを指定して下さい。" );
        } else {
            alert( "Please enter search conditions using keywords of two or more characters." );
        }
    } else {
        theForm.action = URL;
        theForm.method = "POST";
        theForm.submit();
    }
}
function onClickProteinARSA(){
    var theForm = document.forms["protein_arsa"];
    var URL     = "http://arsa.ddbj.nig.ac.jp/arsa/search/HPProteinSearch";
    var Word    = theForm.keyword.value;
    var Lang    = theForm.lang.value;
    if( Word.length <= 1 || Word == "keywords" ) {
        if( Lang == "ja" ) {
            alert( "検索条件は2文字以上のキーワードを指定して下さい。" );
        } else {
            alert( "Please enter search conditions using keywords of two or more characters." );
        }
    } else {
        theForm.action = URL;
        theForm.method = "POST";
        theForm.submit();
    }
}
function onClickACCESSIONGETENTRYDRA(){
    var theForm      = document.forms["accession_getentry_dra"];
    var accnumber    = theForm.accnumber.value;
    var URL          = "";
    var URL_GETENTRY = "http://getentry.ddbj.nig.ac.jp/search/SearchServlet";
    var URL_DRA      = "http://trace.ddbj.nig.ac.jp/DRASearch/query?acc=";
    for(i=0;i<theForm.length;i++){
        if( theForm[i].type == "radio" && theForm[i].checked ) {
            if( theForm[i].value == "dra" ){
                URL = URL_DRA+accnumber; 
                URL = encodeURI(URL);
            } else {
                URL = URL_GETENTRY; 
            }
            break;
        }               
    }
    if( URL == URL_GETENTRY ){
        theForm.action = URL;
        theForm.method = "POST";
        theForm.submit();
    } else {
        window.open(URL);
    }
}

