
/*--------------------------------------------------------------------------------

	Image preview content type
	Sets all images to open full size on pop-up

--------------------------------------------------------------------------------*/

	Event.observe(window, 'load', function(){
	
		$$('a.image_preview').each(function(element){
		
			element.onclick = function()
			{
				var object = element.href.toQueryParams();
				
				var file_name = this.firstChild.src.split('/').last();
			//	var src = '/cms/preview_image.php?file=' + file_name;
				var src = '/assets/file_uploads/images_upfile/' + file_name;
				
				var width = parseInt(object['width']) + 18 + 'px';
				var height = parseInt(object['height']) + 24 + 'px';
				
				window.open(src, 'Preview', 'width=' + width + ', height=' + height);
			
				return false;
			}
		});
	//*	
		$$('.popup_images img').each(function(element){
		
			element.style.cursor = 'pointer';
			
			element.onclick = function()
			{
				var new_window = window.open(element.src, '', 'width=600, height=500');

			//	object = new_window['content'];
				
			//	object.onload = function() {
			//		var bob = object.document.body.childNodes[0];	
			//		var width = bob.width;
			//		var height = bob.height;
				//	alert(width);
			//		new_window.width = width;
				//	new_window.height = height;
			//	};

				return false;
			}
		});
	//*/
	});

/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
