/* author: AkimVital */
/* Creation date: 02.01.04 */
<!--

/*function openWin ( windowURL, windowName, windowFeatures )
{
	return window.open( windowURL, windowName, windowFeatures ) ;
}*/

function popupwin (url, w, h)
{
	/*{if $core.is_explorer}screen.availWidth {else}*//* {/if}*/
	var vleft = (screen.width-w)/2;
	var vtop  = (screen.height-h)/2-100;
	var wname = "popupwin";

	args = popupwin.arguments;

	if (args[3])
		wname = wname + args[3];
	newWindow = window.open(url, wname, 'width='+w+',height='+h+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1,left='+vleft+',top='+vtop);
	//newWindow.moveTo((window.screen.width-w)/2, (window.screen.height-h)/2);
	newWindow.focus();

	return newWindow;
}

function newwin (url, w, h)
{
	/*{if $core.is_explorer}screen.availWidth {else}*//* {/if}*/
	var vleft = (screen.width-w)/2;
	var vtop  = (screen.height-h)/2-100;
	var wname = "popupwin";

	args = newwin.arguments;

	if (args[3])
		wname = wname + args[3];
	newWindow = window.open(url, wname, 'width='+w+',height='+h+',toolbar=1,location=0,directories=0,status=0,menuBar=1,scrollBars=1,resizable=1,left='+vleft+',top='+vtop);
	//newWindow.moveTo((window.screen.width-w)/2, (window.screen.height-h)/2);
	newWindow.focus();

	return newWindow;
}

function ShowImage (object_id, w, h, add_w, add_h)
{
	//add_w = 400;
	//add_h = 0;

	newWindow = openWin('/show_image?object_id=' + object_id ,'picture_'+object_id,'width='+(w+add_w)+',height='+(h+add_h)+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0' );
	newWindow.focus();
}

function DeleteMessage (field_id)
{
	window_width  = 470;
	window_height = 130;

	var params   = DeleteMessage.arguments[1];
	var location = "";

	if (!params) params = "";

	if (params.length == 0)
		location = '/delete_message?field_id=' + field_id;
	else
		location = '/delete_message?field_id=' + field_id + '&' + params;

	newWindow = openWin(location, 'delete_message_'+field_id,'width='+window_width+',height='+window_height+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0' );
	newWindow.focus();

	return newWindow;
}

// -->
