// ***************************************************************************
//                          boxImage.js  -  description
//                             -------------------
//    begin                : Fri Dec 9 2005
//    copyright            : (C) 2005 by Andrei Gavrila
//    email                : andrei.gavrila@gmail.com
// ***************************************************************************
//
// ***************************************************************************
// *                                                                         *
// *   This program is free software; you can redistribute it and/or modify  *
// *   it under the terms of the GNU General Public License as published by  *
// *   the Free Software Foundation; either version 2 of the License, or     *
// *   (at your option) any later version.                                   *
// *                                                                         *
// ***************************************************************************

function boxImage(x, y, w, h, src)
{
	var setup   = ' \
<div class="wmWindowSetupItem" id="boxImage_' + wmWindowIndex + '_SetupBox_2"> \
<b>' + wmText(3100) + '</b> \
<br /> \
<br /> \
<b>' + wmText(3101) + '</b> <br /> \
<input type="text" id="wmWindow_' + wmWindowIndex + '_Setup10" class="wmSetupInputURL" size="50" value="' + src + '" onChange="javascript: boxImageSetupSrc(' + wmWindowIndex + ', this.value);" onMouseMove = "javascript: wmToolTipQuick(\'wmWindow_' + wmWindowIndex + '_Setup10\', this, wmMessage(3100));" /> \
<br /> \
</div> \
';
	var content = '<img border="0" src="' + src + '" />';

	headers = Array();

	headers[0] = '';   
	headers[1] = 'boxImage_' + wmWindowIndex + '_SetupBox_2';

	wmWindow(x, y, w, h, 'image', setup, content, headers);

	boxImageSetupSrc(wmWindowIndex - 1, src);
}

function boxImageSetupSrc(index, src)
{
	wmGetElementById('wmWindow_' + index + '_Content').innerHTML = '<img border="0" src="' + src + '" />';

	wmWindowSaved = false;
}

function boxImageSave(index)
{
	var content = '';

	content += '<input type="hidden" name="box_' + index + '_src" value="' + escape(wmGetElementById('wmWindow_' + index + '_Setup10').value) + '" />\n';

	return content;
}

