//	this is for the included nav
if (document.location.href!="http://personneltodaylivet.rbi.internal" && document.location.href!="http://www.personneltoday.com" && document.location.href.indexOf("home")==-1) {
	// Test for home page - if so, don't do preload
	var preloadlist=new Array("home","news","events","legal","search","yardstick","directory","jobs","careers","links","contact","e-cruit","selftest")
	var navpreload=new Array()
	var counter=0;
	for (j=0;j<preloadlist.length;j++) {
		navpreload[counter]=new Image()
		navpreload[counter].src="../pt_images/nav/include/b_"+preloadlist[j]+"_off.gif"
		counter++
		navpreload[counter]=new Image()
		navpreload[counter].src="../pt_images/nav/include/b_"+preloadlist[j]+"_on.gif"
		counter++
	}
}

function rollover(img,index) {
	document.images[img].src=navpreload[index].src
}
//	end of included nav section

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ShowAd(strSection,strSubSection,strPage,lSizeType,strPosition,strDirectorySubject,strDirectoryTopic)
{

	
	// Check parameter values
	strSection = (null==strSection)?'pthome':strSection;
	strPage = (null==strPage)?'':strPage;
	lSizeType = (null==lSizeType)?1:lSizeType;
	strPosition = (null==strPosition)?1:strPosition;
	
	strDirectorySubject = (null==strDirectorySubject)?'':strDirectorySubject;
	strDirectoryTopic = (null==strDirectoryTopic)?'':strDirectoryTopic;
	
		
	var strAdDivName = 'Adverts';
	var strAdId = '';
	var strSzId = '254';
	var strWidth = '124';
	var strHeight = '44';
	var strKey = '';
	
	var myDate = new Date(); var AT_MISC = myDate.getTime();
	
	switch(lSizeType)
	{
		case 0: strSzId='16';strWidth='1';strHeight='1';break;
		case 1: strSzId='1';strWidth='468';strHeight='60';break;
		case 2: strSzId='254';strWidth='124';strHeight='44';break;
	}
	
	switch(strSection)
	{		
		case 'pthome':
		
		switch(strPosition)
		{
			//case 0:strAdId = '75168';break;
			case 1:strAdId = '75170';break;
			case 2:strAdId = '75169';break;
			case 3:strAdId = '75171';break;
			case 4:strAdId = '75172';break;
		}
		break;
		
		case 'ptdailynews': 
		
		switch(strPosition)
		{
			case 0:strAdId = '83292';break;
			case 1:strAdId = '75176';break;
			case 2:strAdId = '75177';break;
			case 3:strAdId = '75180';break;
			case 4:strAdId = '75182';break;
		}
		break;
		
		case 'ptnewsfeatures': case 'ptnewsawards':
		
		switch(strPosition)
		{
			case 0:strAdId = '75168';break;
			case 1:strAdId = '75189';break;
		}
		break;
		
		case 'ptnewsheadline':
		
		switch(strPosition)
		{
			case 1:strAdId = '75185';break;
		}
		break;
		
		case 'pt_legalfeatlist': 
		
		switch(strPosition)
		{
			case 0:strAdId = '83293';break;
			case 1:strAdId = '75211';break;
		}
		break;
		
		case 'ptystickupdate': case 'ptystickbench': case 'ptystickindicate':
		
		switch(strPosition)
		{
			case 1:strAdId = '75192';break;
		}
		break;
		
		case 'ptcareers':
		
		switch(strPosition)
		{
			case 1:strAdId = '75195';break;
			case 2:strAdId = '75196';break;
			case 3:strAdId = '75197';break;
			case 4:strAdId = '75198';break;
		}
		break;
		
		case 'ptcareers_coach':
		
		switch(strPosition)
		{
			case 1:strAdId = '75199';break;
		}
		break;
		
		case 'ptcareers_guides_detail':
		
		switch(strPosition)
		{
			case 1:strAdId = '80687';break;
			
		}
		break;
		
		case 'ptcareers_events_detail':
		
		switch(strPosition)
		{
			case 1:strAdId = '80689';break;
			
		}
		break;
		
		case 'ptdirectory':
		
		switch(strPosition)
		{
			case 0:strAdId = '83295';break;
			case 1:strAdId = '75200';break;
			case 2:strAdId = '75201';break;
			case 3:strAdId = '75202';break;
			case 4:strAdId = '75203';break;
		}
		break;
		
		case 'ptdirectory_results':
		
		//alert (strDirectoryTopic);
		strKey = 'key='+ strDirectoryTopic +';';
		//alert (strKey);
		
		switch(strPosition)
		{
			case 0:strAdId = '85041';break;
			case 1:strAdId = '75204';break;
		}
		break;
		
		case 'pt_erecruit':
		
		switch(strPosition)
		{
			case 1:strAdId = '75205';break;
		}
		break;
		
		case 'pt_events':
		
		switch(strPosition)
		{
			case 1:strAdId = '75206';break;
		}
		break;
		
		case 'pt_eventslist':
		
		switch(strPosition)
		{
			case 0:strAdId = '83294';break;
			case 1:strAdId = '75206';break;
		}
		break;
		
		case 'ptprint':
		
		switch(strPosition)
		{
			case 1:strAdId = '89670';break;
			
		}
		break;
		
		
		
		case 'legalfeat': case 'ptLegalGuides': case 'legal': 
		case 'ptlegalguidesdetails': case 'ptlegalinternational': case 'ptleglettdetails':
		case 'ptlegalletter': case 'ptLegalTimeFuture': case 'ptlegallinks':
		
		switch(strPosition)
		{
			case 1:strAdId = '75211';break;
		}
		break;
		
		case 'ptlinks': case 'ptlinksresults':
		
		switch(strPosition)
		{
			case 1:strAdId = '75212';break;
		}
		break;
		
		case 'ptquiz':
		
		switch(strPosition)
		{
			case 1:strAdId = '75213';break;
		}
		break;
		
		case 'ptsearch':
		
		switch(strPosition)
		{
			case 1:strAdId = '75214';break;
		}
		break;
		
		case 'ptsearcharticle':
		
		switch(strPosition)
		{
			case 1:strAdId = '75215';break;
		}
		break;
		
		case 'ptsitesearchresults':
		
		switch(strPosition)
		{
			case 1:strAdId = '75216';break;
		}
		break;
		
		default:
		
		switch(strPosition)
		{
			case 1:strAdId = '75217';break;
		}
		break;		
	
	}
	
	// determine which document object to write to 
	// (its different for Netscape with absolute positioned divs,
	//  since each div layer has its own document object)
	 objDoc = document
	if (navigator.appName.indexOf('Netscape')!=-1)
		if (window.document.layers.length>0)
			if (strAdDivName == window.document.layers[strAdDivName].name)
				 objDoc = window.document.layers[strAdDivName].document;
				 
					 
	
	var strURLScript	= 'http://adserver.adtech.de/?addyn|2.0|289|' + strAdId + '|1|' + strSzId + '|';
	var strURLLink		= 'http://adserver.adtech.de/?adlink|2.0|289|' + strAdId + '|1|' + strSzId + '|ADTECH;';
	var strURLImg		= 'http://adserver.adtech.de/?adserv|2.0|289|' + strAdId + '|1|' + strSzId + '|ADTECH;';	
	
	// 26.06.03 Ascension Garcia, IS Development Services
	// add the keyword to the string for adtech targetable ads.
	if (strSection = 'ptdirectory_results')
	
		var strURLScript	= 'http://adserver.adtech.de/?addyn|2.0|289|' + strAdId + '|1|' + strSzId + '|' + strKey;
		var strURLLink		= 'http://adserver.adtech.de/?adlink|2.0|289|' + strAdId + '|1|' + strSzId + '|ADTECH;' + strKey;
		var strURLImg		= 'http://adserver.adtech.de/?adserv|2.0|289|' + strAdId + '|1|' + strSzId + '|ADTECH;' + strKey;	

	
	objDoc.write('<scr' + 'ipt src="' + strURLScript + 'target=_blank;loc=100;misc=' + AT_MISC + ';">');
		
	if (navigator.userAgent.indexOf("Mozilla/2.") >= 0 || navigator.userAgent.indexOf("MSIE") >= 0) 
	{
		objDoc.write('<a href="' + strURLLink + 'loc=200;" target="_blank">');
		objDoc.write('<img src="' + strURLImg + 'loc=200;" border="0" width="' + strWidth + '" height="' + strHeight + '"></a>');
	}
	else
	{
		objDoc.write('<a href="' + strURLLink + 'loc=300;" target="_blank">');
		objDoc.write('<img src="' + strURLImg + 'loc=300;" border="0" width="' + strWidth + '" height="' + strHeight + '"></a>');
	}
	
	objDoc.write('</scr' + 'ipt>');				
}



