// make new popup window
function confirm_ad(oAnchor)
{
	// Original Author: James Craig
	// Source: http://cookiecrook.com/AIR/2003/train/jsexamples.php
	// Modified by Peter Sheppard for RCN

	// one browser sniff to account for a known bug
  var sUserAgent = navigator.userAgent.toLowerCase();
  var isOp = (sUserAgent.indexOf('opera')!=-1)?true:false;
  
	var sUrl = '';

	// get URL from calling link oAnchor
	if(oAnchor.getAttribute)
	  sUrl = oAnchor.getAttribute('href');
	
	if(sUrl=='')
	  sUrl = oAnchor.href;

	// if still no URL, return true and let the regular link take over
	if(sUrl=='')
	  return true;

	// if no window properties are defined in the function call's optional parameter 'sProps'
	sProps = "";

	// assign the popup to this variable so we can verify it exists
	if(sUrl)
	  if (confirm("Click OK to open this advert in a new window or click Cancel to open in the current window."))
		  var oPopup = window.open(sUrl);

	// An Opera bug returns too early if you focus the window, so we don't focus it in that browser.
	// Only a noticable defect if a window is already open and hidden.
	if(oPopup && !isOp)
	  oPopup.focus();

	// If popup was created successfully, cancel link in calling window.
	// Acts as regular link in browser that blocks requested popups or has JavaScript turned off.
	return (oPopup)?false:true;
}

// Show comments form when icon clicked
function show_comments_form(assetid)
{
	var cf = 'comment_form_'+assetid;
	var cb = 'add_comments_button_'+assetid;
	
	document.getElementById(cf).style.display = '';
	document.getElementById(cb).style.display = 'none';
}
