﻿var scroller;

function MsSearch()
{
	window.open("http://search.microsoft.com/results.aspx?mkt=en-US&setlang=en-US&q=" + document.getElementById('tbSearchBox').value);
	return false;
}



function pageLoad() {
   
	//createCookie();

	//scroller = new McCannErickson.Controls.ScrollPanel();
	
	t.clock.reset();
	t.clock.update();

	t.QuestionaireManager.AddCloseButton($get('q_btn_close'));

// this counts the menu buttons and adds on-click handlers to each one

	for (c = 0; c < 100; ) {
	    ele = $get('A' + c);
	    if (ele != null) {
	        // alert("found it");
	        t.QuestionaireManager.AddButton(ele);
	       
	    }
	    else {
	       // break;
	    }
	    c++;
	}
	// this attaches the overlay launch to the elective side menu
	eleStack = $get('electiveStack');
	t.QuestionaireManager.AddButton(eleStack);
	
	//showMeAMenu(chosenSection);

	// this attaches the overlay lauch to a hidden object that we can trigger progromatically
	// like from body copy yet to be loaded into the page.
	
	t.QuestionaireManager.AddButton($get('hiddenLaunchTrigger'));
	
}

if (typeof t == "undefined") var t = {};
if (typeof t.winManager == "undefined") t.winManager = {};
if (typeof t.clock == "undefined") t.clock = {};

function Animation(name, element, startTime, endTime, animator)
{
	this.Name = name;
	this.VisualElement = element;
	this.StartTime = startTime;
	this.EndTime = endTime;
	this.Animator = animator;

	this.Animate = function(currentTime)
	{
		this.Animator.Animate(this.VisualElement, this.StartTime, this.EndTime, currentTime);
	}
}

function Fader(startOpacity, endOpacity)
{
	this.StartOpacity = startOpacity;
	this.EndOpacity = endOpacity;


	this.Animate = function(visualElement, startTime, endTime, currentTime)
	{
		var newOpacity
		if (this.StartOpacity == this.EndOpacity)
		{
			newOpacity = this.StartOpacity;
		}
		else
		{
			// calculate percent elapsed time
			var elapsedTimePercentage = (startTime - currentTime) / (startTime - endTime);

			// calculate new opacity
			newOpacity = ((this.EndOpacity - this.StartOpacity) * elapsedTimePercentage) + this.StartOpacity;
		}

		// set opacity
		visualElement.style.filter = 'alpha(opacity=' + newOpacity * 10 + ')';
		visualElement.style.opacity = newOpacity / 10;
	}
}

function Tweener(startPos, endPos)
{
	this.StartPos = startPos;
	this.EndPos = endPos;

	this.Animate = function(visualElement, startTime, endTime, currentTime)
	{
		var newPosX;

		if (this.EndPos == this.StartPos)
		{
			newPosX = this.StartPos;
		}
		else
		{
			// calculate percent elapsed time
			var elapsedTimePercentage = (startTime - currentTime) / (startTime - endTime);

			// calculate new x pos
			var newPosX = ((this.EndPos - this.StartPos) * elapsedTimePercentage) + this.StartPos;
		}

		// set new position
		visualElement.style.left = newPosX + 'px';
	}
}

