function OpenWin()
{
	window.open('http://www.itgsolutions.com');
}

function OpenWinAal()
{
	window.open('http://www.aalalbayt.org');
}

function getThisYear()
{
var  dt = new Date();
var thisYear = dt.getFullYear().toString();

if (document.getElementById("ServerDate")!= null)
return  document.getElementById("ServerDate").value;
else
return thisYear;
}

var footer;
if (checkBrowser() == "IE") 
	var iniTop = 300;
else	
	var iniTop = parseInt(document.body.scrollHeight) - 500;
	


footer = "<div id='FooterLayer' dir='ltr' name='FooterLayer' style='border:0px solid red; display:none; LEFT:60px; WIDTH:516; POSITION: absolute; HEIGHT: 105px; TEXT-ALIGN: center;Top:" + iniTop + "px;' >";
footer = footer + "<TABLE align='center' border=0 cellPadding=0 cellSpacing=0 style='HEIGHT: 50px; width:516px'>";
footer = footer + "<TR class=FooterEnglish><TD align=middle height=12 noWrap style='HEIGHT: 12px' vAlign=bottom class=FooterEnglish><HR width=90% class=FooterEnglish></TD></TR>";
footer = footer + "<TR class=FooterEnglish><TD align=middle vAlign=top height=12 style='HEIGHT: 12px' class=FooterEnglish>";
footer = footer + "<A  href='http://www.altafsir.com/IntroSrc.asp'><FONT class=FooterEnglish >About Altafsir</FONT></A>";
footer = footer + "&nbsp;<Font style='COLOR: #0b196b; FONT-FAMILY: Tahoma;  FONT-SIZE: 8pt; FONT-WEIGHT: 100' class=FooterEnglish>|</font> <A  href='http://www.altafsir.com/unique_features.asp'><FONT  class=FooterEnglish >Unique Features</FONT></A>";
footer = footer + "&nbsp;<Font style='COLOR: #0b196b; FONT-FAMILY: Tahoma;  FONT-SIZE: 8pt; FONT-WEIGHT: 100' class=FooterEnglish>|</font> <A href='http://www.altafsir.com/AboutFoundation.asp'><FONT  class=FooterEnglish >About the  Institute</FONT></A>";
footer = footer + "&nbsp;<Font style='COLOR: #0b196b; FONT-FAMILY: Tahoma;  FONT-SIZE: 8pt; FONT-WEIGHT: 100' class=FooterEnglish>|</font> <A  href='http://www.altafsir.com/AboutITG.asp'><FONT class=FooterEnglish >About ITG</FONT></A>";
footer = footer + "</TD></TR><TR class=FooterEnglish><TD align=middle height=12 style='HEIGHT: 12px' vAlign=top class=FooterEnglish>";
footer = footer + "<A href='http://www.altafsir.com/TafsirTerms.asp'><FONT class=FooterEnglish>Terms and Conditions</FONT> </A>";
footer = footer + "<Font style='COLOR: #0b196b; FONT-FAMILY: Tahoma;  FONT-SIZE: 8pt; FONT-WEIGHT: 100' class=FooterEnglish>|</font><A href='http://www.altafsir.com/PrivacyPolicy.asp'> <FONT class=FooterEnglish >Privacy  Policy</FONT></A>";
footer = footer + "&nbsp;<Font style='COLOR: #0b196b; FONT-FAMILY: Tahoma;  FONT-SIZE: 8pt; FONT-WEIGHT: 100' class=FooterEnglish>|</font>&nbsp;<A  href='mailto:altafsir@itgsolutions.com'><FONT class=FooterEnglish >Contact Us</FONT></A>";
footer = footer + "&nbsp;<Font style='COLOR: #0b196b; FONT-FAMILY: Tahoma;  FONT-SIZE: 8pt; FONT-WEIGHT: 100' class=FooterEnglish>|</font>&nbsp;<A  href='http://www.altafsir.com/ContactUs.asp?url='><FONT class=FooterEnglish>Feedback </FONT></A>";
footer = footer + "<Font style='COLOR: #0b196b; FONT-FAMILY: Tahoma;  FONT-SIZE: 8pt; FONT-WEIGHT: 100' class=FooterEnglish>|</Font><FONT class=FooterEnglish >&nbsp;Help</FONT></TD></TR>";
footer = footer + "<TR class=FooterEnglish> <TD align=middle height=12 style='HEIGHT: 12px' vAlign=top class=FooterEnglish> <FONT class=FooterEnglish >Copyrights ©  2002-"+ getThisYear()+ " </FONT>";
footer = footer + "<A href='javascript:OpenWinAal()'><FONT style='COLOR: #0b196b; FONT-FAMILY: Tahoma;  FONT-SIZE: 8pt; FONT-WEIGHT: 100' class=FooterEnglish>Royal Aal al-Bayt Institute for Islamic Thought</A></FONT></TD></TR>";
footer = footer + "<TR class=FooterEnglish> <TD align=middle height=12 style='HEIGHT: 12px' vAlign=top class=FooterEnglish><FONT class=FooterEnglish>Developed  and&nbsp;maintained&nbsp;by:</FONT>&nbsp;";
footer = footer + "<A href='javascript:OpenWin()'><FONT style='COLOR: #0b196b; FONT-FAMILY: Tahoma;  FONT-SIZE: 8pt; FONT-WEIGHT: 100' class=FooterEnglish >Integrated Technology Group</FONT></A>";
footer = footer + "</TD></TR>";
footer = footer + "<TR class=FooterEnglish><TD align=center class=FooterEnglish><font style ='COLOR: #0b196b; FONT-FAMILY: Tahoma;  FONT-SIZE: 8pt; FONT-WEIGHT: 100' class=FooterEnglish>This site is best viewed by 800x600 resolution, <br>using IE 5.5+ or Netscape 7.0+</font></TD></TR></TABLE>";
footer = footer + "</div>";

