function popup(set, id, width, height, resizable, location, statusbar, menubar, toolbar, scrollbars) {	if (set == "home") {		var url = 'http://wt.essapps.com/webtrigger/wt-form-home.php';	} else {		var url = 'http://wt.essapps.com/webtrigger/webtrigger.php?set='+set+'&id='+id;	}	if (!width || !height) {		// open a full browser window		window.open(url);	} else {		// open a popup with options		var day = new Date();		var id = day.getTime();		var params = '';			if (!width) width = 0;		if (!height) height = 0;		if (!resizable) resizable = 0;		if (!location) location = 0;		if (!statusbar) statusbar = 0;		if (!menubar) menubar = 0;		if (!toolbar) toolbar = 0;		if (!scrollbars) scrollbars = 0;				if (height >= (window.screen.availHeight - 40)) {			height = window.screen.availHeight - 40;			width = width + 20;			scrollbars = 1;		}				if (width >= (window.screen.availWidth - 20)) {			width = window.screen.availWidth - 20;			scrollbars = 1;		}				params += 'width=' + width + ',';		params += 'height=' + height + ',';		params += 'resizable=' + resizable + ',';		params += 'location=' + location + ',';		params += 'statusbar=' + statusbar + ',';		params += 'menubar=' + menubar + ',';		params += 'toolbar=' + toolbar + ',';		params += 'scrollbars=' + scrollbars + ',';				window.open(url, id, params);	}}