var BusinessCard = false;

function ShowBusinessCard(obj, name, text1, text2) {
	RemoveBusinessCard();

	if(BusinessCard == false) {
		BusinessCard = document.createElement('DIV');
		var html = '';
		BusinessCard.id = 'BusinessCard';
		BusinessCard.style.zIndex = 1;
		/*BusinessCard.style.height = 130+'px';*/
		BusinessCard.style.width = 360+'px';
		BusinessCard.style.backgroundColor = '#E4E4E4';
		BusinessCard.style.position = 'absolute';
		var container = document.getElementById("leftcontent");
		
		var o = container;
		var x = o.offsetLeft;
		var y = o.offsetTop;
		var p;
		
		while(o.offsetParent!=null) {
			p = o.offsetParent;
			x += p.offsetLeft;
			y += p.offsetTop;
			o = p;
		}
		
		BusinessCard.style.top = (y + 170) +'px';
		BusinessCard.style.left = (x + 140) +'px';
		
		text1 = text1.replace(/&quote;/g, '"');
		text2 = text2.replace(/&quote;/g, '"');

		/*BusinessCard.style.top = y+'px';
		BusinessCard.style.left = (x+10)+'px';*/
		

		html += '<table style="width: 100%; height: 100%; border: 1px solid #666666;" cellspacing="0" cellpadding="0">';
		html += '<tr>';
		html += '<td id="header" colspan="2"><span>'+name+'</span></td>';
		html += '</tr>';
		html += '<tr>';
		html += '<td id="left"><div id="leftcontent">'+text1+'</div></td>';
		html += '<td id="right"><div id="rightcontent">'+text2+'</div></td>';
		html += '</tr>';
		html += '<tr>';
		html += '<td id="bottom" colspan="2"><img src="site_images/closewndw.gif" alt="close window" onclick="RemoveBusinessCard();"></td>';
		html += '</tr>';
		html += '</table>';

		BusinessCard.innerHTML = html;
		document.body.appendChild(BusinessCard);
	}
}

function RemoveBusinessCard() {
	if (BusinessCard != false) {
		document.body.removeChild(BusinessCard);
		BusinessCard = false;
	}
}
