// ------------------------------------------
// DEBUG ENV
var debug = false;

if (debug) alert('loading: milliman.js');


// ------------------------------------------
// ENVIRONMENT VARIABLES
var servername;
var sec_servername;

 if (location.hostname == "cms.milliman.com") {
        servername     = "cms.milliman.com/cms/renderfile/milliman.com";
        sec_servername = "dev.secure.milliman.com";
        }
 else if (location.hostname.substring(0,3) == "dev2" || location.hostname == "10.46.2.87") {
        servername     = "dev2.milliman.com";
        sec_servername = "dev.secure.milliman.com";
        //alert('dev2');
        }
 else if (location.hostname.substring(0,3) == "dev" || location.hostname == "10.46.2.53") {
        servername     = "dev.milliman.com";
        sec_servername = "dev.secure.milliman.com";
        }
 else if (location.hostname.substring(0,2) == "qa" || location.hostname == "10.46.2.81") {
        servername     = "qa.milliman.com";
        sec_servername = "qa.secure.milliman.com";
        }
else if (location.hostname.substring(0,3) == "web") {
        servername     = "qa.milliman.com";
        sec_servername = "secure.milliman.com";
        }
 else {
        servername     = "www.milliman.com";
        sec_servername = "secure.milliman.com";
        }


// ------------------------------------------
/* BROWSER DETECTION */
var browser		= navigator.appName;
var browserVersion	= navigator.appVersion;
var version		= parseFloat(browserVersion);

if (navigator.userAgent.indexOf('MSIE') !=-1) {
	IEBrowser = true;
} else {
	IEBrowser = false;
}


// ------------------------------------------
// INCLUDES

// IE 6 has an issue with the jquery libraries so check it here.
if (IEBrowser && ( browserVersion.indexOf('MSIE 6.0') > 0 || browserVersion.indexOf('MSIE 7.0') > 0 )  ) {
   // include the jquery library 1.3.2
   include('http://'+servername+'/includes/js/jquery/jquery-1.3.2.js');
   include('http://'+servername+'/includes/js/jquery/jquery.cookie.js');

} else {
   // include the jquery library 1.4.1
   // include('http://'+servername+'/includes/js/jquery/jquery-1.4.1.js');
   // include('http://'+servername+'/includes/js/jquery/jquery-1.6.2.min.js');
   include('http://'+servername+'/includes/js/jquery/jquery-1.6.3.min.js');
   include('http://'+servername+'/includes/js/jquery/jquery.cookie.js');
   
   // include jquery fancy box extension for image galleries.
   include('http://'+servername+'/includes/js/fancybox/jquery.mousewheel-3.0.2.pack.js');
   include('http://'+servername+'/includes/js/fancybox/jquery.fancybox-1.3.0.pack.js');
   }

// include the share links libraries
include('http://'+servername+'/includes/js/share.js');

// include milliman js libraries
include('http://'+servername+'/includes/js/milliman/milliman.homebanners.js');
include('http://'+servername+'/includes/js/milliman/milliman.utilities.js');
include('http://'+servername+'/includes/js/milliman/milliman.fx.js');
include('http://'+servername+'/includes/js/milliman/milliman.multimedia.js');
include('http://'+servername+'/includes/js/milliman/milliman.country_drop.js');
include('http://'+servername+'/includes/js/milliman/milliman.search.js');

//if (location.hostname == "www.milliman.com" || location.hostname == "dev.milliman.com" || //location.hostname == "qa.milliman.com") {
//   include('http://'+servername+'/includes/js/milliman/milliman.survey.js');
//   }

// Load flowplayer js libraries
include('http://'+servername+'/includes/js/flowplayer/flowplayer-3.2.6.min.js');
include('http://'+servername+'/includes/js/flowplayer/flowplayer.ipad-3.2.2.min.js');


// -----------------------------------------------------------
// Generic include loader
function include(filename)
{
   document.write('<script type="text/javascript" src="'+ filename + '"></scr' + 'ipt>');
}