t.clock = {
	totalTime: 16000,
	interval: 125,
	currTime: t.clock.totalTime,
	clockId: Number,
	start: function()
	{
		// start timer and create setInterval
		t.clock.clockId = setInterval("t.clock.timer()", t.clock.interval);
	},
	stop: function()
	{
		// stop timer and clear setInterval
		clearInterval(t.clock.clockId);
	},
	timer: function()
	{
		// subtract from current time and update clock display and marker position
		t.clock.set(t.clock.currTime - t.clock.interval);
		t.clock.update();
		t.winManager.update();
		t.winManager.EventType = EVENT_TIMER;
	},
	set: function(time)
	{
		// set the curr
		t.clock.currTime = time;
	},
	reset: function()
	{
		// reset the current time to the total time
		t.clock.set(t.clock.totalTime);
	},
	update: function()
	{
		// calculate minutes and seconds
		var ct = t.clock.currTime;

		if (ct <= 0)
		{
			// if the current time reaches 0 then stop the clock and set the display to 0:00
			t.clock.stop();
			t.clock.currTime = 0;
			return;
        }
	}
}
/*
* need to create an array of time that can be associated with the
* state manager to control when a modal window should show itself
*/
var EVENT_TIMER = 0;
var EVENT_DRAG_START = 1;
var EVENT_DRAG = 2;
var EVENT_DRAG_STOP = 3;


t.winManager = new Object()
t.winManager.Animations = new Array();
t.winManager.EventType = EVENT_TIMER;

t.winManager.AddAnimation = function(animation)
{
	t.winManager.Animations.push(animation);
}

t.winManager.update = function()
{
	var currTime = t.clock.currTime;

	var uBound = t.winManager.Animations.length;
	for (i = 0; i < uBound; i++)
	{
		var animation = t.winManager.Animations[i];
		var startTime = animation.StartTime;
		var endTime = animation.EndTime;
		if (startTime >= currTime && endTime <= currTime)
		{
			animation.Animate(currTime);
		}
	}
}

var OPERATION_LOAD_CS = 0;
var OPERATION_CLOSE_CS = 1;

t.QuestionaireManager = new Object()
t.QuestionaireManager.Button = null;
t.QuestionaireManager.OpenButton = null;
t.QuestionaireManager.CloseButton = null;
t.QuestionaireManager.Operation = null;
t.QuestionaireManager.Timer = 0;
t.QuestionaireManager.ElapsedTime = 0;
t.QuestionaireManager.Interval = 50;

t.QuestionaireManager.AddButton = function(buttonItem) {
    t.QuestionaireManager.OpenButton = buttonItem;
    
    var btn = buttonItem;
    $addHandler(btn, 'click', this.ManageButtonClick);

    btn.Animation1 = new Animation('dialog_exit', $get('hub_dialog_container'), 0, 500, new Tweener(0, -530));
    btn.Animation2 = new Animation('questionaire_entry', $get('questionaire_dialog'), 500, 1000, new Fader(0, 10));
}

t.QuestionaireManager.AddCloseButton = function(buttonItem)
{
	t.QuestionaireManager.CloseButton = buttonItem;
	$addHandler(buttonItem, 'click', this.ManageCloseButtonClick);
}

t.QuestionaireManager.ManageButtonClick = function(sender, e) {

    t.clock.stop();
    t.isDisplayingQuestionaire = true;
    t.winManager.update();
    $get('questionaire_dialog_container').style.display = "block";
    t.QuestionaireManager.ElapsedTime = 0;
    t.QuestionaireManager.Operation = OPERATION_LOAD_CS;
    t.QuestionaireManager.Button = t.QuestionaireManager.OpenButton;
    t.QuestionaireManager.CloseButton.Animation1 = new Animation('questionaire_exit', $get('questionaire_dialog'), 0, 500, new Fader(10, 0));
    t.QuestionaireManager.CloseButton.Animation2 = new Animation('dialog_entry', $get('hub_dialog_container'), 500, 1000, new Tweener(-530, 0));


    t.QuestionaireManager.Timer = setInterval("t.QuestionaireManager.OnTimer()", t.QuestionaireManager.Interval);

    
}

t.QuestionaireManager.ManageCloseButtonClick = function(e)
{
	t.QuestionaireManager.ElapsedTime = 0;
	t.QuestionaireManager.Operation = OPERATION_CLOSE_CS;
	t.QuestionaireManager.Button = this;
	t.QuestionaireManager.Timer = setInterval("t.QuestionaireManager.OnTimer()", t.QuestionaireManager.Interval);
}

