//****main buttons****
function glow(x) {
    document.getElementById(x).src ="graphics/"+x+" on.jpg";
}
function unglow(x) {
    document.getElementById(x).src ="graphics/"+x+" off.jpg";
}
//****gallery buttons****
var gallery	= 0;
var mc = 0;
function active(x)
{	
	if(gallery){ 
    document.getElementById(mc).style.visibility ="hidden"; 
    document.getElementById(gallery).src ="graphics/"+gallery+" off.jpg"; 
  }
	gallery = x;
	mc = x+"mc";
	document.getElementById(mc).style.visibility = 'visible';
	document.getElementById(x).src ="graphics/"+x+" on.jpg";
	
}
function deactive(){
  document.getElementById(mc).style.visibility ="hidden"; 
  document.getElementById(gallery).src ="graphics/"+gallery+" off.jpg";
}
// Copyright 2006-2007 javascript-array.com

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 

//******** Gallery ********//
function changepage(x,y) {
  max = y;
  c = 1;
  while (c <= max){
  gallid = "gall"+c;
  linkid = "link"+c;
  document.getElementById(gallid).style.display = 'none';
  document.getElementById(linkid).style.color = '#ffffff';
  c++;
  }
  divid = "gall"+x;
  linko = "link"+x;
  document.getElementById(divid).style.display = 'block';
  document.getElementById(linko).style.color = '#9966ff';
  }

//******** viewer ************//
function viewer (name, height, width, path) {
if (window.newwindow) {window.newwindow.close()};

newwindow = window.open('' ,'','width='+width+',height='+height+', left=100, top=100, toolbar=0, menubar=0, resizable=0, scrollbars=1, location=0, directories=0, status=0');

newwindow.document.write("<html>");
newwindow.document.write("<head>");
newwindow.document.write("<title>"+name+"</title>");
newwindow.document.write("<link href='imagestar.css' type='text/css' rel='stylesheet' />");
newwindow.document.write("<style type='text/css'>body { overflow: scroll; background: url('graphics/iframe2.jpg') #ffffff; color: #000000; font: 12pt georgia; }</style>");
newwindow.document.write("</head>");
newwindow.document.write("<body onClick='window.close()'>");
newwindow.document.write("<div id='bigpic' align='center'>");
newwindow.document.write("<img src='"+path+"' style='border: 5px double #000000;'>");
newwindow.document.write("<br /><span class='picname'>"+name+"</span>");
newwindow.document.write("<br>Šimage copyright of M.J. Cameron 2008");
newwindow.document.write("</div>");
newwindow.document.write("</body>");
newwindow.document.write("</HTML>");
newwindow.document.close();
  }