﻿function PageLoad()
{
	//set log in link
	var extranetLink = document.getElementById("extranetLink");
	var currentUrl = window.location;
	if(currentUrl.href.indexOf("http://localhost") == 0)
	{
		extranetLink.href = "http://localhost/extranet";
	}
	else if(currentUrl.href.indexOf("http://dev.cygmafinancial.com") == 0)
	{
		extranetLink.href = "https://extranetdev.cygmafinancial.com";
	}
	else if(currentUrl.href.indexOf("http://int.cygmafinancial.com") == 0)
	{
		extranetLink.href = "https://extranetint.cygmafinancial.com";
	}
	else if(currentUrl.href.indexOf("http://modoff.cygmafinancial.com") == 0)
	{
		extranetLink.href = "https://extranetmodoff.cygmafinancial.com";
	}
	else
	{
		//Google Analytics - prod only!
		var pageTracker = _gat._getTracker("UA-2255350-10");
		pageTracker._initData();
		pageTracker._trackPageview();
	}
	
	//preload images
	about_off = new Image();
	about_off.src = "images/about_cygma_h1.jpg";
	about_on = new Image();
	about_on.src = "images/about_cygma_h2.jpg";
	contact_off = new Image();
	contact_off.src = "images/contact_us_h1.jpg";
	contact_on = new Image();
	contact_on.src = "images/contact_us_h2.jpg";
	login_off = new Image();
	login_off.src = "images/log_in_h1.jpg";
	login_on = new Image();
	login_on.src = "images/log_in_h2.jpg";
	services_off = new Image();
	services_off.src = "images/services_h1.jpg";
	services_on = new Image();
	services_on.src = "images/services_h2.jpg";
	
}

function SwapImage(imageID, imageName)
{
	document.images[imageID].src = eval(imageName + ".src");
}