//====================================================================================================
//	File Name		:	functions.js
//----------------------------------------------------------------------------------------------------
//	Purpose			:	Javascript Utility functions
//	Author			:	Parimal Gajjar
//	Creation Date	:	27-May-2005
//	Email			:	parimal_gajjar@hotmail.com
//	History			:
//						Date						Author						Remark
//						27-May-2005					Parimal Gajjar				Initial Release
//
//====================================================================================================

//====================================================================================================
//	Function Name	:	popupWindowURL
//	Purpose			:	Whenever you wanna open a link into a new window just call this function
//								you need to pass some arguemnts as described below.
//	Parameters		:	
//								url  = url to be open in the new window
//								winname = winname is the window name for the reference of that window
//								w is the width
//								h is the height
//								menu is the parameter, if you want menubar to be enabled on the window
//								resize if you wanna resize the window
//								scroll i fyou needed
//								x and y are the co-ordinates where you wld like to show the window on the screen
//	Return			:	true or false
//	Author			:	Parimal Gajjar
//	Creation Date	:	27-May-2005
//----------------------------------------------------------------------------------------------------

function popupWindowURL(url, winname,  w, h, menu, resize, scroll, x, y) {
	
	if (winname == null) winname = "newWindow";
	if (w == null) w = 600;
	if (h == null) h = 600;
	if (resize == null) resize = 1;
	
	menutype   = "nomenubar";
	resizetype = "noresizable";
	scrolltype = "noscrollbars";
	if (menu) menutype = "menubar";
	if (resize) resizetype = "resizable";
	if (scroll) scrolltype = "scrollbars";
	
	if (x == null || y == null) {
		cwin=window.open(url,winname,"" + menutype + "," + scrolltype + "," + resizetype + ",width=" + w + ",height=" + h + ",statusbars=no");
	}
	else {
		cwin=window.open(url,winname,"top=" + y + ",left=" + x + ",screenX=" + x + ",screenY=" + y + "," +  menutype + "," + scrolltype + "," + resizetype + ",width=" + w + ",height=" + h + ",statusbars=no");
	}
	
	if (!cwin.opener) cwin.opener=self;
		cwin.focus();

	return true;
}