

var winW;
var winH;



function displayReportFollowup() {

	fdTableSort.init('reportTable');
	hideSaveProgress();

}

function getWindowSize() {
  
	if (document.documentElement.clientWidth)
		winW = document.documentElement.clientWidth; // Firefox
	else
		winW = document.body.clientWidth; // IE
		
	if (document.documentElement.clientHeight)
		winH = document.documentElement.clientHeight; // Firefox
	else
		winH = document.body.clientHeight // IE
}


function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 50;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
    }
  }
}

function fadeOut(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity >= 0) {
      setOpacity(obj, opacity);
      opacity -= 10;
      window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 100);
    } else {
      obj.style.visibility = "hidden";
    }
  }
}


function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}


function showSaveProgress() {
	getWindowSize();
	
	height = document.body.scrollHeight;
	document.getElementById('saveProgressSpan').style.width = winW+'px';
	document.getElementById('saveProgressSpan').style.height = height+'px';
	document.getElementById('saveProgressSpan').style.visibility = 'visible';
}

function hideSaveProgress() {
	document.getElementById('saveProgressSpan').style.visibility = 'hidden';
	document.getElementById('saveProgressSpan').style.width = '0px';
	document.getElementById('saveProgressSpan').style.height = '0px';
}

function showFadeBackground() {
	getWindowSize();
	height = document.body.scrollHeight;

	document.getElementById('fadeBackground').style.width = winW+'px';
	document.getElementById('fadeBackground').style.height = height+'px';
	document.getElementById('fadeBackground').style.visibility = 'visible';
}

function hideFadeBackground() {
	document.getElementById('fadeBackground').style.visibility = 'hidden';
	document.getElementById('fadeBackground').style.width = '0px';
	document.getElementById('fadeBackground').style.height = '0px';
}


function registerScroll(scrollableId){
	scrollFunct = function(){
	var floating = document.getElementById(scrollableId);
	var theTop;
	if (document.documentElement && document.documentElement.scrollTop)
		theTop = document.documentElement.scrollTop;
	else if (document.body)
		theTop = document.body.scrollTop
	else
		theTop = 0;
	if(document.all)
		floating.top = (theTop + 120)+"px";
	else
		floating.style.top = (theTop + 120)+"px";
	}
	document.onscroll = scrollFunct;
}

function getEvent(e){
  if(window.event != null) {
    return event;
  }
  return e;
}

function setBKColor(e){
	e = getEvent(e);
	var src =  e.srcElement || e.target;
	if(src != null) {
		src.style.backgroundColor = "#FFFFEE";
		src.style.borderColor = "red";
		
	}
}
function reSetBKColor(e){
	e = getEvent(e);
	var src =  e.srcElement || e.target;
	if(src != null) {
		src.style.borderColor = "#6593C0";
		src.style.backgroundColor = "#E1E8EF";
	}
}


function doNothing(e) {
	e = getEvent(e);
}


function showFloaty() {
	if (document.getElementById('floaty')) {
		document.getElementById('floaty').style.visibility = "visible";
		document.getElementById('showFloatyLink').style.display = "none";
		document.getElementById('hideFloatyLink').style.display = "block";
	}
}
function hideFloaty() {
	if (document.getElementById('floaty')) {
		document.getElementById('floaty').style.visibility = "hidden";
		document.getElementById('showFloatyLink').style.display = "block";
		document.getElementById('hideFloatyLink').style.display = "none";
	}
}

