//Ham chuyen doi ngon ngu
function languages(str)
 	 {
 	   var QString= unescape(location.search);
	   var vitri=QString.indexOf("lang")
	 	 if (vitri!=-1) QString=QString.substring(0,vitri-1);
	 	 if (QString!='') QString+='&';
	 	 else QString='?'+QString;
 	   location.href=QString+'lang='+str;
 	 }
 	 
 	 function idpage(keystr,valuestr)
 	 {
 	   var QString= unescape(location.search);
	   var vitri=QString.indexOf(keystr)
	 	 if (vitri!=-1) QString=QString.substring(0,vitri-1);
	 	 if (QString!='') QString+='&';
	 	 else QString='?'+QString;
 	   location.href=QString+keystr+'='+valuestr;
 	 }

  function openPage(url,vWidth,vHeight)
	{
		if (vWidth==0) {vWidth=350;vHeight=350;}
		winDef = 'status=no,resizable=yes,scrollbars=yes,toolbar=yes,location=no,menubar=no,directories=no,fullscreen=no,titlebar=no,height='.concat(vHeight).concat(',').concat('width=').concat(vWidth).concat(',');
		winDef = winDef.concat('top=').concat((screen.height - vHeight)/2).concat(',');
		winDef = winDef.concat('left=').concat((screen.width - vWidth)/2);
		newwin = open(url, '_blank', winDef);
	}

function search(str)
 	 {
 	   var QString= unescape(location.search);
	   var vitri=QString.indexOf("idsearch")
	 	 if (vitri!=-1) QString=QString.substring(0,vitri-1);
	 	 if (QString!='') QString+='&';
	 	 else QString='?'+QString;
 	   location.href=QString+'idsearch='+str;
 	 }
function fixImgs() {
var pix=document.images;
  for (i=0; i<pix.length; i++) {
    var imId=pix[i].name;
    if (imId.substring(0,6)=="imgfix")
    {
              pix[i].removeAttribute("width");
              pix[i].removeAttribute("height");
              w=pix[i].width;
              h=pix[i].height;
//              wGoc=160;
//              hGoc=120;

                wGoc=130;
                hGoc=130;
//                wGoc=240;
//                hGoc=180;
              if(h/w==hGoc/wGoc)
              {
                pix[i].width=wGoc;
                pix[i].height=hGoc;
              }
              else
              {
                                  if(h>=w)
                                    {
                                      pix[i].width=(hGoc*w)/h;
                                      pix[i].height=hGoc;
                                    }
                                   else
                                    {
                                      hMoi=(wGoc*h)/w;
                                      if(hMoi<=hGoc)
                                      {
                                        pix[i].width=wGoc;
                                        pix[i].height=hMoi;
                                      }
                                      else
                                      {
                                        pix[i].width=(hGoc*w)/h;
                                        pix[i].height=hGoc;
                                      }
                                    } 
                }
    }
    
    if (imId.substring(0,8)=="imgfix_h")
    {
              pix[i].removeAttribute("width");
              pix[i].removeAttribute("height");
              w=pix[i].width;
              h=pix[i].height;
//              wGoc=160;
//              hGoc=120;

                wGoc=210;
                hGoc=210;
//                wGoc=240;
//                hGoc=180;
              if(h/w==hGoc/wGoc)
              {
                pix[i].width=wGoc;
                pix[i].height=hGoc;
              }
              else
              {
                                  if(h>=w)
                                    {
                                      pix[i].width=(hGoc*w)/h;
                                      pix[i].height=hGoc;
                                    }
                                   else
                                    {
                                      hMoi=(wGoc*h)/w;
                                      if(hMoi<=hGoc)
                                      {
                                        pix[i].width=wGoc;
                                        pix[i].height=hMoi;
                                      }
                                      else
                                      {
                                        pix[i].width=(hGoc*w)/h;
                                        pix[i].height=hGoc;
                                      }
                                    } 
                }
    }
  }
}