function change(str){
   return document.getElementById(str);
}
function over(num,id,args){
   for(i=1;i<=args;i++){
      if(i!=num){
           change(id+i).className="hid";
      }else {
           change(id+i).className="show";
      }
   }
}

function $(sName,msg){
   if(sName.value.replace(/^\s+|\s+$/g,"")==""){
	   alert(msg);
		sName.focus();
		return false;
	}
	return true;
}


function getTagName(id,name){
   return change(id).getElementsByTagName(name);
}
function Nav_Over(tid,tnode,cid,cnode,num){
	o=getTagName(tid,tnode);
	e=getTagName(cid,cnode);
   for(i=0;i<=e.length-1;i++){	
	  if(i==num){
			e[i].className="show";	
			o[i].className="active";
	  }else{
			e[i].className="hid";
			o[i].className="";
	  }
   }
}
function checkdate(){
  if($(document.myform1.option1hide,"Subject no blank!")==false) return false;
  if($(document.myform1.contenthide,"Message no blank!")==false) return false;
  if($(document.myform1.phonehide,"Email no blank!")==false) return false;
  return true;
}

function PrintSWF(file,w,h) { 
   if(w=="") w="100%";
	if(h=="") h="100%";
	document.writeln("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,0,0\" name=\"16\" width=\""+ w +"\" height=\""+ h +"\" align=\"middle\" id=\"16\">");
	document.writeln("            <param name=\"allowScriptAccess\" value=\"sameDomain\" \/>");
	document.writeln("            <param name=\"allowFullScreen\" value=\"true\" \/>");
	document.writeln("            <param name=\"movie\" value=\""+ file +"\" \/>");
	document.writeln("            <param name=\"wmode\" value=\"transparent\" \/>");
	document.writeln("            <param name=\"quality\" value=\"high\" \/>");
	document.writeln("            <param name=\"bgcolor\" value=\"#ffffff\" \/>");
	document.writeln("            <embed src=\""+ file +"\" quality=\"high\" bgcolor=\"#ffffff\" width=\""+ w +"\" height=\""+ h +"\" name=\"16\" align=\"middle\" allowScriptAccess=\"sameDomain\" wmode=\"transparent\" allowFullScreen=\"false\" type=\"application\/x-shockwave-flash\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" \/>");
	document.writeln("         <\/object>");
}

function sub_form1(){
  var arr = document.myform1.P_id.value;
  window.location.href="/en/category/"+ arr + ".html";
}
function setSelect(id){
  obj=document.getElementById("P_id");
  for(i=0;i<=obj.length;i++){
    if(obj.options[i].value.split("|")[0]==id){
	  obj.options[i].selected=true;
	}
  }
}

function CheckImageSize(Article_Content_ID) {
	var MAX_Width = 610;	
	var imgs = document.getElementById(Article_Content_ID).getElementsByTagName("img");
	for ( var i = 0,len = imgs.length;i<len;i++ ){
		if( parseInt(imgs[i].width,10) > MAX_Width ){
			var iw = parseInt(imgs[i].width,10) ;
			var ih = parseInt(imgs[i].height,10) ;
			imgs[i].style.width = MAX_Width +"px";
			imgs[i].style.height =  parseInt( ih * MAX_Width / iw ) + "px";
		}
	}
}

function GetDocumentHight(){
	var bodyHeight=document.documentElement.clientHeight-5;
	if(bodyHeight>629){
	   document.writeln("<style>");
		document.writeln("#Container { height:"+ bodyHeight +"px; }");
		document.writeln("</style>");
	}
}

function drop_mouseout(pos){
	var posSel=change(pos).style.display;
	if(posSel=="block"){
		timer = setTimeout("drop_hide('"+pos+"')", 500);
	}
}
function drop_hide(pos){
	change(pos).style.display="none";
}
function drop_mouseover(pos){
	try{window.clearTimeout(timer);}catch(e){}
}
function search_show(pos,href){
    change(pos).style.display="none";
    change("listslected").innerHTML=href.innerHTML;
	 try{window.clearTimeout(timer);}catch(e){}
	 return false;
}
