   var popup;
   
   var height = screen.height
   var width  = screen.width
   var RICOLAPopup_uniqueId = parseInt((Math.random() * 10000), 10).toString();
   
	function fPopWindow(sURL,sType){
	//  PopContextualHelp
		if (arguments.length < 2) {
			sType="help";
		}
	    switch (sType.toLowerCase())
   		{
    	  	case "help" :      
				var cFeatures = "width=750,height=500,resizable=1,scrollbars=1,status=0,toolbar=0,location=0,menubar=0,screenX=5,screenY=5,left=20,top=20";
				var cWindowName = "helpwind";
        		break;
    	  	case "term" :      
				var cFeatures = "width=300,height=200,resizable=1,scrollbars=1,status=0,toolbar=0,location=0,menubar=0,screenX=20,screenY=150,left=375,top=175";
				var cWindowName = "termwind";
				break;
			case "centric" :		// This is for applications centered in a popup that require a status bar.
				var cFeatures = "width=700,height=475,resizable=1,scrollbars=1,status=1,toolbar=1,location=0,menubar=0,screenX=20,screenY=150,left=300,top=100";
				var cWindowName = "centricwind";
        		break;
    	  	case "sm_lookup" :  
				var cFeatures = "width=125,height=125,resizable=1,scrollbars=0,status=0,toolbar=0,location=0,menubar=0,screenX=5,screenY=5,left=20,top=20";
				var cWindowName = "lookupwind";
        		break;
    	  	case "med_lookup" :   
            // find left & top coordinates to center window
            var left = (width-400)/2
            var top = (height-400)/2
                        
				var cFeatures = "width=400,height=400,resizable=1,scrollbars=0,status=0,toolbar=0,location=0,menubar=0,screenX=5,screenY=5,left="+left+",top="+top;
				var cWindowName = "lookupwind";
        		break
    	  	case "big_lookup" :      
				var cFeatures = "width=575,height=575,resizable=1,scrollbars=0,status=0,toolbar=0,location=0,menubar=0,screenX=5,screenY=5,left=20,top=20";
				var cWindowName = "lookupwind";
        		break;
			case "custom":
				var i=0;
				if (arguments.length < 4) { 
					alert("RICOLA Popup Window Error #0001: \n\nThere were not enough arguments specified to have a \"custom\" type Popup Window.\nThere must be at least 4 arguments: (URL, Type, Width, Height).\n\nPlease refer to the documentation at http://home.www.uprr.com/emp/it/hf/ricola/popup/ for more information.");
					return false;
				}
				var cWindowName = "customWind";
				var cFeatures="width=" + arguments[2] + ",height=" + arguments[3];
				var restArgs=new Array();
				for (i=0; i < arguments.length; i++) {
					restArgs[restArgs.length] = arguments[i];
				}
				
				if ((restArgs.length == 5) && (restArgs[4].search(/\,/g) != -1)) {   // all in one string
					var splitOptions = new Array();
					splitOptions = restArgs[4].split(",");
					restArgs[4] = splitOptions[0];
					for (i=1; i < splitOptions.length; i++) {
						restArgs[restArgs.length] = splitOptions[i];
					}
				}
				for (i=4; i<restArgs.length; i++) {
					if (restArgs[i].toLowerCase().indexOf("windowname:") != -1) {
						cWindowName=restArgs[i].replace(/(\w+)\s*:\s*(\S+)/,"$2");
					} else {
						cFeatures+="," + restArgs[i].replace(/(\w+)\s*:\s*(\S+)/,"$1") + "=" + restArgs[i].replace(/(\w+)\s*:\s*(\S+)/,"$2");
					}
				}
				break;
			default :
				var cFeatures = "width=750,height=500,resizable=1,scrollbars=1,status=0,toolbar=0,location=0,menubar=0,screenX=5,screenY=5,left=20,top=20";
				var cWindowName = "helpwind";
        		break;
		}
    
		cWindowName += "_" + RICOLAPopup_uniqueId;
		if (popup != null && !popup.closed) { 
			popup.close();
	         	orphan="false";
		}
		popup=window.open(sURL,cWindowName,cFeatures);
	      	orphan="true";
	}
