////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 12/15/2015	ELL

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#copy_css_to_mobile", "Help", "scrollbars=1,resizable=1,status=0,toolbar=0,menubar=0,location=0,height=700,width=800");
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////
function CopyToMobileConfirm(style_sheet)
{
	popup_msg.top_offset = 0;
	popup_msg.left_offset = 300;
	popup_msg.popup_msg_type = 3;
	popup_msg.popup_btn_cnt = 2;
	popup_msg.popup_msg_cell = COPY_STYLE_TO_MOBILE_CONFIRM_1_MSG + " <b>" + style_sheet + "</b> " + TO_WORD + " <b>" + style_sheet + "_mobile</b> " + COPY_STYLE_TO_MOBILE_CONFIRM_2_MSG + " <b>" + style_sheet + "_mobile</b> " + COPY_STYLE_TO_MOBILE_CONFIRM_3_MSG;
	popup_msg.popup_button_2_span = YES_WORD;
	popup_msg.popup_button_1_span = NO_WORD;
	popup_msg.popup_timeout = -1;
	popup_msg.ShowPopupMsg();
	document.getElementById("popup_button_2_span").onclick = function () { CopyToMobile(style_sheet); };
	document.getElementById("popup_button_1_span").onclick = function () { HidePopupMsg(); };
}

function CopyToMobile(style_sheet)
{
	HidePopupMsg();
	$.post( "copy_css_to_mobile.php", { style_sheet: style_sheet } ).done(CompleteCopyToMobile) ;
}
function CompleteCopyToMobile(data)
{
	popup_msg.top_offset = 0;
	popup_msg.left_offset = 300;
	popup_msg.popup_msg_type = 1;
	popup_msg.popup_timeout = 3000;
	if (data != -1)
		popup_msg.status_msg = " <b>" + data + "</b> " + COPY_STYLE_TO_MOBILE_COMPLETE_MSG + " <b>" + data + "_mobile</b>.";
	else
		popup_msg.status_msg = COPY_STYLE_TO_MOBILE_COMPLETE_ERR + " <b>" + data + "</b> " + TO_WORD + " <b>" + data + "_mobile</b>.";
		
	popup_msg.ShowPopupMsg();
}

function ChangeStyleSheetSort(bAlpha)
{
	sort_alpha = 0;
	if (bAlpha === true)
		sort_alpha = 1;

	window.location = "copy_css_to_mobile_select.php?sort_alpha=" + sort_alpha;
}

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

}