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

window.parent.document.title = document.title;

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

function SaveRecipient(i)
{
	var xmlhttp;
	xmlhttp = getXmlHttpRequestObject();
	if (xmlhttp.readyState == 4 || xmlhttp.readyState == 0)
	{
		xmlhttp.open("POST","save_form_recipient.php",true);
		xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp = UpdateMessage(xmlhttp);
		
		var page_name_str = 'page_name' + i;
		var recipient_str = 'recipient' + i;

		params = "page_name=" + document.getElementById(page_name_str).value;
		params = params + "&recipient=" + document.getElementById(recipient_str).value;
		xmlhttp.send(params);
	}
}

function UpdateMessage(xmlhttp)
{
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4)
		{
			if (xmlhttp.responseText.length > 0)
				popup_msg.status_msg = EDIT_CSS_UPDATE_COMPLETE_MSG + ": " + xmlhttp.responseText;
			else
				popup_msg.status_msg = EDIT_CSS_UPDATE_COMPLETE_MSG;
			popup_msg.popup_timeout = 2000;
		}
		else if (xmlhttp.readyState==1)
			popup_msg.status_msg = EDIT_CSS_UPDATE_READY_TO_SEND_MSG;
		else if (xmlhttp.readyState==2)
			popup_msg.status_msg = EDIT_CSS_UPDATE_SENT_MSG;
		else if (xmlhttp.readyState==3)
			popup_msg.status_msg = FORM_RECIPIENTS_SAVING_RECIPIENT_MSG;
		popup_msg.ShowPopupMsg();
	}
	return (xmlhttp);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////
function ResizeWorkspace(mainWidth, mainHeight, menuWidth, headerHeight) {

}

function DisplayNotSavedMessage(btn)	{
	// Needed to complete call when deleting unsaved page.
	window.parent.SetWorkSavedNotSaved(true);
	window.parent.next_btn = btn;
	window.parent.DoNextClick();
}