////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 7/2/2010 ELL

var param_array = {'popup_msg_type' : 1, 'status_msg' : '', 'popup_timeout' : -1};
var popup_msg = new PopupMsg(param_array);

function OpenHelpWindow()
{
	window.open("http://breezewebsitebuilder.com/docs/cms/help.html#restore_page_select", "Help", "scrollbars=1,resizable=1,status=0,toolbar=0,menubar=0,location=0,height=700,width=800");
}

//////////////////////////////////////////////////////////////
function DeleteConfirm(page_name, ID)
{
	popup_msg.top_offset = 0;
	popup_msg.left_offset = 300;
	popup_msg.popup_msg_type = 3;
	popup_msg.popup_btn_cnt = 2;
	popup_msg.msg_width = 450;
	popup_msg.popup_msg_cell = "Are you sure you want to <b>delete</b> the <b>" + page_name + "</b> page from the backup history?";
	popup_msg.popup_button_2_span = "Yes";
	popup_msg.popup_button_1_span = "No";
	popup_msg.popup_timeout = -1;
	popup_msg.ShowPopupMsg();
	document.getElementById("popup_button_2_span").onclick = function () { DeletePageFromHistory(page_name, ID); };
	document.getElementById("popup_button_1_span").onclick = function () { HidePopupMsg(); };
}

function DeletePageFromHistory(page_name, ID)
{
	HidePopupMsg();
	var url = "delete_from_history.php?ID=" + ID + "&page_name=" + page_name;
	window.location = url;
}

////////////////////////////////////////////////////////////////////
function RestoreConfirm(page_name, ID)
{
	popup_msg.top_offset = 0;
	popup_msg.left_offset = 300;
	popup_msg.popup_msg_type = 3;
	popup_msg.popup_btn_cnt = 2;
	popup_msg.msg_width = 450;
	popup_msg.popup_msg_cell = "Are you sure you want to <b>restore</b> the <b>" + page_name + "</b> page?";
	popup_msg.popup_button_2_span = "Yes";
	popup_msg.popup_button_1_span = "No";
	popup_msg.popup_timeout = -1;
	popup_msg.ShowPopupMsg();
	document.getElementById("popup_button_2_span").onclick = function () { RestorePage(page_name, ID); };
	document.getElementById("popup_button_1_span").onclick = function () { HidePopupMsg(); };
}

function RestorePage(page_name, ID)
{
	HidePopupMsg();
	var url = "restore_page.php?ID=" + ID + "&page_name=" + page_name;
	window.location = url;
}

/////////////////////////////////////////////////////////////////////////////////
function SelectPage(page_name)
{
	var url = "restore_page_select.php?page_name=" + page_name;
	window.location = url;
}