// Photo Gallery Load script.
// With image cross fade effect for those browsers that support it.
// Script copyright (C) 2004-2008 http://www.cryer.co.uk/.
// Script is free to use provided this copyright header is included.
var FadeDurationMS=1000;
function SetOpacity(object,opacityPct)
{
  // IE.
  object.style.filter = 'alpha(opacity=' + opacityPct + ')';
  // Old mozilla and firefox
  object.style.MozOpacity = opacityPct/100;
  // Everything else.
  object.style.opacity = opacityPct/100;
}
function ChangeOpacity(id,msDuration,msStart,fromO,toO)
{
  var element=document.getElementById(id);
  var msNow = (new Date()).getTime();
  var opacity = fromO + (toO - fromO) * (msNow - msStart) / msDuration;
  if (opacity>=100)
  {
    SetOpacity(element,100);
    element.timer = undefined;
  }
  else if (opacity<=0)
  {
    SetOpacity(element,0);
    element.timer = undefined;
  }
  else 
  {
    SetOpacity(element,opacity);
    element.timer = window.setTimeout("ChangeOpacity('" + id + "'," + msDuration + "," + msStart + "," + fromO + "," + toO + ")",10);
  }
}
function FadeInImage(foregroundID,newImage,backgroundID)
{
  var foreground=document.getElementById(foregroundID);
  if (foreground.timer) window.clearTimeout(foreground.timer);
  if (backgroundID)
  {
    var background=document.getElementById(backgroundID);
    if (background)
    {
      if (background.src)
      {
        foreground.src = background.src; 
        SetOpacity(foreground,100);
		
      }
      background.src = newImage;
	  
	  /*custom code to change where the image links to*/
	  var matchPos1 = newImage.search("bedroom");
	  if(matchPos1 != -1)
	  {
		document.getElementById('rotateLink').href = 'bedroomgallery1.html';
	  }
	  else
	  {
	    document.getElementById('rotateLink').href = 'kitchengallery1.html';
	  }
	  
      background.style.backgroundImage = 'url(' + newImage + ')';
      background.style.backgroundRepeat = 'no-repeat';
      var startMS = (new Date()).getTime();
      foreground.timer = window.setTimeout("ChangeOpacity('" + foregroundID + "'," + FadeDurationMS + "," + startMS + ",100,0)",10);
    }
  }
else {
    foreground.src = newImage;
  }
}
var slideCache = new Array();
function RunSlideShow(pictureID,backgroundID,imageFiles,displaySecs)
{
  var imageSeparator = imageFiles.indexOf(";");
  var nextImage = imageFiles.substring(0,imageSeparator);
  FadeInImage(pictureID,nextImage,backgroundID);
  var futureImages = imageFiles.substring(imageSeparator+1,imageFiles.length)+ ';' + nextImage;
  setTimeout("RunSlideShow('"+pictureID+"','"+backgroundID+"','"+futureImages+"',"+displaySecs+")",displaySecs*1000);
  // Cache the next image to improve performance.
  imageSeparator = futureImages.indexOf(";");
  nextImage = futureImages.substring(0,imageSeparator);  
  if (slideCache[nextImage] == null)
  {
    slideCache[nextImage] = new Image;
    slideCache[nextImage].src = nextImage;
  }
}

/*

var currentGalleryLink = new Array();

function LoadPicture(pictureName,imageFile,captionID,captionText)
{
	var picture=document.getElementById(pictureName);
	if (picture.filters)
	{
		picture.style.filter="blendTrans(duration=1)";
		picture.filters.blendTrans.Apply();
	}
	picture.src = imageFile;
	if (picture.filters)
	{
		picture.filters.blendTrans.Play();
	}
	document.getElementById(captionID).innerHTML=captionText;
	// Which link is currently selected?
	for (i=0; i < document.links.length;i++)
	{
	   	var l=document.links[i];
	   	var n=l.getAttributeNode('onclick');
		if (n)
		{
			var onclick = n.value;
	   		if ((onclick) &&
	   			(onclick.indexOf(pictureName) > 0) &&
	   			(onclick.indexOf(imageFile) > 0))
	   		{
			    currentGalleryLink[pictureName] = i;
			    break;
			}
		}
	}
}
function LoadPrev(pictureName)
{
	var current = currentGalleryLink[pictureName];
	if (current == null) current = document.links.length+1;
	var alt = null;
	for (i=document.links.length-1;i>=0;i--)
	{
		var link=document.links[i];
		var node = link.getAttributeNode('onclick');
		if (node)
		{
			var onclick = node.nodeValue;
			if ((onclick) &&
				(onclick.indexOf('LoadPicture') >= 0) &&
				(onclick.indexOf(pictureName) > 0))
			{
				if (i < current)
				{
					eval(onclick);
					return;
				} else if (alt == null)
					alt = onclick;
			}
		}
	}
	if (alt) eval(alt);
}
function LoadNext(pictureName)
{
	var current = currentGalleryLink[pictureName];
	if (current == null) {
		currentGalleryLink[pictureName]=-1;
		LoadNext(pictureName);
		current = currentGalleryLink[pictureName];
	}
	var alt = null;
	for (i=0;i<document.links.length;i++) {
		var link = document.links[i];
		var node = link.getAttributeNode('onclick');
		if (node)
		{
			var onclick = node.value;
			if ((onclick) &&
				(onclick.indexOf('LoadPicture') >= 0) &&
				(onclick.indexOf(pictureName) > 0))
			{
				if (i > current)
				{
					eval(onclick);
					return;
				} else if (alt == null)
					alt = onclick;
			}
		}
	}
	if (alt) {
		eval(alt);
	}
}*/

