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);
}


function show_block(block_name)        {
        tmpobj = MM_findObj(block_name);
        if (tmpobj != null)        tmpobj.style.display=        'inline';
        return false;
}

function hide_block(block_name)        {
        tmpobj = MM_findObj(block_name);
        if (tmpobj != null)        tmpobj.style.display=        'none';
return false;
}


wnd_name='a';
function popupwindow (url,width,height)	{
	width=(parseInt(width)<1)? 530 : parseInt(width);
	height=(parseInt(height)<1)? 570 : parseInt(height);
	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)));
}

function showSubMenu(monthId, monthsArray) {
	for(var i=0; i<monthsArray.length; i++) {
		document.getElementById(monthsArray[i]).style.display='none';
	}
	document.getElementById(monthId).style.display='block';
}

function sendEvent(typ,prm) { 
  thisMovie(player_id).sendEvent(typ,prm); 
}
function thisMovie(swf) {
  if(navigator.appName.indexOf("Microsoft") != -1) {
    return window[swf];
  } else {
    return document[swf];
  }
}
function loadFile(obj, id) {
	sendEvent('stop');
  thisMovie(player_id).loadFile(obj); 
}

function show_bar(div, id, idName) {
	var winObj = document.getElementById(div);
	var conObj = document.getElementById(idName + '' + id);
	var conBox = document.getElementById('conBox'+id);
	conBox.innerHTML=conObj.innerHTML;
	winObj.style.visibility = 'visible';
	winObj.style.display = 'block';
}
function hide_bar(obj) {
	document.getElementById(obj).style.visibility="hidden"
}
function Move() {
	var winObj = document.getElementById('content_win');
	SelectedItem = winObj;
	SelectedX = SelectedItem.style.pixelLeft;
	SelectedY = SelectedItem.style.pixelTop;
	aMouseX = event.clientX;
	aMouseY = event.clientY;
	document.onmousemove = Drag;
	document.onmouseup = Drop;
}
function Drag() {
	SelectedItem.style.left = SelectedX + (event.clientX - aMouseX);
	SelectedItem.style.top = SelectedY + (event.clientY - aMouseY);
	return false;
}
function Drop() {
	document.onmousemove = null;
	document.onmouseup = null;
}