var ie = 'nemie';
	jQuery.each(jQuery.browser, function(i, val) {
		if(i == "msie" && jQuery.browser.version.substr(0,1)=="6") {
			ie = "ie6";
		}
		if(i == "msie" && jQuery.browser.version.substr(0,1)=="7") {
			ie = "ie7";
		}		
		if(i == "msie" && jQuery.browser.version.substr(0,1)=="8") {
			ie = "ie8";
		}		
	});

$(document).ready(function(){

	if (ie == 'ie6') {
		$('.rolunkhatter').attr('src', 'style/img/sark/rolunk_nagy.gif');
		$('.rolunkhatter_hover').attr('src', 'style/img/sark/rolunk_nagy_hover.gif');
	}

	if (ie == "nemie" || ie=='ie8') {
		$('#skype4').fadeIn(800 , function() {
			$('#skype4').fadeOut(2000);
		});
	}
	else{
		$('.keret').css('margin-top','130px')
		$('.keret').css('margin-left','0px')
	}
/*	
	var animacioMehet = true;
	var fadeMehet = true;
	var nincsBuborek = true;
	$('.hazak').mouseover(function(){
		if (animacioMehet) {
			animacioMehet = false;
			nincsBuborek = false;
			var haz = $(this);
			var bub = $(haz).next();
			
			$(bub).css('margin-top', '0px');
			$(bub).fadeIn('300');
	       	$(bub).animate ( {marginTop: "-20px"},  {queue:false, duration:650, complete:function(){fade(bub)}} );
		}
	});

	function fade(bub) {
       	$(bub).animate ( {marginTop: "-30px"},  {queue:false, duration:300, complete:function(){nincsBuborek = true;}} );
		$(bub).fadeOut(500);
	}


	$('.hazak').mouseout(function () {
		if (nincsBuborek) {
			animacioMehet = true;
		}
	});
*/

	$('.keret').click(function(){	
		$(this).fadeOut();
		$('.rolunkhatter_hover').css('display', 'none');
		$('#dobozok').css('visibility', 'hidden');
		$('.nagykeret img.rolunkhatter').animate({width:'891px'},{queue:false,duration:400})
		$('.nagykeret img.rolunkhatter').animate({height:'540px'}, ('fast'), function() {
				$('.rolunkoszlop').fadeIn();

		})
	});
	
	$('.keret').hover(function () {
		$(this).css('cursor', 'pointer');
		$('.rolunkhatter').css('display', 'none');
		$('.rolunkhatter_hover').css('display', 'block');
	}, function () {
		$('.rolunkhatter').css('display', 'block');
		$('.rolunkhatter_hover').css('display', 'none');
	});
	
	$('.rolunkkeretbezar').hover(function(){
		$(this).css('text-decoration', 'underline');
		$(this).css('cursor', 'pointer');
		}, function(){
		$(this).css('text-decoration', 'none');
	});

	$('.rolunkkeretbezar').click(function(){
		$('.rolunkoszlop').fadeOut('fast', function() {
		$('.nagykeret img.rolunkhatter').animate({width:'359px'},{queue:false,duration:400})
		$('.nagykeret img.rolunkhatter').animate({height:'194px'}, ('fast'), function() {
			$('.keret').fadeIn();
			$('#dobozok').css('visibility', 'visible');
			
		})
		});
	
	});

	$('.fade').innerfade({
			speed: 2000,
			timeout: 6000,
			type: 'sequence',
			containerheight: '100px'
		});

	$('.nagydoboz a.teteje').hover(function(){	
		$(this).animate({marginLeft:'198px'},{queue:false,duration:500})
	});
	
	$('.teteje-keret').hover(function(){
		}, function(){
		$(".nagydoboz a.teteje").animate({marginLeft:'0px'},{queue:false,duration:500});
	});

	$('.kis_teteje_aktualis').hover(function(){	
		$(this).animate({marginTop:'120px'},{queue:false,duration:500})
	});

	$('.kisteteje-keret').hover(function(){
		}, function(){
		$(".kis_teteje_aktualis").animate({marginTop:'0px'},{queue:false,duration:500});
		$(".kis_teteje").animate({marginTop:'0px'},{queue:false,duration:500});
	});

	$('.kisdoboz a.kis_teteje').hover(function(){
		$(this).animate({marginTop:'-120px'},{queue:false,duration:500})
	});
	
	$('#skype').hover(function() {
		if (ie == "nemie") {seb = 'fast';} else {seb = 1;}
			if (ie == 'nemie') {
				$('#skype2').fadeIn(seb, function() {
				$('#skype3').animate({marginLeft: '0px'},('normal'));
				})				
			}
		else {
				$('#skype2').css('display', 'block');
				$('#skype3').animate({marginLeft: '0px'},('normal'));
		}

	});
	$('#skype2').hover(function() {
	}, function() {
		$('#skype3').animate({marginLeft: '413px'},('fast'), function () {
			if (ie == "nemie") {
				$('#skype2').fadeOut('fast');
			} 
			else {
				$('#skype2').css('display', 'none');
			} 
			
		})
	});
});
