jQuery.fn.initBody = function() {	

	// ADD CLASS TO BODY

	$('body').removeClass("no-js");

	$('body').addClass("js");

	$('body').addClass(jQuery.uaMatch(navigator.userAgent).browser);

}



jQuery.fn.evenOddChild = function() {

	// ADD CLASS TO EVEN AND ODD CHILD

	$('tr:nth-child(odd), td:nth-child(odd), th:nth-child(odd), li:nth-child(odd)').addClass('odd');

	$('tr:nth-child(even), td:nth-child(even), th:nth-child(even), li:nth-child(even)').addClass('even');

}



jQuery.fn.firstLastChild = function() {

	// ADD CLASS TO FIRST AND LAST CHILD

	$('li:first-child,th:first-child,td:first-child, .kapcsolodo-kepek a:first-child, .no-border-last-item li:first-child, .no-border-last-item div:first-child, .kereses-blokk:first-child').addClass('first');

	$('li:last-child,th:last-child,td:last-child, .kapcsolodo-kepek a:last-child, .no-border-last-item li:last-child, .no-border-last-item div:last-child').addClass('last');

}



jQuery.fn.formInit = function() {

	// FORM

	$('input').each(function(){

		$(this).addClass($(this).attr('type'));

	});

	

	$('textarea').addClass('textarea');

	

	$("form :input").focus(function() {

	  $("label[for='" + this.id + "']").addClass("labelfocus");

	}).blur(function() {

	  $("label").removeClass("labelfocus");

	});

}

	

jQuery.fn.brokenImage = function() {

	// MISSING IMAGE

	$("img").error(function(){

        $(this).hide();

	});

}



jQuery.fn.konamiCode = function() {

	

	// EASTER EGG - KONAMI CODE

	var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";



	$(document).keydown(function(e) {

	

	  kkeys.push( e.keyCode );

	

	  if ( kkeys.toString().indexOf( konami ) >= 0 ) {

	

		$(document).unbind('keydown',arguments.callee);

	

		// do something awesome

		$("body").addClass("konami");

	

	  }

	});

}



jQuery.fn.nudgeLink = function() {	

	// NUDGE LINK

	$("#navigation a").hover(function() {

       $(this).stop().animate({marginLeft : "10px"},200);

	},function() {

		   $(this).stop().animate({marginLeft : "0px"},200);

	});

};
