<!--
function Back(){
	history.go(-1);
}
function GoBack(){
	history.go(-1);
}
function Close(){
	window.close();
}
function popUpContent(url, x, y) {
	if (!x){x=650;}
	if (!y){y=500;}
	if (x>400 && y>300){
	var popUpWin = window.open(url,'','height='+y+',width='+x+', location=no, scrollbars=yes, menubars=no,toolbars=no,resizable=no');
	}else{
	var popUpWin = window.open(url,'','height='+y+',width='+x+', location=no, scrollbars=yes, menubars=no,toolbars=no,resizable=yes');
	}
	if (!popUpWin.opener) 
	popUpWin.opener = self;
}

function confSlideShow(sURL, id){
	var popUpWin = window.showModalDialog(sURL, id, "dialogWidth:270px;dialogHeight:170px;status:no;help:no");
}


function popUpImage(theURL,winName,width, height)
{
 popUpWin = window.open('','',"'resizable=no,scrollbars=no, width="+width+" ,height="+height+"'");
 if (!popUpWin.opener) popUpWin.opener = self;
 with (popUpWin.document)
 {
 	write('<HTML><HEAD><TITLE>View Full Image</TITLE>');
 	write('</head>');
 	write('<BODY bgcolor="#FFFFFF" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">');
 	write('<IMG SRC="' + theURL + '" alt="Click on image to close window" onclick="window.close()">');
 	write('</BODY></HTML>');
	close();
 }
}

