function WriteNavStart ()
{
document.write("[ ");
}
function WriteNavEnd ()
{
  document.write("]");
}
function WriteOneNav (link, name, idontlink)
{
  document.write(" | ");
  WriteOneNavNoBar(link, name, idontlink);
 }
function WriteOneNavNoBar (link, name, idontlink)
{
  if (!idontlink) document.write(" <A TARGET=_top HREF=\""+link+"\">");
  document.write(name);
  if (!idontlink) document.write("</A> ");
}

function WriteCopyright () 
{
document.write("<HR><ADDRESS>All photographs, text &amp; original works &copy; <A HREF=\"http://www.andrewsenior.com/contact.html\">Andrew Senior</A> 1994-2008");
}

function WriteNavFooter (section) 
{
  var relpath="../../";
  if (section=="top")
    relpath="../";
  WriteNavStart ();
  WriteOneNavNoBar(relpath+"index.html", "Home", 0);
  WriteOneNav(relpath+"e_index.html", "Electronica", section=="electronica");
  WriteOneNav(relpath+"s_index.html", "Sculpture", section=="sculpture");
  WriteOneNav(relpath+"p_index.html", "Photography", (section=="photo" || section=="photography"));
  WriteOneNav(relpath+"l_index.html", "Landscape Art", section=="landscape");
  WriteOneNav(relpath+"d_index.html", "Design", section=="design");
  WriteNavEnd ();
  document.write("<br>");
}

// Google video player stuff
var topMargin = 150;
var slideTime = 3000;
var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);


function layerObject(id,left) {
if (ns6) {
this.obj = document.getElementById(id).style;
this.obj.left = left;
return this.obj;
}
else if(ie4) {
this.obj = document.all[id].style;
this.obj.left = left;
return this.obj;
}
else if(ns4) {
this.obj = document.layers[id];
this.obj.left = left;
return this.obj;
   }
}

function layerSetup() {
floatLyr = new layerObject('floatVideoPlayer', pageWidth * .5);
//window.setInterval("main()", 10)
}

function floatObject() {
if (ns4 || ns6) {
findHt = window.innerHeight;
} else if(ie4) {
findHt = document.body.clientHeight;
   }
}
function floatStart() {
var now = new Date();
this.A = this.targetY - this.currentY;
this.B = Math.PI / ( 2 * this.slideTime );
this.C = now.getTime();
if (Math.abs(this.A) > this.findHt) {
this.D = this.A > 0 ? this.targetY - this.findHt : this.targetY + this.findHt;
this.A = this.A > 0 ? this.findHt : -this.findHt;
}
else {
this.D = this.currentY;
   }
}
// Take the old request and return the request, filling in the value if request was "toggle"
function changevis(vis, oldval)
{
if (vis=="toggle")
{
  if (oldval=="hidden")
    return("visible");
  else 
    return("hidden");
}
return(vis);
}

function makevisible(vis) {
if ( ie4 )document.all.floatVideoPlayer.style.visibility = changevis(vis, document.all.floatVideoPlayer.style.visibility);
if ( ns4 )document.layers["floatVideoPlayer"].visibility = changevis(vis, document.layers["floatVideoPlayer"].visibility);
if ( ns6 )document.getElementById('floatVideoPlayer').style.visibility = changevis(vis, document.getElementById('floatVideoPlayer').style.visibility);
}
function start() {
if(ns6||ns4) {
pageWidth = innerWidth;
pageHeight = innerHeight;
layerSetup();
floatObject();
}
else if(ie4) {
pageWidth = document.body.clientWidth;
pageHeight = document.body.clientHeight;
layerSetup();
floatObject();
   }
}

function insertVideoPlayer(GVURL)
{
  document.write("<DIV id=\"floatVideoPlayer\" style=\"visibility: hidden; position: absolute; width:100%; height:326px; \"><embed style=\"width:400px; height:326px; text-align:center;\" id=\"VideoPlayback\" type=\"application/x-shockwave-flash\" src=\""+GVURL+"\" flashvars=\"\"> </embed></DIV>");
}

function insertYouTubePlayer(YTID)
{
//   int width=425;
//   int height=326;
  var width=640;
  var height=480;
  var YTURL="http://www.youtube.com/v/"+YTID+"&rel=0";
  document.write("<DIV id=\"floatVideoPlayer\" style=\"visibility: hidden; position: absolute; width:100%; height:"+height+"px; \"><object width=\""+width+"\" height=\""+(height+24)+
		 "\"> <param name=\"movie\" value=\""+YTURL+"\"> </param> <embed src=\""+YTURL+"\" type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+(height+24)+"\"> </embed> </object></DIV>");
}

function embedYouTubePlayer(YTID)
{
//   int width=425;
//   int height=326;
  var width=640;
  var height=480;
  var YTURL="http://www.youtube.com/v/"+YTID+"&rel=0";
  document.write("<DIV id=\"YTVideoPlayer\" style=\" height:"+height+"px; \"><object width=\""+width+"\" height=\""+(height+24)+
		 "\"> <param name=\"movie\" value=\""+YTURL+"\"> </param> <embed src=\""+YTURL+"\" type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+(height+24)+"\"> </embed> </object></DIV>");
}