t.QuestionaireManager.OnTimer = function()
{
	this.ElapsedTime += t.QuestionaireManager.Interval;
	if (this.ElapsedTime <= t.QuestionaireManager.Button.Animation1.EndTime)
	{
		t.QuestionaireManager.Button.Animation1.Animate(this.ElapsedTime);
	}
	else
	{
		t.QuestionaireManager.Button.Animation2.Animate(this.ElapsedTime);
	}

	if (this.ElapsedTime >= t.QuestionaireManager.CloseButton.Animation1.EndTime)
	{
		if (t.QuestionaireManager.Operation == OPERATION_CLOSE_CS)
		{
			$get('questionaire_dialog_container').style.display = 'none';
		//	$get('hub_copy').style.filter = 'alpha(opacity=100)';
		//	$get('hub_copy').style.opacity = 1;
		}
	}

	if (this.ElapsedTime >= t.QuestionaireManager.Button.Animation2.EndTime)
	{
		clearInterval(this.Timer);
		if (t.QuestionaireManager.Operation == OPERATION_CLOSE_CS)
		{
			t.isDisplayingCaseStudy = false;
			//$get('questionaire_dialog_container').style.left = "-1000px";
		}
	}
}


t.QuestionManager = new Object();
t.QuestionManager.Questions = new Array();
t.QuestionManager.CurrentQuestion = 0;
t.QuestionManager.Online = 0;
t.QuestionManager.OnPremise = 0;
t.QuestionManager.NotSure = 0;

t.QuestionManager.AddQuestion = function(question)
{
	t.QuestionManager.Questions.push(question);
}

t.QuestionManager.AddNavButton = function(buttonItem)
{
	var btn = buttonItem;
//	$addHandler(btn, 'click', this.ManageNavButtonClick);
	t.QuestionManager.NavButtons.push(btn);
}

t.QuestionManager.NextQuestion = function(e)
{
	if (isNaN(e) && e.target.id == "take_assessment_btn")
	{
		t.QuestionManager.DisplayQuestion(0);
	}
	else
	{
		t.QuestionManager.DisplayQuestion(e);
	}
}

t.QuestionManager.DisplayQuestion = function(questionNbr)
{
	t.QuestionManager.HideQuestions();
	t.QuestionManager.Questions[questionNbr].style.display = "block";
	var n = questionNbr + 1;
	$get('q' + n + '_btn').className = "selected";
}

t.QuestionManager.DisplayResults = function() {
    t.QuestionManager.HideQuestions();

    var result = t.QuestionManager.GetResult();
    if (result == "onpremise") {
        $get('recommend_onpremise').style.display = "block";
        $get('recommend_online').style.display = "none";
        $get('recommend_both').style.display = "none";
        $get('recommend_contact').style.display = "none";
    }

    if (result == "online") {
        $get('recommend_online').style.display = "block";
        $get('recommend_onpremise').style.display = "none";
        $get('recommend_both').style.display = "none";
        $get('recommend_contact').style.display = "none";
    }

    if (result == "both") {
        $get('recommend_both').style.display = "block";
        $get('recommend_onpremise').style.display = "none";
        $get('recommend_online').style.display = "none";
        $get('recommend_contact').style.display = "none";
    }

    if (result == "contact") {
        $get('recommend_contact').style.display = "block";
        $get('recommend_both').style.display = "none";
        $get('recommend_onpremise').style.display = "none";
        $get('recommend_online').style.display = "none";
    }

    $get('results').style.display = "block";

    var queryString = "";
    for (var i in t.AnswerManager.Answers) {
        queryString += i + "=" + t.AnswerManager.Answers[i] + "m";
    }

    queryString = queryString.substring(0, queryString.length - 1);

    $get('print_link').href = "Results.aspx?" + queryString;

    var mailto_embeddedlink = "http://www.microsoft.com/dynamics/crmresults/results.aspx?" + queryString.replace(/&/g, "&amp;");
    var mailto_body = "We%20based%20our%20recommendation%20on%20the%20way%20that%20you%20answered%205%20questions.%20Here%20are%20those%20questions,%20your%20answers,%20and%20a%20brief%20explanation%20about%20how%20these%20factors%20contributed%20to%20our%20recommendation.%0D%0AClick%20here%20for%20Assessment%20Tool%20Results:%0D" + mailto_embeddedlink;
    var mailto_link = "mailto:?subject=Assessment%20Tool%20Results&body=" + mailto_body;
    $get('email_link').href = mailto_link;
}

