











































































//Copyright (c) 2000-2003 Microsoft Corporation. All rights reserved.
//<script>

// Used by foldergenerictoolbar.xsl
function OnNewView(viewName)
{
	NavigateTo(g_sBase + g_szFolderName + "/?Cmd=contents&View=" + viewName + g_szLADate);
}

// Used by the contact and note form
function OnNewPageNum(pageNum)
{
	if(pageNum == "" || pageNum == null)
	{
		pageNum = 1;
	}
	else
	{
		pageNum = parseInt(pageNum, 10);
	}
	if (g_bIsDumpster)
	{
		NavigateTo(g_sBase + g_szFolderName + "/?Cmd=showdeleted&Page=" + pageNum + "&View=" + g_szViewName);
	}
	else
	{
		NavigateTo(g_sBase + g_szFolderName + "/?Cmd=contents&Page=" + pageNum + "&View=" + g_szViewName);
	}
}


function SetCmd(cmd)
{
	document.msgViewer.Cmd.value = cmd;
	document.msgViewer.submit();
}

// Not used anymore, dead code?
function SetApptCmd (loc, type)
{
	var OccurrenceType;

	if (type == "2")
	{
		if (confirm (g_szOpenOccurrence))
		{
			OccurrenceType = "&Type=Occurrence";
		}
		else
		{
			OccurrenceType = "&Type=Master";
		}
		NavigateTo(loc + OccurrenceType);
	}
	else
	{
		NavigateTo(loc);
	}
}

function NavigateTo(loc)
{
	this.location = loc;
}

// Used by foldergenerictoolbar.xsl
function EmptyDeletedItems()
{
	if (confirm(g_szConfirmEmptyDeletedItems))
	{
		NavigateTo(g_sBase + g_sDelItems + "/?Cmd=emptydeleteditems&sessid=" + g_szSessionId);
	}
}

// Used by foldergenerictoolbar.xsl
function EmptyJunkItems()
{
	if (confirm(g_szConfirmEmptyJunkItems))
	{
		NavigateTo(g_sBase + g_sJunkItems + "/?Cmd=emptyjunkemail&sessid=" + g_szSessionId);
	}
}

// Used by foldergenerictoolbar.xsl
function OnNewForm(formName)
{
	if (formName == "Appointment")
	{
		if (typeof g_fHasCalendarToolbar != "undefined" && g_fHasCalendarToolbar == true)
			NavigateTo(g_sBase + g_szFolderName + "/?Cmd=new");
		else
			NavigateTo(g_sBase + g_sCalendar + "/?Cmd=new");
	}
	else if (formName == "Contact")
	{
		if (typeof g_fHasContactToolbar != "undefined" && g_fHasContactToolbar == true)
			NavigateTo(g_sBase + g_szFolderName + "/?Cmd=new");
		else
			NavigateTo(g_sBase + g_sContacts + "/?Cmd=new");
	}
	else if (formName == "Task")
	{
		if (typeof g_fHasTaskToolbar != "undefined" && g_fHasTaskToolbar == true)
			NavigateTo(g_sBase + g_szFolderName + "/?Cmd=new");
		else
			NavigateTo(g_sBase + g_sTasks + "/?Cmd=new");
	}
	else if (formName == "CDL")
	{
		if (typeof g_fHasContactToolbar != "undefined" && g_fHasContactToolbar == true)
			NavigateTo(g_sBase + g_szFolderName + "/?Cmd=newcdl");
		else
			NavigateTo(g_sBase + g_sContacts + "/?Cmd=newcdl");
	}
	else if (formName == "Note")
		NavigateTo(g_sBase + g_sDrafts + "/?Cmd=new");
	else if (formName == "Post")
		NavigateTo(g_sBase + g_szFolderName + "/?Cmd=newpost");
	else if(formName == "Folder")
		NavigateTo(g_sBase + g_szFolderName + "/?Cmd=createfolder");
	else
		NavigateTo(g_sBase + g_szFolderName + "/?Cmd=new");
}

function chkRow(oItm)
{
	var fEnabled = true;
	if (document.all)
	{
		// IE4.x can't handle our table walking for highlight
		// so lets check the version and disable if
		var verRegExp=/MSIE \d+.\d+/;
		var oVer = navigator.appVersion.match(verRegExp);

		// no match returns null
		if (oVer == null)
			return;

		// we should now have something like "MSIE 6.0"

		var verIExp=/ \d+.\d+/;
		oVer = oVer[0].match(verIExp);

		// no match returns null
		if (oVer == null)
			return;

		// we should now have something like "6.0"

		if (5 > parseInt(oVer[0], 10))
			fEnabled = false;
	}
	// lets bail out if the item is null or we can't check its
	// tagName so we can walk the markup to the TR
	if (!fEnabled || !oItm || !oItm.tagName) return;

	var fChkd = oItm.checked;

	while (oItm.tagName!="TR")
		oItm=oItm.parentNode;

	if (fChkd)
		oItm.className = "vwSelItm";
	else
		oItm.className = "";
}

function Open_GalFind()
{
	window.open(g_sBase+"/?cmd=galfind","galfind","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=700,height=500");
}

function chkRow(oItm)
{
	var fEnabled = true;
	if (document.all)
	{
		// IE4.x can't handle our table walking for highlight
		// so lets check the version and disable if
		var verRegExp=/MSIE \d+.\d+/;
		var oVer = navigator.appVersion.match(verRegExp);

		// no match returns null
		if (oVer == null)
			return;

		// we should now have something like "MSIE 6.0"

		var verIExp=/ \d+.\d+/;
		oVer = oVer[0].match(verIExp);

		// no match returns null
		if (oVer == null)
			return;

		// we should now have something like "6.0"

		if (5 > parseInt(oVer[0], 10))
			fEnabled = false;
	}
	// lets bail out if the item is null or we can't check its
	// tagName so we can walk the markup to the TR
	if (!fEnabled || !oItm || !oItm.tagName) return;

	var fChkd = oItm.checked;

	while (oItm.tagName!="TR")
		oItm=oItm.parentNode;

	if (fChkd)
		oItm.className = "vwSelItm";
	else
		oItm.className = "";
}

