//A modal dialog
var overlay;
var modal_dialog;

function win_loaded(event)
{	
	modal_dialog = new Element('div');
	overlay = new DialogOverlay(modal_dialog);
}

function product_enlarge(img_src)
{
	overlay.show();
	
	var cont = new Element('div', {'id': 'dialog_content'});
	var close_button = new Element('img', {'src': 'i/close.png', 'class': 'close'});
	cont.insert(close_button);
	modal_dialog.insert(cont);
	Event.observe(close_button, 'click', hide_dialog);
	
	var product_holder = new Element('div', {'id': 'product_holder'});
	cont.insert(product_holder);
	
	product_holder.insert(new Element('img', {'src' : img_src}));
}

function hide_dialog(event) {
	overlay.hide();
};
Event.observe(window, 'load', win_loaded);

