//Form ürítő

$(document).ready(function() {
			$('input[type="text"]').addClass("idleField");
       		$('input[type="text"]').focus(function() {
       			$(this).removeClass("idleField").addClass("focusField");
    		    if (this.value == this.defaultValue){ 
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
    		});
    		$('input[type="text"]').blur(function() {
    			$(this).removeClass("focusField").addClass("idleField");
    		    if ($.trim(this.value) == ''){
			    	this.value = (this.defaultValue ? this.defaultValue : '');
				}
    		});
		});

jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

// Főoldali slideshow

jQuery(function( $ ){
	
	
	$('#slideshow').serialScroll({
		items:'li',
		prev:'#slider a.prev',
		next:'#slider a.next',
		offset:-310, //when scrolling to photo, stop 230 before reaching it (from the left)
		start:1, //as we are centering it, start at the 2nd
		duration:500,
		force:true,
		stop:true,
		lock:false,
		cycle:true, //don't pull back once you reach the end
		easing:'swing', //use this easing equation for a funny effect
		jump: false, //click on the images to scroll to them
	});
	
	$('#port_slideshow').serialScroll({
		items:'div.pane',
		prev:'#port_slider a.prev',
		next:'#port_slider a.next',
		offset:-310, //when scrolling to photo, stop 230 before reaching it (from the left)
		start:2, //as we are centering it, start at the 2nd
		duration:1200,
		force:true,
		stop:true,
		lock:false,
		cycle:false, //don't pull back once you reach the end
		easing:'easeOutQuart', //use this easing equation for a funny effect
		jump: false //click on the images to scroll to them
	});
	
});

// Ikon váltó

var isDown = false;
		
			function doSlide(){ 
				if(isDown == false){
					revealDown();
				}else if(isDown == true){
					hideUp();
				}else{
					return false;
				}
			};
		
			function revealDown(){ 
				isDown = true;
				$('.client_login').animate({ 'height': '25px', duration: 2000, queue: true });
				$('#menu .login_reveal .indicator').css({'background-position' : 'top'})
			};
			function hideUp(){ 
				isDown = false;
				$('.client_login').animate({ 'height': '0px', duration: 2000, queue: true });
				$('#menu .login_reveal .indicator').css({'background-position' : 'bottom'})
			};

// Kép felirat
$(document).ready(function() {

	//move the image in pixel
	var move = -12;
	
	//zoom percentage, 1.2 =120%
	var zoom = 1.2;

	//On mouse over those thumbnail
	$('.item').hover(function() {
		
		//Set the width and height according to the zoom percentage
		width = $('.item').width() * zoom;
		height = $('.item').height() * zoom;
		
		//Move and zoom the image
		$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200});
		
		//Display the caption
		$(this).find('div.caption').stop(false,true).fadeIn(200);
	},
	function() {
		//Reset the image
		$(this).find('img').stop(false,true).animate({'width':$('.item').width(), 'height':$('.item').height(), 'top':'0', 'left':'0'}, {duration:100});	

		//Hide the caption
		$(this).find('div.caption').stop(false,true).fadeOut(200);
	});

});

// TipTip
$(function(){
    $(".tiptip").tipTip();
	$(".tiptop").tipTip({defaultPosition: "top"});
});

// Oszlopok
$(function(){
	$('#about_skills2 div.textwidget').columnize({ columns: 2 });
});

// Google maps
$(function() {
    $("#map").gMap({
					latitude:               47.569114,
					longitude:              20.324707,
					zoom:                   6,
					markers:                [{latitude: 47.519164, longitude: 21.597458, html: "Debrecen, Hungary"}],
					controls:               ["GLargeMapControl3D"],
					scrollwheel:            false,
					maptype:                G_NORMAL_MAP,
					html_prepend:           '<div class="gmap_marker">',
					html_append:            '</div>',
					icon:
					{
						image:              "wp-content/themes/cd/images/gmap_pin.png",
						shadow:             true,
						iconsize:           [32, 32],
						shadowsize:         false,
						iconanchor:         [10, 30],
						infowindowanchor:   [8, 2]
					}
	});
});

// Link animáció
/*$(document).ready(function(){
  $('a.anim').hoverAttribute({
  
							animationEase:		'swing',
							tweenInFrom:		'left'
  });
});*/
