var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function isValidEmail(emailStr) {
	// checks if the e-mail address is valid
	var emailPat = /^(\".*\"|[A-Za-z0-9\.]*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;		//	"
	var matchArray = emailStr.match(emailPat);
	if (matchArray == null) {
		//alert("Your email address seems incorrect.  Please try again (check the '@' and '.'s in the email address)");
		return false;
	}
	return true;
}


function get_radio_value(object_name)	{
//	достает значение radiobutton'a,  если не выбрано - вернет undefined
	tmp_value = 'undefined';
	my_object=MM_findObj(object_name);
	num = my_object.length;
	for( var i = 0; i < num; i++ ) {
		if( my_object[ i ].checked == '1' ) {
			tmp_value = my_object[ i ].value;
		}
	}
return(tmp_value);
}


wnd_name='a';
function popupwindow(url)	{
	width=530;
	height=570;
	wnd_name=wnd_name+'a';
	top[wnd_name]=window.open(url,wnd_name,'width='+width+',height='+height+',status=no,menubar=no,resizable=yes,scrollbars=yes,left='+String((screen.width-width)/2)+',top='+String((50)));
}