/* array storing image details*/

var imageTitle = [ 'Tuscany Beech',
				   'Normandy Teak',
				   'Tuscany Ivory',
				   'Tuscany Medium Tiepolo',
				   'Tuscany Natural Oak',
				   'Duleek Teak and Black Gloss',
				   'Cornwall In-Frame',
				   'Devon In-Frame',
				   'Duleek High Gloss Ivory',
				   'Duleek Light Tiepolo',
				   'Duleek Olivewood and Cream High Gloss',
				   'Duleek Olivewood and Lime Green High Gloss',
				   'Mona Gloss Walnut',
				   'Paris Medium Tiepolo',
				   'Ribbed Shaker - Sandy Birch',
				   'Brisbane - Lissa Oak',
				   'Duleek Letterbox - Dark Walnut',
				   'Duleek - High Gloss Black',
				   'Prague - Ivory',
				   'Rosapenna - Winchester Oak',
				   'Calcutta - Pippy Oak',
				   'Auckland - Medium Walnut',
				   'Duleek - High Gloss White',
				   'Tuscany - Dark Walnut',
				   'Vienna - Cream Ash',
				   'Yale - Solid Character Oak',
				   'Melbourne - Lancelot Oak ',
				   'Stockholm - Ivory',
				   'Duleek - High Gloss Cappuccino',
				   'Shaker - Solid Cherry',
				   'Calcutta - Vanilla',
				   'Auckland - Winchester Oak',
				   'Houston - Pippy Oak',
				   'Duleek - Sand Beige High Gloss',
				   'Slab - Ontario Maple',
				   'Mona - Loire Ash',
				   'Harvard - Solid Character Oak',
				   'Cologne - Ivory',
				   'Princeton - Solid Oak',
				   'Shaker - Solid Oak',
				   'Cologne - Beech',
				   'Duleek - High Gloss Cream',
				   'Tuscany - Medium Walnut'
				  ];

var imageSource = [ '31-Tuscany-Beech-Kitchen',
					'30-normandy-teak',
					'32-Tuscany-Ivory-Kitchen',
					'33-Tuscany-Medium-Tiepolo',
					'34-Tuscany-Natural-Oak',
					'35-Duleek-Teak-Black-Gloss',
					'36-Cornwall-InFrame',
					'37-Devon-Inframe',
					'38-Duleek-Gloss-Ivory',
					'39-Duleek-Light-Tiepolo',
					'40-Duleek-Olive-Wood-Cream',
					'41-Duleek-Olivewood-Lime',
					'42-Mona-Gloss-Walnut',
					'43-Paris-Medium-Tiepolo',
					'28-ribbedshaker-birch',
					'29-brisbane-lissaoak',
					'1-duleek-letterbox-dark-walnu',
					'2-duleek-highglossblack',
					'3-prague-ivory',
					'4-rosapenna-winoak',
					'5-calcutta-pippyoak',
					'6-auckland-medwal',
					'7-duleek-highglosswhite',
					'8-tuscany-darkwal',
					'9-vienna-creamash',
					'10-yale-charoak',
					'11-melbourne-lancoak',
					'12-stockholm-ivory',
					'13-duleek-cappucino',
					'14-shaker-solidcherry',
					'15-calcutta-vanilla',
					'16-auckland-winoak',
					'17-houston-pippyoak',
					'18-duleek-sandbeige',
					'19-slab-ontarmaple',
					'20-mona-loireash',
					'21-harvard-char-oak',
					'22-cologne-ivory',
					'23-princeton-solidoak',
					'24-shaker-solidoak',
					'25-cologne-beech',
					'26-duleek-highglosscream',
					'27-tuscany-medwal'
					];

