//Clicktags for mailto tags
function callClickActionTag(TagSource)
{
var imgObject = new Image();
imgObject.src = TagSource;
}


// global var for mouseover/mouseout
var selectedTab
/*var selectedTab = "1";*/
function preloadImages() {
	if (document.images) {
		for (var i = 0; i < preloadImages.arguments.length; i++) {
			(new Image()).src = preloadImages.arguments[i];
		}
	}
}



function roll(img_name, img_src, selectedTabParam)
   {
	   if(selectedTab == selectedTabParam){
	   }
	   else if(selectedTab != selectedTabParam){
		    document[img_name].src = img_src;
	   }
   }

function setOtherMenuImgs(img_name, img_src, img_name2, img_src2)
   {
    document[img_name].src = img_src;
	document[img_name2].src = img_src2;
   }

function openDemoWin(url) {
  	window.open(url,"Demo", 'width=710, height=510, top=10, left=10, scrollbars=no, resizable=no');
}

/* DHTML FUNCTIONS */
var isNav4, isIE4, isNav6 = false;
var range = "";
var styleObj = "";

if (navigator.appVersion.charAt(0) >= 4) {
	if (navigator.appName == "Netscape") {
		if (navigator.appVersion.charAt(0) >= 5) {
			isNav6 = true;
		}
		else {
			isNav4 = true;
		}
	}
	else {
		isIE4 = true;
		range = "all.";
		styleObj = ".style";
	}
}

function getObject(obj) {
	var theObj;
	if (typeof obj == "string") {
		if (isNav6) {
			theObj = document.getElementById(obj);
			if (theObj != null) theObj = theObj.style;
		}
		else {
			theObj = eval("document." + range + obj);
			if (theObj != null) theObj = eval("theObj" + styleObj);
		}
	}
	else {
		theObj = obj;
	}
	return theObj;
}

function show() {
	var theObj;
	for (var i = 0; i < show.arguments.length; i++) {
		theObj = getObject(show.arguments[i]);
		if (theObj != null) {
			theObj.display = "block";
			theObj.visibility = "visible";
		}
	}
}

function hide() {
	var theObj;
	for (var i = 0; i < hide.arguments.length; i++) {
		theObj = getObject(hide.arguments[i]);
		if (theObj != null) {
			theObj.display = "none";
			theObj.visibility = "hidden";
		}
	}
}


function menuActive () {
	var theObj;
	for (var i = 0; i < menuActive.arguments.length; i++) {
		theObj = getObject(menuActive.arguments[i]);
		if (theObj != null) {
			theObj.color = "#5CA761";
			theObj.fontWeight = "bold";
		}
	}
}

function menuInActive () {
	var theObj;
	for (var i = 0; i < menuInActive.arguments.length; i++) {
		theObj = getObject(menuInActive.arguments[i]);
		if (theObj != null) {
			theObj.color = "#333333";
			theObj.fontWeight = "normal";
		}
	}
}

function menuChange01(){
	document.getElementById("menu01").className = "navTabsOn";document.getElementById("menu02").className = "navTabs";document.getElementById("menu03").className = "navTabs";
}
function menuChange02(){
	document.getElementById("menu01").className = "navTabs";document.getElementById("menu02").className = "navTabsOn";document.getElementById("menu03").className = "navTabs";
}
function menuChange03(){
	document.getElementById("menu01").className = "navTabs";document.getElementById("menu02").className = "navTabs";document.getElementById("menu03").className = "navTabsOn";
}



function menuActivate(menuBox){
	var menuCount = 3;
	for (var i = 1; i <= menuCount; i++)
	{
		var menuID = "0" + i;
		var menuName = "menu" + menuID;
		if (menuBox == menuID)
		{
			menuActive(menuName);
		}
		else
		{
			menuInActive(menuName);
		}
	}
}

function boxActivate(offerBox) {
	var offerCount = 3;
	for (var i = 1; i <= offerCount; i++)
	{
		var boxID = "0" + i;
		var boxName = "box" + boxID;
		if (offerBox == boxID)
		{
			show(boxName);
			
		}
		else
		{
			hide(boxName);
			
		}
	}
}


/* BUY COPIES TABS */
function tabActive() {
	var theObj;
	for (var i = 0; i < tabActive.arguments.length; i++) {
		theObj = getObject(tabActive.arguments[i]);
		if (theObj != null) {
			theObj.color = "#000000";
			theObj.top = -28+"px";
			theObj.backgroundImage = 'url(/library/media/1033/midsizebusiness/images/windowsvista/buy_tab_on.gif)';
		}
	}
}

function tabInActive() {
	var theObj;
	for (var i = 0; i < tabInActive.arguments.length; i++) {
		theObj = getObject(tabInActive.arguments[i]);
		if (theObj != null) {
			theObj.color = "#FFFFFF";
			theObj.top = -29+"px";
			theObj.backgroundImage = 'url(/library/media/1033/midsizebusiness/images/windowsvista/buy_tab.gif)';
		}
	}
}

function tabStatus(tabBox){
	var tabCount = 5; // was 3
	for (var i = 1; i <= tabCount; i++)
	{
		var tabID = i;
		var tabName = "cTabs" + tabID;
		if (tabBox == tabName)
		{
			tabActive(tabName);
		}
		else
		{
			tabInActive(tabName);
		}
	}
}

function boxStatus(tabBox) {
	var tabCount = 5; // was 3
	for (var i = 1; i <= tabCount; i++)
	{
		var tabboxID = i;
		var tabboxName = "cContent" + tabboxID;
		if (tabBox == tabboxName)
		{
			show(tabboxName);			
		}
		else
		{
			hide(tabboxName);			
		}
	}
}
/* END BUY COPIES TABS */


var TrackTag = "http://switch.atdmt.com/action/";	
function GetActionTag(URL){ 
  document.action_tag.src = TrackTag + URL;
}


function openDemo(url) {
  	window.open(url,"Demo", 'width=948, height=531, top=10, left=10, scrollbars=no, resizable=no');
}

function init() {
	preloadImages('/library/media/1033/midsizebusiness/images/windowsvista/btn_nav_01_on.gif','/library/media/1033/midsizebusiness/images/windowsvista/btn_nav_02_on.gif','images/btn_nav_03_on.gif');
}

window.onload = init;