t.QuestionManager.GetResult = function()
{
	var op = 0;
	var ol = 0;
	var ns = 0;

	if (t.AnswerManager.Answers["q1"] == "y") { op++; }
	else if (t.AnswerManager.Answers["q1"] == "n") { ol++; }
	else { ns++; }

	if (t.AnswerManager.Answers["q2"] == "y") { op++; }
	else if (t.AnswerManager.Answers["q2"] == "n") { ol++; }
	else { ns++; }

	if (t.AnswerManager.Answers["q3"] == "y") { ol++; }
	else if (t.AnswerManager.Answers["q3"] == "n") { op++; }
	else { ns++; }

	if (t.AnswerManager.Answers["q4"] == "y") { op++; }
	else if (t.AnswerManager.Answers["q4"] == "n") { ol++; }
	else { ns++; }

	if (t.AnswerManager.Answers["q5"] == "y") { ol++; }
	else if (t.AnswerManager.Answers["q5"] == "n") { op++; }
	else { ns++; }

	if (op >= 3) { return "onpremise"; }
	if (ol >= 3) { return "online"; }
	if (op == 2 && ol == 2) { return "both"; }
	if (ns > 1) { return "contact"; }
}

t.QuestionManager.HideQuestions = function()
{
	for (var i = 0; i < t.QuestionManager.Questions.length; i++)
	{
		t.QuestionManager.Questions[i].style.display = "none";
	}
}


var COOKIE_NAME = "CRMHUB";


openSizedWindow = function(url, contentWidth, contentHeight) 
{
    var params = "";
    params += "width=" + contentWidth;
    params += ", height=" + contentHeight;
    params += ",location=1,menubar=1,resizable=1,status=1,toolbar=1,scrollbars=1";

    var newWindow = window.open(url, "CRMWindow", params, true);

    if (window.focus) {
        newWindow.focus();
    }
}


/* //////////////////////////////////////////////////////////////*/



function changecolor(id, color) {
    // alert(id, color);
    element = document.getElementById(id);
    // event.cancelBubble = true;
    // oldcolor = element.currentStyle.background;
    element.style.background = color;

}

function changeTitleAdd(num) {
    if (num == 0) {
        document.title = "Training and Certification Program";
    } else {
        document.title = "Training and Certification Program" + " | " + pathTitleArray[num];
    }
}

function showMeAHomeOther(passedOther) {

    /// first turn off the old stuff
    document.getElementById("rightMenu").style.display = "none";
    document.getElementById("electiveStack").style.display = "none";
    document.getElementById("theWordWorkshop").style.display = "none";

// sets section number to home 
    chosenSection = 0;

    /// collapse left menus

        document.getElementById("rightMenu").style.display = "none";
        document.getElementById("electiveStack").style.display = "none";
        document.getElementById("theWordWorkshop").style.display = "none";
        document.getElementById("rightSectionMain").style.display = ""; // show main right section
    
    // bring in the external other content

        var xOther = 'ajaxfiles/' + passedOther + '.htm';
        ajaxpage(xOther, 'mainContent');
        document.getElementById("mainContent").style.width = "600px";

        changeMainMenuIndi(chosenSection);
        changeTitleAdd(chosenSection);
}

var chosenSection = 0;
var chosenWorkshop=0;