document.write(footer);  
	

//  HEIGHT SETTINGS FOR LINKS MENU AND ENGLISH UI MARGIN LINE, 
//  AND THE FOOTER TOP POSITION.

// get height of the whole page; 

if (checkBrowser() == "IE") 
	var scroll_height = parseInt(document.body.scrollHeight) //+ 22;
else
	var scroll_height = parseInt(document.body.scrollHeight) ;

/*
if ((parseInt(document.body.scrollHeight)) < parseInt(window.screen.availHeight) )
	var scroll_height = parseInt(document.body.scrollHeight);	
else
	var scroll_height = parseInt(window.screen.availHeight);
*/

var setFooterTop = 0;
var FooterHeight = parseInt(Dom.getElm('FooterLayer').style.height);
//alert(FooterHeight);
//var WindowHeight = window.screen.availHeight;

// SET THE HEIGHT FOR LINKS BAR, ENGLISH MARGIN LINE AND FOOTER HEIGHT.
function SetAllHeights()
{
	if(checkBrowser() == "IE") 
	{		
		var h_Links = window.screen.height - document.body.offsetHeight;
		var h_screen = window.screen.height - h_Links //- 5;
		
		//alert(document.body.offsetHeight)
		if(document.body.offsetHeight > (document.body.scrollHeight + FooterHeight))
		{
			//alert("CASE 1");
			Dom.getElm('Arabic').style.height = h_screen;
			Dom.getElm('MarginLine').style.height = h_screen;
			Dom.getElm('FooterLayer').style.top = h_screen - (parseInt(2 * FooterHeight) + setFooterTop);
		}
		else
		{
			//alert("CASE 2");
			Dom.getElm('Arabic').style.height = document.body.scrollHeight + FooterHeight;
			Dom.getElm('MarginLine').style.height = document.body.scrollHeight;
			Dom.getElm('FooterLayer').style.top = document.body.scrollHeight - (parseInt(2 * FooterHeight) + setFooterTop);
		}
	}
	
	else // checkBrowser == "NN"
	{
		var h_Links  = window.screen.height - window.innerHeight; 
		var h_screen = window.screen.height - h_Links ;
		var allDocHeight = parseInt(document.body.scrollHeight);
		
		if(window.innerHeight > (allDocHeight + FooterHeight))
		{

			//alert("CASE 1");	
			Dom.getElm('Arabic').style.height = h_screen;
			Dom.getElm('MarginLine').style.height = h_screen ;
			Dom.getElm('FooterLayer').style.top = h_screen - (parseInt(2 * FooterHeight) + setFooterTop);
		}
		else
		{
			//alert("CASE 2 " + FooterHeight );	
			Dom.getElm('Arabic').style.height = allDocHeight + FooterHeight+5;
			Dom.getElm('MarginLine').style.height = allDocHeight + FooterHeight+5;
			Dom.getElm('FooterLayer').style.top = allDocHeight - (parseInt(FooterHeight) + setFooterTop + 15);
		}
	}
	Dom.getElm('FooterLayer').style.display = ''; 	
}

// THIS FUNCTION IS USED IN THE QURAN SCIENCE PAGES
// TO SET THE HEIGHT OF THE DISP LAYER.
var  DispHieghtAdd = 0;
function SetDispHeight()
{
	// SET THE DISPLAY HEIGHT;
	if (checkBrowser() == "IE") 
	{
		Dom.getElm('disp').style.height = (parseInt(Dom.getElm('FooterLayer').style.top) + parseInt(Dom.getElm('FooterLayer').style.height)) //scroll_height - 25;
	}
	else
	{	
		Dom.getElm('disp').style.height = (parseInt(Dom.getElm('FooterLayer').style.top) + parseInt(Dom.getElm('FooterLayer').style.height)) //+ setFooterTop;
		Dom.getElm('disp').style.width = 589;
	}
	Dom.getElm('FooterLayer').style.display = ''; 	
}	

// ------------------------------------------------- //
// THESE TWO FUNCTIONS ARE TO BE UN-USED IN THE SITE //
// ------------------------------------------------- //
function SetHeights()
{	
	// SET HEIGHT OF THE LINKS MENU AND THE ENGLISH MERGIN LINE:
	//alert(scroll_height);
	if (checkBrowser() == "IE") 
	{
		// IE:		
		Dom.getElm('Arabic').style.height = scroll_height + FooterHeight;
		Dom.getElm('MarginLine').style.height = scroll_height + FooterHeight;
	}
	else
	{
		// NN:
		Dom.getElm('Arabic').style.height = scroll_height  + FooterHeight + 25;
		Dom.getElm('MarginLine').style.height = scroll_height + FooterHeight + 25;
	}
	Dom.getElm('FooterLayer').style.display = ''; 	
}

function SetFooterTop()
{
	// SET POSITION OF THE FOOTER'S TOP 
	if (checkBrowser() == "IE") 
	{
		// IE:
		Dom.getElm('FooterLayer').style.top = scroll_height - (FooterHeight);  	
	}
	else
	{
		// NN:
		Dom.getElm('FooterLayer').style.top = scroll_height - (FooterHeight) - setFooterTop;  
	}
	Dom.getElm('FooterLayer').style.display = ''; 	
}	