// JavaScript Document
//start of functions used in user_rightmenu.asp menu and body onload
//to dynamically load content into existing page and resize page elements

var minPageHeight = 773; //used to define mini page height

//detect if IE or not
function pagesize(strDiv,intHeight,blnSuppressRightFiller) {
	//if browser height is greater than intPx, adjust intPx to browser height
	var brHeight = browserWidthHeight('height');
	var brWidth =  browserWidthHeight('width');
	if (brHeight < minPageHeight) {brHeight = minPageHeight;}
	//brHeight = 633;
	
	var maincolumn = document.getElementById('maincolumn');
	var t_topgreybar = document.getElementById('t_bottomgreybar');
	var t_facebook_logo = document.getElementById('t_facebook_logo');
	var t_twitter_logo = document.getElementById('t_twitter_logo');
	var t_bottomgreybar = document.getElementById('t_bottomgreybar');
	var t_rightfiller = document.getElementById('t_rightfiller');	
	
	//set heights and top
	maincolumn.style.height = (brHeight) +'px';
	t_facebook_logo.style.top = (brHeight-46) +'px';
	t_twitter_logo.style.top = (brHeight-46) +'px';
	t_bottomgreybar.style.top = (brHeight-10) +'px';
	t_rightfiller.style.height = (brHeight-20) +'px';
	
	//set widths
	
	if (brWidth>1024) {
		t_topgreybar.style.width = '100%';
		t_bottomgreybar.style.width = '100%';
		t_rightfiller.style.width = (brWidth-1024) +'px';
		if (blnSuppressRightFiller==true) {
			var widget = document.getElementById('widget');
			widget.style.left = (brWidth-300) +'px';
			widget.style.visibility = 'visible';}
		else
			{t_rightfiller.style.visibility = 'visible';}
		}
	else {
		t_topgreybar.style.width = '1024px';
		t_bottomgreybar.style.width = '1024px';
		t_rightfiller.style.width = '0px';
		t_rightfiller.style.visibility = 'hidden';}
	
	if (document.getElementById('t_menubckg'))  {
		var t_menubckg = document.getElementById('t_menubckg');
		t_menubckg.style.height = (brHeight-20) +'px';//set page height
		}
	document.getElementById(strDiv).style.top = (brHeight-intHeight-10) +'px';
	document.getElementById(strDiv).style.visibility = 'visible';
}

function bottomAlign(strDiv,intHeight)  {
	var brHeight = browserWidthHeight('height');
	alert(brHeight);
	//brHeight = 633;
	if (brHeight < minPageHeight) {brHeight = minPageHeight;}
	//brHeight=633;
	document.getElementById(strDiv).style.top = (brHeight-intHeight-10) +'px';
	document.getElementById(strDiv).style.visibility = 'visible';
	
}
function browserWidthHeight(type) {
		d=document;xMax=0;yMax=0;
		if(d.getElementById){
	 if(d.documentElement&&d.documentElement.clientHeight){
	  xMax=d.documentElement.clientWidth;
	  yMax=d.documentElement.clientHeight;
	 }else{
	  xMax=(d.all)?d.body.clientWidth:window.innerWidth;
	  yMax=(d.all)?d.body.clientHeight:window.innerHeight;
	 }
	}else if(d.layers){
	 xMax=window.innerWidth;
	 yMax=window.innerHeight;
	}
	
	if(type=='width') {return xMax;}
	else if (type=='height') {return yMax;}
}









