addComment={moveForm:function(d,f,i,c){var m=this,a,h=m.I(d),b=m.I(i),l=m.I("cancel-comment-reply-link"),j=m.I("comment_parent"),k=m.I("comment_post_ID");if(!h||!b||!l||!j){return}m.respondId=i;c=c||false;if(!m.I("wp-temp-form-div")){a=document.createElement("div");a.id="wp-temp-form-div";a.style.display="none";b.parentNode.insertBefore(a,b)}h.parentNode.insertBefore(b,h.nextSibling);if(k&&c){k.value=c}j.value=f;l.style.display="";l.onclick=function(){var n=addComment,e=n.I("wp-temp-form-div"),o=n.I(n.respondId);if(!e||!o){return}n.I("comment_parent").value="0";e.parentNode.insertBefore(o,e);e.parentNode.removeChild(e);this.style.display="none";this.onclick=null;return false};try{m.I("comment").focus()}catch(g){}return false},I:function(a){return document.getElementById(a)}};
String.prototype.XstartsWith = function(str){return (this.match("^"+str)==str)}
String.prototype.XendsWith = function(str){return (this.match(str+"$")==str)}

var site="http://www.words-chinese.com/";
var timing=0;
var interval=1500;
var downloadtime=3;
var soundArr=[];
var soundIndex=0;

function getSoundName(name){
	if (name.XendsWith(".wav")) {
		return name;
	}
	if (name.XendsWith(".mp3")) {
		return name;
	}
	return name+".mp3";
}
function playSound(url,name){
	try{
		if(soundManager){
			if(soundManager.readyState!=2){
				addSound3(url,name);
				return url;
			}
		}
		addSound(url);
	}catch(e){
		alert(e);
	}
	return url;
}
function addSound(url){
	if(timing==0){
		setTimeout("playSound2('"+url+"','"+name+"')", downloadtime);
		timing+=interval;
		soundArr = [];
		soundIndex=0;	
	}
	soundArr[soundIndex] =url;
	soundIndex++;
}
function urlencode(str) {
return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
}
function playSound2(url,name){
	if(soundIndex>1){
		var playList=site+"sound-list/?";
    		for (var i = 0; i < soundIndex; i++)
   		{
			playList+="p"+i+"="+urlencode(soundArr[i])+"&";
   		}
		playList+="count="+soundIndex+"&";
		playList+="st=.m3u";
		url=playList;
		
	}
	var o;
	o=document.getElementById("soundDiv");
	if(o){
		//var emb;
		//emb=document.getElementById(name);
		//if(emb){
			//emb.Play();
		//}else{
			o.innerHTML='<embed id="'+name+'" src="'+url+'" hidden=true autostart=true loop=false />';
		//}
	}
	timing-=interval;
}

function pss(name,isDelay){
	var path;
	path="sounds/sent0/";
	url=site+path+getSoundName(name);
	return playSound(url,name);
}
function pcs(name){
	var path;
	path="sounds/pinyin0/char0/";
	url=site+path+getSoundName(name);
	return playSound(url,name);
}
function pws(name){
	var path;
	path="sounds/pinyin0/word0/";
	url=site+path+getSoundName(name);
	return playSound(url,name);
}
function ppys(name){
	var path;
	path="sounds/pinyin1/pinyin0/";
	url=site+path+getSoundName(pyConv(name));
	return playSound(url,name);
}
function pps(name){
	var path;
	path="sounds/pinyin1/phoneme0/";
	url=site+path+getSoundName(name);
	return playSound(url,name);
}
function pts(name){
	var path;
	path="sounds/pinyin1/tone0/";
	url=site+path+getSoundName(name);
	return playSound(url,name);
}
function pss(name){
	var path;
	if(name.XstartsWith("ec_")){
		path="sounds/sent0/";
		name=name.replace("ec_","");
		name=name.replace(".wav",".mp3");	
	}else{
		path="sounds/sent0/";
	}
	for(i=10;i<60;i++)
	{t=i;t=t % 10;name=name.replace(i+'S',t+'S');}
	url=site+path+getSoundName(name);
	return playSound(url,name);
}
function printCard(id,id1){
	var o1;
	o1=document.getElementById(id1);
	var nonprintStr;
	nonprintStr=o1.innerHTML;
	o1.innerHTML="";
	var o;
	o=document.getElementById(id);
	var htmlStr;
	htmlStr=o.innerHTML;
	docPrint=window.open("","Print","");
	docPrint.document.open();
	docPrint.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chinese Learning Flash Card - Words-Chinese.com</title>');
	docPrint.document.write('<link rel="stylesheet" href="http://www.words-chinese.com/wp-content/themes/chinese/style.css" type="text/css"/></head><body onLoad="self.print()">');
	docPrint.document.write('<div style="border: 1px; width: 670px; padding-left: 10px; padding-right: 30px; padding-top: 10px; padding-bottom: 10px;">');
	docPrint.document.write(htmlStr); 
	docPrint.document.write('</div></body></html>');
	docPrint.document.close(); 
	docPrint.focus();
	o1.innerHTML=nonprintStr;
}

