function popup(sURL) {
    window.open(sURL,"","menubar=no,width=770,height=600,toolbar=no,scrollbars=yes");
}

/*
ShowImage('http://pics.manager.co.th/ShowImage.html?Image=%2fImages%2f551000001035501.JPEG&Width=695&Height=467', 695, 467); 
*/
var popRress;
var strName = "pop";

function popImage(url, intImageWidth, intImageHeight){
	var strFeatures;
	strFeatures = "dependent=yes,directories=no,location=no,menubar=no,resizable=yes,personalbar=no,scrollbars=yes,titlebar=no,toolbar=no,screenX=50,screenY=50,top=50, left=50, width=" + intImageWidth.toString() + ", height=" + intImageHeight.toString()
	popRress = window.open(url, strName, strFeatures);
	popRress.focus();
	return false;
}

function popHTML(url, intWidth, intHeight){
	var strFeatures;
	strFeatures = "dependent=yes,directories=no,location=no,menubar=no,resizable=yes,personalbar=no,scrollbars=yes,titlebar=no,toolbar=no,screenX=50,screenY=50,top=50, left=50, width=" + intWidth.toString() + ", height=" + intHeight.toString();
	popRress = window.open(url, strName, strFeatures);
	popRress.focus();
	return false;	
}

function ResizeFit(intImageWidth, intImageHeight){
	var intDiffWidth;
	var intFDiffHeight;
	if(navigator.appName=="Netscape"){
		intDiffWidth = intImageWidth - window.innerWidth;
		intDiffHeight = intImageHeight - window.innerHeight;
	}else{
		intDiffWidth = intImageWidth - window.document.body.clientWidth;
		intDiffHeight = intImageHeight - window.document.body.clientHeight;
	}
	window.resizeBy(intDiffWidth, intDiffHeight);
}

function isValidEmail(val)
{
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (!filter.test(val))
	{
		return false;
	}else{
		return true;
	}
}