function autoresizePopup(newWidth,newHeight){
	newLeft   = Math.round((screen.width - newWidth) / 2);
	newTop    = Math.round((screen.height - newHeight - 30) / 2); // - chroma

	try{ //modal dialog
		window.dialogWidth  = newWidth + 'px';
		window.dialogHeight = newHeight + 'px';
		window.dialogLeft   = newLeft + 'px';
		window.dialogTop    = newTop + 'px';
	}catch(e){ void(0); }

	try{ //popup window
		top.window.moveTo(newLeft, newTop);
		top.window.resizeTo(newWidth, newHeight);
	}catch(e){ void(0); }
}

function stopError() { 
	return true;
} 

function popup(adr,title,w,h){
	var ww = Math.floor((screen.width-w)/2);
	var hh = Math.floor((screen.height-h)/2);
	window.open(adr, title, 'status=yes,resizable=no,width='+w+',height='+h+',top='+hh+',left='+ww);
}

function popup2(adr,title,w,h){
	var ww = Math.floor((screen.width-w)/2);
	var hh = Math.floor((screen.height-h)/2);
	window.open(adr, title, 'status=yes,resizable=no,width='+w+',height='+h+',top='+hh+',left='+ww);
}

function submitform(formname){
	alert(formname);
	f = document.formname;
	f.submit();
}

function is_email(str){
	pattern = /^[0-9a-z]([-_\.]?[0-9a-z])*@[0-9a-z]([-\.]?[0-9a-z])*\.[a-z]{2,6}$/gi;
	return pattern.test(str);
}



