function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function imgpreload()  {
	myimages=new Array();
	for (i=1;i<=3;i++) {
		myimages[i]=new Image;
		myimages[i].src='images/rotation/'+currentpic+'.jpg'
	}
}
function imgchange() {
	currentpic++;
	if (currentpic>3) {
		currentpic=1;
	}
	document.getElementById('rotationbit').src='images/rotation/'+currentpic+'.jpg';
}
function imginit() {
	currentpic=1;
	setInterval(imgchange,5000);
}
function popup(what) {
   window.open(what +".asp",'', 'width=780,height=575,scrollbars=yes');
}



// functions to show or hide layers for states of website.  function names took of artwork

// book1 or home page.  doesnt reset right hand green column.  those ids are rightcolumn, contentpageone, rightcolumnpage2, contentpage2
function home() {
	stopvid();
	MM_showHideLayers('contentnormal','','show','contentbook2','','hide','contentauthor','','hide','contentbackground','','hide','middlecolumn','','show','middlecolumntwo','','hide','middlecolumnauthor','','hide','middlecolumnbackground','','hide');
}
// book2
function book2() {
	stopvid();
	MM_showHideLayers('contentbook2','','show','contentnormal','','hide','contentauthor','','hide','contentbackground','','hide','middlecolumntwo','','show','middlecolumn','','hide','middlecolumnauthor','','hide','middlecolumnbackground','','hide');
} 
// author page
function author() {
	stopvid();
	MM_showHideLayers('contentauthor','','show','contentbook2','','hide','contentnormal','','hide','contentbackground','','hide','middlecolumnauthor','','show','middlecolumntwo','','hide','middlecolumn','','hide','middlecolumnbackground','','hide');
}
// background page
function background() {
	MM_showHideLayers('contentbackground','','show','contentbook2','','hide','contentnormal','','hide','contentauthor','','hide','middlecolumnbackground','','show','middlecolumntwo','','hide','middlecolumn','','hide','middlecolumnauthor','','hide');
	playvid("sven");
}

// WMV controls

function playvid(what) {
	frames['wmv'].location.href="wmv_iframe.asp?FN=" + what;
}
function stopvid() {
	frames['wmv'].location.href="wmv_iframe.asp";
}
