function photoSwap(linkId, divId){ //Swaps images for mini-galleries and lightbox
var dd = document.getElementById(divId); //standard-size imgs' <div> id
var ld = document.getElementById(linkId); //thumbnail <a> id
dd.innerHTML = "<img name='myimage' src='/images/legoland-2007/landing09/"+ linkId + ".jpg'>";
dd.href= "/images/legoland-2007/landing09/"+ linkId + "-photo.jpg";
}
function preloading(){
	for (x=0; x<preloading.arguments.length; x++){
		myimages[x] = new Image();
		myimages[x].src = preloading.arguments[x];
	}
}
function dd(function1, function2, function3) { //Solution to single cast event model via multi-cast delegate
    return function() {
	if (function1){
            function1();}
	if (function2){
            function2();}
	if (function3){
            function3();}	
    }
}
var selectWidth = "40";
document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; }</style>');
//Adapted from Ryan Fait's CUSTOM FORM ELEMENTS www.ryanfait.com
var Custom = {
	init: function() {
		var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
		for(a = 0; a < inputs.length; a++) {
			if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && inputs[a].className == "styled") {
				span[a] = document.createElement("span");
				span[a].className = inputs[a].type;

				if(inputs[a].checked == true) {
					if(inputs[a].type == "checkbox") {
						position = "0 -" + (checkboxHeight*2) + "px";
						span[a].style.backgroundPosition = position;
					} else {
						position = "0 -" + (radioHeight*2) + "px";
						span[a].style.backgroundPosition = position;
					}
				}
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				inputs[a].onchange = Custom.clear;
				span[a].onmousedown = Custom.pushed;
				span[a].onmouseup = Custom.check;
				document.onmouseup = Custom.clear;
			}
		}
		inputs = document.getElementsByTagName("select");
		for(a = 0; a < inputs.length; a++) {
			if(inputs[a].className == "styled") {
				option = inputs[a].getElementsByTagName("option");
				active = option[0].childNodes[0].nodeValue;
				textnode = document.createTextNode(active);
				for(b = 0; b < option.length; b++) {
					if(option[b].selected == true) {
						textnode = document.createTextNode(option[b].childNodes[0].nodeValue);
					}
				}
				span[a] = document.createElement("span");
				span[a].className = "select";
				span[a].id = "select" + inputs[a].name;
				span[a].appendChild(textnode);
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				inputs[a].onchange = Custom.choose;
			}
		}
	},
	choose: function() {
		option = this.getElementsByTagName("option");
		for(d = 0; d < option.length; d++) {
			if(option[d].selected == true) {
				document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue;
			}
		}
	}
}
//array of img paths for preloading() and photoSwap()
var myimages = new Array();preloading("/images/legoland-2007/landing09/sheratonImg2.jpg", "/images/legoland-2007/landing09/sheratonImg3.jpg", "/images/legoland-2007/landing09/sheratonImg4.jpg",
"/images/legoland-2007/landing09/gpImg2.jpg", "/images/legoland-2007/landing09/gpImg3.jpg", "/images/legoland-2007/landing09/holidayImg2.jpg", "/images/legoland-2007/landing09/holidayImg3.jpg");
//onload js functions that could not be included in head
window.onload = dd(initLightbox, Custom.init, preloading);