function show(id) {
    var stat = document.getElementById(id);
    var title = document.getElementById(id+'_name');
    if (stat.style.display == 'none') {
        stat.style.display = 'block';
    } else {
        stat.style.display = 'none';
    }
    if (stat.style.display == 'none') {
        title.src = plus.src;
    } else {
        title.src = minus.src;
    }
}

function play_sound(srcv,i){
    var mp = document.getElementById("MediaPlayer1");
    mp.Filename="./Dict/fayin/" + srcv;
}

function str2img(str) {
    //var src = 'http://www.iciba.com/resource/yinbiao/';
    var src = './Dict/yinbiao/';
    var lenStr = str.length;
    var rsString    = "";
    for (var i=0;i<lenStr;i++) {
        var theChar   = str.substr(i,1);
        if (theChar == " ") {
            rsString += " ";
        } else if (theChar == "-") {
            rsString += "<img src=\""+src+"zhonggangxian.gif\" border=\"0\" />";
        } else if (theChar == "_") {
            rsString += "<img src=\""+src+"xiahuaxian.png\" border=\"0\" />";
        } else if (theChar == ".") {
            rsString += "<img src=\""+src+"dian.gif\" border=\"0\" />";
        } else if (theChar == "\\") {
            rsString += "<img src=\""+src+"xiexian.gif\" border=\"0\" />";
        } else if (theChar == "/") {
            rsString += "<img src=\""+src+"fanxiexian.gif\" border=\"0\" />";
        } else if (theChar == "?") {
            rsString += "<img src=\""+src+"wenhao.gif\" border=\"0\" />";
        }else if (theChar == ":") {
            rsString += "<img src=\""+src+"maohao.gif\" border=\"0\" />";
        }  else{
            //如果为大写字母，则访问daxie子目录，之所以放在不同目录，是考虑fat32不支持大小写同名
            if( (theChar<='z' && theChar>='a' || theChar<='Z' && theChar>='A' ) && theChar == theChar.toUpperCase())
                rsString += "<img src=\""+src+"daxie/"+ theChar+".gif\" border=\"0\" />";
            else    
                rsString += "<img src=\""+src+theChar+".gif\" border=\"0\" />";
       }
    }
    document.write('<img src="images/fangkh-z.gif" alt="" />');
    document.write(rsString);
    document.write('<img src="images/fangkh-y.gif" alt="" />');
}

function rwWord(str) {
    document.write('<a href="?s='+encodeURI(str)+'">'+str+'</a>');
}

function echoFlash(url) {
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="20" height="20">');
    document.write('<param name="wmode" value="transparent">');
    document.write('<param name="movie" value="'+url+'" />');
    document.write('<param name="quality" value="high" />');
    document.write('<embed src="'+url+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="20" height="20"></embed>');
    document.write('</object>');
}

function video(theURL) {
    window.open(theURL,"video","width=260,height=350,top=200,left=300,resizable=yes,z-look=yes");
}