var imageDescription = [ "Versatile and light, this five piece beech door looks very well with the bold, dramatic wall colour - but would work equally well with lighter cooler shades. The design of the eating area is ideal for those who prefer chairs to bar stools when dining.",
						"Above we have incorporated the Normandy door with our new foil colour Teak. The Normandy design will be available in any colour and any size made to measure. A full range of matching accessories are also available.",
						"This cleverly designed 'curved' kitchen would suit both spacious or as is the case here, more modestly sized kitchens. It also shows that a stylish cooker over mantle can work extremely well in smaller kitchens.",
						"With its' grain and clean lines, this kitchen has an understated honesty and elegance. It needs no frills or strong colour - the doors themselves and stylish glass inserts are more than enough to create a classic timeless kitchen",
						"With its' stylish curves, Velstone worktops and glass panels, this oak shaker kitchen adds a new twist on country living. The natural characteristics and grains of oak is often associated with large farm house kitchens but this shows that it works equally well in a smaller kitchen - be it urban or country!",
						"The Duleek teak doors combine perfectly with the black gloss to create a simple yet contemporary kitchen that is full of light and space. The open area under the island unit gives a modern design twist that further enhances the open plan feel of this kitchen.",
						"If you are looking for an elegant traditional kitchen that still manages to look light and airy, this is the ideal choice. Closer examination will reveal the sheer attention to detail and calibre of workmanship in this in-frame hand painted kitchen.",
						"Elegance, curves, stylish wooden handles and matching worktops - this solid wood in-frame painted kitchen has it all! Traditional styling blends effortlessly with a hint of modernity.",
						"Ivory has to be one of the most versatile choices for those who want to create an individual kitchen. In this case, the high gloss doors and stylish letterbox handles result in clean lines and a contemporary feel.",
						"The striking curved doors and metallic finishes make a strong style statement in this kitchen. The lines are fluid and uncomplicated and colour is kept to a minimum. Let those doors take centre stage!",
						"Cream gloss doors are incredibly versatile and work beautifully with virtually every wood grain. In this case, the striking olivewood creates an individual style - yet the overall effect is calm, light and inviting.",
						"Zingy, fresh, fun, stylish and current - with the emphasis on city chic! This kitchen merits all of these adjectives and yet, the lime green doesn't overpower in any way.Teamed with the rich tones of olivewood, this is the perfect way to introduce fabulous colour to your home.",
						"Who says that a wood grain can't be a high gloss? The effect is urban, sleek, stylish and cool. The stainless steel handles and extractor fan add an almost industrial dimension to this ultra fashionable kitchen.",
						"This is a classic, timeless kitchen that you will never tire of. It is neither ultra modern nor old style traditional. The rich grain and tone of the doors combined with simplicity of design would look ideal in most homes - be they old, new or in-between!",
						"Standard shaker styling has been embellished with fine ribbing detail which is also reflected in the modern canopy. The island unit creates an excellent preparation and storage area without dominating the space.",
						"The softly rounded corners throughout this classic kitchen are both visually attractive and practical for those with young children. Pot hangers are an ideal way to save on cupboard space and store pots in an accessible manner.",
						"The warmth and richness of the Dark Walnut PVC fascias combined with recessed letterbox handles offer a clean sharp look. The stainless steel appliances and plinth are offset by simple décor to create a feeling of modern living. The perfect place to cook, relax and entertain!",
						"Dramatic, chic, urban - these are just a few words to describe this incredibly stylish kitchen. High gloss black doors coupled with extra thick worktops enhance the elegant linear design.",
						"It's all in the detail! This Prague Ivory door includes a fine slipping detail to create an intricate panel mould. Beautiful gun barrel pilasters, corbels, and fluted rail cornicing all add to this elegant, classic kitchen. With its' cream décor and tumbled marble flooring, the overall effect is light, sophisticated and inviting.",
						"The ideal family kitchen with a modern country feel! This functional square panel design along with simple décor has an appealing yet 'no fuss' feel - perfect in a busy household!",
						"This classic kitchen exudes warmth and atmosphere. The doors feature square cornered panels that complement the black latch style handles. A wall mounted oven is both stylish and user friendly.",
						"With its’ classic mid-toned units, this appealing kitchen would suit a variety of settings – be it modern or older properties. The Shaker styling has been developed with broad stiles and soft slab edges.",
						"White high gloss doors set against white walls create the perfect blank canvas to suit your individual taste, mood and personality – be it 50’s pastel retro or urban monochrome. What does your kitchen say about you?",
						"Indulgent Dark Walnut. This 5-piece PVC wrapped door begs a second look to tell it apart from real wood. This strong walnut grain runs horizontally in the top and bottom rail just like a solid wood door.",
						"The Vienna door incorporates a strong slipping mould around the flat panel to create a stylish kitchen with a fresh timeless feel that would look equally well in an urban or rural setting.",
						"This beautifully crafted solid character oak door looks particularly well against a backdrop of reclaimed brick, marble tiles and sash windows. The ultimate stylish country kitchen!",
						"This kitchen demonstrates the warmth of oak tones with traditional styling in a modern setting. Thumb latch handles and traditional canopy fascia complement the Lancelot character oak vinyl.",
						"The T&G effect panelling in this Stockholm door is carried through in the end panels and canopy fascia. A checked roman blind has been added to create a pleasing ‘modern country’ look.",
						"The rich tone of these coffee coloured doors coupled with the dark flooring and wrap around island worktop result in a contemporary kitchen that is surprisingly warm and versatile.",
						"The rich red tones of this solid cherry wood kitchen are stunning. Simple shaker doors and handles are the perfect choice – stylish, timeless yet plain enough so as not to detract from the wood itself.",
						"With its’ vanilla doors and fresh décor, this appealing kitchen conjures up a feeling of sunshine and hot lazy days! Solid wood worktops, barley twist pillars and stylish over mantle add just the right amount of detail without it being too ornate or formal.",
						"This kitchen represents the proverbial heart of the home – the place where the family congregate, eat, chat and even do home work! The simple shaker doors with slab edges and modern handles add a modern twist to the Winchester Oak finish.",
						"The Houston Pippy Oak doors feature wide stiles and rails with chamfered corners. The mesh door insets, sliding shutter and stainless steel corner unit all add a subtle contemporary feel to this classic kitchen.",
						"Clean lines, minimum clutter and simple décor result in a bright, pleasing. Contemporary kitchen – particularly suitable for open plan living.",
						"The simple slab styling looks particularly well in Ontario Maple. Chunky aluminium and chrome handles complete the streamlined look. The extended up-stand creates a seamless yet practical splash back.",
						"For those of you who want a bright kitchen in a wood effect finish, Loire Ash is a perfect choice as it absorbs minimum light. The unusual Quattro handles work perfectly with the subtle detailing in the door, creating a stylish kitchen that is pleasing to the eye.",
						"This striking character oak kitchen combines quality with style. The granite work tops, rich blue tiles and accessories all add depth and strength to the overall feel. The location of the range cooker in the corner softens the lines of the kitchen and adds and individual touch.",
						"Ivory shaker doors have a broad appeal in that they can look equally well in country, classic or even contemporary settings. In this kitchen, the chunky modern handles, designer lighting, granite worktops and stylish taps create a look that is fresh, young and modern.",
						"This stunning family kitchen has all the warm and character that goes hand in hand with the solid oak triple panel doors. The style is comfortable and timeless – very much the sort of kitchen that will grow gracefully with the owners!",
						"This solid oak shaker door with veneered centre panels features wide stiles and rails with ‘V’ groove joint dealing. The overall feel is modern without being minimalist – a perfect combination in a wide range of settings.",
						"The unusual shaped island unit compete with granite worktop creates a strong focal point in this elegant beech kitchen. With comfortable barstools, it is the perfect place to relax and enjoy a nice meal at the end of a busy day.",
						"As is often the case, our taste and style in clothes are reflected in our taste in décor! The rich mulberry walls work perfectly with the contemporary high gloss units – adding a sense of drama and individuality.",
						"This versatile yet elegant kitchen has a very broad appeal. The warmth of the walnut tones in this 5-piece door are pleasing to the eye. Subtle touches of pale blue add depth and interest to the décor."
						];

