
    var saveableviews= new Object();
	saveableviews['b_prmp']=1;
	saveableviews['a']=1;
	saveableviews['b_plda']=1;
	saveableviews['u_rmp']=1;
	saveableviews['d']=1;
	saveableviews['b_ad']=1;
	saveableviews['b_aslda']=1;
	saveableviews['g']=1;
	saveableviews['m']=1;
	saveableviews['n']=1;
	saveableviews['o']=1;
	saveableviews['a_rmp']=1;
	saveableviews['q']=1;
	saveableviews['b_psrmp']=1;
	saveableviews['s']=1;
	saveableviews['u']=1;
	saveableviews['b_pslda']=1;
	saveableviews['w']=1;
	saveableviews['x']=1;
	saveableviews['y']=1;
	saveableviews['z']=1;
	saveableviews['n_rmp']=1;

    function validate(doc) {
	var form=null;
	if (doc == null) {
	    alert("This feature cannot work with your browser. Please contact the help desk for help");
	    return ;
	}

	if (doc.mainform != null)
	    form=doc.mainform;
	else if (doc.someDiv !=null && doc.someDiv.document !=null &&
	    doc.someDiv.document.mainform != null)
	    form=doc.someDiv.document.mainform;
	else if (doc.layers["someDiv"] != null &&
		 doc.layers["someDiv"].document != null &&
		 doc.layers["someDiv"].document.mainform != null)
	    form=doc.layers["someDiv"].document.mainform;
	else if (doc.layers["someDiv"] != null &&
		 doc.layers["someDiv"].document != null &&
		 doc.layers["someDiv"].document.layers != null &&
		 doc.layers["someDiv"].document.layers["relspan"] != null &&
		 doc.layers["someDiv"].document.layers["relspan"].document != null &&
		 doc.layers["someDiv"].document.layers["relspan"].document.mainform != null)
	    form=doc.layers["someDiv"].document.layers["relspan"].document.mainform;
	if (form==null) {
	    alert("Could not work with your browser. Please contact the help desk for help");
	    return;
	}

	var obj=form.view;
	if (obj == null || obj.selectedIndex < 0) {
	    return;
	}
	var option = obj.options[obj.selectedIndex];
	var value =option.value;
	if (value==null || value.charAt(0)=='l' ||
	    saveableviews[value] == null)
	{
	    alert("\""+option.text + "\" cannot be saved as a default view");
	    return;
	}
	form.SaveDefault1.value="YES";
	form.submit();
    }

    function printScreen(url) {
	window.open(url, "printScreen", "toolbar=yes,resizable=yes");
	return;
    }

    function help_layer(action, ind) {
	if (ind == 1) document.help1.visibility=action;
	else document.help2.visibility=action;
    }

    function launch(newURL, newName, newFeatures, orgName) {
      var remote = open(newURL, newName, newFeatures);
      if (remote.opener == null)
       remote.opener = window;
      remote.opener.name = orgName;
      return remote;
    }

    function launchRemote() {
    myRemote = launch("/cgi-bin/client/cgmacctmgr.cgi",
                    "myRemote",
                    "height=250,width=700,resizable=yes,location=0,menubar=0,scrollbars=yes,status=0,toolbar=0","myWindow");
    }

    function checkViewSelection(doc) {

        var form=null;
        if (doc == null) {
            alert("Could not work with your browser. Please contact the help desk for help");
            // No document? submit anyway.
            return true;
        }

        if (doc.mainform != null)
            form=doc.mainform;
        else if (doc.someDiv !=null && doc.someDiv.document !=null &&
            doc.someDiv.document.mainform != null)
            form=doc.someDiv.document.mainform;
        else if (doc.layers["someDiv"] != null &&
                 doc.layers["someDiv"].document != null &&
                 doc.layers["someDiv"].document.mainform != null)
            form=doc.layers["someDiv"].document.mainform;
        else if (doc.layers["someDiv"] != null &&
                 doc.layers["someDiv"].document != null &&
                 doc.layers["someDiv"].document.layers != null &&
                 doc.layers["someDiv"].document.layers["relspan"] != null &&
                 doc.layers["someDiv"].document.layers["relspan"].document != null &&
                 doc.layers["someDiv"].document.layers["relspan"].document.mainform != null)
            form=doc.layers["someDiv"].document.layers["relspan"].document.mainform;
        if (form==null) {
            alert("Could not work with your browser. Please contact the help desk for help");
            // No form? submit anyway.
            return true;
        }

        var obj=form.view;
        if (obj == null || obj.selectedIndex < 0) {
            // No view? submit anyway.
            return true;
        }

        var option = obj.options[obj.selectedIndex];
        var value =option.value;

        if ( option.text == "Managed Portfolios" ) {
            launchRemote();
            return false; // Dont submit the form!
        }

        return true;
    }


//***********************************************

//     function passFormValues(){//kv 1-21-04
//     	f = document.portfolioFormBean;
//     	ff = document.quoteFormFake;
//
//     	//names of select lists, with corresponding names in fake form followed by _text
//     	var selectListArr = new Array("acct", "positions", "acctGroup", "view");
//
//     	var myName;
//     	for (var i = 0; i < selectListArr.length; ++i)
//     	{
//     		myName = selectListArr[i];
//     		ff[myName + "_text"].value = document.portfolioFormBean.elements[myName].options[document.portfolioFormBean.elements[myName].options.selectedIndex].text;
//     	}
//
//     }