function writeCopyright(){
	document.write('© Copyright 2009 Falun Dafa Association');
	}
function getFileFromURL(){
	var file="";
	var url=window.location+"";
	if(url.indexOf("?")>=0&&url.indexOf("=")<url.length-1)
		file=url.substr(url.lastIndexOf("=")+1,url.length-1);
	if(file&&file.indexOf(".flv")<0)	
		file+=".flv"; 
	return file;	
}
  function trim(str, chars) {
		chars = chars || "\\s";
		str= str.replace(new RegExp("^[" + chars + "]+", "g"), "");
		str= str.replace(new RegExp("[" + chars + "]+$", "g"), "");
		return str
	}
function removeTrailingSpaces(arg) {
	if(!arg)
		return "";
	while(''+arg.charAt(arg.length-1)==' ') { arg=arg.substring(0,arg.length-1); }
	return(arg);
}

function createplayer(go,url, showImg) {
 	document.getElementById("wrapper").style.top=69+"px"; 
  	if (!url) { theFile="image/falun21.jpg"; }
	else { theFile=url; } 
    var theWidth=400; 
	var theHeight=300; 
    var theDisplayheight=400;
 	
 	var s = new SWFObject("flash/mediaplayer.swf", "playerID", theWidth, theHeight, "7");
	s.addParam("allowfullscreen", "true");
	s.addVariable("usefullscreen","true");
	s.addVariable("file", encodeURIComponent(theFile));
	s.addVariable("width", theWidth);
	s.addVariable("height", theHeight);
	s.addVariable("displayheight", theDisplayheight);
	s.addVariable("overstretch", "fit");
	s.addVariable("showicons", true);
	//s.addVariable("quality", "high"); 
	s.addParam('allowscriptaccess','always'); 
	s.addParam('stretching','fill');  
	s.addVariable("shuffle","false"); 
	s.addVariable("enablejs","true"); 
	s.addVariable("javascriptid","playerID"); 

	if(showImg) s.addVariable("image", "image/falun21.jpg");
	if (go) { s.addVariable("autostart", "true"); }
	s.write("placeholder"); 
	//alert(document.getElementById("placeholder").innerHTML);
}
 function doPlay(url){
		
 }

	function sendEMTo(){
		var tg="<";          /*W3C validator needs that*/
		var name="english";   /*first part of your address*/
		var at="@";
			/*as all navigators do not accept Unicode (&#64; or hexa &#x040; ...)*/
			/*a few browsers (as Mozilla) and robots decode it on the fly*/
		var host1="falund";/*start of your provider's name*/
		var host2="afa.org";   /*end of your provider's name*/
		var text="Lien lac";  /*text you want to display - don't display the address*/
		var title="titl"+"e=";
		var span = document.getElementById("email_span");
		if (span){
			var html = tg+"a hr"+"ef=mai"+"lto:"+name;
			html = html + at+host1+host2+" " +title+name+at+host1+host2+">"+text+tg+"/a>";	
			span.innerHTML = html;
		}
	}
	
	function sendEMTo(name, company, domain) {
		locationstring = 'mai' + 'lto:' + name + '@' + company + '.' + domain;
		window.location.replace(locationstring);
	}
	
	function setEMTitle(name, company, domain, obj) {
		string = name + '@' + company + '.' + domain;
		obj.setAttribute('title', string);
		window.status = "Lien lac voi chung toi theo dia chi: " + string;
	}
	function doSearch(){ 
	  var key=trim(document.searchform.query.value,' ');
		  if(!key){ 
		  	 alert('Ban vui long nhap tu khoa truoc!');
		     return false;
		   } 
		   
	 document.forms.searchgoogle.domains.value = "phapluan.org";
	 document.forms.searchgoogle.sitesearch.value = "phapluan.org";
	 document.forms.searchgoogle.q.value = document.forms.searchform.query.value;
	 document.forms.searchgoogle.submit ();
	 return false;
	}
	function checkSearch(){
		var key=trim(document.search_form.query.value,' ');
		  if(key==''){
			   alert('Ban vui long nhap tu khoa truoc!');
			   return false;
	   }
	return true; 
	}
	


				
