
////////////////////////////////////////////////////////
function render_ewc_popin_container(show_close_button) {
////////////////////////////////////////////////////////
	
	document.writeln('<div id="ewc_anchored_popin" class="ewc_anchored_popin_class">');
	if(show_close_button == true) {
		document.writeln('<img class="pseudo_link" style="float: right; margin-top: 2px; margin-right: 6px;"');
		document.writeln('     src="media/img/etc/xp_close_off.png" width="28" height="15"');
		document.writeln('     onMouseOver="this.src=\'media/img/etc/xp_close_over.png\'"');
		document.writeln('     onMouseOut="this.src=\'media/img/etc/xp_close_off.png\'"');
		document.writeln('     onMouseDown="this.src=\'media/img/etc/xp_close_click.png\'"');
		document.writeln('     onMouseUp="this.src=\'media/img/etc/xp_close_over.png\'"');                        
		document.writeln('     onClick="document.getElementById(\'ewc_anchored_popin\').style.visibility = \'hidden\'">');
	} // end if
	document.writeln('<div id="ewc_anchored_popin_content"></div>');
	document.writeln('</div>');
	SET_DHTML('ewc_anchored_popin' + NO_DRAG);
	
/////////////////
} // end function
/////////////////

//////////////////////////////////////////////////////
function show_ewc_popin(anchor_object, text_to_show) {
//////////////////////////////////////////////////////
	
	// Let's get the anchor position and size
	if(document.all) {
		// MSIE
		var xoffset = $(anchor_object).offset();
		xleft   = xoffset.left;
		xtop    = xoffset.top;
		xwidth  = anchor_object.width;
		xheight = anchor_object.height;
	} else {
		// Other browsers
		xleft   = anchor_object.offsetLeft;
		xtop    = anchor_object.offsetTop;
		xwidth  = anchor_object.width;
		xheight = anchor_object.height;
	} // end if
	
	// Let's put the content
	document.getElementById('ewc_anchored_popin_content').innerHTML = text_to_show;
	
	// Let's position and show the popin
	tleft = xleft + xwidth - 20;
	ttop  = xtop - 130;
	dd.elements['ewc_anchored_popin'].moveTo(tleft, ttop);
	document.getElementById('ewc_anchored_popin').style.visibility = 'visible';
	// alert('left: ' + tleft + ' top: ' + ttop);
	
/////////////////
} // end function
/////////////////

///////////////////////////
function hide_ewc_popin() {
///////////////////////////
	
	document.getElementById('ewc_anchored_popin').style.visibility = 'hidden';
	
/////////////////
} // end function
/////////////////



///////////////////////////
function switch_ewc_popin(anchor_object, text_to_show) {
///////////////////////////
	if(document.getElementById('ewc_anchored_popin').style.visibility == 'hidden')
	{
		show_ewc_popin(anchor_object, text_to_show);
	}
	else
	{
		document.getElementById('ewc_anchored_popin').style.visibility = 'hidden';
	}
/////////////////
} // end function
/////////////////

