// Global JS file
// 
// COPYRIGHT NOTICE //////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2001 Agtown.com.  All Rights Reserved.
//
// License is granted with written permission only. Selling any and/or all parts of this
// code is expressly forbidden. The code may not be redistributed over the 
// Internet or in any other medium without or implimented in any other web applications
// without prior written consent.
//
// Contact Information
// http://www.agtown.com
// agtown@agtown.com
//
// see readme.txt file in root directory for detailed copyright notice.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// window open function ->
//	 include the following line outside of a javascript function on the page
// 		var win1 = createWinObj();
//  	include the followin line inside the init(); function on your page
//		win1 = createWinObj();
//	use the following function to open the window
//		winOpen(win1,'/index.asp','newwindow',1, 350, 400, 10, 10);
//		[variable,url of page to open, name of window(no spaces), type of window to open, width, height, coordinate x, coordinate y]
//	use the following function to close the window
//		winClose(win1);
//end window open function ||
// end init

function sObj() {
	this.win = new Array();
}
var nObj = new sObj();

function createWinObj() {
	var x = nObj.win.length;
	return x;
}

function winOpen (x,url,nm,prop,wdth, hght, cordx,cordy) {
	var nProp;
	if (prop == 0) {
		nProp = 'location=no,menubar=no,scrollbars=no,resizable=no,status=no,toolbar=no';
	} else if (prop == 1) {
		nProp = 'location=no,menubar=no,scrollbars=no,resizable=yes,status=no,toolbar=no';
	} else if (prop == 2) {
		nProp = 'location=no,menubar=no,scrollbars=yes,resizable=yes,status=no,toolbar=no';
	} else if (prop == 3) {
		nProp = 'location=no,menubar=yes,scrollbars=yes,resizable=yes,status=no,toolbar=no';
	} else if (prop == 4) {
		nProp = 'location=no,menubar=yes,scrollbars=yes,resizable=yes,status=no,toolbar=yes';
	} else {
		nProp = 'location=yes,menubar=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes';
	}
	if (wdth && hght) {nProp = nProp + ',width=' + wdth + ',height=' + hght; }
	if (nObj.win[x] && nObj.win[x].open && !nObj.win[x].closed) {
		nObj.win[x].focus();
	} else {
		nObj.win[x] = window.open(url,nm,nProp);
	}
	nObj.win[x].moveTo(cordx,cordy);
}

function winClose (x) {
	if (nObj.win[x] && nObj.win[x].open && !nObj.win[x].closed) {
		nObj.win[x].close();
	}
}
function init_global()
{

}
