function get_data(id){
	var url = popup_url+ encodeURIComponent(id);
	//innerData(popup,"");
	popup=1;
	xmlHttp.open("POST", url, true);
  	xmlHttp.onreadystatechange = update_popup;
  	xmlHttp.send(null);
}


var prev_user_popup='';
var user_popup_show='';
var user_popup_confirm=false;


var delta=20;
var cur_w=0;
var m_w=0;
var interval_show;
var timeout_show;
var popup=null;
var other_elm;
var other_elm1;
var other_elm2;
var prev_elm;

function innerData(elm,data){
	elm.innerHTML=data;
}

function update_popup(){
	if (xmlHttp.readyState==4&&xmlHttp.responseText!=""){
	pos=getElementPositionIE(other_elm);
	pos2=getElementPosition(other_elm1);
	pos3=getElementPosition(other_elm2);
	popup=document.createElement('div');
	popup.className="user_popup_show";
	popup.id="comment_popup_user_id";
	popup.style.top=(pos3.top-25)+'px';
	popup.style.left=(pos.left+pos.width)+'px';
	popup.onmouseover=set_popup_over;
	popup.onmouseout=set_popup_out;
	popup=document.body.appendChild(popup);
	//popup.style.right='0px';
	innerData(popup,xmlHttp.responseText);
	img=popup.getElementsByTagName('IMG');
	pos2=getElementPosition(img[0]);
	w=img[0].width;
	if (img[0].height&&img[0].height>65){
		h=img[0].height;
		h=h*65/w;
		img[0].height=h;
	}
	img[0].width='65';
	}
}

function show_user_popup(event,elm,id){
	if ((popup==null&&xmlHttp)||(other_elm!=elm)){
	elm1=elm;
	elm2=elm;
	while (elm1&&elm1.tagName!='SPAN'){
		elm1=elm1.parentNode;
	}	
	while (elm2&&elm2.tagName!='DIV'){
		elm2=elm2.parentNode;
	}		
		other_elm=elm;
		other_elm1=elm1;
		other_elm2=elm2;
		prev_user_popup=id;
		hide_user_popup();
		user_popup_show=id;
		prev_elm=elm;
		get_data(id);
	}
}


function getElementPositionIE(elemId){
	   var elem = typeof elemId == 'object' ? elemId : document.getElementById(elemId);

		if (elem.getBoundingClientRect) {
		      var box = elem.getBoundingClientRect();
		      var t = box.top;
	 	 	  var l = box.left;
		}else{
			 var l = 0;
			 var t = 0;
			 var myelem=elem;
			 while (elem){
			   l += elem.offsetLeft;
				 t += elem.offsetTop;
				 elem = elem.offsetParent;
			 }
		}
			var w = elem.offsetWidth;
		 	var h = elem.offsetHeight;

		 return {"left":l, "top":t, "width": w, "height":h};
}


function getElementPosition(elemId){
	   var elem = typeof elemId == 'object' ? elemId : document.getElementById(elemId);
		 var w = elem.offsetWidth;
		 var h = elem.offsetHeight;
		 var l = 0;
		 var t = 0;
		 var myelem=elem;
		 IE='\v'=='v';
		 while (elem){
		   l += elem.offsetLeft;
			 t += elem.offsetTop;
			 if (IE&&elem.style&&elem.style.marginLeft){
				 l-=elem.style.marginLeft;
			 }
			 elem = elem.offsetParent;
		 }
		 return {"left":l, "top":t, "width": w, "height":h};
}


function start_timeout_hide(event){
	timeout_show=setTimeout("hide_user_popup()",1000);
}




function set_show_window(w,t){
	popup.style.width='330px';
}

function set_w(w,d){
	if (cur_w+d<m_w){
		cur_w=cur_w+d;
		popup.style.width=(cur_w+d)+'px';
	}else{
		cur_w=m_w;
		popup.style.width=m_w+'px';
		clearInterval(interval_show);
	}
}

function hide_user_popup(){
	if (popup!=null&&popup!='1'&&popup.className=='user_popup_show'){
		popup.className='user_popup_hide';
		popup.parentNode.removeChild(popup);
		popup=null;
	}
	user_popup_confirm=false;
}

function set_popup_over(){
	user_popup_confirm=true;
	clearTimeout(timeout_show);
}
function set_popup_out(){
	user_popup_show='';
	user_popup_confirm=false;
	timeout_show=setTimeout("hide_user_popup()",1000);
}