<!--//--><![CDATA[//><!--
// Menu Loader
var mnu = new Array();

jQuery(document).ready(function(){
    jQuery(':first-child').addClass('first');
    jQuery(':last-child').addClass('last');
});

window.onload = function(){
    var folder = document.getElementById("currentFolder");
    var subnav = document.getElementById("subnav");
    
    if (subnav != null) {
	    if (folder != null){
		if (folder.innerHTML.length > 0){
			mnu[0] = new xMenu5('subnav', 'xMenuBtn', folder.innerHTML);
		} else {
			mnu[0] = new xMenu5('subnav', 'xMenuBtn');
		}
	    } else {
		    mnu[0] = new xMenu5('subnav', 'xMenuBtn');
	    }	
    }
}

function toggleBoxes(ancLink, box, imageSrc) {
	new Effect.toggle(box, 'slide', {queue:{position:'end', scope: 'myscopeone'},duration:0.5});
	if (document.getElementById(imageSrc).src == "http://www.londondevelopmentcentre.org/cms/outertemplates/images/icon-collapse.gif")
		document.getElementById(imageSrc).src = "http://www.londondevelopmentcentre.org/cms/outertemplates/images/icon-expand.gif";
	else
		document.getElementById(imageSrc).src = "http://www.londondevelopmentcentre.org/cms/outertemplates/images/icon-collapse.gif";
}

var appearEffects = new Array();
var fadeEffects = new Array();

for (var i=0; i<5; i++)
{
	appearEffects[i] = new Array();
	appearEffects[i][0] = null;
	appearEffects[i][1] = null;
	fadeEffects[i] = new Array();
	fadeEffects[i][0] = null;
	fadeEffects[i][1] = null;
}

function StartAppear(id, index)
{
	appearEffects[index][0] = new Effect.SlideDown(id, {queue:{position:'end', scope: 'myscopeone'},duration:0.2});
	appearEffects[index][1] = new Effect.SlideDown(id+'Text', {queue:{position:'end', scope: 'myscopeone'},duration:0.2});
	if (fadeEffects[index][0] != null || fadeEffects[index][1] != null)
	{
		fadeEffects[index][0].cancel();
		fadeEffects[index][1].cancel();
		fadeEffects[index][0] = null;
		fadeEffects[index][1] = null;
	}
}

function StartFade(id, index)
{
	if (appearEffects[index][0] != null || appearEffects[index][1] != null)
	{
		appearEffects[index][0].cancel();
		appearEffects[index][1].cancel();
		appearEffects[index][0] = null;
		appearEffects[index][1] = null;
	}	
	fadeEffects[index][0] = new Effect.SlideUp(id, {queue:{position:'end', scope: 'myscopeone'},duration:0.1});
	fadeEffects[index][1] = new Effect.SlideUp(id+'Text', {queue:{position:'end', scope: 'myscopeone'},duration:0.1});
}

function slideFlash(box,open) {
	if (open == 0) {
		new Effect.toggle(box, 'slide', {queue:{position:'end', scope: 'myscopeone',limit:4},duration:0.2});
		new Effect.toggle(box + 'Text', 'slide', {queue:{position:'end', scope: 'myscopeone',limit:4},duration:0.2});
	} else {
		new Effect.toggle(box, 'slide', {queue:{position:'end', scope: 'myscopeone',limit:4},duration:0.1});
		new Effect.toggle(box + 'Text', 'slide', {queue:{position:'end', scope: 'myscopeone',limit:4},duration:0.1});
	}
}

function createMarker(point, address) {
	var marker = new GMarker(point);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(address);
	});

	return marker;
}

function validateSearch(obj) {
	if(obj.value == "") {
		alert("Please enter a search phrase");
		return false;
	} else {
		location.href = '/cms/search/search2.asp?zoom_query=' + obj.value;
		return false;
	}
}

function flashWrite(flashfile,x,y,flashvar) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+ x +"' height='"+ y +"'>");
	document.write("<param name='movie' value='"+ flashfile +"' />");
	document.write("<param name='quality' value='high' />");
	document.write("<param name='flashvars' value='"+ flashvar +"' />");
	document.write("<param name='wmode' value='transparent' />");
	document.write("<embed src='"+ flashfile +"' wmode='transparent' ");
	document.write("flashvars='"+ flashvar +"'  ");
	document.write("quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+ x +"' height='"+ y +"'></embed>");
	document.write("</object>");
}

function printYear() {
	var today = new Date();
	document.write(today.getFullYear());
}

function writeEmail(email) {
	document.write('<a href="mailto:'+email+'">'+email+'</a>');
}

function changeTextSize(textSize) {
	document.body.className = 'site ' + textSize;
	return false;
}

function printPage() {
	window.print();
	return false;
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function addOnloads() {
	var sfEls = document.getElementById("widgets").getElementsByTagName("a");
	for (var i=0; i<sfEls.length; i++) {
		if(sfEls[i].id == "printToolbar") {
			sfEls[i].onclick=function() {
				return printPage();
			}		
		}
		if(sfEls[i].id == "smallTxtToolbar") {
			sfEls[i].onclick=function() {
				return changeTextSize('smallText');
			}		
		}
		if(sfEls[i].id == "mediumTxtToolbar") {
			sfEls[i].onclick=function() {
				return changeTextSize('mediumText');
			}		
		}
		if(sfEls[i].id == "largeTxtToolbar") {
			sfEls[i].onclick=function() {
				return changeTextSize('largeText');
			}		
		}		
	}
}

window.onunload = function(e) {
	var textSize = document.body.className.split(' ')[1];
	createCookie('style', textSize, 365);
}

//--><!]]>