
document.write('<div style="text-align:center; width:100%; margin-top:10px; margin-bottom:10px; "><div style="margin:auto; width:700px; text-align:center; border:2px black solid; font-family:arial; font-size:15px; color:#000000; background:white; "><div style="font-family:arial; font-size:15px; font-weight:bold; background:white; color:#000000; margin-top:5px; margin-bottom:5px; " id="pdtitle">Looking for more prison penpals? &nbsp;Visit</div><div style=" font-size:13px; "><div style="width:50%; background:#ffbbd2; text-align:center; float:left; height:85px; "><a href="http://www.paperdollspenpals.com/newest.asp" target="_PaperDolls" style="font-weight:bold; font-size:14px; ">Paper Dolls</a><br>Women in prison looking for friends in the free world.<br>Free addresses on each profile page.<br>Free pages for inmates.<br>Since 2001</div><div style="background:#bbb; text-align:center; margin-left:50%; height:85px; "><a href="http://www.ironmenpenpals.com/newest.asp" target="_IronMen" style="font-weight:bold; font-size:14px; ">Iron Men</a><br>Men in prison looking for friends in the free world.<br>Free addresses on each profile page.<br>Since 2009</div></div></div></div>');

var colorincrement=8;

function fadeto(divid, colorto)
{
var onediv = document.getElementById(divid);
var colorfrom = onediv.style.color + '';

//alert(colorfrom);
if (colorfrom == 'undefined') colorfrom='';
else if (colorfrom.indexOf('rgb') == 0)
  {
  colorfrom = colorfrom.substr(colorfrom.indexOf('(') + 1);
  colorfrom = colorfrom.substr(0, colorfrom.indexOf(')'));
  colorfrom = colorfrom.split(', ');
  colorfrom=rgb(colorfrom[0], colorfrom[1], colorfrom[2]);
  }
if (colorfrom.length==0) colorfrom ='#000000';

if (colorfrom.indexOf('#') == 0) colorfrom = colorfrom.substr(1);

var redfrom = parseInt('0x' + colorfrom.substr(0,2), 16);
var greenfrom = parseInt('0x' + colorfrom.substr(2,2), 16);
var bluefrom = parseInt('0x' + colorfrom.substr(4,2), 16);

if (colorto.indexOf('#') == 0) colorto=colorto.substr(1);

var redto = parseInt('0x' + colorto.substr(0,2), 16);
var greento = parseInt('0x' + colorto.substr(2,2), 16);
var blueto = parseInt('0x' + colorto.substr(4,2), 16);

var reddirection = 1, greendirection = 1, bluedirection = 1;

if (redto < redfrom) reddirection = -1;
if (greento < greenfrom) greendirection = -1;
if (blueto < bluefrom) bluedirection = -1;

if (Math.abs(redto - redfrom) <= colorincrement)
  {redfrom=redto;}
else
  {redfrom += reddirection * colorincrement;}
  
if (Math.abs(greento - greenfrom) <= colorincrement)
  {greenfrom=greento;}
else
  {greenfrom += greendirection * colorincrement;}
  
if (Math.abs(blueto - bluefrom) <= colorincrement)
  {bluefrom=blueto;}
else
  {bluefrom += bluedirection * colorincrement;}

onediv.style.color=rgb(redfrom, greenfrom, bluefrom);;

var timeout = 50;
if (redfrom == redto && (greenfrom==greento && bluefrom == blueto))
  {
  ti++;
  ti %= titlecolor.length;
  colorto=titlecolor[ti];
  timeout=1200;
  }
setTimeout('fadeto("' + divid + '", "' + colorto + '")', timeout);
}

function rgb(red, green, blue)
{
var rgbcolor='#';
var hexdigit='0123456789abcdef';

rgbcolor += hexdigit.charAt(Math.floor(red / 16));
rgbcolor += hexdigit.charAt(red % 16);
rgbcolor += hexdigit.charAt(Math.floor(green / 16));
rgbcolor += hexdigit.charAt(green % 16);
rgbcolor += hexdigit.charAt(Math.floor(blue / 16));
rgbcolor += hexdigit.charAt(blue % 16);

return rgbcolor;
}

var ti=0;
var titlecolor=['#000000', '#ff0000', '#0000bb', '#ff8833', '#00aa00', '#bbbbbb', '#ffbbd2'];
setTimeout('fadeto("pdtitle", "' + titlecolor[ti] + '")', 3000);


