/* Version: 11.0.6554 */
/*
	Copyright (c) Microsoft Corporation.  All rights reserved.
*/


function ExpandDiv(theDivName)
{
	InitializeGlobalData();

	if (null == theDivName || typeof(theDivName) == "undefined") return; var theDiv = allDivsInPage[theDivName]; if (null == theDiv || typeof(theDiv) == "undefined") return;
	theDiv.style.display = "block";

	var thePic = allImagesInPage[theDivName + "_img"];
	if (null != thePic && typeof(thePic) != "undefined")
		{
		thePic.src = "/java/bluedrop.gif";
		thePic.alt = strHide;
		}
}

function CollapseDiv(theDivName)
{
	InitializeGlobalData();

	if (null == theDivName || typeof(theDivName) == "undefined") return; var theDiv = allDivsInPage[theDivName]; if (null == theDiv || typeof(theDiv) == "undefined") return;
	theDiv.style.display = "none";

	var thePic = allImagesInPage[theDivName + "_img"];
	if (null != thePic && typeof(thePic) != "undefined")
		{
		thePic.src = "/java/blueup.gif";
		thePic.alt = strShow;
		}
}

function ToggleDiv(theDivName)
{
	InitializeGlobalData();

	if (null == theDivName || typeof(theDivName) == "undefined") return; var theDiv = allDivsInPage[theDivName]; if (null == theDiv || typeof(theDiv) == "undefined") return;

	if (theDiv.style.display.toUpperCase() != "BLOCK")
		ExpandDiv(theDivName);
	else
		CollapseDiv(theDivName);
}

function AlterAllDivs(displayStyle)
{
	InitializeGlobalData();

	if (null == allDivsInPage || typeof(allDivsInPage) == "undefined")
		return;

	if (typeof(allDivsInPage["divShowAll"]) != "undefined" &&
		typeof(allDivsInPage["divHideAll"]) != "undefined")
		{
		if (displayStyle == "block")
			{
			allDivsInPage["divShowAll"].style.display = "none";
			allDivsInPage["divHideAll"].style.display = "block";
			}
		else
			{
			allDivsInPage["divShowAll"].style.display = "block";
			allDivsInPage["divHideAll"].style.display = "none";
			}
		}

	AlterAllDivsSpans(document.body.getElementsByTagName("DIV"), displayStyle);
	AlterAllDivsSpans(document.body.getElementsByTagName("SPAN"), displayStyle);
}

function AlterAllDivsSpans(allDivsSpans, displayStyle)
{
	if (typeof(allDivsSpans) == "undefined" ||
		null == allDivsSpans)
		return;

	for (i=0; i < allDivsSpans.length; i++)
		if (typeof(allDivsSpans[i]) != "undefined" &&
			null != allDivsSpans[i] &&
			typeof(allDivsSpans[i].id) != "undefined" &&
			null != allDivsSpans[i].id &&
			allDivsSpans[i].id.length > 0)
			{
			if (0 == allDivsSpans[i].id.indexOf("divExpCollAsst_")) 
				{
				var thePic = allImagesInPage[allDivsSpans[i].id + "_img"];

				if (displayStyle == "block")
					{
					allDivsSpans[i].style.display = "block";

					if (typeof(thePic) != "undefined" && null != thePic)
						{
						thePic.src = "/global/images/bluedrop.gif";
						thePic.alt = strHide;
						}
					}
				else
					{
					allDivsSpans[i].style.display = "none";

					if (typeof(thePic) != "undefined" && null != thePic)
						{
						thePic.src = "/global/images/blueup" + strIsRtl + ".gif";
						thePic.alt = strShow;
						}
					}
				}

			if (0 == allDivsSpans[i].id.indexOf("divInlineDef_")) 
				if (displayStyle == "block")
					allDivsSpans[i].style.display = "inline";
				else
					allDivsSpans[i].style.display = "none";
			}
}

function ToggleAllDivs()
{
	InitializeGlobalData();

	if (fExpandedAssistance)
		AlterAllDivs("none");
	else
		AlterAllDivs("block");

	fExpandedAssistance = !fExpandedAssistance;
}

function ToggleAll()
{
	InitializeGlobalData();
	ToggleAllDivs();
}

function InitializeGlobalData()
{
	if ('undefined' != typeof(strRtl))
		strIsRtl = strRtl;

	var divs = document.body.getElementsByTagName("DIV");
	var spans = document.body.getElementsByTagName("SPAN");

	var countDiv = 0;
	var countSpan = 0;
	if (typeof(divs) != "undefined" && null != divs)
		countDiv = divs.length;

	if (typeof(spans) != "undefined" && null != spans)
		countSpan = spans.length;

	allDivsInPage = new Array();
	for (i=0; i < countDiv; i++)
		if (typeof(divs[i].id) != "undefined" &&
			null != divs[i].id &&
			divs[i].id.length > 0)
			allDivsInPage[divs[i].id] = divs[i];

	for (i=0; i < countSpan; i++)
		if (typeof(spans[i].id) != "undefined" &&
			null != spans[i].id &&
			spans[i].id.length > 0)
			allDivsInPage[spans[i].id] = spans[i];

	allImagesInPage = document.body.getElementsByTagName("IMG");
}

