$(document).ready(function() {
	$("#slider").easySlider({
		numeric: true
	});
	$("#slider2").easySlider2({
		numeric: true
	});
	$('#knopka').tabify();
	//$(".saity").click(function(){
	//	$("#slider").slideDown("normal", function () {
	//		$("#controls").slideDown(500);
	//		$("#promosaity").slideUp(500);
	//		$("#controls_promo").slideUp(500);
    //  	});
	//	return false;
	//});						   
	//$(".promosaity").click(function(){
	//	$("#slider").slideUp("normal", function () {
	//		$("#controls").slideUp(500);
	//		$("#promosaity").slideDown(500);
	//		$("#controls_promo").slideDown(500);
	//		
    //  	});
	//	return false;
	//});					   
	//slide μενώ					   
	  $('#input_name').example(function() {
         return $(this).attr('title'); 
      });
      $('#input_telefon').example(function() {
         return $(this).attr('title'); 
      });
      $('#input_email').example(function() {
         return $(this).attr('title'); 
      });
      $('#input_message').example(function() {
         return $(this).attr('title'); 
      });
	
	//Custom settings
	var style_in = 'easeOutBounce';
	var style_out = 'jswing';
	var speed_in = 1000;
	var speed_out = 1000;	

	//Calculation for corners
	var neg = Math.round($('.banner').width() / 2) * (-1);	
	var pos = neg * (-1);	
	var out = pos * 2;
	
	$('.banner').each(function () {
	
		url = $(this).find('a').attr('href');
		img = $(this).find('img').attr('src');
		alt = $(this).find('img').attr('alt');
		
		$('img', this).remove();
		$(this).append('<div class="topLeft"></div><div class="topRight"></div><div class="bottomLeft"></div><div class="bottomRight"></div>');
		$(this).children('div').css('background-image','url('+ img + ')');

		$(this).find('div.topLeft').css({top:0, left:0, width:pos , height:pos});	
		$(this).find('div.topRight').css({top:0, left:pos, width:pos , height:pos});	
		$(this).find('div.bottomLeft').css({bottom:0, left:0, width:pos , height:pos});	
		$(this).find('div.bottomRight').css({bottom:0, left:pos, width:pos , height:pos});	

	}).hover(function () {
	
		$(this).find('div.topLeft').stop(false, true).animate({top:neg, left:neg}, {duration:speed_out, easing:style_out});	
		$(this).find('div.topRight').stop(false, true).animate({top:neg, left:out}, {duration:speed_out, easing:style_out});	
		$(this).find('div.bottomLeft').stop(false, true).animate({bottom:neg, left:neg}, {duration:speed_out, easing:style_out});	
		$(this).find('div.bottomRight').stop(false, true).animate({bottom:neg, left:out}, {duration:speed_out, easing:style_out});	
				
	},
	
	function () {

		$(this).find('div.topLeft').stop(false, true).animate({top:0, left:0}, {duration:speed_in, easing:style_in});	
		$(this).find('div.topRight').stop(false, true).animate({top:0, left:pos}, {duration:speed_in, easing:style_in});	
		$(this).find('div.bottomLeft').stop(false, true).animate({bottom:0, left:0}, {duration:speed_in, easing:style_in});	
		$(this).find('div.bottomRight').stop(false, true).animate({bottom:0, left:pos}, {duration:speed_in, easing:style_in});	
	
	}).click (function () {
		window.open($(this).find('a').attr('href'), '_blank');	
	});
	  $(".spec_s_link").click(function(){
	   var specRel = $(this).attr("href");
	   $(specRel).slideToggle(500)
	   return false;
	  });	


});