/*change the picture in the gallery*/

var title = '';
var src = '';
var des = '';

var contentkeeper;

function display(x)
{	
	if(x > 31)
	{
		imagePath = 'img/kitchengallery3/med/';
		imageLrgPath = 'img/kitchengallery3/lrg/';
	}
	else if(x > 15)
	{
		imagePath = 'img/kitchengallery2/med/';
		imageLrgPath = 'img/kitchengallery2/lrg/';
		if(x == 16)
		{
			document.getElementById('zoomMaps').innerHTML = '<area shape="rect" coords="121,119,176,174" href="#" onMouseOver="zoom(\'kit2\', \'1-duleek-letterbox-dark-1.jpg\')" onMouseOut="hideZoom()" />'+
															 '<area shape="rect" coords="252,17,306,72" href="#" onMouseOver="zoom(\'kit2\', \'1-duleek-letterbox-dark-2.jpg\')" onMouseOut="hideZoom()" />';
		}
		else if(x == 17)
		{
			document.getElementById('zoomMaps').innerHTML = '<area shape="rect" coords="297,121,356,179" href="#" onMouseOver="zoom(\'kit2\', \'2-duleek-highglossblack-2.jpg\')" onMouseOut="hideZoom()" />';
		}
		else
		{
			contentkeeper = document.getElementById('zoomMaps').innerHTML;
			document.getElementById('zoomMaps').innerHTML = "";
		}
	}
	else
	{
		imagePath = 'img/kitchengallery1/med/';
		imageLrgPath = 'img/kitchengallery1/lrg/';
	}


	document.getElementById('imageTitle').innerHTML = imageTitle[x];
	document.getElementById('imageDisplay').src = 'img/loading.gif';
	document.getElementById('imageDescription').innerHTML = imageDescription[x];
	document.getElementById('imageEnlarge').href = imageLrgPath + imageSource[x] + '.jpg';
	
	preload_image_object = new Image();
	preload_image_object.src = imagePath + imageSource[x] + '-med.jpg';

	window.setTimeout("changePic('" + x + "')",1250);
}