function OnSeeAlsoClicked()
{
	InitializeGlobalData();

	if (null == allDivsInPage || typeof(allDivsInPage) == "undefined")
		return;

	if (typeof(allDivsInPage["divSeeAlsoShowBullet"]) != "undefined" &&
		typeof(allDivsInPage["divSeeAlsoHideBullet"]) != "undefined")
		{
		if (allDivsInPage["divSeeAlsoShowBullet"].style.display.toUpperCase() == "INLINE")
			{
			allDivsInPage["divSeeAlso"].style.display = "block";
			allDivsInPage["divSeeAlsoShowBullet"].style.display = "none";
			allDivsInPage["divSeeAlsoHideBullet"].style.display = "inline";
			}
		else
			{
			allDivsInPage["divSeeAlso"].style.display = "none";
			allDivsInPage["divSeeAlsoShowBullet"].style.display = "inline";
			allDivsInPage["divSeeAlsoHideBullet"].style.display = "none";
			}
		}
}

var QUIZ_COOKIE_NAME = "QUIZ_DATA";

function SetQuizCookie(strName, strValue)
{
	var strQuizCookie = GetCookie(QUIZ_COOKIE_NAME);
	if (null != strQuizCookie && 0 != strQuizCookie.length)
	{
		var iStart = strQuizCookie.indexOf(strName);
		if (iStart >= 0)
		{
			var iEnd = strQuizCookie.indexOf(" ", iStart + 1);
			var strEnd = (iEnd > 0 ? strQuizCookie.substr(iEnd) : "");
			var strCookie = (strValue == null ? "" : strName + ":" + strValue);
			strQuizCookie = strQuizCookie.substr(0, iStart) + strCookie + strEnd;
		}
		else if (strValue != null)
		{
			strQuizCookie += " " + strName + ":" + strValue;
		}
	}
	else
	{
		strQuizCookie = strName + ":" + strValue;
	}
	mSetCookie(QUIZ_COOKIE_NAME, strQuizCookie);
}

function GetQuizCookie(strName)
{
	var strQuizCookie = GetCookie(QUIZ_COOKIE_NAME);
	if (null != strQuizCookie && 0 != strQuizCookie.length)
	{
		var iStart = strQuizCookie.indexOf(strName);
		if (iStart >= 0)
		{
			iStart = strQuizCookie.indexOf(":", iStart + 1);
			if (iStart > 0)
			{
				iStart++;
				var	iEnd = strQuizCookie.indexOf(" ", iStart + 1);
				if (iEnd == -1)
				{
					return strQuizCookie.substr(iStart);
				}
				else
				{
					return strQuizCookie.substring(iStart, iEnd);
				}
			}
		}
	}
	return "";
}

function ShowElement(name)
{
	var objElement = GetPageElementQuiz(name);
	if (objElement != null)
		{
		objElement.style.display = 'inline';
		}
}

function GetPageElementQuiz(strElementID)
{
	if (document.all)
		{
		return document.all[strElementID];
		}
	else if (document.getElementById)
		{
		return document.getElementById(strElementID);
		}
	else if (document.layers)
		{
		return document.MainForm.elements[strElementID];
		}
	return null;
}

function fnMail()
{
	var re;

	g_strMailToUrl = UpdateQuizTokens(g_strMailToUrl);

	var sUrl = location.href;
	var iEnd = sUrl.indexOf('?');
	if (iEnd > -1)
		{
		sUrl = sUrl.substr(0, iEnd);
		}

	re = /%Quiz_Url%%26/g;
	g_strMailToUrl = g_strMailToUrl.replace(re, sUrl + '?');

	location.href = XMLDecode(g_strMailToUrl);
}

function fnMaintainAnswer(opt)
{
	var strID = opt.id;
	var iPos = strID.indexOf('_', 0);
	var iQuestion = parseInt(strID.substring(1, iPos));
	var strAnswer = strID.substring(iPos + 1);

	g_strUserAnswers = '0' + 
		g_strUserAnswers.substring(1, iQuestion) + 
		strAnswer + 
		(iQuestion == g_iTotalQuestions ? '' : g_strUserAnswers.substring(iQuestion + 1));

	SetQuizCookie(g_strQuizID, g_strUserAnswers);
}

function SubmitAnswers()
{
	g_strUserAnswers = '1' +
		g_strUserAnswers.substring(1, g_strUserAnswers.length);
	SetQuizCookie(g_strQuizID, g_strUserAnswers);
	document.location.href = g_strQuizID + '.aspx?ctt=6&submit=1';
	return true;
}

