function brwstester()
{
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function resizeheights(me)
{
    $("#" + me).css({'height' : $(window).height() + brwstester().scrollTop  + "px"});
}
function ScrollEvent(Div)
{
	$(window).scroll(function()
     {
         resizeheights(Div);
     });
}
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function ShowAdsRequest()
{
	document.location='#';
	HideAllObjects();
	$("#AdvertiseBackground").css({
			"opacity": "0.7"
	});
	$("#AdvertiseBackground").fadeIn("slow");
	$("#AdvertiseRequest").fadeIn("slow");
	
	var windowWidth = document.documentElement.clientWidth;  
	var windowHeight = document.documentElement.clientHeight;  
	var popupHeight = $("#AdvertiseRequest").height();  
	var popupWidth = $("#AdvertiseRequest").width();  
	//centering  
	
	$("#AdvertiseRequest").css({  
		"position": "absolute",  
		"top": "10%",  
		"left": windowWidth/2-popupWidth/2,
		"height":"100%"
	});  
	
	//only need force for IE6  
	$("#AdvertiseBackground").css({  
		"height": windowHeight  
	});  
	ScrollEvent('AdvertiseBackground');
}
function CloseAdsRequest()
{
	$("#AdvertiseBackground").fadeOut("slow");
	$("#AdvertiseRequest").fadeOut("slow");
	ShowAllObjects();
}
function ShowNewsletterSubscription()
{
	document.location='#';
	HideAllObjects();
	$("#NewsletterBackground").css({
			"opacity": "0.7"
	});
	$("#NewsletterBackground").fadeIn("slow");
	$("#Newsletter").fadeIn("slow");
	
	var windowWidth = document.documentElement.clientWidth;  
	var windowHeight = document.documentElement.clientHeight;  
	var popupHeight = $("#Newsletter").height();  
	var popupWidth = $("#Newsletter").width();  
	//centering  
	var NewHeight = windowHeight/2-popupHeight/2;
	if(NewHeight < 0) NewHeight = 50;
	$("#Newsletter").css({  
		"position": "absolute",  
		"top": "10%",  
		"left": windowWidth/2-popupWidth/2,
		"height":"100%"
	});  
	
	//only need force for IE6  
	$("#NewsletterBackground").css({  
		"height": windowHeight  
	});  
	ScrollEvent('NewsletterBackground');
}
function CloseNewsletterSubscription()
{
	
	$("#NewsletterBackground").fadeOut("slow");
	$("#Newsletter").fadeOut("slow");
	ShowAllObjects();
}
function ShowArticleParticipation()
{
	document.location='#';
	HideAllObjects();
	$("#ArticleBackground").css({
			"opacity": "0.7"
	});
	$("#ArticleBackground").fadeIn("slow");
	$("#Article").fadeIn("slow");
	
	var windowWidth = document.documentElement.clientWidth;  
	var windowHeight = document.documentElement.clientHeight;  
	var popupHeight = $("#Article").height();  
	var popupWidth = $("#Article").width();  
	//centering  
	
	$("#Article").css({  
		"position": "absolute",  
		"top": "10%",  
		"left": windowWidth/2-popupWidth/2,
		"height":"100%"
	});  
	
	//only need force for IE6  
	$("#ArticleBackground").css({  
		"height": windowHeight  
	});  
	ScrollEvent('ArticleBackground');
}
function CloseArticleSubscription()
{
	$("#ArticleBackground").fadeOut("slow");
	$("#Article").fadeOut("slow");
	ShowAllObjects();
}

function ShowAddFatwaForm(Top)
{
	document.location='#';
	HideAllObjects();
	$("#FatawaBackground").css({
			"opacity": "0.7"
	});
	
	$("#FatawaBackground").fadeIn("slow");
	$("#SendFatwa").fadeIn("slow");
	
	var windowWidth = document.documentElement.clientWidth;  
	var windowHeight = document.documentElement.clientHeight;  
	var popupHeight = $("#SendFatwa").height();  
	var popupWidth = $("#SendFatwa").width();  
	//centering  
	
	var NewHeight = windowHeight/2-popupHeight/2;
	if(NewHeight < 0) NewHeight = 50;
	$("#SendFatwa").css({  
		"position": "absolute",  
		"top": "10%",  
		"left": windowWidth/2-popupWidth/2,
		"height":"100%"
	});  
	
	//only need force for IE6  
	$("#FatawaBackground").css({  
		"height": windowHeight  
	});  
	ScrollEvent('FatawaBackground');
}
function CloseAddFatwaForm()
{
	$("#FatawaBackground").fadeOut("slow");
	$("#SendFatwa").fadeOut("slow");
	ShowAllObjects();
}
function ShowTellFriend()
{
	document.location='#';
	HideAllObjects();
	$("#TellFriendBackground").css({
			"opacity": "0.7"
	});
	$("#TellFriendBackground").fadeIn("slow");
	$("#tellfriend").fadeIn("slow");
	
	var windowWidth = document.documentElement.clientWidth;  
	var windowHeight = document.documentElement.clientHeight;  
	var popupHeight = $("#tellfriend").height();  
	var popupWidth = $("#tellfriend").width();  
	
	$("#tellfriend").css({  
		"position": "absolute",  
		"top": "10%",  
		"left": windowWidth/2-popupWidth/2,
		"height":"100%"
	});  
	
	//only need force for IE6  
	$("#TellFriendBackground").css({  
		"height": windowHeight  
	});  
	ScrollEvent('TellFriendBackground');
}
function CloseTellFriend()
{
	$("#TellFriendBackground").fadeOut("slow");
	$("#tellfriend").fadeOut("slow");
	ShowAllObjects();
}
function ShowArticleImages()
{
	document.location='#';
	HideAllObjects();
	$("#ImagesBackground").css({
			"opacity": "0.7"
	});
	$("#ImagesBackground").fadeIn("slow");
	$("#ImagesDiv").fadeIn("slow");
	
	var windowWidth = document.documentElement.clientWidth;  
	var windowHeight = document.documentElement.clientHeight;  
	var popupHeight = $("#ImagesDiv").height();  
	var popupWidth = $("#ImagesDiv").width();  
	//centering  
	var NewHeight = windowHeight/2-popupHeight/2;
	if(NewHeight < 0) NewHeight = 50;
	$("#ImagesDiv").css({  
		"position": "absolute",  
		"top": "10%",  
		"left": windowWidth/2-popupWidth/2,
		"height":"100%"
	});  
	
	//only need force for IE6  
	$("#ImagesBackground").css({  
		"height": windowHeight  
	});  
	ScrollEvent('ImagesBackground');
}
function CloseArticleImages()
{
	$("#ImagesBackground").fadeOut("slow");
	$("#ImagesDiv").fadeOut("slow");
	ShowAllObjects();
}
function ShowSurvey()
{
	document.location='#';
	HideAllObjects();
	$("#SurveyBackground").css({
			"opacity": "0.7"
	});
	$("#SurveyBackground").fadeIn("slow");
	$("#SurveyBox").fadeIn("slow");
	
	var windowWidth = document.documentElement.clientWidth;  
	var windowHeight = document.documentElement.clientHeight;  
	var popupHeight = $("#SurveyBox").height();  
	var popupWidth = $("#SurveyBox").width();  
	//centering  
	var NewHeight = windowHeight/2-popupHeight/2;
	if(NewHeight < 0) NewHeight = 50;
	$("#SurveyBox").css({  
		"position": "absolute",  
		"top": "10%",  
		"left": windowWidth/2-popupWidth/2,
		"height":"100%"
	});  
	
	//only need force for IE6  
	$("#SurveyBackground").css({  
		"height": windowHeight  
	});  
	ScrollEvent('SurveyBackground');
}
function CloseSurvey()
{
	$("#SurveyBackground").fadeOut("slow");
	$("#SurveyBox").fadeOut("slow");
	ShowAllObjects();
}
function ShowAudio()
{
	HideAllObjects();
	$("#AudioBackground").css({
			"opacity": "0.7"
	});
	$("#AudioBackground").fadeIn("slow");
	$("#AudioDiv").fadeIn("slow");
	
	document.location='#';
	
	var windowWidth = document.documentElement.clientWidth;  
	var windowHeight = document.documentElement.clientHeight;  
	var popupHeight = $("#AudioDiv").height();  
	var popupWidth = $("#AudioDiv").width();  
	//centering  
	var NewHeight = windowHeight/2-popupHeight/2;
	if(NewHeight < 0) NewHeight = 50;
	$("#AudioDiv").css({  
		"position": "absolute",  
		"left": windowWidth/2-popupWidth/2,
		"height":"200px"
	});  
	
	//only need force for IE6  
	$("#AudioBackground").css({  
		"height": windowHeight  
	});  
	ScrollEvent('AudioBackground');
}
function CloseAudio()
{
	$("#AudioBackground").fadeOut("slow");
	$("#AudioDiv").fadeOut("slow");
	ShowAllObjects();
}