function P_openByName ( P_name , P_caption , P_print , P_module , P_obj , P_field , P_addW , P_addH , P_fixSizes , P_shablon , P_canScroll , P_canExpand , P_mainShablon ) {
	//var parts = /([^\/]+)\.(\w+)$/.exec(el.src);
	//var el_file = parts[ 1 ];
	//var el_extension = parts[ 2 ];
	//var big_name = el_file + "_big.jpg";
	var tmp_img = new Image();
	if( P_name.indexOf( "http://" ) == -1 ) {
		tmp_img.src = "/img_out/" + P_name;
		}
	else {
		tmp_img.src = P_name;
		}
	
	if( tmp_img.width > 0 ) {
		P_openByNameLoad( tmp_img , P_name ,  P_caption , P_print , P_module , P_obj , P_field , P_addW , P_addH , P_fixSizes , P_shablon , P_canScroll , P_canExpand , P_mainShablon );
		}
	else {
		tmp_img.onload = function(){ P_openByNameLoad( tmp_img , P_name , P_caption , P_print , P_module , P_obj , P_field , P_addW , P_addH , P_fixSizes , P_shablon , P_canScroll , P_canExpand , P_mainShablon ) };
		}
	} 

function P_openByNameFromSmall( el ) {
	P_openByName( el.getAttribute( "P_name" ) , el.getAttribute( "P_caption" ) , el.getAttribute( "P_print" ) , el.getAttribute( "P_module" ) , el.getAttribute( "P_obj" ) , el.getAttribute( "P_field" ) , el.getAttribute( "P_addW" ) , el.getAttribute( "P_addH" ) , el.getAttribute( "P_fixSizes" ) , el.getAttribute( "P_shablon" ) , el.getAttribute( "P_canScroll" ) , el.getAttribute( "P_canExpand" ) , el.getAttribute( "P_mainShablon" ) );
	}
	
function P_openByNameLoad( el , img_src , tmp_caption , print , module , obj , field , addW , addH , fixSizes , shablon , canScroll , canExpand , mainShablon ) {
	P_today = new Date();
	var tmp_sizes = fixSizes ? "width=" + addW + ",height=" + addH : "width=" + ( el.width + ( addW ? parseInt( addW ) : 20 ) ) + ",height=" + ( el.height + ( addH ? parseInt( addH ) : 63 ) );
	ff = window.open("/scripts/picture.php?picture_path=" + img_src + "&picture_caption=" + tmp_caption + "&print=" + ( print == "yes" ? "visible" : "hidden" ) + "&module=" + ( module ? module : "" ) + "&obj=" + ( obj ? obj : "" ) + "&field=" + ( field ? field : "" ) + "&fixSizes=" + ( fixSizes ? "yes" : "no" ) + "&shablon=" + ( shablon ? shablon : "" ) + "&mainShablon=" + ( mainShablon ? mainShablon : "" ) ,"����" + P_today.getTime() ,"resizable=" + ( canExpand ? "yes" : "no" ) + ",status=no,scrollbars=" + ( canScroll ? "yes" : "no" ) + "," + tmp_sizes + "");
	//ff = window.open("/scripts/picture.php?picture_path=" + img_src + "&picture_caption=" + tmp_caption + "&print=" + ( print == "yes" ? "visible" : "hidden" ) + "&module=" + ( module ? module : "" ) + "&obj=" + ( obj ? obj : "" ) + "&field=" + ( field ? field : "" ) + "&fixSizes=11" + ( fixSizes ? "yes" : "no" ) ,"����","resizable=no,status=no,scrollbars=no,width=" + ( el.width + ( addW ? addW : 20 ) ) + ",height=" + ( el.height + ( addH ? addH : 63 ) ) + "");
	if( !ff ) {
		//alert( '��������, � ����� �������� ������������� ����������� ����' );
		}
	else {
		ff.focus(); 
		}
	}