function PreloadAnswers()
{
	var strUserAnswer = '';

	for (var i = 1; i <= g_iTotalQuestions; i++)
		{

		strUserAnswer = g_strUserAnswers.charAt(i);

		if (strUserAnswer == '0')
			{
			ShowElement('q' + i + '_Unanswered');
			}
		else
			{

			if (strUserAnswer == g_strCorrectAnswers.charAt(i))
				{
				ShowElement('q' + i + '_Correct');
				}

			else
				{
				ShowElement('q' + i + '_Incorrect');
				ShowElement('q' + i + '_' + strUserAnswer);
				}
			}
		}

	if (g_dAvgScore > 0.0)
		{
		ShowElement('quizMetrics');
		}
}

function PreloadQuestions()
{
	var strUserAnswer;
	var obj;

	g_strUserAnswers = GetQuizCookie(g_strQuizID);

	for (var i = 1; i <= g_iTotalQuestions; i++)
		{
		strUserAnswer = g_strUserAnswers.substring(i, i + 1);
		if (strUserAnswer != "0")
			{
			obj = GetPageElementQuiz('q' + i + '_' + strUserAnswer);
			if (obj != null)
				{
				obj.checked = true;
				}
			}
		}
}

function UpdateQuizTokens(s)
{
	if (typeof(s) == 'undefined')
		return "";

	var re;

	re = /%Quiz_AvgScore%/g;
	s = s.replace(re, g_dAvgScore);

	re = /%Quiz_NumberOfScores%/g;
	s = s.replace(re, g_iTotalUsers);

	re = /%Quiz_Questions%/g;
	s = s.replace(re, g_iTotalQuestions);

	re = /%Quiz_Score%/g;
	s = s.replace(re, g_iScore);

	return s;	
}

function XMLDecode(s)
{
	if (typeof(s) == 'undefined')
		return "";

	var re;

	re = /&amp;/g;
	s = s.replace(re, "&");

	re = /&gt;/g;
	s = s.replace(re, ">");

	re = /&lt;/g;
	s = s.replace(re, "<");

	re = /&apos;/g;
	s = s.replace(re, "'");

	re = /&quot;/g;
	s = s.replace(re, "\"");

	return s;
}

function SetAWSPanels(strSetDivFeedbackDropDownWeb, strSetDivComment, strSetDivNewContent, strSetDivFeedbackAsset)
{
	{ allDivs["divFeedbackDropDownWeb"].style.display = strSetDivFeedbackDropDownWeb; }
	{ allDivs["divComment"].style.display = strSetDivComment; }
	{ allDivs["divNewContent"].style.display = strSetDivNewContent; }
	{ allDivs["divFeedbackAsset"].style.display = strSetDivFeedbackAsset; }
	{ allDivs["divThirdImage"].style.display = strSetDivFeedbackAsset; }
}

function SetExtraAWSPanels(strSetDivClipArtComplaint, strSetDivNewContentCategory, strSetDivNewContentProduct) 
{
	{ allDivs["divClipArtComplaint"].style.display = strSetDivClipArtComplaint; }
	{ allDivs["divNewContentCategoryPanel"].style.display = strSetDivNewContentCategory; }
	{ allDivs["divNewContentProductPanel"].style.display = strSetDivNewContentProduct; }
}

function SetBottomPanels(strSetDivDisclaimerPanel, strSetDivButtonPanel)
{
	{ allDivs["divDisclaimerPanel"].style.display = strSetDivDisclaimerPanel; }
	{ allDivs["divButtonPanel"].style.display = strSetDivButtonPanel; }
}

function SetPageMode(mode)
{
	{ allDivs["divDownloadsProblem"].style.display = "none"; };
	{ allDivs["divDownloadsProblemEmail"].style.display = "none"; };

	switch (mode)
		{
		case iAWSCompliment:
			SetAWSPanels("block", "block", "none", "none"); 
			SetExtraAWSPanels("none", "none", "none");
			SetBottomPanels("block", "block"); 
		break;

		case iAWSComplaint:
			SetAWSPanels("block", "block", "none", "none"); 
			SetExtraAWSPanels("none", "none", "none");
			SetBottomPanels("block", "block"); 
			if (iWebOfficeUpdate == allSelects["m_ddlFeedbackRegardingWeb"].selectedIndex)
				{
				{ allDivs["divDownloadsProblem"].style.display = "block"; };
				{ allDivs["divDownloadsProblemEmail"].style.display = "block"; };
				}
		break;

		case iAWSComplaint_Clipart:
			SetAWSPanels("block", "block", "none", "none"); 
			SetExtraAWSPanels("block", "none", "none"); 
			SetBottomPanels("block", "block"); 
		break;

		case iAWSSuggestion:
			SetAWSPanels("block", "none", "block", "none"); 
			SetExtraAWSPanels("none", "none", "none");
			SetBottomPanels("block", "block"); 
		break;

		case iAWSSuggestion_Cat:
			SetAWSPanels("block", "none", "block", "none"); 
			SetExtraAWSPanels("none", "block", "none"); 
			SetBottomPanels("block", "block"); 
		break;

		case iAWSSuggestion_Prod:
			SetAWSPanels("block", "none", "block", "none"); 
			SetExtraAWSPanels("none", "none", "block"); 
			SetBottomPanels("block", "block"); 
		break;

		case iAWSAsset:
			SetAWSPanels("block", "none", "none", "block"); 
			SetExtraAWSPanels("none", "none", "none");
			SetBottomPanels("block", "block"); 
			SetStepGraphics(2);
			{ allDivs["divSecondImage"].style.display = "none"; }
			{ allDivs["divThirdImage"].style.display = "block"; }
		break;

		case iAWSNo_Bottom:
			SetAWSPanels("block", "none", "none", "none"); 
			SetExtraAWSPanels("none", "none", "none");
			SetBottomPanels("none", "none");
		break;
		};
}

