function openWin( windowURL, windowName, windowFeatures ) { 
		return window.open( windowURL, windowName, windowFeatures ) ; 
	} 
function autofitIframe(id){
//if (!window.opera && !document.mimeType && document.all && document.getElementById){	
if (!window.opera && document.all && document.getElementById){
parent.document.getElementById(id).style.height=this.document.body.offsetHeight+"px";
}
else if(document.getElementById) {
parent.document.getElementById(id).style.height=this.document.body.scrollHeight+"px"
}
}

function autofitWindow(){
//if (!window.opera && !document.mimeType && document.all && document.getElementById){	
if (!window.opera && document.all && document.getElementById){
window.resizeTo(this.document.body.offsetWidth+10,this.document.body.offsetHeight+40);
}
else if(document.getElementById) {
	window.resizeTo(this.document.body.offsetWidth+6,this.document.body.scrollHeight+60);
}
}

function isEmail( str ) {
  var result;
  //var pattern = /^\s*(\w+(\.\w+)*@(\w+\.)+\w+)\s*$/;
  //var pattern = /^\s*([a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)*@([a-zA-Z0-9_-]+\.)+[a-zA-Z0-9_-]+)\s*$/;
  var pattern = /^\s*([^[\]()<>@,;:".\000-\040\177\\]+(\.[^[\]()<>@,;:".\000-\040\177\\]+)*@([^[\]()<>@,;:".\000-\040\177\\]+\.)+[^[\]()<>@,;:".\000-\040\177\\]+)\s*$/;
  if ( ( result = pattern.exec( str ) ) == null ) return "";
  return result[1].toLowerCase();
}

