function PopupTag(objid) {
	this.objid = objid;
	this.popupDivID = this.objid+'Tag';
	this.popupIFrameID = this.objid+'TagIframe';
	var div = document.createElement('div');
	div.setAttribute('id',this.popupDivID);
	div.setAttribute((document.all ? 'className' : 'class'),'yellowtag');
	var iframe = document.createElement('iframe');
	iframe.setAttribute('id',this.popupIFrameID);
	iframe.setAttribute((document.all ? 'className' : 'class'),'yellowtagiframe');
	iframe.setAttribute('src','/source/?m=blank');
	iframe.setAttribute('frameBorder',0);
	$('bodyTag').appendChild(div);
	$('bodyTag').appendChild(iframe);
}
PopupTag.prototype.show = function(text) {
	var coors = getPos($(this.objid));
	$(this.popupDivID).innerHTML = text;
	if ($(this.popupDivID).offsetWidth > 300) {
		$(this.popupDivID).style.whiteSpace = 'normal';
		$(this.popupDivID).style.width = '300px';
	}
	$(this.popupDivID).style.top = coors[1] - $(this.popupDivID).offsetHeight - 2 + 'px';
	coors[0] = coors[0] - (($(this.popupDivID).offsetWidth - $(this.objid).offsetWidth) / 2);
	if (coors[0] + $(this.popupDivID).offsetWidth > 977) {
		coors[0] = 977 - $(this.popupDivID).offsetWidth;
	}
	$(this.popupDivID).style.left = coors[0] + 'px';
	$(this.popupIFrameID).style.top = $(this.popupDivID).offsetTop + 'px';
	$(this.popupIFrameID).style.left = $(this.popupDivID).offsetLeft + 'px';
	$(this.popupIFrameID).style.width = $(this.popupDivID).offsetWidth + 'px';
	$(this.popupIFrameID).style.height = $(this.popupDivID).offsetHeight + 'px';
	$(this.popupDivID).className = 'yellowtagover';
	$(this.popupIFrameID).className = 'yellowtagiframeover';
}
PopupTag.prototype.hide = function() {
	$(this.popupDivID).innerHTML = '';
	$(this.popupDivID).style.whiteSpace = 'nowrap';
	$(this.popupDivID).className = 'yellowtag';
	$(this.popupIFrameID).className = 'yellowtagiframe';
	$(this.popupDivID).style.top = 0;
	$(this.popupDivID).style.left = 0;
	$(this.popupDivID).style.width = '';
	$(this.popupIFrameID).style.top = 0;
	$(this.popupIFrameID).style.left = 0;
}
popups = new Array();
function newTag(objid) {
	if (typeof popups[objid] == 'undefined') {
		popups[objid] = new PopupTag(objid);
	}
}
function showTag(obj,display) {
	if (typeof popups[obj.id] != 'undefined') {
		popups[obj.id].show(display);
	}
}
function hideTag(obj) {
	if (typeof popups[obj.id] != 'undefined') {
		popups[obj.id].hide();
	}
}
