$.noConflict();
  jQuery(document).ready(function($) {

	$("#int ul").tabs("#panels > div", {effect: 'fade', fadeOutSpeed: "slow"});
	
	
	
	$("#slidetabs").tabs("#slides > div", {

	// enable "cross-fading" effect
	effect: 'fade',
	fadeOutSpeed: "slow",

	// start from the beginning after the last tab
	rotate: true

	// use the slideshow plugin. It accepts its own configuration
	}).slideshow();
	
	
	//  FORM
	// adds an effect called "wall" to the validator
	$.tools.validator.addEffect("wall", function(errors, event) {
	// get the message wall
	var wall = $(this.getConf().container).fadeIn();
	// remove all existing messages
	wall.find("span").remove();
	// add new ones
	$.each(errors, function(index, error) {
		wall.append(
			"<span>>&nbsp;<strong>" +error.input.attr("alt")+ "</strong> " +error.messages[0]+ "&nbsp;&nbsp;</span>"
		);		
	});
	// the effect does nothing when all inputs are valid	
	}, function(inputs)  {	
	});
	
	// initialize validator with the new effect
	$("#contactForm").validator({
    effect: 'wall', 
    container: '.errors',
    // do not validate inputs when they are edited
    errorInputEvent: null   
	// custom form submission logic  
	}).submit(function(e)  { 
    // when data is valid 
    if (!e.isDefaultPrevented()) {     
    // tell user that everything is OK
    $(".errors").html("All good");    
	// prevent the form data being submitted to the server
    e.preventDefault();
    }   
	});
	
	// red border input field
	$("#contactForm").bind("onFail", function(e, errors)  {

	// we are only doing stuff when the form is submitted
	if (e.originalEvent.type == 'submit') {

		// loop through Error objects and add the border color
		$.each(errors, function()  {
			var input = this.input;
			input.css({borderColor: '#D8382A'}).focus(function()  {
				input.css({borderColor: '#FBC2C4'});
				});
			});
		}
	});

	//  endFORM
	
});
