function displayTopJobs( section )
{
  if ( typeof tj_jobs != "undefined" && tj_jobs.length > 0 )
  {

    var justOneJob = false ;
	if ( tj_jobs.length > 1 )
      justOneJob = true ;

    // maximum number of top jobs to display		
    var TJ_COUNT = 5 ;

		 tableWidth="228" ;	
		 bottomImageWidth="228";
		 mainCellWidth="204"; 
		 topImage ='<img src="http://media.washingtonpost.com/wp-adv/topjobs/TJ_top.gif" width="228" height="50" border="0" usemap="#tj_top">';   

		if ( typeof section == "string" ) 
    {
      switch ( section )
	  {
	    case "entertainment":
		{
          TJ_COUNT = 5 ;	    
	      break ;				
		}
		case "sitesearch":
		{
		 tableWidth="336" ;	
		 bottomImageWidth="336";
		 mainCellWidth="312"; 
		 topImage ='<img src="http://www.washingtonpost.com/wp-adv/topjobs/topJobsTopper.gif" width="336" height="36" border="0" usemap="#tj_top">';   
	     break ;	
		}
		case "article":
		{
		 tableWidth="336" ;	
		 bottomImageWidth="336";
		 mainCellWidth="312"; 
		 topImage ='<img src="http://www.washingtonpost.com/wp-adv/topjobs/topJobsTopper.gif" width="336" height="36" border="0" usemap="#tj_top">';   
	     break ;	
		}	
	  }
    }

    var tj_limit = (TJ_COUNT>tj_jobs.length) ? tj_jobs.length : TJ_COUNT ;
    var tj_display_jobs = new Array(tj_limit) ;

    for(var i=0; i<tj_limit; i++)
    {
      var tj_random = Math.floor(tj_jobs.length*Math.random()) ;
      tj_display_jobs[i] = tj_jobs[tj_random] ;

      if ( tj_random == 0 ) tj_jobs.shift() ;
      else if ( tj_random == tj_jobs.length ) tj_jobs.pop() ;
      else
      {
        var front = tj_jobs.slice(0,tj_random) ;
        var back = tj_jobs.slice(tj_random+1,tj_jobs.length) ;
        tj_jobs = (front.concat(back)) ;
      }
    }

    var tj_output = '' ;
    tj_output += ( '<table width="'+tableWidth+'" cellpadding="0" cellspacing="0" border="0">' ) ;
    tj_output += ( '<!-- top spacer -->' ) ;
    tj_output += ( '<tr>\n<td colspan="5">'+topImage+'</td>\n</tr>\n' ) ;
    tj_output += ( '<tr>\n' ) ;
    tj_output += ( '<td rowspan="'+(tj_limit+3)+'" width="1" bgcolor="#CC9933"><spacer type="block" width="1"></td>\n' ) ;
    tj_output += ( '<td width="17" height="1" bgcolor="#FFF2CC"><spacer type="block" width="17" height="1"></td>\n' ) ;
    tj_output += ( '<td width="204" height="1" bgcolor="#FFF2CC"><spacer type="block" width="204" height="1"></td>\n' ) ;
    tj_output += ( '<td rowspan="'+(tj_limit+3)+'" width="5" bgcolor="#FFF2CC"><spacer type="block" width="5"></td>\n' ) ;
    tj_output += ( '<td rowspan="'+(tj_limit+3)+'" width="1" bgcolor="#CC9933"><spacer type="block" width="1"></td>\n' ) ;
    tj_output += ( '</tr>\n' ) ;

    tj_output += ('<!-- content -->' ) ;
    for ( var i=0; i<tj_limit; i++ )
    {
      var job = tj_display_jobs[i] ;

      tj_output += ( '<tr>\n' ) ;
      tj_output += ( '<td width="17" bgcolor="#FFF2CC" align="left" valign="top"><font face="verdana,sans-serif" size="-2" color="#989AA9">&nbsp&nbsp;&#149;</font></td>\n' ) ;
      tj_output += ( '<td width="'+mainCellWidth+'" bgcolor="#FFF2CC" align="left" valign="top"><font face="verdana,sans-serif" size="-2" color="#003399"><b><A HREF="'+job.url+'"><font color="#003399">'+job.text+'</font></A></b>/ '+job.posttext+'<br><img src="images/spacer.gif" width="'+mainCellWidth+'" height="3"><br></font></td>\n' ) ;
      tj_output += ( '</tr>\n' ) ;
    }

    tj_output += ('<!-- bottom spacer -->' ) ;
    tj_output += ('<tr>\n<td colspan="2" height="3" bgcolor="#FFF2CC"><spacer type="block" width="221" height="3"></td>\n</tr>\n' ) ;
    if ( justOneJob )
	  tj_output += ('<tr>\n<td colspan="2" align="middle" bgcolor="#FFF2CC"><A HREF="http://www.washingtonpost.com/wl/jobs/JS_JobSearchResult?topjobs=all"><font face="verdana,sans-serif" size="-2" color="#003399"><b>All Top Jobs</b></font></A></td>\n</tr>\n' ) ;
    else
	  tj_output += ('<tr>\n<td colspan="2" align="middle" bgcolor="#FFF2CC" height="1"><spacer type="block" height="1"></td>\n</tr>\n' ) ;
    tj_output += ('<tr>\n<td colspan="5" bgcolor="#FFFFFF"><img src="http://media.washingtonpost.com/wp-adv/topjobs/TJ_bottom.gif" width="'+bottomImageWidth+'" height="16" border="0"></td>\n</tr>\n' ) ;
    tj_output += ('</table>');
	tj_output += ('<map name="tj_top"><area coords="0,0,228,37" href="http://www.washingtonpost.com/wl/jobs/JS_JobSearchResult?topjobs=top"></map>' ) ;

    document.write( tj_output ) ;

if (typeof thisNode == "undefined" )
  thisNode = "" ;

window.onload = tjOnload ;
var parent_node = thisNode.substring(0,(thisNode.indexOf('/')==-1 ? thisNode.length:thisNode.indexOf('/') ) )

function tjOnload ()
{
  if (typeof sa_onclick != "undefined" )
    sa_onclick('http://www.washingtonpost.com/wp-adv/topjobs/tracking/'+parent_node);
}


  } // if tj_jobs != "undefined" && tj_jobs.length > 0
}

