/*
 MODULE: wwwRedirect.js
 AUTHOR: Dower Chin
 DATE:   04/28
 DESCRIPTION: 
	 Tests for a condition of the user comes to the site without the
	 www prefix. If so, a redirect is made to force a www.

*/

function checkWWWPrefix()
{
	var fURL = document.URL;
	var prtcl = document.location.protocol;
	var isBadURL = fURL.indexOf("www.mvp");
	var tBase = fURL.substring(fURL.indexOf("//")+2,fURL.length);
	var curBase = tBase.substring(0,tBase.indexOf("/"));

	/* We only want to check in PROD, no other place */
	if (curBase.indexOf("mvpselectcare") >= 0)
	{
		if (isBadURL < 0)
		{
			this.location.replace(prtcl + "//www." + tBase);
		}
	}
}
