﻿var c;

	function viewattact(c)
		{
			OpenDialog(c,800,600)
		}
	
	function OpenDialog(sPage,iWidth,iHeight) {
		//if (window.showModalDialog)
		//{
			//window.showModalDialog(sPage, window, "dialogWidth:" + iWidth + "px;dialogHeight:" + iHeight + "px; toolbar=yes;status:no; help:no; resizable:yes; scroll:yes;center:yes;dialogTop:0px")
		//}else{
			window.open(sPage,"Dialog", "height=" + iHeight + ",width=" + iWidth + ",toolbar=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,border=thin,center=yes,modal=yes")
		//}
	}
	function sohieu_focus()
		{
			window.Form1.txtSoHieu.focus();
		}
	function Open(){
		//alert("tung");
		var file=document.getElementById("fileAttact")
		//file.click();
		document.getElementById("pathfilename").value=file.value;
		strfile=cutfilename(file.value);
		document.getElementById("txtNamefile").value=strfile;
	}
	function cutfilename(strpath){
		txt = strpath.substring(strpath.lastIndexOf("\\")+1,strpath.length);
		return txt;
	}	
	function dropCategory(obj)
    {
	    if(obj.id.substr(0,2) == "xt")
	    {
		    if(obj.className == "on")
		    {
			    obj.className = "off";
			    document.Form1.objdropXT.value = "";	
		    }
		    else
		    {
			    obj.className = "on";
			    if(document.Form1.objdropXT.value != "")
			    {
				    identity=document.getElementById(document.Form1.objdropXT.value);
				    identity.className = "off";
    				
			    }
			    document.Form1.objdropXT.value = obj.id;
    			
		    }
	    }
	    else if(obj.id.substr(0,2) == "ct")
	    {
		    if(obj.className == "on")
		    {
			    obj.className = "off";
			    document.Form1.objdropCT.value = "";	
		    }
		    else
		    {
			    obj.className = "on";
			    if(document.Form1.objdropCT.value != "")
			    {
				    identity=document.getElementById(document.Form1.objdropCT.value);
				    identity.className = "off";
			    }
			    document.Form1.objdropCT.value = obj.id;
		    }
	    }
    }
    function openWindow(url) {
        var image = new Image;
        image.src = url;
        win2Open = window.open("","","toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no,copyhistory=no");
        if (!document.layers && !document.all)	return;
        win2Open.resizeTo (100 + image.width, 100 + image.height);
        win2Open.moveTo ((screen.width - image.width) / 2, (screen.height - image.height) / 2);
        win2Open.document.open();
        win2Open.document.write ('<html><head><title>Preview Image</title></head><body>');
        win2Open.document.write ('<table cellpadding="2" cellspacing="0" border="0" width="100%">');
        win2Open.document.write ('<tr><td width="100%" align="center"><img src="' + url + '" vspace="5" hspace="5" border="1" style="cursor:Hand" onclick="window.close();" /></td></tr>');
        win2Open.document.write ('<tr><td width="100%" align="center" style="cursor:hand" onclick="javascript:window.close();"><font face="Arial" color="#26690a" style="font-size:10pt"><b>Đóng lại</b></font></td></tr>');
        win2Open.document.write ('</table></body></html>');
        win2Open.document.close();
        return;
    }
