
function GetObj(objName){
if(document.getElementById){
return eval('document.getElementById("' + objName + '")');
}else{
return eval('document.all.' + objName);
}
}

var uniqnum_counter = (new Date).getTime();;
function UniqueNum() {
  ++uniqnum_counter;
  return uniqnum_counter;
}
function XHConn()
{
  var xmlhttp, bComplete = false;
  try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); cache=false;}
  catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");  cache=false;}
  catch (e) { try { xmlhttp = new XMLHttpRequest();  cache=true;}
  catch (e) { xmlhttp = false; }}}
  if (!xmlhttp) {
  	 alert('Your browser do not support xmlHTTP technic .');
	return null;
  }
  this.connect = function(sURL, sMethod, sTarget ,is_sub)
  {
    if (!xmlhttp) return false;
    bComplete = false;
    sMethod = sMethod.toUpperCase();

    try {
      if (sMethod == "GET")
      {
        xmlhttp.open(sMethod, sURL, cache);
		//xmlhttp.open(sMethod, sURL+"&rand="+ UniqueNum(), cache);
      }
      else
      {
        //xmlhttp.open(sMethod, sURL + "&rand="+ UniqueNum(), true);
		xmlhttp.open(sMethod, sURL, true);
        xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1");
        xmlhttp.setRequestHeader("Content-Type",
          "application/x-www-form-urlencoded");
      }
      xmlhttp.onreadystatechange = function(){
        if (xmlhttp.readyState == 4 && !bComplete)
        {
          bComplete = true;
		  if (is_sub==true)
		  {
          try{
          parent.document.getElementById(sTarget).innerHTML=xmlhttp.responseText;	
          }
          catch (e){}
          }else{
          try{document.getElementById(sTarget).innerHTML=xmlhttp.responseText;}catch(e){}
          }
        }};
      xmlhttp.send(null);
    }
    catch(z) { return false; }
    return true;
  };
  return this;
}
function update_innerHTML(g,url,is_sub){
	var myConn = new XHConn();
	myConn.connect(url, "GET", g,is_sub);
	return false;
}
function PopMsg(path)
{		
window.open(path,"","height=450,width=650,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}

function showtopuser(v){
if(v==1){
	document.getElementById('topuserbycode').style.display='block';
	document.getElementById('topuserbypoint').style.display='none';
}else{
	document.getElementById('topuserbycode').style.display='none';
	document.getElementById('topuserbypoint').style.display='block';
}

}

function win_open(url,iWidth,iHeight,name){
	iTop=(window.screen.height-iHeight)/2;
	iLeft=(window.screen.width-iWidth)/2;
	var newwin=window.open(url,name,"height="+iHeight+", width="+iWidth+", top="+iTop+", left="+iLeft+", toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
	newwin.focus();
}

