// JavaScript Document openWindows
/* Chayne Walsh : 2007 08 01 */
var AutoResizeWindow = 
{
	init: function()
	{
		var autoResize = Core.getElementsByClass("AutoResizeWindow");
		for (var i = 0; i < autoResize.length; i++)
		{
			Core.addEventListener(autoResize[i], "click", AutoResizeWindow.onclickHandlerAutoResize);
		}
	},
	
	onclickHandlerAutoResize: function()
	{
		
		/* /////////////////////////////////////////
		Developer : Chayne Walsh
		Date : 2007 12 03
		Copyright : none , please send any improvements to development@chayne.net
		Link creator.
		////////////////////////////////////////// */
		var obj = new Object(); // object holder
		obj.Origin = document;
		obj.WindowWidth = 200;
		obj.WindowHeight = 200;
		obj.Img = this.title.replace('#','');
 		obj.LinkTarget = getEnv('RELATIVE_ROOT') + 'assets/scripts/popup_resize.asp?dir=&img=' + obj.Img ;
		
		if (window.showModalDialog)
		{
			var r = window.showModalDialog(obj.LinkTarget, obj, 'Status:NO; dialogWidth:'+obj.WindowWidth+'px; dialogHeight:'+obj.WindowHeight+'px;  dialogHide:no; help:no; scroll:no; resizable:yes; status:no; unadorned:yes;' ); 
		}
		else
		{
			var r=window.open(obj.LinkTarget, 'LinkTarget', 'width='+obj.WindowWidth+',height='+obj.WindowHeight+',top=10,left=10,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes,modal=yes');
		}

		Core.preventDefault(event);
		return;	
	}
}
Core.start(AutoResizeWindow);