/*
Author: Thanh Hu*ng
Phone: 0978893678
*/
var repeat=0 //enter 0 to not repeat scrolling after 1 run, othersise, enter 1
var title=document.title
var leng=title.length
var start=1
function titlemove() {
  titl=title.substring(start, leng) + title.substring(0, start)
  document.title=titl
  start++
  if (start==leng+1) {
    start=0
    if (repeat==0)
    return
  }
  setTimeout("titlemove()",140)
}
if (document.title)
titlemove();

function check(v,fname){
var frm = document[fname];	
for (i = 0; i < frm.length; i++)
if (frm[i].type == "checkbox")
frm[i].checked = v;
}
function uncheck(fname){
var frm = document[fname];	
for (i = 0; i < frm.length; i++)
if (frm[i].type == "checkbox")
if (frm[i].checked)
frm[i].checked = false
else
frm[i].checked = true;
}
function GetCenteredXY(w, h) {
		var ps = getScrollXY();
		var sz = getInnerSize();
		var Left = (sz[0] - w) / 2 + ps[0];
		var Top = (sz[1] - h) / 2 + ps[1];
		return [ Math.ceil(Left), Math.ceil(Top) ];
	}
	
	function getScrollXY() {
	  var scrOfX = 0, scrOfY = 0;
	  if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	  }
	  return [ scrOfX, scrOfY ];
	}
	
	function getInnerSize() {
	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
	  return [ myWidth,  myHeight ];
	}
