// JavaScript Document
jQuery.fn.exists = function(){return jQuery(this).length>0;}
<!--
$(document).ready(function(){
	    if (maxim < -470) rollerpos = -jump;
		myspin();
		
		$('#sname').focus(function() {
			if ($('#sname').val() == 'név...') $('#sname').val('');
		});
		$('#sname').blur(function() {
		    if ($('#sname').val() == '') $('#sname').val('név...');
		});
		
		$('#smail').focus(function() {
			if ($('#smail').val() == 'e-mail...') $('#smail').val('');
		});
		$('#smail').blur(function() {
		    if ($('#smail').val() == '') $('#smail').val('e-mail...');
		});		
		
		$('#sstring').focus(function() {
			if ($('#sstring').val() == 'keresett kifejezés...') $('#sstring').val('');
		});
		$('#sstring').blur(function() {
		    if ($('#sstring').val() == '') $('#sstring').val('keresett kifejezés...');
		});				
		
		
		$('#moveright').mouseover(function() {
			spin=-4;
		});

		$('#moveright').mouseout(function() {
			spin=0;
		});

		$('#moveleft').mouseover(function() {
			spin=4;
		});

		$('#moveleft').mouseout(function() {
			spin=0;
		});
		
		//var rolpo = $('.theroller').offset();
		//$('.bakker').css('top',rolpo.top - 24);
		var timess = setTimeout("dodo()",200);

		if ( $('#popup').size() > 0 ){
		var h = $(document).height();
        var w = $(document).width();
		
		var myh = $('#popup').height();
		var myw = $('#popup').width();
		
		$('#modal').height(h);
		$('#modal').width(w);	
		$('#modal').css('top',0);
		$('#modal').css('left',0);			
		var tmp = (h/2)-myh;
		
		$('#popup').css('top',80);
		$('#popup').css('left',(w/2)-(myw/2));	

		var z = setTimeout("closeme()",34000);
	}			
});

	var jump = 0;
	var spin = 0;
	var rollerpos = 0;
	var maxim = 0;
	
	
	function dodo() {
		
		var rolpo = $('.theroller').offset();
		if (rolpo.top >100){
			$('.bakker').css('top',rolpo.top - 24);
		}
		
		
	}

	function myspin(){
		if (maxim*-1 > pagewidth){
			rollerpos += spin; 		
			if (rollerpos>0) rollerpos=0; 
			if (rollerpos < (maxim+pagewidth)) rollerpos = (maxim+pagewidth);
		} else {
			
		}
		var spinpx = rollerpos+"px";
		$('#roller').css("margin-left", spinpx );					

		setTimeout("myspin()",4);
	}

	function showme(img, wi){
		document.getElementById('bigone').src =  img;
		document.getElementById('bigone').width = wi;
		//document.getElementById('bigone').height = 375;
	}

var t;

function rotatorbuttons() {
	if (rotaObject.length == 0) return;	
	var maxi = rotaObject.length;
	var placerw = 658 - maxi *32 - 10;
	var offset = 0;

	if (maxi <= 1) return;
	for (var i=0; i< maxi; i++) {
		offset = placerw+32*i;
		$("#cbox").append("<div class='nember' style='margin-left:"+offset+"px'><a href='javascript:jumpto("+i+")'>"+(i+1)+"</a></div>");
	}
	
}
	
function jumpto(line) {
	clearTimeout(t);
	rotator(line);
}
	
function rotator(line){
	var maxi = rotaObject.length;
	var timer = (rotaObject[line][1]*1000);
	
	if ($('#rotbody').html() != '&nbsp;'){
		$('#rothead').animate({
			opacity: 0
		}, 400);
		$('#rotbody').animate({
			opacity: 0
		}, 400);
	}

	setTimeout(function() {$('#rothead').html(rotaObject[line][4])} , 400);
	setTimeout(function() {$('#rotbody').html('<img src="'+rotaObject[line][3]+'">')} , 400);
	
	$("#rotbody").one("click", function() {
  		document.location = rotaObject[line][2];
	});

	$('#rothead').animate({
    	opacity: 0.7
	}, 1000);

	$('#rotbody').animate({
    	opacity: 1
	}, 1000);

	if (maxi > 1) {
		if (line < (maxi-1)) 
			t = setTimeout ( "rotator("+(line+1)+")", timer ); 
		else 
			t = setTimeout ( "rotator("+(0)+")", timer ); 
	}
}	
	

function closeme(){
	document.getElementById('popup').className='rh';
	document.getElementById('modal').className='rh';
}	
	
//-->