function changePic(x)
{
	document.getElementById('imageDisplay').src = imagePath + imageSource[x] + '-med.jpg';
}

var bedImageTitle = [ "Prague – Ivory",
						"Brisbane – Medium Walnut",
						"Duleek – High Gloss Cream",
						"Slab – Dark Walnut",
						"Slab – Beech",
						"Ashford – Celtic Birch",
						"Paris – Loire Ash",
						"Duleek Black Gloss with Light Tiepolo End Panels and Worktop",
						"Porto Medium Walnut",
						"Tuscany Lissa Oak",
						"Tuscany Beech",
						"Tuscany Dark Walnut",
						"Tuscany Ivory",
						"Tuscany Light Tiepolo",
						"Tuscany Medium Walnut",
						"Ribbed Shaker – Sandy Birch",
						"Windsor – Montana Oak",
						"Ottowa – Ontario Maple",
						"Cologne – Beech",
						"Auckland – Winchester Oak",
						"Cologne – Ivory",
						"Duleek – High Gloss Cappuccino",
						"Melbourne – Pippy Oak"
					];

var bedImageSource = [ "1-prague-ivory",
						"2-brisbane-medwalnut",
						"3-duleek-highgloss",
						"4-slab-darkwalnut",
						"5-slab-beech",
						"6-ashford-celticbirch",
						"7-paris-loireash",
						"16-Duleek-Gloss-Black",
						"17-Porto-Medium-Walnut",
						"18-Tuscany-Beech-Door",
						"19-Tuscany-Beech",
						"20-Tuscany-Dark-Walnut",
						"21-Tuscany-Ivory",
						"22-Tuscany-Light-Tiepolo",
						"23-Tuscany-Medium-Walnut",
						"9-ribbedshaker-birch",
						"10-windsor-montanaoak",
						"11-ottowa-ontariomaple",
						"12-cologne-beech",
						"13-AucklandWinOak",
						"14-cologne-ivory",
						"15-duleek-highglosscap",
						"8-melborne-pippyoak"
					];

