//
//
//

function openNewWindow( url )
{
	window.open( url, "myWin", "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes" );
}

//
//
//

function setCookieAndReload( name, value )
{
	var today = new Date;
	var expiryDate = new Date;

	expiryDate.setTime( today.getTime() +  1000 * 60 * 60 * 24 * 365 );
	
	document.cookie =
		name + "=" + value +
    "; expires=" + expiryDate.toGMTString() +
    "; path=/";

  window.location.reload();
}

//
//
//

function addUrlParamAndReload( name, value )
{
  if ( window.location.href.indexOf( '?' ) == -1 )
  {
	  window.location.href = window.location.href + "?" + name + "=" + value;
  }
  else
  {
    window.location.href = window.location.href + "&" + name + "=" + value;
  }
}

//
//
//

function toggleAbstract( count )
{
  var element = document.getElementById( "abstract" + count );
  var toggle = document.getElementById( "abstract-link" + count );

  if ( element.className == "abstract-hidden" )
  {
    element.className = "abstract";
    toggle.innerHTML = "^";
    return;
  }

  if ( element.className == "abstract" )
  {
    element.className = "abstract-hidden";
    toggle.innerHTML = "overview";
    return;
  }
}
