var standardStyle1 = "<body bgcolor=0 text=#ffffff link=#cafaca vlink=#aafaaa background=galbg.jpg>"
var standardStyle3 = "<body bgcolor=0 text=#ffffff link=#cafaca vlink=#aafaaa background=bg3.jpg>"
var standardStyle4 = "<body bgcolor=0 text=#ffffff link=#cafaca vlink=#aafaaa background=bg4.jpg>"

var cssLink = "<link href='jbh.css' rel='stylesheet'>"

function writeStyle1() {
  document.write(standardStyle1+cssLink)
}

function writeStyle3() {
  document.write(standardStyle3+cssLink)
}

function writeStyle4() {
  document.write(standardStyle4+cssLink)
}

var newWindow
function makeNewWindow( fileName ) {
  if (!newWindow || newWindow.closed) {
    newWindow = window.open(fileName, "", "height=600,width=800")
    if (!newWindow.opener) {
      newWindow.opener = window
    }
  } else {
    // window's already open
    newWindow.focus()
    newWindow.location = fileName
//    newWindow.document.URL = fileName
  }
}

function makePicPage2 ( picFileName ) {
  if (!newWindow || newWindow.closed) {
    newWindow = window.open("", "", "height=800,width=800")
    if (!newWindow.opener) {
      newWindow.opener = window
    }
  } else {
    // window's already open
    newWindow.focus()
  }
  newWindow.document.clear();
  newWindow.document.open();
  newWindow.document.write('<html>');
  newWindow.document.write('<script language="JavaScript" src="functions.js"></script>');
  newWindow.document.write('<head>');
  newWindow.document.write('</head>');
  newWindow.document.write(standardStyle3+cssLink)
  newWindow.document.write('<center>');

  newWindow.document.write('<img src="', picFileName, '" />')

  newWindow.document.write('</center>');
  newWindow.document.write('<script type="text/javascript" language="javascript">');
  newWindow.document.write('var sc_project=2242424;');
  newWindow.document.write('var sc_invisible=1;');
  newWindow.document.write('var sc_partition=20;');
  newWindow.document.write('var sc_security="bf338d1a";');
  newWindow.document.write('</script>');
  newWindow.document.write('<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/frames.js">');
  newWindow.document.write('</script><noscript><a href="http://www.statcounter.com/" target="_blank">');
  newWindow.document.write('<img src="http://c21.statcounter.com/counter.php?sc_project=2242424&java=0&security=bf338d1a&invisible=1" border="0"></a></noscript>');
  newWindow.document.write('</body></html>');
  newWindow.document.close();

} // function makePicPage2

function makePicPage( picFileName ) {
  document.clear();
  document.open();
  document.write('<html>');
  document.write('<script language="JavaScript" src="functions.js"></script>');
  document.write('<head>');
  document.write('</head>');
  document.write(standardStyle3+cssLink)
  document.write('<center>');

  document.write('<img src="', picFileName, '" />')

  document.write('</center>');
  document.write('<script type="text/javascript" language="javascript">');
  document.write('var sc_project=2242424;');
  document.write('var sc_invisible=1;');
  document.write('var sc_partition=20;');
  document.write('var sc_security="bf338d1a";');
  document.write('</script>');
  document.write('<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/frames.js">');
  document.write('</script><noscript><a href="http://www.statcounter.com/" target="_blank">');
  document.write('<img src="http://c21.statcounter.com/counter.php?sc_project=2242424&java=0&security=bf338d1a&invisible=1" border="0"></a></noscript>');
  document.write('</body></html>');
  document.close();
}

function picPageLink( picPath, picFileName, alignment ) {
  document.write('<a href="javascript:void(0)" onClick="makePicPage2(\'', picPath+picFileName, '\' )">')
  document.write('<img src="',picPath+'t-'+picFileName,'" alt="" border="0" ')
  if ( alignment == 0 ) {} // do nothing
  if ( alignment == 1 ) { document.write(' align="right"')}
  if ( alignment == 2 ) { document.write(' align="left"')}
  document.write('/></a>')
}


function picPageLink2( picPath, picFileNames, alignment ) {
  var fnArray = picFileNames.split('|')
  for (i = 0; i < fnArray.length; i++ ) {
    document.write('<a href="javascript:void(0)" onClick="makePicPage2(\'', picPath+fnArray[i], '\' )">')
    document.write('<img src="',picPath+'t-'+fnArray[i],'" alt="" border="0" ')
    if ( alignment == 0 ) {} // do nothing
    if ( alignment == 1 ) { document.write(' align="right"')}
    if ( alignment == 2 ) { document.write(' align="left"')}
    document.write('/></a> ')
  }
}

function amazonLink(isbn) {
  document.write('<a target="0" href="http://www.amazon.com/exec/obidos/ASIN/', isbn, '/');
  document.write('theofficialharry/"><img src="amazoncom.png" alt="Amazon.com" border="0"/></a>');
}

function amazonUKLink(isbn) {
  document.write('<a target="0" href="http://www.amazon.co.uk/exec/obidos/ASIN/', isbn, '/');
  document.write('theofficialhar00/"><img src="amazoncouk.png" alt="Amazon.co.uk" border="0"/></a>');
}