function SetStepGraphics(step)
{
	var active = "";
	var inactive = "";
	if (!fIsRTL) 
		{
		active = "/assistance/images/icon_right_arrow_active.gif";
		inactive = "/assistance/images/icon_right_arrow_inactive.gif";
		}
	else
		{
		active = "/assistance/images/icon_left_arrow_active.gif";
		inactive = "/assistance/images/icon_left_arrow_inactive.gif";
		}

	switch (step) 
		{
		case 1:
			allImages["imgFirstPanel"].src = active; allImages["imgFirstPanel"].alt = strAltTextCurrent;
			allImages["imgSecondPanel"].src = inactive; allImages["imgSecondPanel"].alt = strAltTextCompleted;
			allImages["imgThirdPanel"].src = inactive; allImages["imgThirdPanel"].alt = strAltTextCompleted;

			{ allDivs["divSecondImage"].style.display = "none"; }
			{ allDivs["divThirdImage"].style.display = "none"; }
		break;

		case 2:
			allImages["imgFirstPanel"].src = inactive; allImages["imgFirstPanel"].alt = strAltTextCompleted;
			allImages["imgSecondPanel"].src = active; allImages["imgSecondPanel"].alt = strAltTextCurrent;
			allImages["imgThirdPanel"].src = active; allImages["imgThirdPanel"].alt = strAltTextCurrent;

			{ allDivs["divSecondImage"].style.display = "block"; }
			{ allDivs["divThirdImage"].style.display = "none"; }
		break;

		case 3:
			allImages["imgFirstPanel"].src = inactive; allImages["imgFirstPanel"].alt = strAltTextCompleted;
			allImages["imgSecondPanel"].src = inactive; allImages["imgSecondPanel"].alt = strAltTextCompleted;
			allImages["imgThirdPanel"].src = active; allImages["imgThirdPanel"].alt = strAltTextCurrent;

			{ allDivs["divSecondImage"].style.display = "block"; }
			{ allDivs["divThirdImage"].style.display = "block"; }
		break;
		};
}

