/* 

	Dialogs.js
	
	Functions which are used to confirm user action (such as deletes) or gather user input
	via java popup windows.


*/


/*

	Confirm the clicked link is really to be followed.

*/

/*
function ConfirmHyperlinkClick()
{
	return confirm('Are you sure?');
}
*/

// AUTHOR:			Scott MacDonald
// DATE:			Oct. 22, 2003
// DESCRIPTION:		Pop up a confirmation box for deletion of content.
// PARAMETERS:		- frm is the form being submitted...
//					- strSiteType is the type of site... one of:
//						BASIC - content isn't shared between pages
//					- hiddenElement is the hidden element to write the Content Id to
//					- contentId is the Id to write to hiddenElement
// RETURNS:			void, if confirmed, the specified form is posted.
function ConfirmDeleteContent( frm, strSiteType, hiddenElement, contentId, pageID, Lang, domainName )
{
	if( strSiteType == "BASIC" )
	{
		if( confirm( "Are you sure you want to delete this item?  This content will be deleted for ALL languages." ) )
		{
			// Write the Id of the Content to delete
			// to the hidden element.  This can be
			// retrieved in the post code...
			frm.action = domainName + "/AbsPage.aspx?id=" + pageID + "&lang=" + Lang
			hiddenElement.value = contentId;

			// Submit the specified form...
			frm.submit();			
		}
	}
}


// AUTHOR:			Scott MacDonald
// DATE:			Jan 15, 2004
// DESCRIPTION:		Pop up a confirmation box for publication of content.
// PARAMETERS:		- frm is the form being submitted...
//					- strSiteType is the type of site... one of:
//						BASIC - content isn't shared between pages
//					- hiddenElement is the hidden element to write the Content Id to
//					- contentId is the Id to write to hiddenElement
// RETURNS:			void, if confirmed, the specified form is posted.
function ConfirmPublishContent( frm, strSiteType, hiddenElement, contentId , pageID, Lang, domainName )
{
	if( strSiteType == "BASIC" )
	{
		if( confirm( "Are you sure you want to publish this item?" ) )
		{
			// Write the Id of the Content to delete
			// to the hidden element.  This can be
			// retrieved in the post code...
			frm.action = domainName + "/AbsPage.aspx?id=" + pageID + "&lang=" + Lang
			hiddenElement.value = contentId;

			// Submit the specified form...
			frm.submit();
		}
	}
}


// AUTHOR:			Scott MacDonald
// DATE:			Jan 15, 2004
// DESCRIPTION:		Pop up a confirmation box for reverting of content to the live version, abandoning edits.
// PARAMETERS:		- frm is the form being submitted...
//					- strSiteType is the type of site... one of:
//						BASIC - content isn't shared between pages
//					- hiddenElement is the hidden element to write the Content Id to
//					- contentId is the Id to write to hiddenElement
// RETURNS:			void, if confirmed, the specified form is posted.
function ConfirmRevertContent( frm, strSiteType, hiddenElement, contentId, pageID, Lang, domainName )
{

	if( strSiteType == "BASIC" )
	{
		if( confirm( "Are you sure you want to revert this item to the live version and abandon your edits?" ) )
		{
			// Write the Id of the Content to delete
			// to the hidden element.  This can be
			// retrieved in the post code...
			frm.action = domainName + "/AbsPage.aspx?id=" + pageID + "&lang=" + Lang
			hiddenElement.value = contentId;

			// Submit the specified form...
			frm.submit();
		}
	}
}



// AUTHOR:			Adam Nickerson
// DATE:			May 25, 2004
// DESCRIPTION:		Pop up a confirmation box for mirroring a piece of content.
// PARAMETERS:		- frm is the form being submitted...
//					- strSiteType is the type of site... one of:
//						BASIC - content isn't shared between pages
//					- hiddenElement is the hidden element to write the Content Id to
//					- contentId is the Id to write to hiddenElement
// RETURNS:			void, if confirmed, the specified form is posted.
function ConfirmMirrorContent( frm, strSiteType, hiddenElement, contentId, pageID, Lang, domainName )
{

	if( strSiteType == "BASIC" )
	{
		if( confirm( "Are you sure you want to mirror this item?" ) )
		{
			// Write the Id of the Content to delete
			// to the hidden element.  This can be
			// retrieved in the post code...
			frm.action = domainName + "/AbsPage.aspx?id=" + pageID + "&lang=" + Lang
			hiddenElement.value = contentId;

			// Submit the specified form...
			frm.submit();
		}
	}
}
