/***********************************************
        * Disable Text Selection script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
        * This notice MUST stay intact for legal use
        * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
        ***********************************************/

        function disableSelection(target)
        {
        if (typeof target.onselectstart!="undefined") //IE route
	        target.onselectstart=function(){return false}
        else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	        target.style.MozUserSelect="none"
        else //All other route (ie: Opera)
	        target.onmousedown=function(){return false}
        target.style.cursor = "default"
        }
        //Sample usages
        // phan nay phai nam cuoi trang or cuoi div
        //disableSelection(document.getElementById("mydiv")) //Disable text selection on entire body
        //disableSelection(document.getElementById("mydiv")) //Disable text selection on element with id="mydiv"

		function disableRightClick(e)
        {
            if(!document.rightClickDisabled) // initialize
            {
                if(document.layers)
                {
                    document.captureEvents(Event.MOUSEDOWN);
                    document.onmousedown = disableRightClick;
                }
                else document.oncontextmenu = disableRightClick;
                return document.rightClickDisabled = true;
            }
            if(document.layers || (document.getElementById && !document.all))
            {
                if (e.which==2||e.which==3)
                {
                    return false;
                }
            }
            else
            {
                return false;
            }
        }
        disableRightClick();
				
function openFull() {
	var intWidth = screen.availWidth - 10;
	var intHeight = screen.availHeight - 10;
	window.open('popup.html','mac','width='+intWidth+',height='+intHeight+',top=0,left=0,scrollbars=yes,resizable=yes');void(0);
}

x = 0;
y = 0;
w = screen.availWidth;
h = screen.availHeight;
function win_move(tx, ty,tw,th) {
	cw = Math.abs(tw-w)>1
    ch = Math.abs(th-h)>1
	if (cw || ch) {
		w = w+(tw-w)*0.5;
		h = h+(th-h)*0.5;
		window.moveTo(x, y);
           x=(screen.width-w)/2;
		   y=(screen.height-h)/2 - 30;
		window.resizeTo(w, h);
	} else {
		clearInterval(id);
	}
}

<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function backToTop() {
	var x1 = x2 = x3 = 0;
	var y1 = y2 = y3 = 0;
	if (document.documentElement) {
		x1 = document.documentElement.scrollLeft || 0;
		y1 = document.documentElement.scrollTop || 0;
	}
	if (document.body) {
		x2 = document.body.scrollLeft || 0;
		y2 = document.body.scrollTop || 0;
	}
	x3 = window.scrollX || 0;
	y3 = window.scrollY || 0;
	var x = Math.max(x1, Math.max(x2, x3));
	var y = Math.max(y1, Math.max(y2, y3));
	window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));
	if (x > 0 || y > 0) {
		window.setTimeout("backToTop()", 25);
	}
}

function startMq(mqId) {
    var mq = document.getElementById(mqId);
    mq.start();
}

function stopMq(mqId) {
    var mq = document.getElementById(mqId);
    mq.stop();
}
//-->

