 function centerHeight(obj)
		{
			var xyCoord = new Array();
			xyCoord = findCurrentDocumetPosition('event');
			var xyScreenCoord = new Array();
			xyScreenCoord = getWindowCenterPoint();
			var x = document.getElementById(obj);
			x.style.top = ((xyScreenCoord[1]+xyCoord[1])-(x.style.height.replace("px","")/2)) + 'px';
		}
		function centerPos(obj)
		{
		    
			//alert(obj);
			var xyCoord = new Array();
			xyCoord = findCurrentDocumetPosition('event');
			var xyScreenCoord = new Array();
			xyScreenCoord = getWindowCenterPoint();
			var x = document.getElementById(obj);
			//alert(x);
			x.style.top = ((xyScreenCoord[1]+xyCoord[1])-(x.style.height.replace("px","")/2)) + 'px';
			x.style.left =((xyScreenCoord[0]+xyCoord[0])-(x.style.width.replace("px","")/2)) + 'px';
			x.style.visibility='visible';
      		x.style.display='block';
		
	  	}
		
		var WindowPosition=new Object();
		WindowPosition.getWindowSize = function(w) {
			var width, height;
			w = w ? w : window;
			this.width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth);
			this.height = w.innerHeight || (w.document.documentElement.clientHeight || 
			w.document.body.clientHeight);
			return this;
		}
		
		var getWindowCenterPoint = function(){
 			var _position = WindowPosition.getWindowSize();
 			var coordinates = new Array();
			coordinates[0] = _position.width/2;
			coordinates[1] = _position.height/2;
			return coordinates;
		}


		var findCurrentDocumetPosition  = function(obj) {
        	var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
			var dsocleft = document.all? iebody.scrollLeft : pageXOffset
	    	var dsoctop = document.all? iebody.scrollTop : pageYOffset
        	return [dsocleft,dsoctop];
		}
 function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY ;
		xWithScroll = window.innerWidth + window.scrollMaxX - (17);
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}
 