function formatDate(whichDate){
	showDate = new String()
	thisDate = new Date(whichDate)
	thisMonth = thisDate.getMonth()
	thisMonth += 1
	thisDay = thisDate.getDate()
	thisYear = thisDate.getYear()

	switch(thisMonth){
		case 1:
			showDate = "January ";
			break;
		case 2:
			showDate = "February ";
			break;
		case 3:
			showDate = "March ";
			break;
		case 4:
			showDate = "April ";
			break;
		case 5:
			showDate = "May ";
			break;
		case 6:
			showDate = "June ";
			break;
		case 7:
			showDate = "July ";
			break;
		case 8:
			showDate = "August ";
			break;
		case 9:
			showDate = "September ";
			break;
		case 10:
			showDate = "October ";
			break;
		case 11:
			showDate = "November ";
			break;
		case 12:
			showDate = "December ";
			break;
		}
		
		
		showDate = showDate + thisDay + ", " + thisYear
		
		return showDate
		
	}

////////////////////////////////////////////////////////
// User login functionality
///////////////////////////////////////////////////////
	function submitMALogin(){
            //document.forms[0].action = "http://arhp.ninja.bwdcorp.com/form.asp"
            document.forms[0].__VIEWSTATE.name = 'NOVIEWSTATE';
            //document.forms[0].action = document.forms[0].postUrl.options[document.forms[0].postUrl.selectedIndex].value
            selectedLogin = document.forms[0].postUrl.options[document.forms[0].postUrl.selectedIndex].value
            
            switch (selectedLogin){
                case "2":  //classic CD Quick
                    //set action
                    document.loginForm.action = "http://ecatalog.medassets.com/membersonly/GroupBuy.asp";
                    
                    //set username/password fields
                    document.loginForm.user.name = "username2"
                    document.loginForm.password.name = "password2"
                    document.loginForm.user.value = document.forms[0].uname.value
                    document.loginForm.password.value = document.forms[0].pword.value
                    
                    //set any other hidden fields that this form needs
                    
                    //submit form
                    document.loginForm.submit()
                    
                    
                    break;
                case "3":   //Avega
                    //set action
                    document.loginForm.action = "http://www.avega.com/names.nsf?Login";
                    
                    //set username/password fields
                    document.loginForm.user.name = "Username"
                    document.loginForm.password.name = "Password"
                    document.loginForm.user.value = document.forms[0].uname.value
                    document.loginForm.password.value = document.forms[0].pword.value
                    
                    //set any other hidden fields that this form needs
                    document.loginForm.holder.value = '/web/clientsonly.nsf';
                    document.loginForm.holder.name = 'RedirectTo';
                    
                    //submit form
                    document.loginForm.submit()
                
                    break;
                case "4":   //mdx
                    //set action
                    document.loginForm.action = "https://www.md-x.com/login.aspx";
                    
                    //set username/password fields
                    document.loginForm.user.name = "loginId"
                    document.loginForm.password.name = "password"
                    document.loginForm.user.value = document.forms[0].uname.value
                    document.loginForm.password.value = document.forms[0].pword.value
                    
                    //set any other hidden fields that this form needs
                    document.loginForm.holder.value = 'dDwtNDQ5Nzk0MDc0OztsPEltYWdlMTs+Pu1IZEn4oJzrvTNf9BwZbPg2/Hom';
                    document.loginForm.holder.name = '__VIEWSTATE';
                    document.loginForm.holder2.value = '28';
                    document.loginForm.holder2.name = 'Image1.x';
                    document.loginForm.holder3.value = '18';
                    document.loginForm.holder3.name = 'Image1.y';
                    
                    //submit form
                    document.loginForm.submit()
                    
                    
                  
                    break;
                case "5": //revenue solutions

                    //set action
                    document.loginForm.action = "https://prod1.medassets-nrs.com/OSIMIsc/login.aspx";
                    
                    //set username/password fields
                    document.loginForm.user.name = "OSIUSER"
                    document.loginForm.password.name = "OSIUSER2"
                    document.loginForm.user.value = document.forms[0].uname.value
                    document.loginForm.password.value = document.forms[0].pword.value
                    
                    //set any other hidden fields that this form needs
                    document.loginForm.holder.value = '/OSI_Start/Default.aspx';
                    document.loginForm.holder.name = 'OSIAPP';
                    
                    //submit form
                    document.loginForm.submit()
                    
                    break;
                case "6":
                    document.forms[0].action = "http://ecatalog.medassets.com/cdquick/cdqframe.asp";
                    document.forms[0].uname.name = "username"
                    document.forms[0].pword.name = "password"
                    break;
                case "7": //new cd quick
                
                     document.loginForm.action = "http://ea.medassets.com/Security/login.aspx?appID=7&redirect=http%3a%2f%2fecatalog2.medassets.com%2fcdquick%2fdefault.aspx";
                  //document.loginForm.action = "http://arhp.ninja.bwdcorp.com/form.asp"
                    
                    document.loginForm.user.name = "_ctl0:txtUserName"
                    document.loginForm.password.name = "_ctl0:txtPassword"
                    document.loginForm.user.value = document.forms[0].uname.value
                    document.loginForm.password.value = document.forms[0].pword.value
                     
                    //custom hidden fields
                    document.loginForm.holder.value = '/wEPDwULLTE1MTQ0ODQ4NDIPZBYCAgEPZBYCAgEPZBYCZg9kFgICAQ8PFgIeB1Zpc2libGVoZGRk/BE/dnqF3329Q3NPRwd0Um22cAw=';
                    document.loginForm.holder.name = '__VIEWSTATE';
                    
                    document.loginForm.holder2.value = '/wEWBAKa+922CwLN+dawCwKFr86bDALY7/vbClGuzJAioTyYybbJ5arew3QupsK+';
                    document.loginForm.holder2.name = '__EVENTVALIDATION';
                    
                    document.loginForm.holder3.value = 'Login';
                    document.loginForm.holder3.name = '_ctl0:btnLogin';
                    document.loginForm.submit()
                             
                    
                    break;
            }
            
            //document.forms[0].submit();
        }