function showlink(url, link_type, bi_tag)
{
	// used for Omniture Tracking
	ctr(bi_tag);

	var status,toolbar,width,height,resizable,scrollbars ;
	
	var left = 0;
	var top = 0;

	if(link_type == 'normal')
	{
		return true; // don't do anything
	}
	if(link_type == 'small_popup')
	{
       width = 480;
	   height = 400;
	   scrollbars = 0;
	   toolbar = 0;
	   resizable = 0;
	   status = 0;

	   left = 25;
	   top = 25;
	}
	else
	if(link_type == 'assess_iq')
	{
       width = 715;
	   height = 600;
	   scrollbars = 1;
	   toolbar = 0;
	   resizable = 1;
	   status = 0;

	   left = 25;
	   top = 25;
	}
	else
	if(link_type == 'new_window')
	{
		// just open a new window
		window.open(url);
		return false;
	}
	else
	{
		return true;
	}

	//alert(url);

	var newWindow = window.open(url,"","width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",scrollbars=" + scrollbars + ",toolbar=" + toolbar + ",resizable=" + resizable + ",status=" + status);
	
	//if(	moveWindow == true)
	//	newWindow.moveTo(XPosition,YPosition);

	return false;
}

function showLogobrandImage()
{
	var logoBrandingName = getCookie("logo-branding_name");
	if(logoBrandingName != null)
	{
		var logoBrandingImageLink = getCookie("logo-branding_image_link");
		var logobrandImage = "<a href=\"" + logoBrandingImageLink + "\"><img border=\"0\" src=\"" + image_server_url + "/logobrand_images/logo_" + logoBrandingName + ".gif\" alt=\"\" width=\"108\" height=\"49\" /></a>";
		document.write(logobrandImage);
	}
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = unescape(document.cookie);
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }

    var end = dc.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
	var s = dc.substring(begin + prefix.length, end); 
    return s;
}

function wmdDoBookmark() {
  /* quick check of the browser and OS */
  var agt=navigator.userAgent.toLowerCase();

  /*** PLATFORM ***/
  var is_win = (agt.indexOf('windows')!=-1);
  var is_mac = (agt.indexOf('mac')!=-1);

  /*** BROWSER ***/
  var is_ie     = (agt.indexOf('msie') != -1);
  var is_firefox = (agt.indexOf('firefox') != -1);
  var is_netscape  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('compatible') == -1));
  var is_safari = ((agt.indexOf('safari')!=-1)&&(is_mac));

  if (is_win) {
    if (is_ie && window.external) {
      window.external.AddFavorite(location.href,document.title);
    }
    else {
      if (is_firefox) {
        alert('Please press CTRL + D to bookmark this page.');
      }
      else {
        if (is_netscape) {
          alert('Please press CTRL + D to bookmark this page.');
        }
        else {
          alert('Please press CTRL + D to bookmark this page.');
        }
      }
    }
  }
  else {
    if (is_mac) {
      if (is_ie && window.external) {
        window.external.AddFavorite(location.href,document.title);
      }
      else {
        if (is_safari) {
          alert('Please press Command (Apple) + D to bookmark this page.');
        }
        else {
          alert('Please press UP arrow + Command (Apple) + D to bookmark this page.');
        }
      }
    }
    else {
      alert('Please press CTRL + D to bookmark this page.');
    }
  }
  return false;
}

function getToday() {
	var now = new Date();
	var days = new Array(
	  'Sunday','Monday','Tuesday',
	  'Wednesday','Thursday','Friday','Saturday');
	var months = new Array(
	  'January','February','March','April','May',
	  'June','July','August','September','October',
	  'November','December');
	var date = ((now.getDate()<10) ? "0" : "") + now.getDate();
	today =  months[now.getMonth()] + " " + date + ", " + (fourdigits(now.getYear()));
	return today;
}	

function fourdigits(number)	{
  return (number < 1000) ? number + 1900 : number;}