// JavaScript Document
var root
//root = 'http://www.hong-kong-web-design.com/clients/relish/'
root = 'http://www.relish-kitchen.com/'

//////////////////////////////////////////////////////////////////////
// Copyright 2006-2007 javascript-array.com

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
//document.onclick = mclose; 


///////////// gallery ///////////////////
$(function() {       
	  var galleries = $('.ad-gallery').adGallery({
		  loader_image: root + 'images/galleryPlugin/loader.gif',
		  width: 328, // Width of the image, set to false and it will read the CSS width
		  height: 492, // Height of the image, set to false and it will read the CSS height
		  thumb_opacity: 0.7, // Opacity that the thumbs fades to/from, (1 removes fade effect)
		  start_at_index: 0, // Which image should be displayed at first? 0 is the first image	
		  //description_wrapper: $('#descriptions'),   
		  animate_first_image: false, // Should first image just be displayed, or animated in?
		  animation_speed: 400, // Which ever effect is used to switch images, how long should it take?
		  display_next_and_prev: true, // Can you navigate by clicking on the left/right on the image?
		  display_back_and_forward: true, // Are you allowed to scroll the thumb list?
		  scroll_jump: 0, // If 0, it jumps the width of the container
		  slideshow: {
			enable: true,
			autostart: true,
			speed: 4000,
			start_label: ' ',
			stop_label: ' ',
			stop_on_scroll: true, // Should the slideshow stop if the user scrolls the thumb list?
			countdown_prefix: '(', // Wrap around the countdown
			countdown_sufix: ')'
		  },
		  effect: 'slide-hori', // or 'slide-vert', 'resize', 'fade', 'none' or false
		  enable_keyboard_move: true, // Move to next/previous image with keyboard arrows?
		  cycle: true // If set to false, you can't go from the last image to the first, and vice versa	  
		});
 	});
