
function cfmdelete(url)
{
	cfm = confirm("กรุณากดยืนยันก่อนจะทำการลบ");
	if (cfm==1)
		go(url);
}

function cfmapprove(url)
{
	cfm = confirm("กรุณากดยืนยันก่อนระบบจะดำเนินงานต่อไป");
	if (cfm==1)
		go(url);
}

function go(url)
{
	window.location.href = url;
}

function openwin(url,title,width,height)
{
	option = "width="+width+",height="+height+",resizable=no,scrollbars=yes,menubar=no"
	window.open(url,title,option);
}
function isfloat(str)
{
	var r = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/; 
	if (!r.test(str.value)) 
		return false	;
	else
		return true;
}
function isEmail(str)
{
	  emailpat = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;
	  if( !emailpat.test( str))
		  return false;
	  else
		  return true
}

function swapimg(img,id)
{
	imgobj = document.getElementById(id);
	imgobj.src = img;
}

function change(id, newClass)
{
	identity=document.getElementById(id);
	identity.className=newClass;
}

function setStyle(objId, style, value)
{
   document.getElementById(objId).style[style]= value;
 }