function ShowSearchAd(strSection,strPage,lSizeType,strPosition,strSearchKeyword)
{
  // Advert engine parameter names
  var strParamNameSite = 'site'
  var strParamNameSection = 'ptsection'
  var strParamNamekeyword = 'ptkeyword'
  var strParamNamePage = 'ptpage'
  var strParamNamePosition = 'ptposition'
  
  // Advert engine default parameter values
  var strSite = 'personneltoday'

  // Temporary variables
  var strParamLine = ''
  var lWidth = 0
  var lHeight = 0
  var objDoc
  var strAdDivName = 'Adverts'

  // Check parameter values
  strSection = (null==strSection)?'':strSection
  strPage = (null==strPage)?'':strPage
  lSizeType = (null==lSizeType)?1:lSizeType
  strPosition = (null==strPosition)?'':strPosition
  strSearchKeyword = (null==strSearchKeyword)?'':strSearchKeyword
  if (""==strPosition) { strPosition='banner' }

  // Determine advert width and height from size type
  switch (lSizeType)
  {
    default: lWidth=498; lHeight=60; break;
    case 2:  lWidth=154; lHeight=44; strPosition='button_' + strPosition; break;
    case 3:  lWidth=30; lHeight=44; strPosition='awards_' + strPosition; break;
    case 4:  lWidth=498; lHeight=60; break;
  }

  // Build parameter string
  strParamLine = strParamNameSite + '=' + strSite
  + '&' + strParamNameSection + '=' + strSection
  + '&' + strParamNamePage + '=' + strPage
  + '&' + strParamNamePosition + '=' + strPosition
  + '&' + strParamNamekeyword + '=' + strSearchKeyword
	
  // determine which document object to write to 
  // (its different for Netscape with absolute positioned divs,
  //  since each div layer has its own document object)
  objDoc = document
  if (navigator.appName.indexOf('Netscape')!=-1)
    if (window.document.layers.length>0)
      if (strAdDivName == window.document.layers[strAdDivName].name)
        objDoc = window.document.layers[strAdDivName].document;

  // Output HTML to call advert engine
  objDoc.write( '<IFRAME src="http://www.rbiproduction.co.uk/html.ng/' + strParamLine + '"' )
  objDoc.write( ' width=' + lWidth + ' height=' + lHeight + ' bgcolor="#ffffff" marginwidth=30 marginheight=0 frameborder=0 scrolling=no' )
  objDoc.write( ' title="Click here for more information...">\n' )
  objDoc.write( ' <SCRIPT language="JavaScript1.1"' )
  objDoc.write( '  src="http://www.rbiproduction.co.uk/js.ng/params.richmedia=yes&' + strParamLine + '"' )
  objDoc.write( '  title="Click here for more information...">\n' )
  objDoc.write( ' </SCRIPT>\n' )
  objDoc.write( '</IFRAME>\n' )
}

