
<!-- Begin
var maxWidth=100;
var maxHeight=100;
var fileTypes=["bmp","gif","png","jpg","jpeg"];
var outImage="previewField";
var defaultPic="../images/na.gif";
function preview(what){
  var source=what.value;
  var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
  for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;
  globalPic=new Image();
  if (i<fileTypes.length) globalPic.src=source;
  else {
    globalPic.src=defaultPic;
    alert("Chu y: SAI FILE UPLOAD\nXin moi Upload trong cac kieu file sau:\n\n"+fileTypes.join(", "));
  }
  setTimeout("applyChanges()",200);
}
var globalPic;
function applyChanges(){
  var field=document.getElementById(outImage);
  var x=parseInt(globalPic.width);
  var y=parseInt(globalPic.height);
  if (x>maxWidth) {
    y*=maxWidth/x;
    x=maxWidth;
  }
  if (y>maxHeight) {
    x*=maxHeight/y;
    y=maxHeight;
  }
  field.style.display=(x<1 || y<1)?"none":"";
  field.src=globalPic.src;
  field.width=x;
  field.height=y;
}
// End -->
//-------------------------Xac nhan xoa thong tin--------------------------

function submitFormSupport(){
var name=confirm("Are you sure you want to delete this item(s) ?");
	if(name==true){
		document.getElementById("myform").action="delete_support.asp";
		document.getElementById("myform").submit();
		}
}
function submitFormCustomer(){
var name=confirm("Are you sure you want to delete this item(s) ?");
	if(name==true){
		document.getElementById("myform").action="delete_customer.asp";
		document.getElementById("myform").submit();
		}
}

//-------------------------Xac nhan xoa thong tin--------------------------

function submitNewPro(){
var name=confirm("Are you sure you want to delete this item(s) ?");
	if(name==true){
		document.getElementById("myform").action="delete_adver.asp";
		document.getElementById("myform").submit();
		}
}
function submitFormRegSite(){
var name=confirm("Are you sure you want to delete this item(s) ?");
	if(name==true){
		document.getElementById("myform").action="delete_regsite.asp";
		document.getElementById("myform").submit();
		}
}

//-------------------------Xac nhan xoa thong tin--------------------------

function submitFormGroup(){
var name=confirm("Are you sure you want to delete this item(s) ?");
	if(name==true){
		document.getElementById("myform").action="delete_categroup.asp";
		document.getElementById("myform").submit();
		}
}
//-------------------------Xac nhan xoa thong tin--------------------------

function submitFormCategory(){
var name=confirm("Are you sure you want to delete this item(s) ?");
	if(name==true){
		document.getElementById("myform").action="delete_category.asp";
		document.getElementById("myform").submit();
		}
}
//-------------------------Xac nhan xoa thong tin--------------------------

function submitFormCate(){
var name=confirm("Are you sure you want to delete this item(s) ?");
	if(name==true){
		document.getElementById("myform").action="delete_cate.asp";
		document.getElementById("myform").submit();
		}
}

//----------------------------------------------------------------------
function ConvertBR(input) {
	var output = "";
	for (var i = 0; i < input.length; i++) {
	if ((input.charCodeAt(i) == 13) && (input.charCodeAt(i + 1) == 10)) {
	i++;
	output += "<BR>";
	} else {
	output += input.charAt(i);
	   }
	}
	return output;
}
//------------------------------Checked or UnChecked------------------------------
var checkflag = "false";
function check(field) {
	if (checkflag == "false") {
	for (i = 0; i < field.length; i++) {
	field[i].checked = true;}
	checkflag = "true";
	return "Uncheck All"; }
	else {
	for (i = 0; i < field.length; i++) {
	field[i].checked = false; }
	checkflag = "false";
	return "Check All"; }
}
//-------------------------Xac nhan xoa thong tin--------------------------
function DeleteVT(FileDeleteVT)
{
	var name=confirm("Ban muon xoa muc nay ?")
	if(name==true)
	{
		window.location = FileDeleteVT
	} 
	
}

