var ank;
var szoveg;
var index;
var valtozo=false;
function write() {
	valtozo=true;
   ank.text(visszaszoveg);
	visszaszoveg+=szoveg.charAt(index);
	index++;
	n=setTimeout("write()",100);
	if (index>szoveg.length) {
		clearTimeout(n);
		valtozo=false;
	}

}
function terminal(a) {
if (!valtozo) {
ank=$(a);
szoveg=ank.text();
visszaszoveg='';
index=0;
write();
}
}


$(document).ready(function(){
   $(".header a").click(function(){
    var target=$(this).attr("href");
    $.scrollTo(target,3000);
	 }).bind("mouseenter",function(){terminal($(this).children("span"))});
	$("div#merleg_ul a,div#program_ul a").click(function(){
		var target=$(this).attr("href");
		$.scrollTo(target,3000);
		var pos=$(target).position();
		var toppos=parseInt(pos.top);
		$(this).parents("div.ul_div").animate({top:toppos+160+"px"},"slow");
		});
	var wheight=$(window).height();
   $(".colmask").css({minHeight:wheight-222+"px"});
	if ($.browser.msie) {
		if (parseInt($.browser.version)==6) {
			$("div#ceg, div#web, div#szolg, div#hardver, div#kapcsolat, div#letolt").css({height:wheight-222+"px"});
		}
	}
  $("a#merleg_vissza").unbind().click(function(){
      var target=$(this).attr("href");
      $.scrollTo(target,3000);
      $("div#merleg_ul").css({top:"100px"});
      });
  $("div#web ul.ref a").hover(function(){
      $(this).children("img").fadeIn("slow");},function(){$(this).children("img").fadeOut("slow")}
  );


});

