var s1=0;

function bindHint(id,text){
	$('#'+id).bind('mouseover',function(){
		$(hint).html(text);
		$(hint).stop();$('#hint').show();
		$(hint).animate({opacity:1.0},500);
	});

	$('#'+id).bind('mouseout',function(){
		$(hint).stop();
		$(hint).animate({opacity:0.0},500);
	});
};

function searchsubmit(form){	
	form.submit();
}


function showCalendar(inputid){
	displayCalendar(
									document.getElementById(inputid),
									'dd/mm/yyyy',
									document.getElementById(inputid) 
								  );
}

function hideCalendar(){
	document.getElementById('calendarDiv').style.display='none';
}

function CalcNewSize(eredeti_x, eredeti_y, max_x, max_y){
	uj=new Array();
	if (eredeti_x>max_x){
		ratio=max_x/eredeti_x;	
		eredeti_x=max_x;
		eredeti_y=Math.round(eredeti_y*ratio);
	}
	if (eredeti_y>max_y)	{
		ratio=max_y/eredeti_y;
		eredeti_y=max_y;
		eredeti_x=Math.round(eredeti_x*ratio);
	}
	return {x:eredeti_x, y:eredeti_y};
}

var welcomeanimating=0;
var welcomestarted=0;
$(document).ready(function(){	
	$('#welcomevideo').bind('mouseover',function(){
		if(!welcomeanimating){
			$('#welcomevideo').stop().animate({marginTop:0},1000,function(){
				if(!welcomestarted){
					document.getElementById('player').sendEvent('PLAY');
					welcomestarted=1;
				}
			});
		}
	});
	$('#welcomevideoclose').bind('click',function(){	
		welcomeanimating=1;
		$('#welcomevideo').stop().animate({marginTop:-325},1000,function(){
			//document.getElementById('player').sendEvent('STOP');
			setTimeout('welcomeanimating=0;',1000);
		});
	});
});

