$(document).ready(function(){
	if ( $('#popup').size() > 0 ){
		var h = $(document).height();
        var w = $(document).width();
		
		var myh = $('#popup_content').height();
		var myw = $('#popup_content').width();
		
		$('#popup').height(h);
		$('#popup').width(w);	
		
		var tmp = (h/2)-myh;
		
		$('#popup_content').css('top',100);
		$('#popup_content').css('left',(w/2)-(myw/2));	
		
		document.getElementById('popup').className='popup';
		document.getElementById('popup_content').className='popup_content';		
		var z = setTimeout("closeme()",9000);
	}

	$(".controlbutton").hover(
	  function () {
		$(this).addClass("controlhover");
	  },
	  function () {
		$(this).removeClass("controlhover");
	  }
	);
	
	$(".controlbuttonlast").hover(
	  function () {
		$(this).addClass("controlhoverlast");
	  },
	  function () {
		$(this).removeClass("controlhoverlast");
	  }
	);	
	
    $(function(){
        $(".contentNew").haccordion();
    }); 
    $(function(){
        $(".contentSlim").haccordion();
    }); 
	
	var tt = setTimeout("doClick()",5000);
	var ttt = setTimeout("doMy()",1000);
	
});

var accords = ['#hh1','#hh2','#hh3'];
var accordsslim = ['','#hhh1','#hhh2','#hhh3'];
var teker = 0;

function doClick(){
	jQuery(accords[teker]).trigger('click'); 
	teker++;
	if (teker>2) teker=0;
	var tt = setTimeout("doClick()",5000);
};

function doMy(){
	jQuery(accordsslim[cobol]).trigger('click'); 	
}

function closeme(){
	document.getElementById('popup').className='rh';
	document.getElementById('popup_content').className='rh';
	//document.getElementById('popup_shadow').className='rh';	
}

function gogo(url){
	document.location.href = url	;
}

var akt = 1;

function initlaps(lang){
	var tit = '';
	var laps = 3;
	var offset = 32;
	for (var i=1; i<=laps; i++){
		/*
		tit = '<img src="images/vtitle0'+i+'_'+lang+'.png">';
		$("#vtitle0"+i).html(tit);
		*/
		tit = '<img src="images/lap0'+i+'.jpg">';
		$("#lap0"+i).html(tit);
		$("#lap0"+i).css({'opacity': '0'});

	}
	$("#lap0"+akt).css({'opacity': '1'});

	$("#vtitle").html(str[(akt-1)]);

	$("#control01").mouseover(function(){
		pager(1);
	});
	$("#control02").mouseover(function(){
		pager(2);
	});
	$("#control03").mouseover(function(){
		pager(3);
	});

}

function pager(page){
	if (page == akt) return;
	
	$("#vtitle").animate({
	  "top": "+=250px",
	  opacity: "0.2"
	}, 50 );
	$("#vtitle").html(str[(page-1)]);
	$("#vtitle").animate({
	  "top": "-=250px",
	  opacity: "0.7"
	}, 150 );	
	
	$("#lap0"+akt).hide();
	$("#lap0"+page).fadeIn(300);
	akt = page;	
}



