$(document).ready(function() {
	
	if($('.slideshow')){
	
    	$('.slideshow').cycle({
			fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		});
	};

	$('#support').change(function(){
		var support = $('#support').val();
		location.href="/Support_Centre/"+support;
	});

	$('.btn1').bind('click',function(){
		var links=$(this).parent('a').attr('href');
		$(this).parent('a').click(function(){
			location.href=links;
		});
	})

	$('.btn2').bind('click',function(){
		var links=$(this).parent('a').attr('href');
		$(this).parent('a').click(function(){
			location.href=links;
		});
	})
	
	$('.btn3').bind('click',function(){
		var links=$(this).parent('a').attr('href');
		$(this).parent('a').click(function(){
			location.href=links;
		});
	})	


	$("#mini_form").validationEngine()

 	$("#prod_form").validationEngine()

});

	
// extend the current rules with new groovy ones
	
// this one requires the value to be the same as the first parameter
$.validator.methods.equal = function(value, element, param) {
	return value == param;
};
$.validator.setDefaults({
	submitHandler: function() { document.forms["myform"].submit(); }
});

$().ready(function() {
	if($('#myform')){
		var validator = $("#myform").bind("invalid-form.validate", function() {
			$("#summary").html("Your form contains " + validator.numberOfInvalids() + " errors, see details below.");
		}).validate({
			debug: true,
			success: function(label) {
				label.text("ok!").addClass("success");		
			},
			rules: {
				math: {
					equal: 2	
				}
			}
		});	
	}
});

$(function() {
	// Use this example, or...
	$('a[rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
	// This, or...
	// ... The possibility are many. Use your creative or choose one in the examples above
});

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-3132884-5']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


