
 
		function centerPos(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';
			x.style.left =((xyScreenCoord[0]+xyCoord[0])-(x.style.width.replace("px","")/2)) + 'px';
			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];
		}
 