	
// Cufon Font Replace	
  Cufon.replace('.nav li, h1, h2, h3, h4, h5, .nav li a span, ul.nav li a, .rightcol li a, .topnav ul li a', {
  hoverables: { li: true }, 
  hover: true, 
  ignore: { ul: true } 

  }); 
  
  
// Form Titles
  $(document).ready(function() {   
      $('.callback').example(function() {
         return $(this).attr('title'); 
      });
	  
	  // Tool Tip
	  
	  $('area.normalTip').aToolTip();
				
				
	  
	  //FancyBox

            $("a.grouped_elements").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			
			$("a.tariff").fancybox({

		'speedIn'		:	600, 
		'speedOut'		:	200
	});

$("a#inline").fancybox({
		'hideOnContentClick': true
	});

 $("area.map").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'outside',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">'+ (title.length ? '  ' + title : '') + '</span>';
				}
			});

	  
	  
	  // Accordian
	   
	   //Set default open/close settings
$('.acc_container').hide(); //Hide/close all containers
<!--$('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container-->

//On Click
$('.acc_trigger').click(function(){
	if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
	}
	return false; //Prevent the browser jump to the link anchor
});
	   
	  

// Slideshow
	  $('.slides').cycle({
		  fx: 'fade' 
	  });
  
// Date Picker
	   $( ".datepick" ).datepicker({ 
		   dateFormat: 'dd/mm/yy' 
		   });  
	   
// Show/Hide Car Details

       $("input:radio:eq(0)").click(function(){
             $(".details").show(300);
          });
 
       $("input:radio:eq(1)").click(function(){
             $(".details").hide(300);
          });
	   
	   
	   });

  


// Email Subscribe Ajax Form
  function checkEmail(email) { 
    var pattern = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    var emailVal = $("#" + email).val();
    return pattern.test(emailVal);
  }
  $(function() {
    $("#subForm input:image").click(function() { 
      
      // First, disable the form from submitting
      $('form#subForm').submit(function() { return false; });
      
      // Grab form action
      var formAction = $("form#subForm").attr("action");
      
      // Hacking together id for email field
      // Replace the xxxxx below:
      // If your form action were http://mysiteaddress.createsend.com/t/r/s/abcde/, then you'd enter "abcde" below
      var id = "uinku";
      var emailId = id + "-" + id;
      
      // Validate email address with regex
      if (!checkEmail(emailId)) {
        alert("Please enter a valid email address");
        return;
      }
      
      // Serialize form values to be submitted with POST
      var str = $("form#subForm").serialize();
      
      // Add form action to end of serialized data
      // CDATA is used to avoid validation errors
      //<![CDATA[
      var serialized = str + "&action=" + formAction;
      // ]]>
      
      // Submit the form via ajax
      $.ajax({
        url: "proxy.php",
        type: "POST",
        data: serialized,
        success: function(data){
          // Server-side validation
          if (data.search(/invalid/i) != -1) {
            alert('The email address you supplied is invalid and needs to be fixed before you can subscribe to this list.');
          }
          else
          {
            $("#eform").hide(); // If successfully submitted hides the form
            $("#confirmation").slideDown("slow");  // Shows "Thanks for subscribing" div
            $("#confirmation").tabIndex = -1;
            $("#confirmation").focus(); // For screen reader accessibility
            // Fire off Google Analytics fake pageview
            //var pageTracker = _gat._getTracker("UA-XXXXX-X");
            //pageTracker._trackPageview("/newsletter_signup");
          }
        }
      });
    });
  });

 $(document).ready(function() { 
    var io = location.href.indexOf("#");
    if (io != -1) {
        var nm=location.href.substr(io+1);
        var l = $('a[name="'+nm+'"]');
        var p =l.closest('h6');
       p.click();
    }
});	



