// ------------------------------------------
// DEBUG ENV
var debug = false;

if (debug) alert('loading: milliman.js');


// ------------------------------------------
// ENVIRONMENT VARIABLES
var servername;
var ads_servername;
var sec_servername;

if (location.hostname.substring(0,3) == "dev" || location.hostname == "10.46.2.53") {
        servername     = location.hostname;
        ads_servername = "dev.ads.milliman.com";
        sec_servername = "dev.secure.milliman.com";
        //alert('See: /includes/js/milliman/milliman.js line:20');
        // IPAG
        servername = servername + "/Milliman"
        }
 else if (location.hostname.substring(0,2) == "qa" || location.hostname == "10.46.2.81") {
        servername     = location.hostname;
        ads_servername = "ads.milliman.com";
        sec_servername = "qa.secure.milliman.com";
        //alert("qa");
        }
else if (location.hostname.substring(0,3) == "web") {
        servername     = location.hostname;
        ads_servername = "ads.milliman.com";
        sec_servername = "secure.milliman.com";
        //alert('dev2');
        
        }
 else {
        servername     = location.hostname;
        ads_servername = "ads.milliman.com";
        sec_servername = "secure.milliman.com";
        //alert('prod');
        }


// ------------------------------------------
/* 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

// include the jquery library
// 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');
} else {
   // include the jquery library 1.4.1
   include('http://'+servername+'/includes/js/jquery/jquery-1.4.1.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 ad server libraries
include('http://ads.milliman.com/adx.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.ads.js');
include('http://'+servername+'/includes/js/milliman/milliman.search.js');


// -----------------------------------------------------------
// Generic include loader
function include(filename)
{
   document.write('<script type="text/javascript" src="'+ filename + '"></scr' + 'ipt>');
}