var bedImageDescription = [ "Beautiful fluted rail cornice, reeded pilasters and fretted frames combine to create a sophisticated and elegant bedroom. French fabrics known as ‘toile de jouy’ and ‘ticking’ add the perfect finishing touches.",
							"The warmth of the Brisbane Medium Walnut doors, coupled with the rounded corners result in a visually attractive yet practical run of units. Striking duck egg and red accessories add depth to the cream décor.",
							"The cream high gloss doors set against coffee décor result in a contemporary bedroom with a distinctly urban feel. The matching bedside cabinets, headboard and bed trunk create a simple co-ordinated look that is both stylish and practical.",
							"The Dark Walnut effect Slab doors create a rich expensive feel to this bedroom. The square design in the headboard is mirrored in the centre doors giving a clever designer touch. Dramatic bed linen in tones of chocolate and duck egg completes the look.",
							"Pink, stylish and unashamedly girly! The décor works extremely well with the tone and grain of the simple Slab Beech doors. A matching headboard and unusual porthole design complete the picture.",
							"Rich blue décor and accessories from Cape Cod complement the simple lines of the Celtic Birch Ashford door. The mirrored doors reflect light and add interest to the room.",
							"Loire Ash Paris doors are the perfect choice for those who want a wood grain that won’t in anyway darken the space. The clever design maximises storage without overpowering the room.",
							"Chic and sophisticated, this bedroom has a real 'Uptown New York' feel to it. However the understated styling would look equally well in less far off fields! The wood grain surrounding panels add warmth and contrast to the black gloss doors.",
							"The Gothic detail on the headboard and wardrobes is striking yet the overall feel is classic and fresh. But for those preferring a more traditional bedroom, this range would work equally well with rich warm colours and bedding.",
							"Enjoy the clean lines of this five piece shaker oak finish. The oak grain runs horizontally in the top and bottom rail just like a solid wood door. For those in need of maximum storage, the over head cupboards and matching blanket box are ideal.",
							"This simple yet elegant run of wardrobes has a light fresh feel that would suit a wide variety of settings. The grain runs horizontally in the top and bottom rail just like a solid wood door. Match cushions, curtains and accessories to suit your mood and taste!",
							"This bedroom shows the classic elegance and timeless quality of rich dark walnut. The décor is simple and the overall effect has an uncluttered and uncomplicated dimension. A matching headboard and blanket box, combined with a few carefully chosen teal coloured accessories, all add to the understated elegance of the bedroom.",
							"Timeless, light and versatile, this five piece shaker door gives any bedroom an open and spacious feel. Over head cupboards maximise all available space and create excellent storage. Rich chocolate and orange coloured accessories add a stylish and warm feel to this bedroom.",
							"The warm and striking grain of the light Tiepolo is complemented by the contemporary chrome handles. A stylish, elegant room in which to relax and enjoy the Sunday papers! Very much a bedroom that would suit a wide variety of homes!",
							"Walnut is a beautiful finish - rich, expensive looking and dramatic. The five piece door means that the grain on the cross sections runs horizontally making it very difficult to tell it apart from solid wood.",
							"Mirror mirror on the wall… The Ribbed Shaker Sandy Birch doors and handles are both practical and timeless. The perfect backdrop for whatever the current trend happens to be – in this case, it’s unmistakably Barbie Pink!",
							"The Windsor Montana Oak doors and matching dressing table result in a stylish elegant bedroom that would suit a wide variety of tastes and settings.",
							"The subtle grain of the Ontario Maple is bright and fresh, ideal for this simple yet tasteful design. Overhead units and headboard shelf leave no space unused. Sisal flooring complements the green accent colours creating a tranquil ambience.",
							"Shaker Beech doors, frosted insets and a matching headboard create a stylish co-ordinated look – made individual with a rich cerise colour scheme and bright accessories.",
							"The angled step out section prevents this run of oak shaker doors from looking bland. Winchester Oak looks light and natural in the Auckland style door. A matching dressing table, carved headboard along with rich chocolate and duck egg accessories complete this stylish room.",
							"Natural décor and accessories work perfectly with this simple yet elegant shaker design. The reeded pilasters and glass doors add interest to the mid section. The end result is a very calm, understated bedroom with broad appeal.",
							"The sleek coffee coloured gloss doors set against similar coloured walls create the ultimate blank canvas to introduce striking chocolate and lime accessories. An incredibly stylish bedroom – yet the level of storage makes it extremely functional.",
							"The Melbourne Pippy Oak doors and matching dressing table enhance the comfortable leather sleigh bed. A palette of neutral tones is both timeless and easy to live with."
						];

function displayBedroom(x)
{
	imagePath = 'img/bedroomgallery/med/';
	imageLrgPath = 'img/bedroomgallery/lrg/';

	document.getElementById('imageTitle').innerHTML = bedImageTitle[x];
	document.getElementById('imageDisplay').src = 'img/loading.gif';
	document.getElementById('imageDescription').innerHTML = bedImageDescription[x];
	document.getElementById('imageEnlarge').href = imageLrgPath + bedImageSource[x] + '.jpg';
	
	preload_image_object = new Image();
	preload_image_object.src = imagePath + bedImageSource[x] + '.jpg';

	window.setTimeout("changeBedPic('" + x + "')",1250);
}

function changeBedPic(x)
{
	document.getElementById('imageDisplay').src = imagePath + bedImageSource[x] + '.jpg';	
}

