function findObj(theObj, theDoc){
  var p, i, foundObj;
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length){
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  return foundObj;
}
function SetSRC(o,s){
	var obj=findObj(o);
	o.src=s;
}
function ShowandHide(h,s){
	var obj=findObj(h);
	obj.style.display='none';
	obj=findObj(s);
	obj.style.display='';
}
function Show(objShow,bShow){
	var obj=findObj(objShow);
	if(bShow==true)
		obj.style.display='';
	else
		obj.style.display='none';
}
function ShowOneObj(name,num,objshow){
    var obj,i;
    for(i=0;i<=num;i++)
    {
        obj=findObj(name+i);
        if(obj!=null){
            if(i==objshow)
                obj.style.display='';
            else obj.style.display='none';
        }
    }
}
function SwitchShow(objShow){
	var obj=findObj(objShow);
	if(obj.style.display=='none')
		obj.style.display='';
	else
		obj.style.display='none';
}
function GetScroll(inputID){
    var obj=findObj(inputID)
    if(obj==null)
        return true;
    obj.value=""+document.body.parentNode.scrollLeft+","+document.body.parentNode.scrollTop;
    return true;
}
function getViewportDimensions() {
    var intH = 0, intW = 0;    
    if(self.innerHeight) {
       intH = window.innerHeight;
       intW = window.innerWidth;
    } 
    else {
        if(document.documentElement && document.documentElement.clientHeight) {
            intH = document.documentElement.clientHeight;
            intW = document.documentElement.clientWidth;
        }
        else {
            if(document.body) {
                intH = document.body.clientHeight;
                intW = document.body.clientWidth;
            }
        }
    }

    return {
        height: parseInt(intH, 10),
        width: parseInt(intW, 10)
    };
}
/*
//tao tooltip cho anh, them <div id="toolTipBox" style="width:250px;display: none;padding: 5;font-size: 12px;border: black solid 1px;font-family: verdana;position: absolute;background-color: #ffd038;color: 000000;"></div>
var ua = navigator.userAgent
var ps = navigator.productSub 
var dom = (document.getElementById)? 1:0
var ie4 = (document.all&&!dom)? 1:0
var ie5 = (document.all&&dom)? 1:0
var nn4 =(navigator.appName.toLowerCase() == "netscape" && parseInt(navigator.appVersion) == 4)
var nn6 = (dom&&!ie5)? 1:0
var sNav = (nn4||nn6||ie4||ie5)? 1:0
var sbw=0,move=0,hs="",mx,my,scl,sct,ww,wh,obj,sl,st,ih,iw,vl,hl,sv,evlh,evlw,tbody
var doc_root = ((ie5&&ua.indexOf("Opera")<0||ie4)&&document.compatMode=="CSS1Compat")? "document.documentElement":"document.body"
var PX = (nn6)? "px" :"" 
if(nn4||nn6) {
	mx = "e.pageX"
	my = "e.pageY"
	scl = "window.pageXOffset"
	sct = "window.pageYOffset"	
	if(nn4) {
		obj = "document.toolTipBox."
		sl = "left"
		st = "top"
		ih = "clip.height"
		iw = "clip.width"
		vl = "'show'"
		hl = "'hide'"
		sv = "visibility="
	}
	else obj = "document.getElementById('toolTipBox')."
} 
if(ie4||ie5) {
	obj = "toolTipBox."
	mx = "event.x"
	my = "event.y"
	scl = "eval(doc_root).scrollLeft"
	sct = "eval(doc_root).scrollTop"
	if(ie5) {
		mx = mx+"+"+scl 
		my = my+"+"+sct
	}
}
if(ie4||dom){
	sl = "style.left"
	st = "style.top"
	ih = "offsetHeight"
	iw = "offsetWidth"
	vl = "'visible'"
	hl = "'hidden'"
	sv = "style.visibility="
}
if(ie4||ie5||ps>=20020823) {
	ww = "eval(doc_root).clientWidth"
	wh = "eval(doc_root).clientHeight"
}	 
else { 
	ww = "window.innerWidth"
	wh = "window.innerHeight"
	evlh = eval(wh)
	evlw = eval(ww)
	sbw=15
}	


var theObj="";
function toolTip(text,me) {
  theObj=me;
  
  document.getElementById('toolTipBox').innerHTML=text;
  document.getElementById('toolTipBox').style.display="";
  window.onscroll=updatePos;
  theObj.onmousemove=updatePos;
}
function updatePos() {
    /var diffX=14, diffY=10; 
    var X,Y,MouseX = eval(mx),MouseY = eval(my),
        oWidth = parseInt(eval(obj+iw)+3)
		tbodywiw = parseInt(eval(ww+"+"+scl)), tbodywih = parseInt(eval(wh+"+"+sct))
		
		X=MouseX+diffX+parseInt(eval(scl)); 
		Y=MouseY+diffY+parseInt(eval(sct));
		
		if(tbodywiw<oWidth+X){
		    X = tbodywiw-oWidth;
		    Y=parseInt(eval(sct))+MouseY+diffY+20;
		}
		var oHeight = parseInt(eval(obj+ih)+3);
		if(tbodywih<oHeight+Y+sbw) {
			Y = MouseY-oHeight-sbw;
		}
		if(X<0) X=0 
		eval(obj+sl+"=X+PX;"+obj+st+"=Y+PX;")
/
  var e=arguments[0]?arguments[0]:event;
  var x=eval(mx);//ev.clientX;
  var y=eval(my);//ev.clientY;
  var sWidth= parseInt(eval(ww));//document.body.scrollWidth;//getViewportDimensions().width
  var sHeight= parseInt(eval(wh));
  var mobj=findObj('toolTipBox');
  var scrollt=parseInt(eval(sct));
  var scrolll=parseInt(eval(scl));
  diffX=20;
  diffY=10; 
  if(parseInt(mobj.style.width) + x + diffX >= sWidth-30){
  	mobj.style.left = (sWidth-parseInt(mobj.style.width)-30)+"px";
	mobj.style.top  = (y+diffY+10+scrollt)+ "px";
  }
  else{
	mobj.style.left = (x+diffX)+"px";
	mobj.style.top  = (y+diffY+scrollt)+ "px";
  }
  if(parseInt(mobj.clientHeight) + parseInt(mobj.style.top) >= sHeight-10){
	  //document.getElementById('toolTipBox').style.left = (x-2+diffX)+"px";
	  mobj.style.top = (y-parseInt(mobj.clientHeight)-10)+"px";
  }

  //theObj.onmouseout=hideMe;
}
function hideMe() {
  document.getElementById('toolTipBox').style.display="none";
}
*/