function showMeAMenu(num) {
   //alert("yo");
    /// first turn off the old stuff
    document.getElementById("rightMenu").style.display = "none";
    document.getElementById("electiveStack").style.display = "none";
    document.getElementById("theWordWorkshop").style.display = "none";

    document.getElementById("electiveStack_Underlay_1").style.display = "none";
    document.getElementById("electiveStack_Underlay_2").style.display = "none";
    document.getElementById("electiveStack_Underlay_3").style.display = "none";
    document.getElementById("electiveStack_Underlay_4").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_5").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_6").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_7").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_8").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_9").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_10").style.display = "none"; 

    document.getElementById("rightSectionMain").style.display = ""; // show main right section

    chosenSection = num;
    
    /// collapse left if home screen
    if (chosenSection == 0) {

        document.getElementById("rightMenu").style.display = "none";
        document.getElementById("electiveStack").style.display = "none";
        document.getElementById("theWordWorkshop").style.display = "none";
         // bring in the external home content

        var xHome = 'ajaxfiles/pathHome.htm';
        ajaxpage(xHome, 'mainContent');
        document.getElementById("mainContent").style.width = "640px";
        
    } else {

        // turn on left content
//    document.getElementById("theWordWorkshop").style.display = "block";
//  document.getElementById("rightMenu").style.display = "block";
//    document.getElementById("electiveStack").style.display = "block";
//    document.getElementById("electiveStack_Underlay_" + chosenSection).style.display = "block";   
        // bring in the external menu and content

    var xContent = 'ajaxfiles/path' + num + '.htm';

        ajaxpage(xContent, 'mainContent');
        
       // var xMenuElectives = 'ajaxfiles/xMenu' + num + '.aspx';
       // ajaxpage(xMenuElectives, 'electiveStack');


        document.getElementById("mainContent").style.width = "640px";

        // get the overlay ready
        prepMeASection(chosenSection);
    }
    
    changeMainMenuIndi(num);
    changeTitleAdd(num);
}

function showRegistration(course, provider, loc, dates) {
   //alert("yo");
    /// first turn off the old stuff
    document.getElementById("rightMenu").style.display = "none";
    document.getElementById("electiveStack").style.display = "none";
    document.getElementById("theWordWorkshop").style.display = "none";

    document.getElementById("electiveStack_Underlay_1").style.display = "none";
    document.getElementById("electiveStack_Underlay_2").style.display = "none";
    document.getElementById("electiveStack_Underlay_3").style.display = "none";
    document.getElementById("electiveStack_Underlay_4").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_5").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_6").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_7").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_8").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_9").style.display = "none"; 
    document.getElementById("electiveStack_Underlay_10").style.display = "none"; 

    document.getElementById("rightSectionMain").style.display = ""; // show main right section

    var xContent = '/register_frame.aspx?c=' + course + '&p=' + provider + '&l=' + loc + '&d=' + dates;

        ajaxpage(xContent, 'mainContent');

        document.getElementById("mainContent").style.width = "640px";

        // get the overlay ready
        prepMeASection('10');
    
    changeMainMenuIndi('10');
    changeTitleAdd('10');
}

function prepMeASection(num) {
    var leftColOver = document.getElementById("leftColumn");
    var rightColOver = document.getElementById("rightColumn");

    rightColOver.style.width = "535px";
    rightColOver.style.left = "260px";
    leftColOver.style.display = "block";
    
    $get("pathTitleContent").innerHTML = pathTitleArray[num];
    $get("overlayTopTable").style.background = colorArray[0];

    var pathy = 'ajaxfiles/path' + num + '.htm';
    ajaxpage(pathy, 'rightColumn');

    document.getElementById("electiveStack_Overlay_1").style.display = "none";
    document.getElementById("electiveStack_Overlay_2").style.display = "none";
    document.getElementById("electiveStack_Overlay_3").style.display = "none";
    document.getElementById("electiveStack_Overlay_4").style.display = "none"; 
    document.getElementById("electiveStack_Overlay_5").style.display = "none"; 
    document.getElementById("electiveStack_Overlay_6").style.display = "none"; 
    document.getElementById("electiveStack_Overlay_7").style.display = "none"; 
    document.getElementById("electiveStack_Overlay_8").style.display = "none"; 
    document.getElementById("electiveStack_Overlay_9").style.display = "none"; 
    document.getElementById("electiveStack_Overlay_10").style.display = "none"; 
    document.getElementById("electiveStack_Overlay_" + chosenSection).style.display = "block";
}

