$(document).ready(function() {

	$('#home_slider').anythingSlider({
		width : 960,          // Override the default CSS width
		buildArrows: false,
		autoPlay: true,
		autoPlayLocked: true,
		startStopped: false,
		pauseOnHover: true,
		startText: '',
		stopText: '',
		delay: 5000,
		resumeDelay: 1000,
		animationTime: 0,
		easing: 'easeInOutExpo'
    })
    .anythingSliderFx({
        // target the entire panel and fade will take 500ms
        '.panel' : [ 'fade', 500, 'easeInOutExpo' ]
    });
	
	ddsmoothmenu.init({
		mainmenuid: "smoothmenu", //menu DIV id
		orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
		classname: 'ddsmoothmenu', //class added to menu's outer DIV
		//customtheme: ["#1c5a80", "#18374a"],
		contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
	});

	// expand or contract specials list
	$(".specials_more_body").hide();
	$(".specials_more_tab").toggle(function() {
		$(".specials_more_body").slideDown(300);
		$('.more_less').replaceWith('<a href="#" class="more_less">&hellip;less</a>');
	}, function() {
		$(".specials_more_body").slideUp(300);
		$('.more_less').replaceWith('<a href="#" class="more_less">more&hellip;</a>');
	});

	// toggle field labels on focus
	$('.newsletter_email_address').focus(function() {
		$(this).val('');
	});

	$('.newsletter_email_address').blur(function() {
		if ($(this).val().length == 0) {
		    $(this).val('Email Address:');
		}
	});

	$('.gift_voucher_name').focus(function() {
		$(this).val('');
	});

	$('.gift_voucher_name').blur(function() {
		$(this).val('Name:');
	});

	$('.gift_voucher_email_address').focus(function() {
		$(this).val('');
	});

	$('.gift_voucher_email_address').blur(function() {
		if ($(this).val().length == 0) {
		    $(this).val('Email Address:');
		}
	});

if( document.addEventListener ) document.addEventListener( 'DOMContentLoaded', contact_form, false);

function contact_form(){
  // Hide forms
  $( '#contact_form' ).hide().end();

  // Processing
  $( '#contact_form' ).find( 'li/label' ).not( '.nocmx' ).each( function( i ){
    var labelContent = this.innerHTML;
    var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );
    var labelSpan = document.createElement( 'span' );
        labelSpan.style.display = 'block';
        labelSpan.style.width = labelWidth;
        labelSpan.innerHTML = labelContent;
    this.style.display = '-moz-inline-box';
    this.innerHTML = null;
    this.appendChild( labelSpan );
  } ).end();

  // Show forms
  $( '#contact_form' ).show().end();
}

});