function ShowSearchAdWithoutPage(strSection,lSizeType,strPosition,strSearchKeyword)
{
  // Advert engine parameter names
  var strParamNameSite = 'site'
  var strParamNameSection = 'ptsection'
  var strParamNamekeyword = 'ptkeyword'
  var strParamNamePosition = 'ptposition'
  
  // Advert engine default parameter values
  var strSite = 'personneltoday'

  // Temporary variables
  var strParamLine = ''
  var lWidth = 0
  var lHeight = 0
  var objDoc
  var strAdDivName = 'Adverts'

  // Check parameter values
  strSection = (null==strSection)?'':strSection
  lSizeType = (null==lSizeType)?1:lSizeType
  strPosition = (null==strPosition)?'':strPosition
  strSearchKeyword = (null==strSearchKeyword)?'':strSearchKeyword
  if (""==strPosition) { strPosition='banner' }

  // Determine advert width and height from size type
  switch (lSizeType)
  {
    default: lWidth=498; lHeight=60; break;
    case 2:  lWidth=154; lHeight=44; strPosition='button_' + strPosition; break;
    case 3:  lWidth=30; lHeight=44; strPosition='awards_' + strPosition; break;
    case 4:  lWidth=498; lHeight=60; break;
  }

  // Build parameter string
  strParamLine = strParamNameSite + '=' + strSite
  + '&' + strParamNameSection + '=' + strSection
  + '&' + strParamNamePosition + '=' + strPosition
  + '&' + strParamNamekeyword + '=' + strSearchKeyword
	
  // determine which document object to write to 
  // (its different for Netscape with absolute positioned divs,
  //  since each div layer has its own document object)
  objDoc = document
  if (navigator.appName.indexOf('Netscape')!=-1)
    if (window.document.layers.length>0)
      if (strAdDivName == window.document.layers[strAdDivName].name)
        objDoc = window.document.layers[strAdDivName].document;

  // Output HTML to call advert engine
  objDoc.write( '<IFRAME src="http://www.rbiproduction.co.uk/html.ng/' + strParamLine + '"' )
  objDoc.write( ' width=' + lWidth + ' height=' + lHeight + ' bgcolor="#ffffff" align="right" marginwidth=30 marginheight=0 frameborder=0 scrolling=no' )
  objDoc.write( ' title="Click here for more information...">\n' )
  objDoc.write( ' <SCRIPT language="JavaScript1.1"' )
  objDoc.write( '  src="http://www.rbiproduction.co.uk/js.ng/params.richmedia=yes&' + strParamLine + '"' )
  objDoc.write( '  title="Click here for more information...">\n' )
  objDoc.write( ' </SCRIPT>\n' )
  objDoc.write( '</IFRAME>\n' )

}

function RefreshAdFrame(lAdType,strAd,strAd2)
{
  var colFrames
  var lFrame
  var objFrame
  var objLocation

  colFrames = top.frames;

  if (colFrames)
  {
    for (lFrame=0;lFrame<colFrames.length;lFrame++)
    {				
      objFrame = colFrames[lFrame];
      if (objFrame)
      {
        if ('ads'==objFrame.name)
        {
          objLocation = objFrame.location;
          if (objLocation)
          {
            objLocation.href = 'dir_ads.asp?AdType=' + lAdType + '&Ad=' + strAd + '&Ad2=' + strAd2;
            break;
          }
        }
      }
    }
  }
}