function prepMeAHomeOverlay(num) {

    var leftColOver = document.getElementById("leftColumn");
    var rightColOver = document.getElementById("rightColumn");

    rightColOver.style.width = "700px";
    rightColOver.style.left = "20px";
    leftColOver.style.display = "none";

    $get("pathTitleContent").innerHTML = pathTitleArray[num];
    $get("overlayTopTable").style.background = colorArray[0];

    var pathy = 'ajaxfiles/elective' + num + '.htm';
    ajaxpage(pathy, 'rightColumn');



}

function chooseWorkshop(num) {
    chosenWorkshop = num;
    changeIndi(chosenWorkshop);
}

function turnOnAWorkshop(num) {

    var pathy = 'ajaxfiles/workshop' + num + '.htm';
    ajaxpage(pathy, 'rightColumn');

    evalHeight(chosenSection, num);
}


function turnOnAnElective(num) {
    numString = "" + num;
    var temp = new Array();
    temp = numString.split('');

    path = temp[0];
    link = temp[1];
    sub = temp[2];

    //  alert("path: " + path + " " + " link: " + link + " " + " sub: " + sub);

    if (link > 5) {
        var pathy = 'ajaxfiles/elective' + link + '.htm';
        ajaxpage(pathy, 'rightColumn');

    } else {
        //nothing
    }

    if
         (link == 5) {
        //  alert("equal" + link);
        var pathy = 'ajaxfiles/elective' + path + "_" + link + "_" + sub + '.htm';
        ajaxpage(pathy, 'rightColumn');

    } else {
        //nothing
    }

    evalHeight(path, link, sub);

}

function evalHeight(path, link, sub, thisValue) {

   // alert("path: " + path + " " + " link: " + link);
    var qd = $get("questionaire_dialog");
    qd.style.height = 100;


    if
         (link == 5) {
        // alert(link);
        theHeight = eval("heightArray" + path + "path" + link + "link[" + sub + "]");
        //    alert(theHeight);
        qd.style.height = theHeight;

    } else {

        theHeight = eval("heightArray" + path + "path[" + link + "]");
        // alert(theHeight);
        qd.style.height = theHeight;
    }


}

