//js file
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function loadPageContent(){
	var footer_html = "<p><a href='mailto:webadmin@icmga.org'>Web Admin</a>";
	footer_html += " | Disclaimer";
	footer_html += " | Updated on Sept 17<sup>th</sup>, 2009";
  footer_html += " | <a href='javascript:window.external.AddFavorite(\"http://www.icmga.org\",\"Islamic Center of Marietta\")'><span><u>Click here to bookmark this website.</u></span></a>";
	var footerObj = MM_findObj('footer');
	footerObj.innerHTML = footer_html;
	
	var top_right_links = "";
	top_right_links += '<p style="text-align:right;font-weight:bold">';
 	top_right_links += '<!--<a href="signin.htm" target="_self" onMouseover="window.status=\'Sign in\';return true" onMouseout="window.status=\'Masjid Al-Hedaya\'">-->Sign-in<!--</a>-->';
 	top_right_links += '<font color="#EF8421">|</font>'; 
 	//top_right_links += '<!--<a href="joinicm.htm" onMouseover="window.status=\'Contact Information\';return true" onMouseout="window.status=\'Masjid Al-Hedaya\'">-->Join<!--</a>-->';
 	top_right_links += '<a href="javascript:void(0);" onClick="OpenWindowInCenter3(\'joinicm.htm\');return false;" onMouseover="window.status=\'Join ICM\';return true" onMouseout="window.status=\'Masjid Al-Hedaya\'">Join</a>';
 	top_right_links += '<font color="#EF8421">|</font>'; 
 	top_right_links += '<a href="javascript:void(0);" onClick="OpenWindowInCenter3(\'email_contact/contact.htm\');return false;" onMouseover="window.status=\'Contact ICM\';return true" onMouseout="window.status=\'Masjid Al-Hedaya\'">Contact</a>';
 	top_right_links += '</p>';
 	
 	var top_right_links_obj = MM_findObj('top_right_links');
  top_right_links_obj.innerHTML = top_right_links;	

  var website_search_html = "";
  website_search_html += '<p style="text-align:right;">';
  website_search_html += '<form name="jse_Form" onsubmit="search_form(jse_Form);return false;">';
  website_search_html += '<input class="leftnav_search" type="text" name="d" class="textbox" size="24">';
  website_search_html += '<input type="hidden" name="lang" value="english">';
  website_search_html += '&nbsp;<input class="" type="button" value="Search" onClick="search_form(jse_Form);return false;">';
  website_search_html += '</form>';
  website_search_html += '</p>';
 	var website_search_html_obj = MM_findObj('website_search');
  website_search_html_obj.innerHTML = website_search_html;  
  
}

function OpenWindowInCenter2(url) { 
		var iMyWidth; 
		var iMyHeight; 
		iMyWidth = (window.screen.width/2) - (800 + 10); //half the screen width minus half the new window width (plus 5 pixel borders). 
		iMyHeight = (window.screen.height/2) - (800 + 50); //half the screen height minus half the new window height (plus title and status bars). 
		window.open(url,"constitution","status,height=600,width=600,resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=no,toolbar=no,menubar=no,location=no"); 
}

function OpenWindowInCenter3(url) { 
		var iMyWidth; 
		var iMyHeight; 
		iMyWidth = (window.screen.width/2) - (800 + 10); //half the screen width minus half the new window width (plus 5 pixel borders). 
		iMyHeight = (window.screen.height/2) - (800 + 50); //half the screen height minus half the new window height (plus title and status bars). 
		window.open(url,"constitution","status,height=550,width=650,resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=no,toolbar=no,menubar=no,location=no"); 
}

function bookmarkthispage (url,title)
{
	alert(url);
	var app = navigator.appName;
	var ver = parseInt(navigator.appVersion);

	if ((app == "Microsoft Internet Explorer") && (ver >= 4)) {
		document.write("<a href=\"javascript:window.external.AddFavorite('" + url + "',\'" + title + "')\"><span><u>Click here to bookmark this website.</u></span></a>");
	} else {
		document.write('<span>Press CTRL-D to Bookmark this Page</span>');
	}
}