function open_center ( source, title, width, height )
{
    var w_height = screen.availHeight - height;
    var w_width = screen.availWidth - width;
    var w_left = ( screen.availWidth / 2 ) - ( width / 2 );
    var w_top = ( screen.availHeight / 2 ) - ( height / 2 );
  
    var w_dimension = "height=" + height + ",width=" + width + ",left=" + w_left + ",top=" + w_top;
    window.open ( source, title, w_dimension );
};

function open_center_full ( source, title, width, height )
{
    var w_height = screen.availHeight - height;
    var w_width = screen.availWidth - width;
    var w_left = ( screen.availWidth / 2 ) - ( width / 2 );
    var w_top = ( screen.availHeight / 2 ) - ( height / 2 );
  
//    var w_dimension = "height=" + height + ",width=" + width + ",left=" + w_left + ",top=" + w_top + ",toolbar=true,menubar=true,scrollbars=true"
	var w_dimension = "toolbar=yes, menubar=yes, scrollbars=yes, status=yes, width=800, height=600, resizable=1, location=1";
    window.open ( source, title, w_dimension );
};

//???????? ??????? ?????, ?????? ??? ? ????? ??????
function trim_spaces ( from_where )
{
	var temp_string = this

	if ( arguments.length == 0 )
	{
	  	from_where = "BOTH"
	}

	if ( from_where.toUpperCase () == "LEFT" || from_where == "BOTH" )
	{
  		while ( temp_string.left ( 1 ) == " ")
		{
	  		temp_string = temp_string.substring ( 1 );
	  	}
	}
  
	if ( from_where.toUpperCase () == "RIGHT" || from_where == "BOTH" )
	{
  		while ( temp_string.right ( 1 ) == " " )
		{
  			temp_string = temp_string.substring ( 0, temp_string.length - 1 )
	  	}
	}

	return temp_string
}

//???????? ???????-?? ???????? ?????
function extract_left ( total_chars )
{
	return this.substring ( 0, total_chars )
}

//???????? ???????-?? ???????? ??????
function extract_right ( total_chars )
{
	return this.substring ( this.length - total_chars )
}

//?????? ????????? ??????? ??? ?????
String.prototype.right = extract_right;
String.prototype.left = extract_left;
String.prototype.trim = trim_spaces;

//????????? ????? ??. ????? ?? ????????????
function check_email ( email_address )
{
	var reg_mail = /^[a-z][\w\-\.]*@[\w\-\.]+\.[a-z]{2,3}/i
	return reg_mail.test ( email_address ) 
}

document.oncontextmenu = new Function ( "return false" )

