var _PopupEditHtml;
function PopupEditHtml(id){
	var vPopupWidth = 600;
	var vPopupHeight = 500;

	var vTopPos = (window.screen.availHeight - vPopupHeight) / 2;
	var vLeftPos =(window.screen.availWidth - vPopupWidth) / 2;

	_PopupEditHtml=window.open('ASD/HtmlParts/EditHtml.aspx?Id=' + id,
		'popup_edithtml', 'top=' + vTopPos + ', left=' + vLeftPos + 
		', width=' + vPopupWidth + ', height=' + vPopupHeight + 
		', menubar=no, resizable=yes, scrollbars=no, toolbar=no, location=no');
	_PopupEditHtml.focus();
}

function SaveHtmlBody() {
	_PopupEditHtml.close();
}


var _PopupHelp;
function PopupHelp(id){
	var vPopupWidth = 600;
	var vPopupHeight = 500;

	var vTopPos = (window.screen.availHeight - vPopupHeight) / 2;
	var vLeftPos =(window.screen.availWidth - vPopupWidth) / 2;

	_PopupHelp = window.open('ASD/Help/Help.aspx?id=' + id,
		'popup_help', 'top=' + vTopPos + ', left=' + vLeftPos + 
		', width=' + vPopupWidth + ', height=' + vPopupHeight + 
		', menubar=no, resizable=yes, scrollbars=yes, toolbar=no, location=no');
	_PopupHelp.focus();
}

var _PopupReport;
function PopupReport(path){
	var vPopupWidth = window.screen.availWidth - 200;
	var vPopupHeight = window.screen.availHeight - 50;

	var vTopPos = 0;
	var vLeftPos =(window.screen.availWidth - vPopupWidth) / 2;

	_PopupReport=window.open(path,
		'popup_report', 'top=' + vTopPos + ', left=' + vLeftPos + 
		', width=' + vPopupWidth + ', height=' + vPopupHeight + 
		', menubar=no, resizable=yes, scrollbars=yes, toolbar=no, location=no');
	_PopupReport.focus();
}

var _PopupWindow;
function PopupPage(path){
	var vPopupWidth = 600;
	var vPopupHeight = 500;
	var vTopPos = (window.screen.availHeight - vPopupHeight) / 2;
	var vLeftPos =(window.screen.availWidth - vPopupWidth) / 2;

	_PopupWindow=window.open(path,
		'popup_window', 'top=' + vTopPos + ', left=' + vLeftPos + 
		', width=' + vPopupWidth + ', height=' + vPopupHeight + 
		', menubar=no, resizable=yes, scrollbars=yes, toolbar=no, location=no');
	_PopupWindow.focus();
}

var _PopupNotes;
function PopupInputNotes(id){
	var vPopupWidth = 310;
	var vPopupHeight = 200;

	var vTopPos = (window.screen.availHeight - vPopupHeight) / 2;
	var vLeftPos =(window.screen.availWidth - vPopupWidth) / 2;

	_PopupNotes=window.open('Popup/InputNotes.aspx?id=' + id,
		'popup_page', 'top=' + vTopPos + ', left=' + vLeftPos + 
		', width=' + vPopupWidth + ', height=' + vPopupHeight + 
		', menubar=no, resizable=yes, scrollbars=no, toolbar=no, location=no');
	_PopupNotes.focus();
}
function PopupViewNotes(id){
	var vPopupWidth = 510;
	var vPopupHeight = 300;

	var vTopPos = (window.screen.availHeight - vPopupHeight) / 2;
	var vLeftPos =(window.screen.availWidth - vPopupWidth) / 2;

	_PopupNotes=window.open('Popup/ViewNotes.aspx?id=' + id,
		'popup_page', 'top=' + vTopPos + ', left=' + vLeftPos + 
		', width=' + vPopupWidth + ', height=' + vPopupHeight + 
		', menubar=no, resizable=yes, scrollbars=yes, toolbar=no, location=no');
	_PopupNotes.focus();
}
function SaveNotes() {
	_PopupNotes.close();
}

function fnHideShowContent(DDPanelName) {
	var oDDPanel = document.getElementById(DDPanelName);
	var oTopBar = oDDPanel.rows[0];
	var oContent = oDDPanel.rows[1];

	var oTab1 = oDDPanel.cells[0];

	var oTab2 = oDDPanel.cells[1];
	var oShowHideImage = oTab2.children[0];

	if (oContent.style.display == "none") {
		oContent.style.display = "";

		oTab1.className = oDDPanel.getAttribute('Custom_cssTitle');
		oTab2.className = oDDPanel.getAttribute('Custom_cssImage');
		
		oShowHideImage.src = oDDPanel.getAttribute('Custom_ImageUrl');
	}
	else {
		oContent.style.display = "none";

		oTab1.className = oDDPanel.getAttribute('Custom_cssTitleHidden');
		oTab2.className = oDDPanel.getAttribute('Custom_cssImageHidden');
		
		oShowHideImage.src = oDDPanel.getAttribute('Custom_ImageUrlHidden');
	}
}