var doorImageTitle = [ "Toronto",
						"Victoria",
						"Windsor",
						"Annabelle",
						"Bermuda",
						"Cathedral Single",
						"Cathedral Double",
						"Coyle",
						"Gothic",
						"Heriette Single Arch",
						"Heriette Double Arch",
						"Plank",
						"Shutter",
						"Shutter and Groove",
						"Zurich",
						"Porto",
						"Pembrook",
						"Reymondo Arched",
						"Bourbon",
						"Berlin",
						"Saxon Arched",
						"Calcutta",
						"Cologne",
						"Auckland",
						"Houston",
						"Ottowa",
						"Stockholm",
						"Belfast Shaker",
						"Quebec",
						"Raymondo Square",
						"Ribbed Shaker",
						"Paris",
						"Brisbane",
						"Prague",
						"Vancouver",
						"Hereford",
						"Westbury",
						"Melbourne",
						"Slab",
						"Classic Square",
						"Dallas",
						"Hourglass",
						"Duleek Letterbox",
						"Scoop",
						"Florida",
						"Duleek",
						"Modena",
						"Mona",
						"Ryandale",
						"Scoop",
						"Derwent",
						"Canberra",
						"Ashford",
						"Cairo",
						"Chamfered and Groove",
						"Chamfered",
						"Euroline",
						"Valencia",
						"Duleek",
						"Duleek",
						"Duleek",
						"Duleek",
						"Duleek",
						"Tuscany",
						"Tuscany",
						"Tuscany",
						"Tuscany",
						"Tuscany",
						"Tuscany",
						"Tuscany",
						"Tuscany",
						"Tuscany",
						"Tuscany",
						"Princeton",
						"Shaker",
						"Shaker",
						"Harvard",
						"Shaker",
						"Yale",
						"Lisbon"
					];

var doorImageSource = [ "01toronto",
						"02victoria",
						"03windsor",
						"04annabelle",
						"05bermuda",
						"06cathedralsingle",
						"07cathedraldouble",
						"08coyle",
						"09gothic",
						"10hariettesingle",
						"11hariettedouble",
						"12plank",
						"13shutter",
						"14shuttergroove",
						"15zurich",
						"16porto",
						"17pembrook",
						"18reymondo",
						"19bourbon",
						"20berlin",
						"21saxonarched",
						"01calcutta",
						"02cologne",
						"03Auckland",
						"04houston",
						"05ottowa",
						"06stockholm",
						"07belfastshaker",
						"08quebec",
						"09reymondosq",
						"10ribbedshaker",
						"11paris",
						"12brisbane",
						"13prague",
						"14vancouver",
						"15hereford",
						"16westbury",
						"17melbourne",
						"18slab",
						"19classicsq",
						"20dallas",
						"21hourglass",
						"01duleekletterbox",
						"02scoop",
						"03florida",
						"04duleek",
						"05modena",
						"06mona",
						"07ryandale",
						"08scoop",
						"09derwent",
						"10canberra",
						"11ashford",
						"12cairo",
						"13chamfered",
						"14chamfered",
						"15euroline",
						"16valencia",
						"17Duleek-Brown-Drift-Oak",
						"18Duleek-Gloss-Zebrano",
						"19Duleek-Grey-Drift-Oak",
						"20Duleek-Lime-Green",
						"21Duleek-Rosalis",
						"29TuscanyLightTiepolo",
						"30TuscanyLighttiepoloSlipa",
						"28TuscanyLighttiepoloSlipb",
						"32Tuscany-Beech",
						"33Tuscany-Medium-Tiepolo",
						"34Tuscany-Natural-Oak",
						"01tuscanymedwal",
						"02tuscanydarkwal",
						"03tuscanylissa",
						"27Tuscany-Ivory-Door",
						"01princeton",
						"02shaker",
						"03shaker",
						"04harvard",
						"05shaker",
						"06yale",
						"07lisbon"
					];

