function getValue(varname)
{
  // First, we load the URL into a variable
  var url = window.location.href;

  // Next, split the url by the ?
  var qparts = url.split("?");

  // Check that there is a querystring, return "" if not
  if (qparts.length == 0)
  {
    return "";
  }

  // Then find the querystring, everything after the ?
  var query = qparts[1];

  // Split the query string into variables (separates by &s)
  var vars = query.split("&");

  // Initialize the value with "" as default
  var value = "";

  // Iterate through vars, checking each one for varname
  for (i=0;i<vars.length;i++)
  {
    // Split the variable by =, which splits name and value
    var parts = vars[i].split("=");
    
    // Check if the correct variable
    if (parts[0] == varname)
    {
      // Load value into variable
      value = parts[1];

      // End the loop
      break;
    }
  }
  
  // Convert escape code
  value = unescape(value);

  // Convert "+"s to " "s
  value.replace(/\+/g," ");

  // Return the value
  return value;
}


currentIndx=0;
MyImages=new Array(6);
MyImages[0]='images/press/expanded/01.jpg';
MyImages[1]='images/press/expanded/02.jpg';
MyImages[2]='images/press/expanded/03.jpg';
MyImages[3]='images/press/expanded/04.jpg';
MyImages[4]='images/press/expanded/05.jpg';
MyImages[5]='images/press/expanded/06.jpg';


Messages=new Array(6)

Messages[0]='<h1>Essential Kitchen Bathroom Bedroom Magzine - September 2008</h1><br /><p>Polka Dots - Embrace this relentless popular pattern in your home for spot-on style.</p><p>For indoor spaces that cry out for an injection of vibrancy, designers have come to the rescue with an array of products dedecked in vivid pattern.</p><p>With this distinctive motif on many a wish-list, how do you achieve a chic décor that will work for you?</p><p>For an all-out contemporary look, a specked feature wall will make an eye-catching statement...</p><p>So, whether it’s a few key items or an all-over, striking scheme...dare to do dotty in style.</p><p>Bespoke interior price on request, Colliss & Quinton</p>';
Messages[1]='<h1>DuBella.com - 24th July 2008</h1><br /><h1>Funky Little Darlings (Wall Inspiration)</h1><p>Funky Little Darlings is a cute wallpaper and mural company out of the UK that specializes in childrens murals and prints, but they also have something jazzy for us grown ups over at Colliss & Quinton! I love their patterns and colors in both their children and adult collections. The Colliss & Quinton rooms that are featured below make me think of a fantastic mood board or collage of textiles and patterns…I love it & would love to see more collage effects as wall treatments! It would be great to experiment with depths of layers, patterns, and textures when we think of adorning our walls!</p>';
Messages[2]='<h1>The Guardian - July 2008</h1><p>Despite its tiny size (only 2,000 people live here), the town of Llandeilo, on the edge of the Brecon Beacons national park, has just about everything you could wish for. Shops include a branch of fashion store Toast, there&#39;s a local chocolatier, and cosy pubs proliferate. It even boasts a swish new organic B&amp;B, Fronlas. If you can drag yourself out into the surrounding countryside you&#39;ll find nature reserves, ruined castles, river valleys, deer parks and the National Botanic Garden of Wales all within a short drive or bike ride (Fronlas thoughtfully provides a bike and boot wash, drying room and lock-up for outdoor gear). Tel: 01558 824733 <a href="http://www.fronlas.com">www.fronlas.com</a> doubles from £70 pn B&amp;B.</p><p>&copy; Guardian Newspapers Limited 2008</p>';
Messages[3]='<h1>Kitchens, Bedrooms & Bathrooms - March 2008</h1><p>Resist the temptation to fill your child&#39;s bedroom with pint-sized accessories and instead opt for furniture that will grow with them. Funky Little Darlings designs bespoke contemporary murals, printed onto wallpaper and canvases that are exciting for children and fit with parents&#39; cool interiors. Ready-made designs are also available from the online shop. Bespoke price start around £1400 for an average-sized wall, while stock designs are printed to order and start at around &pound;45 per sq m.';
Messages[4]='<h1>Grand Designs - March 2008</h1><p>Building in your garden is becoming a familiar concept, but Tim and Zoe Bawtree went one step further. To get the space they needed in a fierce conservation and ventured underground. Seven-year-old Fraser worked with the designers to come up with the bespoke mural for his bedroom.</p>';
Messages[5]='<h1>Living etc - January 2008</h1><p>Kid&#39;s rooms for rest and play, get inspired ideas for your child&#39;s space from our experts - tweenies section. "Murals can create a focal point in a kid&#39;s room. &#39;A modern minimalist room that appeals to grown-ups can be completely updated with a stylish, graphic mural&#39;, says Mandy Colliss of Funky Little Darlings, who can create a bespoke mural with all your child&#39;s favourite things. &#39;Pick contemporary furniture and soft furnishings in the colours of the mural to create a coherent look.&#39;"</p>';

imagesPreloaded = new Array(6)
for (var i = 0; i < MyImages.length ; i++)
	{
	imagesPreloaded[i] = new Image(460,365)
	imagesPreloaded[i].src=MyImages[i]
}

function Nexter(){
if (currentIndx<imagesPreloaded.length-1){

currentIndx=currentIndx+1;

document.theImage.src=imagesPreloaded[currentIndx].src
document.getElementById('articletext').innerHTML = Messages[currentIndx];

}

else {

currentIndx=0

document.theImage.src=imagesPreloaded[currentIndx].src
document.getElementById('articletext').innerHTML = Messages[currentIndx];

}

}


function Backer(){

if (currentIndx>0){

currentIndx=currentIndx-1;

document.theImage.src=imagesPreloaded[currentIndx].src

document.getElementById('articletext').innerHTML = Messages[currentIndx];

}

else {

currentIndx=11

document.theImage.src=imagesPreloaded[currentIndx].src

document.getElementById('articletext').innerHTML = Messages[currentIndx];

}}


function InitialPhoto(){
	var image = getValue("image");
document.theImage.src=imagesPreloaded[image].src
document.getElementById('articletext').innerHTML = Messages[image];
}
