
function DetectImageSize(picPath,picTitle)
{
    
  image_1 = new Image();
  image_1.src = picPath;
  var picName=image_1;
  picURL=picName.src;
  newWindow=window.open(picURL,'newWin','scrollbars=yes,toolbar=yes,width='+picName.width+',height='+picName.height);
  newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body oncontextmenu="return false;" background="'+picURL+'"><\/body><\/html>');
  newWindow.resizeBy(picName.width-newWindow.document.body.clientWidth,picName.height-newWindow.document.body.clientHeight);
  newWindow.focus();
} 

function isEmail(email) {
	var pattern = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.0123456789@~";
	var theStr = new String(email)
	var index = theStr.indexOf("@");

	for (var a=0; a<pattern.length; a++) {
		if (pattern.indexOf(email.charAt(a),0) == -1) return false;
	}
	if (theStr.indexOf(" ",0) != -1) return false;
	if (index > 0) {
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1)) return true;
	}
	return false;
}