var doorImageDescription = [ "Farmhouse Pine",
							 "Farmhouse Pine",
							 "Yellow Pine",
							 "Light Oak",
							 "Farmhouse Pine",
							 "Lancelot Oak",
							 "Soft Touch Oak",
							 "Beech",
							 "Milano Cherry",
							 "Farmhouse Pine",
							 "Light Oak",
							 "Lancelot Oak",
							 "Sienna Calvados",
							 "Plain Cream",
							 "Montana Oak",
							 "Milano Cherry",
							 "Horns White",
							 "Cream Ash",
							 "Winchester Oak",
							 "Montana Oak",
							 "Montana Oak",
							 "Sandy Birch",
							 "Beech",
							 "Medium Walnut",
							 "Pippy Oak",
							 "Ontario Maple",
							 "Ivory",
							 "Sienna Calvados",
							 "Sandy Birch",
							 "Vanilla",
							 "Sandy Birch",
							 "Plain Cream",
							 "Medium Walnut",
							 "Ivory",
							 "Lancelot Oak",
							 "Celtic Birch",
							 "Ontario Maple",
							 "Cream Ash",
							 "Beech",
							 "Loire Ash",
							 "Celtic Birch",
							 "Horns White",
							 "Ivory",
							 "Fino Bronze",
							 "Loire Ash",
							 "Sand Beige High Gloss",
							 "Ivory Gloss",
							 "Loire Ash",
							 "Red Alder",
							 "Soft Touch Oak",
							 "Sienna Calvados",
							 "Lancelot Oak",
							 "Winchester Oak",
							 "Medium Walnut",
							 "Vanilla",
							 "Montana Oak",
							 "Brushed Steel",
							 "Winchester Oak",
							 "Brown Drift Oak",
							 "Gloss Zebrano",
							 "Grey Drift Oak",
							 "Lime Green",
							 "Rosalis",
							 "Light Tiepolo",
							 "Light Tiepolo Slip A",
							 "Light Tiepolo Slip B",
							 "Beech",
							 "Medium Tiepolo",
							 "Natural Oak",
							 "Medium Walnut",
							 "Dark Walnut",
							 "Lissa Oak",
							 "Ivory",
							 "Solid Oak",
							 "Solid Cherry",
							 "Solid Oak",
							 "Solid Character Oak",
							 "Solid Birch",
							 "Solid Character Oak",
							 "Solid Oak"
						];

function displayDoor(x)
{

	if(x > 72)
	{
		imagePath = 'img/doorgallery5/med/';
	}
	else if(x > 62)
	{
		imagePath = 'img/doorgallery4/med/';
	}
	else if(x > 41)
	{
		imagePath = 'img/doorgallery3/med/';
	}
	else if(x > 20)
	{
		imagePath = 'img/doorgallery2/med/';
	}
	else
	{
		imagePath = 'img/doorgallery1/med/';
	}

	document.getElementById('doorImageTitle').innerHTML = doorImageTitle[x];
	document.getElementById('doorImageDisplay').src = 'img/loading.gif';
	document.getElementById('doorImageDisplay2').src = 'img/invisible.png';
	document.getElementById('imageDescription').innerHTML = doorImageDescription[x];
	
	preload_image_object = new Image();
	preload_image_object.src = imagePath + doorImageSource[x] + '1.jpg';

	window.setTimeout("changeDoorPic('" + x + "')",1250);
}

function changeDoorPic(x)
{
	document.getElementById('doorImageDisplay').src = imagePath + doorImageSource[x] + '1.jpg';
	
	document.getElementById('doorImageDisplay2').src = 'img/loading.gif';
	
	preload_image_object2 = new Image();
	preload_image_object2.src = imagePath + doorImageSource[x] + '2.jpg';
	
	window.setTimeout("changeDoorPic2('" + x + "')",1250);
}

function changeDoorPic2(x)
{
	document.getElementById('doorImageDisplay2').src = imagePath + doorImageSource[x] + '2.jpg';
}

var lastImage;

function changeHandleTitle(x)
{
	/*document.getElementById('handleTitle').innerHTML=x;*/
	
	lastImage = x;
	
	document.getElementById('handleTitle').innerHTML = document.getElementById(lastImage).getAttribute('alt');
	document.getElementById(x).style.border = "1px #0466b4 solid";
	document.getElementById(x).style.opacity = 1;
	document.getElementById(x).filters[0].opacity=100;
}

function returnToFade()
{
	document.getElementById(lastImage).style.border = "1px #D5D5B5 solid";
	document.getElementById(lastImage).style.opacity = 0.7;
	document.getElementById(lastImage).filters[0].opacity=70;
}

function zoom(j, k)
{	
	var path;
	
	document.getElementById("zoomBox").style.display = "block";
	
	if(j == "kit2")
		{
			path = "img/kitchengallery2/zoom/";
		}
		
	pic1= new Image(); 
	pic1.src=path + k;

	
	document.getElementById('zoomImage').src = path + k;
}

function hideZoom()
{
	document.getElementById("zoomBox").style.display = "none";
	document.getElementById('zoomImage').src = "img/invisible.png";
}

/*function preloadImages()
{
	if (document.images)
	{
		preload_image_object = new Image();
		// set image url
		image_url = new Array();
		image_url[0] = 'img/kitchengallery1/30-normandy-teak-med.jpg';
		image_url[1] = 'img/kitchengallery1/32-Tuscany-Ivory-Kitchen-med.jpg';
		image_url[2] = 'img/kitchengallery1/33-Tuscany-Medium-Tiepolo-med.jpg';
		
		var i = 0;
		for(i=0; i<=3; i++) 
		{
			preload_image_object.src = image_url[i];
		}
	}
}*/