// JavaScript Document
function showlb(){
	$("#lb").fadeIn('fast');	
}

$(document).ready(function(){
		$("#closelb, #lbbg").css('cursor','pointer').click(function(){
			$("#lb").fadeOut('fast');	
			return false;
		})
		$("#splash_left a").hover(
		  	function(){ 
		  		$(this).find('span').stop().fadeTo(300,1);
		  		$(this).find('.arrow').stop().animate({backgroundPosition:'17px 0px'},300);
			},
		  function(){ 
				$(this).find('span').stop().fadeTo(300,0.7); 
				$(this).find('.arrow').stop().animate({backgroundPosition:'0px 0px'},300);
		  }		  
		);	
		$("#smallblocks .second a").hover(
		  	function(){ 
				nr = $(this).parent().children().index($(this));
				activateSmallBlock(nr);
				clearInterval(blockInterval);
			},
			function(){
				blockInterval = setInterval(nextBlock,2500);
			}
		);
		
		activeBlock = 0;
		blockInterval = null;
		activateSmallBlock(0);
		blockInterval = setInterval(nextBlock,2500);
	});
	
	function nextBlock(){
		newblock = (activeBlock+1)
		if(newblock >= $("#smallblocks .second a").length){
			newblock = 0;	
		}
		activateSmallBlock(newblock);
	}
	
	function activateSmallBlock(index){
		$("#smallblocks .second a:eq("+activeBlock+")").css('backgroundPosition','0px -33px').find('span').stop().css({backgroundPosition:'0px 0px'});
		activeBlock = index;
		$("#smallblocks .second a:eq("+index+")").css('backgroundPosition','0px 0px').find('span').stop().animate({backgroundPosition:'-150px 0px'},250, function(){
				$(this).animate({backgroundPosition:'0px -50px'},250);					 
			}
		);
		$("#smallblocks .first .slider").stop().animate({'top':(index*-133) + 'px'},300)
	}
	function pageHeight(){
		var _docHeight = (document.height !== undefined) ? document.height : document.body.offsetHeight;
		return(_docHeight)
	}
		//	function resizeElements(){
		//		if(document.getElementById('occFrame')){
				//	document.getElementById('occFrame').style.height=(pageHeight()-210)+'px';
		//		}
		//	}

		var depth  = 100;
		var timeout = new Object();
		var submenuinit = new Object();
		function getNextHighestDepth(){
			depth = depth + 1;
			return(depth);
		}
		function submenuOn(id){
//			document.getElementById('mainmenu_'+id).className	= 'mainmenu_button_on';	
			if(document.getElementById('hider_'+id)){
				document.getElementById('container_'+id).style.zIndex = getNextHighestDepth();			
				document.getElementById('hider_'+id).style.display = 'block';			
				if(timeout[id]){
					clearTimeout(timeout[id]);
				}			
				if(document.getElementById('hider_'+id)){				
					if(!submenuinit[id]){
	
						document.getElementById('submenu_'+id).style.top = ((document.getElementById('submenu_'+id).offsetHeight*-1)-30) + 'px';
						submenuinit[id] = true;
					}
					mover('hider_'+id,false,false,false,(parseInt(document.getElementById('submenu_'+id).offsetHeight)+30),9);
					mover('submenu_'+id,false,'0',false,false,9);					
				}
			}
		}
		function submenuOff(id){
			if(timeout[id]) clearTimeout(timeout[id]);		
			timeout[id] = setTimeout('submenuOff2('+id+')',200);
		}		
		
		function submenuOff2(id){
//			document.getElementById('mainmenu_'+id).className	= 'mainmenu_button_off';							
			if(document.getElementById('hider_'+id)){		
				mover('hider_'+id,false,false,false,'0',9);
				mover('submenu_'+id,false,(document.getElementById('submenu_'+id).offsetHeight*-1)-30,false,false,9);			
			}			
		}