//________________________________--
var cE0a_ModNm = "E0a_Articles_PageType_Dependent_Funcs.js";
var cE0a_cpyra = "©2011 Rako DP Enterprises";
// 
/*jsl:ignoreall*/
//________________________________--

var vE0g_Panes_Size_Set_Error = false;

/*const*/ var cE0m_MainPane_RelTop_Min = 5;
/*const*/ var cE0m_MainPane_Left_Min = 10;
/*const*/ var cE0m_Panes_Border_WidthAdj = 8;
/*const*/ var cE0m_TitleBox_Top_Min = 5;
var vE0m_TitleBox_Top = -1;
///*const*/ var gcdTitleBoxStdTop = 12;
var vE0m_TitleBox_Left;

var vE0m_Article_Available_Width ;
var vE0m_MainArea_Borders ;

var vE0m_MainArea_MarginTop = 0; ;

var vE0m_MainPane_Width ;

var vE0m_Page_Type = 0;
/*const*/ var cE0g_Page_Type_Simple = 0;
/*const*/ var cE0g_Page_Type_With_Greeting_Page = 1;
/*const*/ var cE0g_Page_Type_Pictures_Page = 2;
/*const*/ var cE0g_Page_Type_Poems_Page = 3;
/*const*/ var cE0g_Page_Type_Family_Tree = 5;

function fE0g_Adjust_Article_Parts_Widths (pMainPaneLeft_Adj) {
    vE0g_Panes_Size_Set_Error = false;
	if  ( ( (!vD0g_Article_Loading_Completed) || (!parent.vA0bg_Root_Loading_Completed)  || (isNaN(parent.vA0bg_Articles_Available_Width) ) ) ) {  // || (isNaN(vD0g_Article_Available_Width) ) ) {
	    vE0g_Panes_Size_Set_Error = true;
		return;
		}
	if (vE0m_TitleBox_Top < 0) {
		fE0m_Set_Site_Positions(); }
	vE0m_MainArea_Borders = vD0g_MainPage_Area_Obj.clientLeft * 2;
	vE0m_Article_Available_Width = parent.vA0bg_Articles_Available_Width - vE0m_MainArea_Borders;
	if (!vD0g_ArticlePage_Body_Obj) {
		if (fD1g_Create_Global_Objects_For_Article) {
	        fD1g_Create_Global_Objects_For_Article(); }
		}
	if (!vD0g_ArticlePage_Body_Obj) {
	    vE0g_Panes_Size_Set_Error = true;
		return;
		}
    fE0m_Set_Page_Width()
	switch (vE0m_Page_Type) {
		case cE0g_Page_Type_With_Greeting_Page:

		case cE0g_Page_Type_Family_Tree:
		case cE0g_Page_Type_Simple:
	    	fE0m_Posit_TitleBox_And_MainPane (vD0g_MainPage_Area_Obj);
			wWidthAdjust = fE0m_Check_For_ScrollBars_Size_Adjust();
			if (wWidthAdjust > 0) {
				fE0m_Posit_TitleBox_And_MainPane (vD0g_MainPage_Area_Obj);
				}
		    fD3g_ItemsToCenter (vE0m_Article_Available_Width);
			fE0g_Check_Page_Height();
			break;
		case cE0g_Page_Type_Poems_Page:
			fE0g_Adjust_Poems_Page_Widths();
	    	fE0m_Posit_TitleBox_And_MainPane (vE3m_Poems_Text_Column_Obj);
			wWidthAdjust = fE0m_Check_For_ScrollBars_Size_Adjust();
			if (wWidthAdjust > 0) {
				wPageColumnWidth = wPageColumnWidth - wWidthAdjust;
				fE0m_Posit_TitleBox_And_MainPane (vE3m_Poems_Text_Column_Obj);
				}
		    fD3g_ItemsToCenter (vE3m_Poems_Text_Column_Obj.clientWidth);
			fE0g_Check_Page_Height(vE3m_Poems_Text_Column_Obj);
			break;
		}
	parent.fA6g_Set_Invisible_Parts_Info();
}  // ________________ end of function:  E0g_Posit_TitleBox_And_MainPane() {

function fE0g_Check_Page_Height (pTextContainer_Obj) {
var tAAH = parent.vA0bg_Articles_Available_Height;
var tMPAH1 = vD0g_MainPage_Area_Obj.offsetHeight;
var tAPBH1 = vD0g_ArticlePage_Body_Obj.offsetHeight;
var tHDif1 = vD0g_MainPage_Area_Obj.offsetHeight - parent.vA0bg_Articles_Available_Height;
	var wMainPage_Borders = vD0g_MainPage_Area_Obj.offsetHeight - vD0g_MainPage_Area_Obj.clientHeight;
	var wMainPage_Height = (parent.vA0bg_Articles_Available_Height - wMainPage_Borders);
	if (vD0g_MainPage_Area_Obj.offsetHeight < parent.vA0bg_Articles_Available_Height) {
		vD0g_ArticlePage_Body_Obj.style.height = wMainPage_Height + "px";
		vD0g_MainPage_Area_Obj.style.height = wMainPage_Height + "px";
		}
	if (typeof(pTextContainer_Obj) == "object") {
var tTCOH1 = pTextContainer_Obj.offsetHeight;
		if(pTextContainer_Obj.offsetHeight < wMainPage_Height) {
			var wTextContainer_Borders = pTextContainer_Obj.offsetHeight - pTextContainer_Obj.clientHeight;
			var wTextContainer_Height = (wMainPage_Height - wTextContainer_Borders);
			pTextContainer_Obj.style.height = wTextContainer_Height + "px";
			}
var tTCOH2 = pTextContainer_Obj.offsetHeight;
		}
var tMPAH2 = vD0g_MainPage_Area_Obj.offsetHeight;
var tAPBH2 = vD0g_ArticlePage_Body_Obj.offsetHeight;
var tHDif2 = vD0g_MainPage_Area_Obj.offsetHeight - parent.vA0bg_Articles_Available_Height;
var tx = wMainPage_Borders;
}  // ________________ end of function:  fE0g_Check_Page_Height() {

