function changeColour(colour, noCookie)
{
	var obj = document.getElementById("header");
	obj.style.backgroundColor = colour;
	
	obj = document.getElementById("nav");
	
	var imgs = obj.getElementsByTagName("a");
	
	for (i = 0; i < imgs.length; i++)
	{
		imgs[i].style.backgroundColor = colour;
	}
	
	if (!noCookie)
	{
		var expire = new Date();
		expire.setTime(expire.getTime() + 3600000 * 24 * 365);
		setCookie("colour", colour, expire.toGMTString());
	}
}

function changeBackgroundColour(obj, colour)
{
	obj.style.backgroundColor = colour;
}

var images = new Array();

function change(refname, event)
{
	document [refname].src = images[refname + "." + event].src;
	return;
}

function over(refname)
{
	change(refname, "over");
	return;
}

function out(refname)
{
	change(refname, "out");
	return;
}

function load(prefix, refname)
{
	images[refname + ".out"] = new Image();
	images[refname + ".out"].src = "/images/" + prefix + ".out.png";
	//- - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - -
	images[refname + ".over"] = new Image();
	images[refname + ".over"].src = "/images/" + prefix + ".over.png";
	return;
}

load("nav.training", "training");
load("nav.nutrition", "nutrition");
load("nav.breeds", "breeds");
load("nav.services", "services");
load("nav.dogblog", "dogblog");
load("nav.hollywoof", "hollywoof");
load("nav.qa", "qa");
load("nav.contact", "contact");

function openWindow(theUrl, width, height, name)
{
	window.open(theUrl, name, 'width=' + width +',height=' + height + ',scrollbars=1,resizable=1');
}

function popupMovie(moviePath, width, height, title, heightOffset)
{
	openWindow('/resources/popup/?title=' + escape(title) + '&moviePath=' + escape(moviePath) + '&width=' + width + '&height=' + height, (width + 36), (height + heightOffset + 36), 'popup');
}

// Copyright (c) 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.

function setCookie(name, value, expires)
{
	//document.cookie = "cookieName=cookieValue";
	var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires : "") + "; path=/";
	document.cookie = curCookie;
}

//var obj = document.getElementById("hamish");
//obj.style.display = 'block';
