/***************************************************************/
//* adjustLayout.js created for http://www.stephencmeyer.org   */
//Created by Mike Cleek 3.24.2009    (mr.cleek@gmail.com )     */
//**************************************************************/


/*******************************************************************************

Updated:
By:

 *******************************************************************************/

function adjustLayout()
{	
	
	var insideMainTextDocObj = document.getElementById('insideMainText');
	if(insideMainTextDocObj != null)
	{
		insideAdjust(insideMainTextDocObj);
	}
	
	//alert('entered');
	//determine if this is a stephencmeyer.org page or a thesignatureinthecell.org page
	var SITCDocObj = document.getElementById('SITC');
	if(SITCDocObj != null) //this is a signature page
	{  
		//alert('entered sign');
		var contentDocObj = document.getElementById('content');
		var top = contentDocObj.offsetTop;
		contentDocObj.style.top = 100 + 'px';
		document.getElementById('signature').style.visibility = 'visible'; 
		
		var sMainTextDocObj = document.getElementById('sMainText');
		if(sMainTextDocObj != null) //this is a signature Main page
		{
			//sMainPage(sMainTextDocObj);
		}
	}
	else
	{	//alert('sitc');
		//Show hidden "The Signature in the Cell" link if it is the www.stephencmeyer.org page
		document.getElementById('bookLink').style.visibility = 'visible'; 
	}
	
}

function insideAdjust(insideMainTextDocObj)  //adjust main signature page.
{
	//alert('inside');
	//determine if this is a stephencmeyer.org page or a thesignatureinthecell.org page
	var SITCDocObj = document.getElementById('SITC');
	if(SITCDocObj != null) //this is a signature page
	{  
		//alert('entered sign');
		var contentDocObj = document.getElementById('content');
		var top = contentDocObj.offsetTop;
		contentDocObj.style.top = 105 + 'px';
		document.getElementById('signature').style.visibility = 'visible'; 
		

		
	}
	else
	{	
		//Show hidden "The Signature in the Cell" link if it is the www.stephencmeyer.org page
		document.getElementById('bookLink').style.visibility = 'visible'; 
	}
}

function sMainPage(sMainTextDocObj) //put footer under the text
{
	//alert('s');
	var sFooterDocObj = document.getElementById('sFooter');
	var sQutoesDocObj = document.getElementById('sQuotes');
	
	var qHeight = sQutoesDocObj.offsetHeight;
	var mHeight = sMainTextDocObj.offsetHeight;
	var top = sFooterDocObj.offsetTop;
	//alert('qheight ' + qHeight);
	//alert('mheight ' + mHeight);
	//alert('top ' + top);
	if(qHeight > mHeight)
	{  
		sMainTextDocObj.style.height = qHeight - 51 + 'px';
		sFooterDocObj.style.top = qHeight  + 'px';
	}
	else //if the quotes section doesn't reach the bottom of MainText
	{ 
		sQutoesDocObj.style.height = mHeight + 1 + 'px';
	}

}

