﻿$(document).ready(function(){
	if($('.youtubeVideo').length > 0)	{
		$('.youtubeVideo').each(function(){
			var code = $(this).attr('alt');			
			$(this).replaceWith('<iframe class="youtube-player" type="text/html" width="400" height="240" src="http://www.youtube.com/embed/'+code+'" frameborder="0"></iframe>');
		});
	}

	$(".userdoboz").hover(
	function() {
		$(this).find(".csik").animate({"left": "100px"}, {queue: false}, "slow");
	},
	function() {
		$(this).find(".csik").animate({"left": "0px"}, {queue: false}, "slow");
	}
	);

	$(".referenciadoboz").hover(
	function() {
		$(this).find(".csik").animate({"left": "100px"}, {queue: false}, "slow");
	},
	function() {
		$(this).find(".csik").animate({"left": "0px"}, {queue: false}, "slow");
	}
	);
	
	$(".referencia_kiskep").click(function(ev){
		ev.preventDefault();
		$("#referencia_fokep").html('<img src="/uploads/reference/'+$(this).attr("rel")+'" width="638" height="340px"/>');
	});
	
	$(".design_kiskep").click(function(ev){
		ev.preventDefault();
		$("#referencia_fokep").html('<img src="/uploads/design/'+$(this).attr("rel")+'" width="638" height="340px"/>');
	});
	
	$(".markaszotar_szo").click(function(ev){
		ev.preventDefault();
		var id = $(this).attr("rel");
		
		$("#kozepjobb2 .cim").html($(this).html());
		$("#kozepjobb2 .dict_desc").html($("#description_"+id).val());
	});
});
