
function href(url) {
	location.href = url;
}

function openMovieWindow(url) {
	win=window.open(url,'window','width=320,height=320,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=yes');
}

// Image rollover script

var imageList = new Array();
var imageCount = 0;

function loadImage(name, imageOut, imageOn) {
    if (document.images) {
        imageList[imageCount] = new Array(3);
        imageList[imageCount][0] = name;
        imageList[imageCount][1] = new Image();
        imageList[imageCount][1].src = imageOut;
        imageList[imageCount][2] = new Image();
        imageList[imageCount][2].src = imageOn;
        imageCount++;
    }
}

function imgOn(name) {
    if (document.images) {
        for (var i=0; i < imageList.length; i++) {
            if (imageList[i][0] == name) {
                document.images[name].src = imageList[i][2].src;
                break;
            }
        }
    }
}

function imgOff(name) {
    if (document.images) {
        for (var i=0; i < imageList.length; i++) {
            if (imageList[i][0] == name) {
                document.images[name].src = imageList[i][1].src;
                break;
            }
        }
    }
}

// color variables

var groupColorOver = 'c3b8a8'
var groupColorOut = 'ffffff'

var sectionColorOver = 'c3b8a8'
var sectionColorOut = 'e3dfd5'

var subsectionColorOver = 'f4f1ea'
var subsectionColorOut = 'cec7bd'

// ********** Navigation rollover

function rollGroup(element,OverOut){
	if (OverOut == 0){element.style.backgroundColor=groupColorOver;}
	else if (OverOut == 1){element.style.backgroundColor=groupColorOut;}
}

function rollSection(element,OverOut){
	if (OverOut == 0){element.style.backgroundColor=sectionColorOver;}
	else if (OverOut == 1){element.style.backgroundColor=sectionColorOut;}
}

function rollSubsection(element,OverOut){
	if (OverOut == 0){element.style.backgroundColor=subsectionColorOver;}
	else if (OverOut == 1){element.style.backgroundColor=subsectionColorOut;}
}

// ********** Article background rollover

// Defining the article types used
var articleTypeList = new Array("default","news","project","casestudy","policy","publication","education","youth","campaign","event","link");
// Defining the article backgrounds
var articleTypeColourList = new Array("ffffff","aabbdd","ddccdd","eecba9","aabbcc","dcedbb","aabbbb","feedaa","ddbbcc","dccca9","cbeded");

function rollArticleBG(element,articleType,OverOut){
	var i = '';
	for (i = 0; i < articleTypeList.length; i++)
		if (articleType == articleTypeList[i]){
			element.style.backgroundColor=articleTypeColourList[i];
		}
	else{}
}


// ********** Pop up windows

function popup(content){

var page = "";
var camberwelloffice = "/scuk/jsp/includes/content/contactus/camberwelloffice.jsp";
var vauxhalloffice = "/scuk/jsp/includes/content/contactus/vauxhalloffice.jsp";

if (content == "camberwelloffice"){page = camberwelloffice}
if (content == "vauxhalloffice"){page = vauxhalloffice}

window.open(page,'Directions','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=no,resizable=no,copyhistory=no,width=540,height=820');

}