function changeIndi(num) {
    // alert(num);

    // first lets turn all buttons back on and restore their roll over functions

    $get("subButton0").src = 'pvpImages/workShopButton_00.jpg';
    $get("subButton0").onmouseover = function() { javascript: this.src = 'pvpImages/workShopButton_over_00.jpg' };
    $get("subButton0").onmouseout = function() { javascript: this.src = 'pvpImages/workShopButton_00.jpg' };
    $get("subButton1").src = 'pvpImages/workShopButton_01.jpg';
    $get("subButton1").onmouseover = function() { javascript: this.src = 'pvpImages/workShopButton_over_01.jpg' };
    $get("subButton1").onmouseout = function() { javascript: this.src = 'pvpImages/workShopButton_01.jpg' };
    $get("subButton2").src = 'pvpImages/workShopButton_02.jpg';
    $get("subButton2").onmouseover = function() { javascript: this.src = 'pvpImages/workShopButton_over_02.jpg' };
    $get("subButton2").onmouseout = function() { javascript: this.src = 'pvpImages/workShopButton_02.jpg' };
    $get("subButton3").src = 'pvpImages/workShopButton_03.jpg';
    $get("subButton3").onmouseover = function() { javascript: this.src = 'pvpImages/workShopButton_over_03.jpg' };
    $get("subButton3").onmouseout = function() { javascript: this.src = 'pvpImages/workShopButton_03.jpg' };
    $get("subButton4").src = 'pvpImages/workShopButton_04.jpg';
    $get("subButton4").onmouseover = function() { javascript: this.src = 'pvpImages/workShopButton_over_04.jpg' };
    $get("subButton4").onmouseout = function() { javascript: this.src = 'pvpImages/workShopButton_04.jpg' };

    

    // ok now we turn all the elective submenus off using the names "e1-e10"


    for (c = 0; c < 500; ) {
        ele = $get('ov' + c);
        if (ele != null) {
            // alert("found it");
            //ele.style.background = "";
            ele.className = "style2";
        }
        else {
            // no errors if not found

        }
        c++;

    }



    // now set indicator and roll functions for passed button number
    // first is it a menu or a sub menu???

    if (num < 5) {

        // if under five then it's a workshop button

        $get("subButton" + num).src = 'pvpImages/workShopButton_over_0' + num + '.jpg';
        $get("subButton" + num).onmouseover = function() { javascript: this.src = 'pvpImages/workShopButton_over_0' + num + '.jpg' };
        $get("subButton" + num).onmouseout = function() { javascript: this.src = 'pvpImages/workShopButton_over_0' + num + '.jpg' };

        turnOnAWorkshop(num);
    }
    else {
        // its a elective submenu

       var ele2 = $get("ov" + num);
       ele2.className = "style1";
        turnOnAnElective(num);
    }
   
     
}





function changeMainMenuIndi(num) {
    // alert(num);

    // first lets turn all buttons back on and restore their roll over functions


    // home looks weird with indicator state, reutun it to normal


}

function toggle(showHideDiv, number) {
    var ele = document.getElementById(showHideDiv);
    var togImg = document.getElementById("plus" + number + "Minus");
   
    if (ele.style.display == "block") {
        ele.style.display = "none";
        // text.innerHTML = "restore";
      //  alert(togImg.src);
        togImg.src = "pvpImages/plus.gif";
        
    }
    else {
        ele.style.display = "block";
       // text.innerHTML = "collapse";

        togImg.src = "pvpImages/minus.gif";
    }
}


function clickOverlayLaunchButton(passedNum) {

   
// if we are at home an no section is chosen
    if (chosenSection == 0) {

        prepMeAHomeOverlay(passedNum);
        evalHeight(1, 1, 1, 1500);
    
    }

    else {

        prepMeASection(chosenSection);
       // numJoin = chosenSection + "" + passedNum + "";
       // alert(numJoin);
        chooseWorkshop(passedNum);
    }

    var overlayForAll = document.getElementById('hiddenLaunchTrigger');
    overlayForAll.click();
    //alert("clicked");
} 

function email() {
   // alert("clicked");
    var varTo = "Cathleen@unitedtraining.com"; 
var subject = "Microsoft Dynamics Training and Certification Program Registration";

var body = "Thank you for your interest in the Microsoft Dynamics Training and Certification Program. Please provide the following information and a representative from United Training will contact you soon: "


body = body + "%0a%0a" + "Full name: ";
body = body + "%0a" + "Title: ";
body = body + "%0a" + "Organization: ";
body = body + "%0a" + "Organization address (city, state, zip): ";
body = body + "%0a" + "Phone number: ";
body = body + "%0a" + "E-mail address: ";
body = body + "%0a" + "Which specialization area are you most interested in?";


if (subject != "" && varTo != "")
{
window.location = "MAILTO:" + varTo +"?subject=" + subject + "&body=" + body;

return true;
}
else
{
alert("You must select someone to send the message to and a subject!")
}

}