function Complete_Page() 
{
	{ allDivs["divSuggestNewContent_EntireWebSite"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_Assistance"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_Training"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_TemplateGallery"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_Clipart"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_PartnerMarketplace"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_OfficeUpdate"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_TFYJ"].style.display = "none"; };

	{ allDivs["divSuggestNewContent_a_EntireWebSite"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_a_Assistance"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_a_Training"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_a_TemplateGallery"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_a_Clipart"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_a_PartnerMarketplace"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_a_OfficeUpdate"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_a_TFYJ"].style.display = "none"; };

	{ allDivs["divSuggestNewContent_b_EntireWebSite"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_b_Assistance"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_b_Training"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_b_TemplateGallery"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_b_Clipart"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_b_PartnerMarketplace"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_b_OfficeUpdate"].style.display = "none"; };
	{ allDivs["divSuggestNewContent_b_TFYJ"].style.display = "none"; };

	{ allDivs["divProvideComments_Compliment"].style.display = "none"; };
	{ allDivs["divProvideComments_Complaint"].style.display = "none"; };

	var fIsAsset = false;

	if (iWebAsset == allSelects["m_ddlFeedbackRegardingWeb"].selectedIndex)
		{
		fIsAsset = true;
		}

	if (0 == iFeedbackType)
		{

		SetPageMode(iAWSCompliment);
		SetStepGraphics(2);
		{ allDivs["divProvideComments_Compliment"].style.display = "block"; };
		}
	else if (1 == iFeedbackType)
		{

		if (allSelects["m_ddlFeedbackRegardingWeb"].selectedIndex == iWebClipart)
			SetPageMode(iAWSComplaint_Clipart);
		else
			SetPageMode(iAWSComplaint);

		SetStepGraphics(2);
		{ allDivs["divProvideComments_Complaint"].style.display = "block"; };
		}
	else if (2 == iFeedbackType)
		{

		switch (allSelects["m_ddlFeedbackRegardingWeb"].selectedIndex) 
			{
			case iWebEntire_Web_Site:
				SetPageMode(iAWSSuggestion);
				{ allDivs["divSuggestNewContent_EntireWebSite"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_a_EntireWebSite"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_b_EntireWebSite"].style.display = "block"; };
			break;

			case iWebAssistance:
				SetPageMode(iAWSSuggestion);
				{ allDivs["divSuggestNewContent_Assistance"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_a_Assistance"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_b_Assistance"].style.display = "block"; };
			break;

			case iWebTraining: 
				SetPageMode(iAWSSuggestion_Prod);
				{ allDivs["divSuggestNewContent_Training"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_a_Training"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_b_Training"].style.display = "block"; };
			break;

			case iWebTemplateGallery: 
				SetPageMode(iAWSSuggestion_Cat);
				{ allDivs["divSuggestNewContent_TemplateGallery"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_a_TemplateGallery"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_b_TemplateGallery"].style.display = "block"; };
			break;

			case iWebClipart:
				SetPageMode(iAWSSuggestion);
				{ allDivs["divSuggestNewContent_Clipart"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_a_Clipart"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_b_Clipart"].style.display = "block"; };
			break;

			case iWebMarketplace:
				SetPageMode(iAWSSuggestion);
				{ allDivs["divSuggestNewContent_PartnerMarketplace"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_a_PartnerMarketplace"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_b_PartnerMarketplace"].style.display = "block"; };
			break

			case iWebOfficeUpdate:
				SetPageMode(iAWSSuggestion);
				{ allDivs["divSuggestNewContent_OfficeUpdate"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_a_OfficeUpdate"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_b_OfficeUpdate"].style.display = "block"; };
			break;

			case iWebToolsForYourJob:
				SetPageMode(iAWSSuggestion);
				{ allDivs["divSuggestNewContent_TFYJ"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_a_TFYJ"].style.display = "block"; };
				{ allDivs["divSuggestNewContent_b_TFYJ"].style.display = "block"; };
			break;

			default: 
				SetPageMode(iAWSAsset);
			};

		SetStepGraphics(2);
		if (fIsAsset)
			{
			{ allDivs["divSecondImage"].style.display = "none"; }
			{ allDivs["divThirdImage"].style.display = "block"; }
			}
		}
	else
		{

		SetPageMode(iAWSNo_Bottom);
		SetStepGraphics(2);
		}
}

function StrTrim(str)
{
	if (typeof(str) == "undefined" || null == str)
		return null;

	while (str.length > 0 && str.charCodeAt(0) <= 32)
		str = str.substring(1);

	while (str.length > 0 && str.charCodeAt(str.length-1) <= 32)
		str = str.substring(0, str.length-1);

	return str;
}

function FIsCommentValid(str, err, limit, auxError)
{
	if (typeof(str) == "undefined" || null == str)
		{
		alert(err);
		return false;
		}

	str = StrTrim(str);

	if (str.length <= 0)
		{
		alert(err);
		return false;
		}

	if (limit > 0 && str.length > limit)
		{
		if (auxError.length > 0)
			alert(auxError);

		return false;
		}

	return true;
}

function FIsEmailAddressValid(strEmail)
{
	if (typeof(strEmail) == "undefined")
		return true;

	if (null == strEmail)
		return true;

	if (0 == strEmail.length)
		return true;

	for (var i=0; i < strEmail.length; i++)
		{
		if (strEmail.charCodeAt(i) > 127 )
			return false;
		}

	return true;
}

function AttemptSubmit()
{
	{ allDivs["divDownloadsInvalidEmailAddress"].style.display = "none"; };

	if ((allDivs["divFeedbackAsset"].style.display == "block"))
		if (!FIsCommentValid(allTextAreas["m_txbAssetBox"].value, strErrorDescription, 650, ""))
			return;

	if ((allDivs["divComment"].style.display == "block"))
		if (!FIsCommentValid(allTextAreas["m_txbCommentBox"].value, strErrorDescription, 650, ""))
			return;

	if ((allDivs["divNewContent"].style.display == "block"))
		{
		if (!FIsCommentValid(allTextAreas["m_txbNewContentDescribe"].value, strErrorDescription, 650, ""))
			return;
		}

	var fInvalidInput = false;

	if ((allDivs["divDownloadsProblemEmail"].style.display == "block"))
		{
		if (!FIsEmailAddressValid(allInputs["m_txbDownloadsEmail"].value))
			{
			{ allDivs["divDownloadsInvalidEmailAddress"].style.display = "block"; };
			fInvalidInput = true;
			}
		}

	if (fInvalidInput)
		return;

	document.forms["Form1"].submit();
}

function StrReplace(strSource, strWhat, strNew)
{
	if (typeof(strSource) == 'undefined' ||
		typeof(strWhat) == 'undefined' ||
		typeof(strNew) == 'undefined' ||
		null == strSource ||
		null == strSource ||
		null == strSource)
		{
		return strSource;
		}

	var iPos = strSource.indexOf(strWhat);
	if (iPos < 0)
		return strSource;

	return strSource.substring(0, iPos) + strNew + strSource.substring(iPos+strWhat.length);
}

function goDisplayCount(max_len, box, label, strSubmitButtonId)
{
	if ('undefined' == typeof(fDisableCounter) ||
		'undefined' == typeof(fDisableCounterFirst) ||
		'undefined' == typeof(fWasLastCountOver))
		{
		return;
		}

	var txbBox = document.getElementById(box);
	if ('undefined' == typeof(txbBox) || null == txbBox)
		return;

	var fDoCount = true;
	if (fDisableCounter)
		{
		if (fDisableCounterFirst)
			{
			document.getElementById(label).innerHTML =
				'<SPAN CLASS="FeedbackWizCounterText">' + strGoDisplayCountOK + '</SPAN>';

			fDisableCounterFirst = false;
			}

		fDoCount = false;
		}

	var strDescr = txbBox.value;
	var nLen = max_len - strDescr.length;

	var btnFeedback = null;
	var fFoundButton = false;
	if ('undefined' != typeof(strSubmitButtonId) && null != strSubmitButtonId)
		{
		btnFeedback = document.getElementById(strSubmitButtonId);
		if ('undefined' != typeof(btnFeedback) && null != btnFeedback)
			fFoundButton = true;
		}

	if (nLen >= 0) 
		{
		if (fDoCount)
			{
			document.getElementById(label).innerHTML = '<SPAN CLASS="FeedbackWizCounterText">' +
				StrReplace(strGoDisplayCountOK, '{0}', '' + nLen) + '</SPAN>';
			}
		else if (fWasLastCountOver)
			{
			document.getElementById(label).innerHTML =
				'<SPAN CLASS="FeedbackWizCounterText">' + strGoDisplayCountOK + '</SPAN>';
			}

		fWasLastCountOver = false;

		if (fFoundButton)
			{

			var fCanDisable = true;
			if ('undefined' != typeof(iFeedbackWizStarRated))
				fCanDisable = (iFeedbackWizStarRated < 1 || iFeedbackWizStarRated > 5);

			if (0 == strDescr.length && fCanDisable)
				btnFeedback.disabled = true;
			else
				btnFeedback.disabled = false;
			}
		}
	else
		{
		if (fDoCount)
			{
			var strError = strGoDisplayCountOver;
			strError = StrReplace(strError, '{0}',  '' + (max_len-nLen));
			strError = StrReplace(strError, '{1}',  '' + max_len);
			document.getElementById(label).innerHTML = '<SPAN CLASS="FeedbackWizCounterStar">' +
				strGoDisplayCountOverStar + '</SPAN><SPAN CLASS="FeedbackWizCounterOverText">' +
				strError + '</SPAN>';
			}
		else if (!fWasLastCountOver)
			{
			document.getElementById(label).innerHTML = '<SPAN CLASS="FeedbackWizCounterStar">' +
				strGoDisplayCountOverStar + '</SPAN><SPAN CLASS="FeedbackWizCounterOverText">' +
				strGoDisplayCountOK + '</SPAN>';
			}

		fWasLastCountOver = true;

		if (fFoundButton)
			btnFeedback.disabled = true;
		}
}

function modifyDisplayCount(nMaxLen, strTextBoxName, strSpanName)
{
	var txbBox = G(strTextBoxName);
	if (null == txbBox)
		return;

	var strDescr = txbBox.value;
	var nLen = nMaxLen - strDescr.length;
	var allSpans = document.body.getElementsByTagName("SPAN");	

	if (nLen >= 0) 
		{
		allSpans[strSpanName].className = 'OFLbl';
		allSpans[strSpanName].innerHTML = StrReplace(strGoDisplayCountOK, '{0}', '' + nLen)
		}
	else 
		{
		var strError = strGoDisplayCountOver;
		strError = StrReplace(strError, '{0}',  '' + (nMaxLen-nLen));
		strError = StrReplace(strError, '{1}',  '' + nMaxLen);
		allSpans[strSpanName].className = 'OILbl2';
		allSpans[strSpanName].innerHTML = strError;
		}	
}

function FeedbackRegardingAppsValid(s,e)
{
	var sDescr = allSelects["m_ddlFeedbackRegardingApps"].value;
	if (sDescr == "-1")
		{
		e.IsValid = false;
		}
	else
		{
		e.IsValid = true;
		}
}

function SetClipArtClientURLCookie()
{
	if (FIsMac() || null != SzGetArgumentValue("CAG"))
		mSetCookie("AWS_ClientURL_Sess", "CIL");

	return;
}

function ClipartPreviewCreateWMPControl()
{
	try
		{
		WMP7Obj = new ActiveXObject("WMPlayer.OCX.7");
		}
	catch(e)
		{

		}

	try
		{
		if (typeof(WMP7Obj) == "object") 
			{
			document.write('<OBJECT ID="MediaPlayer7" WIDTH="175" HEIGHT="175" CLASSID="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6">');
			document.write('<PARAM name="url" VALUE="' + sMediaURL + '">');
			document.write('<PARAM NAME="enablecontextmenu" VALUE="false">');
			document.write('<PARAM NAME="uimode" VALUE="mini">');
			document.write('<PARAM NAME="autostart" VALUE="true">');
			document.write('</OBJECT>');
			}
		else  
			{
			document.write('<OBJECT ID="MediaPlayer6" WIDTH="200" HEIGHT="200" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95">');
			document.write('<PARAM name="filename" VALUE="' + sMediaURL + '">');
			document.write('<PARAM NAME="animationatstart" VALUE="true">');
			document.write('<PARAM NAME="autorewind" VALUE="true">');
			document.write('<PARAM NAME="autostart" VALUE="true">');
			document.write('<PARAM NAME="showaudiocontrols" VALUE="true">');
			document.write('<PARAM NAME="showpositioncontrols" VALUE="false">');
			document.write('<PARAM NAME="showstatusbar" VALUE="false">');
			document.write('<EMBED TYPE="application/x-mplayer2"');
			document.write('	PLUGINSPAGE = "http://www.microsoft.com/Windows/MediaPlayer/"');
			document.write('	SRC="' + sMediaURL + '"');
			document.write('	NAME="MediaPlayer1"');
			document.write('	WIDTH="200"');
			document.write('	HEIGHT="200"');
			document.write('	ANIMATIONATSTART="true"');
			document.write('	AUTOREWIND="true"');
			document.write('	AUTOSTART="true"');
			document.write('	SHOWAUDIOCONTROLS="true"');
			document.write('	SHOWPOSITIONCONTROLS="false"');
			document.write('	SHOWSTATUSBAR="true">');
			document.write('</EMBED>');
			document.write('</OBJECT>');
			}
		}
	catch(e)
		{

		}
}

function FIsMac()
{
	if (typeof(window.navigator.platform) != 'undefined')
		return (-1 != window.navigator.platform.toUpperCase().indexOf("MAC"));
	else
		return (-1 != navigator.userAgent.toUpperCase().indexOf("MAC"));
}

function SetReturnParameterValue(strReturn)
{
	strAxInstallReturnParameter = escape(strReturn);
}

function FIsSupportedWindows()
{
	return ("Win32" == navigator.platform &&
		-1 == navigator.userAgent.indexOf("Windows 95") &&
		-1 == navigator.userAgent.indexOf("Windows 98") &&
		-1 == navigator.userAgent.indexOf("Windows ME") &&
		-1 == navigator.userAgent.indexOf("Windows NT 4") &&
		-1 == navigator.userAgent.indexOf("Windows CE"));
}

function FIsCorrectVersion()
{
	var rgstrVersion;
	var iVerMajor;
	var iVerMinor;
	var iVerBuild;
	var iVerRev;

	strVersion = GetCookie("AWS_ActivexVersion_Perm");
	if ("" == strVersion || "0" == strVersion)
		return false;

	rgstrVersion = strVersion.split(".");

	iVerMajor = Number(rgstrVersion[0]);
	iVerMinor = Number(rgstrVersion[1]);
	iVerBuild = Number(rgstrVersion[2]);
	iVerRev = Number(rgstrVersion[3]);

	if (iVerMajor > 11)
		return true;

	if (iVerMajor < 11)
		return false;

	if (iVerMinor > 0)
		return true;

	if (iVerMinor < 0)
		return false;

	if (iVerBuild > 6006)
		return true;

	if (iVerBuild < 6006)
		return false;

	if (iVerRev < 0)
		return false;

	return true;
}

function SetActiveXInstallStatus()
{

	if (!fSupportsActiveX || fDisableActivex)
		return;

	var fIsCorectVersion = FIsCorrectVersion();

	if (fIsCorectVersion)
		{

		document.write('<SPAN style="display:none"><OBJECT CLASSID="clsid:02BCC737-B171-4746-94C9-0D8A0B2C0089" ID="DCTRL" WIDTH="0" HEIGHT="0"></OBJECT></SPAN>');
		fIsActiveXInstalled = (typeof(DCTRL) != "undefined" &&	typeof(DCTRL.Version) != "undefined");

		if (!fIsActiveXInstalled)
			SetPersistentCookie("AWS_ActivexVersion_Perm", 0);
		}
}

function FShouldPromptForAx()
{
	return !(FIsVariableInCookie("AWS_DontPrompt_Sess") ||
		FIsVariableInCookie("AWS_DontPrompt_Perm") ||
		fDisableActivex);
}

function FIsDCTRLInstalled()
{
	return fIsActiveXInstalled;
}

function InstallActiveX(fIgnoreCookie, wnd, fUseWndUrl)
{
	var strAxInstallStyle = "";
	if ("undefined" != typeof(strActiveXInstallStyle))
		strAxInstallStyle = strActiveXInstallStyle;

	if ("undefined" == typeof(fIgnoreCookie) || null == fIgnoreCookie)
		fIgnoreCookie = false;

	if ("undefined" == typeof(wnd) || null == wnd)
		wnd = window;

	if ("undefined" == typeof(fUseWndUrl) || null == fUseWndUrl)
		fUseWndUrl = false;

	if (!fIsActiveXInstalled &&
		!fInstallingActiveX &&
		fSupportsActiveX &&
		(fIgnoreCookie || FShouldPromptForAx()))
		{

		fInstallingActiveX = true;

		var strNewUrl = strAxInstall;
		strNewUrl = strNewUrl.replace("{0}", strAxInstallStyle);
		strNewUrl = strNewUrl.replace("{2}", strAxInstallReturnParameter);

		if (fUseWndUrl)
			strNewUrl = strNewUrl.replace("{1}", escape(wnd.location.pathname.slice(1) + wnd.location.search));

		else
			strNewUrl = strNewUrl.replace("{1}", escape(document.location.pathname.slice(1) + document.location.search));

		wnd.location.href = strNewUrl;

		return false;
		}

	return fIsActiveXInstalled;
}

function StrRemoveParameterFromUrl(strUrl, strParam)
{
	var strUpperUrl = strUrl.toUpperCase();
	var strUpperParam = strParam.toUpperCase();

	var iStart = strUpperUrl.indexOf("?" + strUpperParam);
	if (iStart < 0)
		iStart = strUpperUrl.indexOf("&" + strUpperParam);

	if (iStart < 0)
		return strUrl;

	var iEnd = strUpperUrl.indexOf("&", iStart+1);

	if (iEnd < 0)
		iStart--;

	var strRet = strUrl.substring(0, iStart+1);

	if (iEnd >= 0)
		strRet += strUrl.substring(iEnd+1, strUrl.length);

	return strRet;
}

function SetDontPrompt()
{
	if (chkDontPrompt.checked)
		{
		SetPersistentCookie("AWS_DontPrompt_Perm", "1");
		}
	else
		{
		mDeleteCookie("AWS_DontPrompt_Perm");
		}
}

function FIsActiveXInstalled()
{
	return (typeof(DCTRL) != "undefined" &&
		typeof(DCTRL.Version) != "undefined")
}

function ReturnToCaller()
{
	var strReturn;
	strParameter = unescape(strQueryStringParameter);

	if (0 == strParameter.length)
		strParameter = "1";

	mSetCookie("AWS_DontPrompt_Sess", 1);

	if (FIsActiveXInstalled())
		mDeleteCookie("AWS_DontPrompt_Perm");

	strReturn = strQueryStringReturn;

	if (0 == strReturn.length)
		location.replace(".");
	else if ("{1}" == strReturn)
		history.back();
	else
		{
		var regExp = /&amp;/g;
		strReturn = strReturn.replace(regExp, "&");
		strReturn = StrRemoveParameterFromUrl(strReturn, "AxInstalled");
		strReturn += (-1 == strReturn.indexOf("?")) ? "?" : "&";
		strReturn += "AxInstalled=" + unescape(strParameter);
		location.replace("http://" + location.hostname + "/" + strReturn);
		}
}

function SetInstallStatus()
{
	document.getElementById("divStatus").style.display = "none";
	if (FIsActiveXInstalled())
		document.getElementById("divSuccess").style.display = "inline";
	else
		{
		document.getElementById("divFailure").style.display = "inline";
		document.getElementById("opnlRetry").style.visibility = "visible";
		document.getElementById("btnRetry").disabled = false;
		}
}

function SafePrintWindow()
{
	try
		{
		window.print();
		}
	catch(e)
		{

		}
}

function TryChapter(e)
{
	var oCNFrm = document.frmChapterNav;
	if (!oCNFrm) return false;

	var oChapter = oCNFrm.ChapterNav;
	if (!oChapter) return false;

	var nIndex = oChapter.selectedIndex;
	var strUrl = oChapter[nIndex].value;
	if (typeof(strUrl) != "undefined" &&
		null != strUrl && strUrl.length > 0)
	{
		window.location.href = strUrl;
	}
}

function FixWidthForClient(strClientAgent)
{
	if (-1 != strClientAgent.indexOf('CLView'))
	{
		G('_TopHtmlTableCell').width='100%';
		G('_TopHtmlTableCellChild').width='100%';
		G('_BottomHtmlRightSide').style.display='none';

		document.styleSheets[document.styleSheets.length - 1].addRule('.RightNavBackgroundNew', 'display:none');
	}
}

function SStyle(selector,style)
{
	if (window.navigator.appName.toUpperCase().indexOf("NETSCAPE") >= 0)
	{
		SStyleNetscape(selector,style);
	}
	else
	{
		SStyleIE(selector,style);
	}
}

function SStyleNetscape(selector,style)
{
	var e=document.createElement('style');
	e.type='text/css';
	var h=document.getElementsByTagName('head')[0];
	h.appendChild(e);
	var s=e.sheet;
	s.insertRule(selector+' {'+style+'}',s.cssRules.length);
}

function SStyleIE(selector, style)
{
	var o=document.styleSheets[document.styleSheets.length - 1]
	o.addRule(selector,style);
}

function SStyleH(selector)
{
	SStyle(selector, 'display:none;');
}

function FixPageForPrinting()
{
	AlterAllDivs('block');
	SWdthNF('_TopHtmlTableCell');
	SWdthNF('_TopHtmlTableCellChild');
	SWdthNF('_TopTmpltHtmlTable');
	SDsplyH('_BottomHtmlRightSide');
	SDsplyH('_Ont_LeftNav_Cell');
	SDsplyH('OntTocCell');
	SDsplyH('tblRatings');
	SDsplyH('m_RightNav');
	SStyleH('.RightNavBackgroundNew');
	SStyleH('.BOSiblingNav');
}
