function ImACustomer() {
	var w = screen.width;
	var h = screen.height;	
	W=window.open("https://www.greenfieldsoftware.com/GFSWSupport/inv1.jsp","ImACustomer","resizable,scrollbars,status,width="+w+",height="+h);
	W.window.focus();
}


function openNewWindow (url, name, w, h) {
	r = "=yes";
	p = ",left=50px,top=50px";
	if (w == null || w == 0) {
		r = "=no";
		w = screen.width;
		p = "";		
	}
	if (h == null || h == 0) {
		r = "=no";
		h = screen.height;
		p = "";
	}
	if (name == null || name == "") {
		name = "_blank";
	}
	win = window.open(url,name,"resizable"+r+",scrollbars,status,width="+w+"px,height="+h+"px,replace"+p);
	win.focus();
}

function openNewWindow2 (url, name) {
	if (name == null || name == "") {
		name = "_blank";
	}
	win = window.open(url,name);
	win.focus();
}

function formCheck(formobj){
	// name of mandatory fields
	var fieldRequired = Array("name", "company", "email", "phone");
	// field description to appear in the dialog box
	var fieldDescription = Array("Name", "Company", "Email", "Phone");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			if (obj.type == null){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				continue;
			}

			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}

