jQuery.noConflict();

preload_img = new Image();
preload_img.src = '/images/win/ajax-loader.gif';

jQuery.print_photo = function(gallery, filename) {
	var my_iframe = document.createElement('iframe');
	var my_doc = null;
	jQuery(my_iframe).attr('style', 'position:absolute;width:0;height:0;text-indent:-9999px;');
	document.body.appendChild(my_iframe);
	my_doc = my_iframe.contentWindow.document;
	my_doc.write('<img src="/images/gallery/'+gallery+'/'+filename+'" />'); 
	my_doc.close();
	my_iframe.contentWindow.focus();
	my_iframe.contentWindow.print();
	//alert('Printing...');
	//wait(1);
	document.body.removeChild(my_iframe);
}

function disable_button(obj, text) {
	jQuery(obj).attr('style', 'display:none');

	var new_span = document.createElement('span');
	jQuery(new_span).attr('style', "background:transparent url('/images/win/ajax-loader.gif') no-repeat;width:16px;height:16px;margin-left:5px;padding-left:8px;padding-right:8px");
	new_span.innerHTML = '&nbsp;';

	obj.parentNode.insertBefore(new_span, obj.nextSibling);

	var new_button = document.createElement('input');
	new_button.type = 'button';
	new_button.value = text;
	new_button.className = obj.className;

	obj.parentNode.insertBefore(new_button, obj.nextSibling);
}

jQuery(document).ready(function() {
	jQuery("#common_dialog").dialog({
		modal: true,
		overlay: {
			opacity: 0.5,
			background: "black"
		}
	});
});