
var pagetitle='cramberry.com'
var dlc = document.location.href
var pt = new Array('pix2','pix','photos3','photos2','photos','drawings','scapes','animated_gifs','paintings2','paintings','flashworks','tiles','sites','gcramresume','sculptures','music','writings','videos')
var pn = new Array('Pix 2','Pix','Photos 3','Photos 2','Photos','Drawings','Scapes','Craminations','Paintings 2','Paintings','Flashworks','Tiles','Web Portfolio','Glendenning McGregor Cram','Sculptures','Music','Writings','Videos')

for (x = 0 ; x < pt.length ; ++x)
	{
	if (dlc.indexOf(pt[x]) > 0)
		{
		pagetitle = pn[x]
		break
		}
	}
document.title='cramberry.com - ' + pagetitle
//alert(document.title)

function pagename(pname)
{
document.title=pname
}

function copy_year()
{
var year = new Date()
year = year.getYear()
document.write(year)
}

function clientSideInclude(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) { 
  alert("Bad id " + id + 
   "passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
}


function openpic(picname)
{
newloc='callpic.shtml?' + picname
bunga=window.open(newloc,'pikka','width=400,height=600,status=yes,toolbar=no,menubar=no,location=no,status=no,directories=no,resizable=yes')
}

function openurl(newloc)
{
bunga=window.open(newloc,'pikka','width=460,height=700,status=yes,toolbar=no,menubar=no,location=no,status=no,directories=no,resizable=yes')
}

function openflash(flashname)
{
newloc='callflash.shtml?' + flashname 
bunga=window.open(newloc,'pikka','width=400,height=600,status=yes,toolbar=no,menubar=no,location=no,status=no,directories=no,resizable=yes')
}

function initTree(root)
  { for(var i=0; i<root.childNodes.length; i++)
      { if(/li/i.test(root.childNodes[i].nodeName))
          { uls = root.childNodes[i].getElementsByTagName('ul');
            if(uls.length)
              { root.childNodes[i].firstChild.onclick = function(e)
                  { target = e?e.currentTarget:window.event?this:null;
                    if(!target) return;
                    ul = (target.parentNode.getElementsByTagName('ul'))[0];
                    if(ul.style.display=='none')
                      { ul.style.display = '';
                        target.className = target.className.replace(/\bcollapsed\b/,' expanded');
                      }
                    else
                      { ul.style.display = 'none';
                        target.className = target.className.replace(/\bexpanded\b/,' collapsed');
                      }

                  };
                uls[0].style.display = 'none';
                root.childNodes[i].firstChild.className += ' collapsed';
                initTree(uls[0]);
              }
          }
      }
  }

