/**********************************************************
*                                                         *
* Function    :    openwindow()                           *
*                                                         *
* Description :    This method creates a new window		  *	
*				   using the arguments passed, link		  *	
*				   location, window name, width and       *
*				   height of window	 `					  *
*                  										  *
* Trigger     :   				                          *
*                                                         *
**********************************************************/
function openwindow(strfilename, strwinname, intwidth, intheight)
{
	window.open(strfilename,strwinname,"toolbar=no,location=no,resizable=1,directories=no,menubar=yes,scrollbars=yes,width="+intwidth+",height="+intheight);
}  

/**********************************************************
*                                                         *
* Function    :    Email()                                *
*                                                         *
* Description :    This method calls openWindow function  *
*				   when user confirms they wish to        *
*				   continue						          *
*                  										  *
* Trigger     :   				                          *
*                                                         *
**********************************************************/
function Email(type) 
{
    var msg = "You are about to send information to the Internet zone.";

        msg += "  It might be possible for other people to see what ";
        msg += "you are sending.  To protect your privacy you may wish ";
        msg += "to contact us by telephone at 1-888-799-2474 [TDD ";
        msg += "1-800-557-7395].  Do you wish to continue?";

    if (confirm(msg))
    {
        if (type == "contact")
            openwindow('https://loanconsolidation.ed.gov/AppEntry/email/contactus.jsp', 'ContactUs', 640, 500); 
        else
            openwindow('https://loanconsolidation.ed.gov/AppEntry/email/webmaster.jsp', 'WebMaster', 640, 500); 
    }
}

/**********************************************************
*                                                         *
* Function    :    newImage()                             *
*                                                         *
* Description :    This function loads the new image 	  *	
*				   and returns it				          *
*                  										  *
* Trigger     :    preloadImages()                        *
*                                                         *
**********************************************************/
function newImage(arg) 
{
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

/**********************************************************
*                                                         *
* Function    :    changeImages()                         *
*                                                         *
* Description :    Passed pairs of arguments - image	  * 
*				   name and image source, for each pair   *
*				   this function assigns the source to    *
*				   the image passed				          *
*                  										  *
* Trigger     :    onMouseOver(); onMouseOut()            *
*                                                         *
**********************************************************/
function changeImages() 
{
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

/**********************************************************
*                                                         *
* Function    :    preloadImages()                        *
*                                                         *
* Description :    This function loads the new image 	  *	
*				   and returns it				          *
*                  										  *
* Trigger     :    onLoad()                               *
*                                                         *
**********************************************************/
// Initializes variable to false - variable indicates whether the mouse over images have been preloaded
var preloadFlag = false;

function preloadImages() 
{
	if (document.images) {
		bborrower_bschool_over = newImage("http://loanconsolidation.ed.gov/images/bborrower-bschool_over.gif");
		bschool_over = newImage("http://loanconsolidation.ed.gov/images/bschool-over.gif");
		bloanholder_over = newImage("http://loanconsolidation.ed.gov/images/bloanholder-over.gif");
		preloadFlag = true;
	}
}

/**********************************************************
*                                                         *
* Function    :    customDateString()                     *
*                                                         *
* Description :    This function determines and displays  *	
*				   the current date 			          *
*                  										  *
* Trigger     :    			                              *
*                                                         *
**********************************************************/
monthNames = new Array(12);
monthNames[1]  = "January"
monthNames[2]  = "February"
monthNames[3]  = "March"
monthNames[4]  = "April"
monthNames[5]  = "May"
monthNames[6]  = "June"
monthNames[7]  = "July"
monthNames[8]  = "August"
monthNames[9]  = "September"
monthNames[10]  = "October"
monthNames[11]  = "November"
monthNames[12]  = "December"

dayNames = new Array(7);
dayNames[1] = "Sunday"
dayNames[2] = "Monday"
dayNames[3] = "Tuesday"
dayNames[4] = "Wednesday"
dayNames[5] = "Thursday"
dayNames[6] = "Friday"
dayNames[7] = "Saturday"

function customDateString(oneDate)
{
    theDay = dayNames[oneDate.getDay() + 1];
    theMonth = monthNames[oneDate.getMonth() + 1];
    theYear = oneDate.getFullYear();
    return theDay + " " + theMonth + " " + oneDate.getDate() + ", " + theYear ;
}