function pyConv(str) {
        str = str.replace("¨¡", "a1");
        str = str.replace("¨¢", "a2");
        str = str.replace("¨£", "a3");
        str = str.replace("¨¤", "a4");
        str = str.replace("¨­", "o1");
        str = str.replace("¨®", "o2");
        str = str.replace("¨¯", "o3");
        str = str.replace("¨°", "o4");
        str = str.replace("¨¥", "e1");
        str = str.replace("¨¦", "e2");
        str = str.replace("¨§", "e3");
        str = str.replace("¨¨", "e4");
        str = str.replace("¨©", "i1");
        str = str.replace("¨ª", "i2");
        str = str.replace("¨«", "i3");
        str = str.replace("¨¬", "i4");
        str = str.replace("¨±", "u1");
        str = str.replace("¨²", "u2");
        str = str.replace("¨³", "u3");
        str = str.replace("¨´", "u4");
        str = str.replace("¨µ", "v1");
        str = str.replace("¨¶", "v2");
        str = str.replace("¨·", "v3");
        str = str.replace("¨¸", "v4");
        return str;
}
function closeLayer(objName){
var obj=FP_getObjectByID(objName)
if(obj.style.visibility=="visible") obj.style.visibility="hidden";
}
function openLayer(objName){
var obj=FP_getObjectByID(objName)
if(obj.style.visibility=="hidden") obj.style.visibility="visible";
}
function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}
function setCharRate(id){
var half= document.createElement('span');
var full= document.createElement('span');
half.appendChild(document.createTextNode('.'));
full.appendChild(document.createTextNode('\uFF0E'));
document.body.insertBefore(half, document.body.firstChild);
document.body.insertBefore(full, document.body.firstChild);
var rate = full.offsetWidth/half.offsetWidth;
document.body.removeChild(half);
document.body.removeChild(full);
var obj=FP_getObjectByID(id);
if(obj!=null){
	obj.value=rate;
}
}

