function popUpFat(URL) {
  id = 1000 ;
  eval("pageFat = window.open(URL, '" + id +
       "','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,"
       + "resizable=1,width=1000,height=780,left = 10,top = 10');");
  if (pageFat == null) {
    alert(
      'Error while launching new window! Your browser maybe blocking popups.'
        + '\nPlease allow popups from http://www.Thulasidas.com to see this content.'
        + '\nOr, use <Control><Alt> click on the link to temporarily allow the popup.') ;
  }
  else {
    pageFat.focus() ;
  }
}

function PrologN(quote, dude, face, num)
{
  var ImgCol = '/img/' + face + 'c.gif' ;

  document.write(
    '<table align="center" width="70%" border="0" rules="none">'
      + ' <tr><td width="80%">'
      + ' <table border="0"><tr><td> '
      + ' <i>"' + quote +'"</i></td></tr>'
      + ' <tr><td align="right">&#8212; ' + dude + '</td></tr>'
      + ' </table></td><td align="center">'
      + ' <img src="' + ImgCol + '" /></td></tr></table>') ;
}

function Prolog(quote, dude, face)
{
  PrologN(quote, dude, face, '0') ;
}

function AttachPDF(pdf, title)
{
  if( typeof(title) == 'undefined' ){
    title = 'Published Version (PDF)' ;
  }
  document.write(
    '<a href="javascript:popUpFat(\'/col/'
      + pdf + '\')" title="' + title + ' [Pops up a window]"'
      + '><img src="/img/pdf.gif" /> '
      + title + '</a>' ) ;
}

function amazon(str, alt, title, cls)
{
  asin = str.replace(/^\s+|\s+$/g, '') ;
  if( typeof(alt) == 'undefined' ){
    alt = '[Amazon:' + asin + ']' ;
  }
  if( typeof(title) == 'undefined' ){
    title = alt ;
  }
  if( typeof(cls) == 'undefined' ){
    cls = 'alignleft' ;
  }
  var Url = 'http://www.amazon.com/exec/obidos/ASIN/' + asin + '/unrblo-20' ;
  var Img = 'http://images.amazon.com/images/P/' + asin + '.01._SCMZ_.gif' ;

  document.write(
    '<a href="javascript:popUpFat(\'' + Url
      + '\')" title="' + title + ' [Pops up a window]"'
      + '><img src= "' + Img + '" '
      + ' alt= "' + Img + '"'
      + ' class= "'+ cls + '"'
      + ' /></a>' ) ;
}

function changeText(id, text)
{
  document.getElementById(id).innerHTML = text ;
}

function changeImg(id, img)
{
  document.getElementById(id).innerHTML = '<a name=""></a> <img src="' + img + '" />' ;
}

