var winpop=new function(){
	this.open =function(element ,title ,content){
		var win =document.getElementById('oDiv');
		pos =this.getPosition(element);
		console.log(pos)
		win.innerHTML =title+'<br />';
		win.style.left =pos.x+element.offsetWidth/2+'px';
		win.style.top  =pos.y-element.offsetHeight/2+'px';
		win.style.display="block";
	}
	this.getPosition =function(oNode){
		try{
			var oCurrentNode=oNode;
			var iLeft=0;
			var iTop=0;
			while(oCurrentNode.tagName!="HTML" && oCurrentNode.tagName!="BODY"){
				iLeft+=oCurrentNode.offsetLeft;
				iTop+=oCurrentNode.offsetTop;
				oCurrentNode=oCurrentNode.offsetParent;
			}
			iLeft +=document.body.scrollLeft;
			iTop  +=document.body.scrollTop;
			return {x:iLeft,y:iTop};
		}catch(e){return {x:0,y:0};}
	}
}