function fE0m_Check_For_ScrollBars_Size_Adjust () {
	wRetWidth = 0;
	if (parent.vC0Ag_ScrollBars_Visible) {
		if (vD0g_ArticlePage_Body_Obj.offsetHeight > parent.vA0bg_Articles_Available_Height) {
			vE0m_Article_Available_Width = vE0m_Article_Available_Width - vRPRIp_REU_ScrollBar_Width;
            fE0m_Set_Page_Width();
            wRetWidth = vRPRIp_REU_ScrollBar_Width;
			}
		}
	return wRetWidth;
}  // ________________ end of function:  fE0m_Check_For_ScrollBars_Size_Adjust() {

function fE0m_Set_Page_Width () {
	vD0g_ArticlePage_Body_Obj.style.width = vE0m_Article_Available_Width + "px";
	vD0g_MainPage_Area_Obj.style.width = vE0m_Article_Available_Width + "px";
}  // ________________ end of function:  fE0m_Set_Page_Width() {

function fE0m_Posit_TitleBox_And_MainPane (pContainer_Obj) {
	var wAvailable_Width = pContainer_Obj.clientWidth;
	if (pContainer_Obj != vD0g_MainPage_Area_Obj) {
		wAvailable_Width = wAvailable_Width - vE0m_MainArea_Borders; }
	var wTitleBox_Width = wAvailable_Width - (2 * vE0m_TitleBox_Left) - cE0m_Panes_Border_WidthAdj;
	vD0g_TitleBox_Obj.style.marginTop = vE0m_TitleBox_Top + "px";
//	vD0g_TitleBox_Obj.style.top = vE0m_TitleBox_Top + "px";
	vD0g_TitleBox_Obj.style.width = wTitleBox_Width + "px";
	vD0g_TitleBox_Obj.style.marginLeft = vE0m_TitleBox_Left + "px";
	var wMainPane_Margin_Right = Math.max(vD0g_MainPane_Left,parent.cA0g_Root_FixedToolBar2_Area_Width);
	vE0m_MainPane_Width = wAvailable_Width - vD0g_MainPane_Left - wMainPane_Margin_Right - cE0m_Panes_Border_WidthAdj;
	var wMainPane_Top = vE0m_TitleBox_Top + vD0g_TitleBox_Obj.offsetHeight +vD0g_MainPane_RelTop;
	vD0g_MainPane_Obj.style.width = vE0m_MainPane_Width  + "px";
	vD0g_MainPane_Obj.style.marginLeft = vD0g_MainPane_Left + "px";
	vD0g_MainPane_Obj.style.marginTop = vD0g_MainPane_RelTop  + "px";
	vD0g_MainPane_Obj.style.marginBottom = vD0g_MainPane_RelTop  + "px";
}  // ________________ end of function:  fE0m_Posit_TitleBox_And_MainPane() {

function fE0m_Set_Site_Positions (pMainPaneLeft_Adj) {
	var wMainPaneLeft_Adj = pMainPaneLeft_Adj;
	if (typeof(wMainPaneLeft_Adj) == "undefined") {
		wMainPaneLeft_Adj = 0; }
	vE0m_TitleBox_Top = Math.max(cS0g_TitleBox_Top,cE0m_TitleBox_Top_Min);
	vD0g_MainPane_RelTop = Math.max(cS0g_MainPane_RelTop,cE0m_MainPane_RelTop_Min);
	vD0g_MainPane_Left = Math.max(cS0g_MainPane_Left,cE0m_MainPane_Left_Min);
	vD0g_MainPane_Left = vD0g_MainPane_Left + wMainPaneLeft_Adj;
	vE0m_TitleBox_Left = vD0g_MainPane_Left + cS0g_TitleBox_Inset;
	vE0m_Page_Type = cE0g_Page_Type_Simple;
	if (typeof(acPage_Type) != "undefined") {
        vE0m_Page_Type = acPage_Type; }
}  // ________________ end of function:  E0_SetSitePositions() {

function fE0g_Adjust_Poems_Page_Widths() {
    vE3m_PBK_Poems_Index_Box_Obj.style.width = vE3m_PBK_Poems_Index_Box_Width + "px";
    vE3m_IndexColumn_Cell_Width = vE3m_PBK_Poems_Index_Box_Obj.offsetWidth + vE3m_PBK_Poems_Index_Box_Width_OverHd; // + 10;
    vE3m_Index_Column_Obj.width = vE3m_IndexColumn_Cell_Width; // + "px";
    vE3m_Index_Column_Obj.style.width = vE3m_IndexColumn_Cell_Width + "px";
    vE3m_PBK_Poems_Index_Pane_Obj.style.width = vE3m_IndexColumn_Cell_Width + "px";
    vE3m_Poems_Text_Column_Width = vE0m_Article_Available_Width - vE3m_IndexColumn_Cell_Width - vE3m_PBK_Poems_Index_Box_SizerCell_Width ;
    vE3m_Poems_Text_Column_Obj.width = vE3m_Poems_Text_Column_Width; //  + "px";
    vE3m_Poems_Text_Column_Obj.style.width = vE3m_Poems_Text_Column_Width + "px";
 }  // ________________ end of function:  fE0g_Adjust_Poems_Page_Widths()

//  