function add2SrcItem(){
	word=FP_getObjectByID('uword').value;
	tag=FP_getObjectByID('utag').value;
	img=FP_getObjectByID('uimgn').value;
	if(word==''){
		alert('Item [word] should not be null.');
		return false;
	}
	
	srcArr = [];
	if(tag){
		srcArr[0]='[tag]'+tag;
	}else{
		srcArr[0]='';
	}
	srcArr[1]='[word]'+word;
	if(img){
		srcArr[2]='[uimg]'+img;
	}
	srcText=srcArr.join('=>');
	srcObj=FP_getObjectByID('src');
	if(srcObj && srcText)srcObj.value+="\n"+srcText;
	return true;
}
function onImageUploaded(id,img){
	obj = FP_getObjectByID(id);
	obj.value=img;
}
try{eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('f 9;1w{4(1y){3 1t(5){4(9.5==5&&9.a==l)9.w()}3 1d(5){4(9.5==5&&9.a==t)9.F()}1n={1a:1x,11:1C,R:1B,k:1D,z:1z,v:1E,T:1v,5:0,n:1P,14:"1O",A:"1Q",W:"1F",y:"1N",1m:"1M",a:l,P:l,H:1L,G:1K,1c:3(){4(2.H>0)B(\'1t(\'+2.5+\')\',2.H)},18:3(){4(2.G>0)B(\'1d(\'+2.5+\')\',2.G)},u:3(){4(Z)m Z[2.5]},N:3(){4(X)m X[2.5]},1j:3(Y){f s;4(!2.a){s=2.u()}8{s=2.N()}m"<p><D 1J=\'D-1I:"+2.n+"1G;\' 1H=\\""+s+"\\";>"+Y+"</D></p>"},K:3(){2.5=0},19:3(){2.5=2.v},17:3(){2.5++;4(2.5>2.v)2.K()},16:3(){2.5--;4(2.5<0)2.19()},F:3(){4(2.a){2.1b()}8{2.w()}},w:3(){4(2.a){2.g()}8{2.12()}},1b:3(){2.17();2.g()},1S:3(){2.16();2.g()},1R:3(){2.K();2.g()},o:3(){f k=2.5+1;2.j(2.14,2.1a+"/"+2.11);4(2.k==\'1T\'){2.j(2.A,"15 "+": "+2.R)}8{2.j(2.A,"15 "+2.k+": "+2.R)}2.j(2.W,"1A "+k+"/"+2.T)},g:3(b){2.a=l;2.q(2.y,1l[2.5]);2.o();4(2.z)2.Q(b);2.S();2.1c()},12:3(b){2.a=t;2.q(2.y,1i[2.5]);2.o();4(2.z)2.M(b);2.S();2.18()},q:3(r,7){f c;4(7.h().d(\'.2i\')||7.h().d(\'.2r\')){c=\'<V I="/2s/2t.13"> 2u\'}8 4(7.h().d(\'.13\')||7.h().d(\'.2q\')||7.h().d(\'.2p\')||7.h().d(\'.2l\')){c=\'<V I="\'+7+\'">\'}8 4(7.h().d(\'.2k\')){c=\'<1f 2m="2n:2o-2w-2v-2E-2C" k="1p" 2B="U://2y.1k.1u/2z/1r/2A/1s/2x.2D#1U=6,0,O,0"  1q="1h" 1g="1e" 2j="0"><10 J="22" i="\'+7+\'"><10 J="23" i="24"><25 I="\'+7+\'" 21="U://20.1k.1u/F/1W" 1V="1X/x-1r-1s" J="1p" 1q="1h" 1g="1e"></1f>\'}8{c=2.1j(7)}2.j(r,c)},j:3(r,c){f C=1Y(r);4(C){C.1Z=c}},Q:3(b){4(b)m;4(2.P){1o(2.u())}8{B(2.u(),26)}},M:3(b){1o(2.N())},27:3(b){4(2.a){2.M(b)}8{2.Q(b)}},2e:3(){2.n+=O;4(2.n>2f)2.n=O;2.g(t)},E:3(){2.o();2.g();2.P=t},S:3(){f i;f 5=2.5;4(!2.a){i=1i[5]}8{5++;4(5>2.v)m;i=1l[5]}2.q(2.1m,i)}};9=1n}}2g(e){}4(9){4(2h.2d){L.2c=3(){4(L.28=="29")9.E()}}8{L.2a("2b",3(){9.E()},l)}}',62,165,'||this|function|if|index||content|else|wcc|flipped|quiet|html|XendsWith||var|setQ|toLowerCase|value|sethtml|id|false|return|fontSize|settitle||setContent|objID|sound|true|getSoundScriptQ|bound|flip||contentdiv|autoplay|titlediv2|setTimeout|obj|font|initialize|go|timeNext|timeFlip|src|name|movestart|document|playA|getSoundScriptA|40|initialized|playQ|title|preload|length|http|img|titlediv3|wcc_dest_soundArr|text|wcc_src_soundArr|param|atype|setA|gif|titlediv1|Lesson|moveprevious|movenext|autoNext|moveend|qtype|gonext|autoFlip|wcc_fc_autoNext2|157|object|height|170|wcc_destArr|createP|macromedia|wcc_srcArr|cachediv|wcc_fc|eval|obj_swf|width|shockwave|flash|wcc_fc_autoFlip2|com|wcc_count|try|wcc_qtype|wcc_fc_init|wcc_autoplay|Card|wcc_title|wcc_atype|wcc_lesson_id|wcc_bound|wcc_title_div_right|pt|onclick|size|style|wcc_timing_gonext|wcc_timing_answer|wcc_cache|wcc_content_div|wcc_title_div_left|wcc_fontSize|wcc_title_div_center|restart|goprevious|na|version|type|getflashplayer|application|FP_getObjectByID|innerHTML|www|pluginspage|movie|quality|High|embed|300|play|readyState|complete|addEventListener|DOMContentLoaded|onreadystatechange|ActiveXObject|resize|160|catch|window|mp3|border|swf|bmp|classid|clsid|D27CDB6E|jpg|png|wav|images|music|Audio|11CF|AE6D|swflash|download|pub|cabs|codebase|444553540000|cab|96B8'.split('|'),0,{}));}catch(e){}