function deleteConfirm(str) {
  if (confirm(str)){	
    return true;
  }	
  else{
    return false;
  }	
}

	var current_row=null;
	function Datmau(tr, color, bgcolor){
		if(current_row!=null){
			current_row.style.background = '#EDEADE';
			current_row.style.color = '#3300CC';
			current_row.style.fontStyle = 'italic';
		}
		tr.style.background = bgcolor;
		tr.style.color = color;
		tr.style.fontStyle = 'italic';
		current_row=tr;

	}

		var f, imgUser, imgPwd;
		function Loi(txt, msg){
			if (txt.value==""){
				alert (msg + " chua co !");
				selectFocus(txt);
				return true;
			}			
			return false;
		}
		
		function setImage(img, src){
			if(img=="[object]"||img=="[object Image]"||img=="[object HTMLImageElement]")img.src=src;
		}
	
		function keyDown(e) {				
			if(Browser.Type=="ie" && window.event.keyCode==9 && window.event.shiftKey) return;
			if(Browser.Type=="ie" && window.event.srcElement.name=="")return;
		
			var f=document.form1; f.indexOfBeginElement=0;
			var Info =getSourceElementInfo(f, e);
			if(Info.SourceName==null)return;

			var KeyCode=Info.KeyCode, SourceName=Info.SourceName, SourceType=Info.SourceType, NextType=Info.NextType, tt=Info.IndexOfElement, ttNext=Info.IndexOfNextElement, ttPrev=Info.IndexOfPreviousElement;

			if(SourceType=="select-one"){
				if (KeyCode==38 || KeyCode==40)return;
			}			
			if(SourceType=="textarea") return;
			if (KeyCode==13){
				if(Browser.Type=="ns" && Browser.Version>4 && NextType=="button") return false;
				if (SourceType=='button') return;
			}
			
			//-- Begin --				
			
			if(KeyCode==38) selectFocus(f.elements[ttPrev]);

			//----------------------------------------			
			if (KeyCode==13 || KeyCode==9 || KeyCode==40){
				switch(SourceName){								
					case "TenNSD":
						if(!Loi(f.TenNSD,"Ten truy cap")) {
							if(KeyCode!=9) selectFocus(f.elements[ttNext]);
						}												
						break;
						
					case "MatKhau":
						if(!Loi(f.MatKhau,"Mat khau")) {
							if(KeyCode!=9) selectFocus(f.elements[ttNext]);
						}												
						break;
						
					default:
						f.elements[tt].value = Trim(f.elements[tt].value)
						if(KeyCode!=9 || (KeyCode==9 && ttNext==f.indexOfBeginElement) ) selectFocus(f.elements[ttNext]);
				}
			}			
			
			if (KeyCode==13 || KeyCode==38 || KeyCode==40 || (KeyCode==9 && ttNext==f.indexOfBeginElement) ) {
				return false;		
			};
		}

		//--------------------------------
	
		var d, top, left=0,lim, dai;
		function OnResize(){
			if (Browser.Type=="ns" && Browser.Version==4)window.location.reload();
		}
		function setPos(x, y){
			if (Browser.Type=="ie"){
				d.style.pixelLeft=x; d.style.pixelTop=y;
			}
			if (Browser.Type=="ns" && Browser.Version==4){
				d.left=x; d.top=y;
			}
			if (Browser.Type=="ns" && Browser.Version>4){
				d.style.left=x; d.style.top=y;
			}			
		}
		
		function Move(){
			top--;if (top<-dai) top=lim;
			setPos(left, top);			
			setTimeout("Move()",30)
		}
		
		function cmdOK_onclick(){
			if(Loi(f.TenNSD,"Ten truy cap")) return;
			if(Loi(f.MatKhau,"Mat khau")) return;
		
			f.action="logon.asp?time="+(new Date()).getTime();
			f.submit();
			selectFocus(f.TenNSD);
		}
		
		function start(){
			if(Browser.Type=="ns") {				
				//document.dbox.captureEvents(Event.KEYDOWN);
				//document.dbox.onkeydown= keyDown;
			}
			if(Browser.Type=="ie") {
				document.onkeydown= keyDown;
				document.onkeypress= new Function("if(window.event.keyCode==13 && window.event.srcElement.name!='' && (window.event.srcElement.type!='textarea'))return false;");
			}			
			
			if (Browser.Type=="ns" && Browser.Version==4){		
				var dtg = document.dbox.document.d2;
				d = dtg.document.d1;	
				dai=d.document.height;
				lim = dtg.clip.height;
				f = document.dbox.document.form1;				
				imgUser = document.dbox.document.images["imgUser"];
				imgPwd = document.dbox.document.images["imgMatKhau"];
			}
			else{
				d=GetElementById("d1");				
				if(Browser.Type=="ns") dai=d.offsetHeight; else dai=d.scrollHeight;				
				lim = GetElementById("d2").offsetHeight;
				d.style.width="100%"
				f=document.form1;
				imgUser = document.images["imgUser"];
				imgPwd = document.images["imgMatKhau"];
			}

			top=lim;
			Move();		
			f.TenNSD.focus();				
			
		}


function roll(img_name, img_src)
   {
   document[img_name].src = img_src;
   }



function AddImage(iid)
{
	vWH = 170;
	vWW = 330;
	vWN = 'AddImage';
	winDef = 'status=no,resizable=no,scrollbars=no,toolbar=no,location=no,fullscreen=no,titlebar=yes,height='.concat(vWH).concat(',').concat('width=').concat(vWW).concat(',');
	winDef = winDef.concat('top=').concat((screen.height - vWH)/2).concat(',');
	winDef = winDef.concat('left=').concat((screen.width - vWW)/2);
	newwin = open('modules.php?name=Your_Account&op=ChangeImage&iid='+iid,vWN, winDef);	
	newwin.focus();
}

function RemoveImage(iid)
{
	if (document.frmSubmit.elements['ImgID'.concat(iid)].value != 0)
	{
		document.images['Pic'.concat(iid)].src = '/Images/White.gif';
		document.frmSubmit.elements['ImgID'.concat(iid)].value = 0;
		document.frmSubmit.elements['ImgToken'.concat(iid)].value = '';
		document.frmSubmit.elements['ImgDesc'.concat(iid)].value = '';
	}
}
//-->