$(document).ready(function() {
	

		/*visa beroende på publdatum
		var currentTime = new Date()
		var month = currentTime.getMonth() + 1
		var day = currentTime.getDate()
		var year = currentTime.getFullYear()
		var $firstDay = $(".drift_cont .driftday:first span:first").html();
		var $firstMonth = $(".drift_cont .driftmonth:first span:first").html();
		*/
		
		
		
		
		
		
		
			
/* -- Aktuellt/drift-flikar startsidan -- */
function $selFirst(){
		$($firstObj).addClass('akt_row_active');
		$($firstObj).find('a').css('color', '#FFE400');
		var $ImageURL = ($($firstObj).find('.imgURL').val());
		$(".akt_imgView").html('<img src="'+$ImageURL+'">');	
}

/*function timedAlert()
{
	var t=setTimeout("$('.flik_drift img').attr('src', '/images/18.262d1caa12b0fa7e12c80004860/alertfast.png')",5500);
//var t=setTimeout("$('.flik_drift img[alt='Upplysning']').hide()",5500);
}
	
	var $countDrift = $(".drift_cont").find(".drift_row").length;		//Om det finns någon driftinfo
	if ($countDrift > 0) {
		
		
		
		timedAlert();
		$(".flik_drift img").show();
		$(".drift_cont").show();
		$(".akt_cont").hide();
		var $firstObj = (".drift_cont .drift_row:first");
		$selFirst();
	}
	else {
		$(".drift_cont").hide();
		$(".akt_cont").show();
		$(".flik_drift img").hide();
		var $firstObj = (".akt_cont .akt_row:first");
		$selFirst();
	} */
			$(".drift_cont").hide();
		$(".akt_cont").show();
		$(".flik_drift img").hide();
		var $firstObj = (".akt_cont .akt_row:first");
		$selFirst();

	
	
	$(".flik_drift").click(function() {								//klickfunktion flikar
		$(".drift_cont").show();
		$(".akt_cont").hide();
		var $firstObj = (".drift_cont .akt_row:first");
		$selFirst();
	
		
	});
	
	$(".flik_akt").click(function() {
		$(".drift_cont").hide();
		$(".akt_cont").show();
		$(".akt_row:first").addClass('akt_row_active');
		$(".akt_row:first").find('a').css('color', '#FFE400');
		var $ImageURL = ($(".akt_row:first").find('.imgURL').val());
		$(".akt_imgView").html('<img src="'+$ImageURL+'">');
			
	});
	
	

	$(".akt_row").mouseenter(function() {							//hovereffekt aktuellt
		
			$(".akt_row:first").removeClass('akt_row_active');
			$(".akt_row:first").find('a').css('color', 'black');
		var $ImageURL = ($(this).find('.imgURL').val());
		$(".akt_imgView").html('<img src="'+$ImageURL+'">');
  		$(this).addClass('akt_row_active');
  		$(this).find('a').css('color', '#FFE400');
			
  
	});

	$(".akt_row").mouseleave(function() {
		
		$(".akt_imgView").html('');
  		$(this).removeClass('akt_row_active');
 	 	$(this).find('a').css('color', '#000');
			
		$(".akt_row:first").addClass('akt_row_active');
		$(".akt_row:first").find('a').css('color', '#FFE400');
		var $ImageURL = ($(".akt_row:first").find('.imgURL').val());
		$(".akt_imgView").html('<img src="'+$ImageURL+'">');
			
	});
	
	$(".drift_row").mouseenter(function() {							//hovereffekt drift
		
			$(".drift_row:first").removeClass('akt_row_active');
			$(".drift_row:first").find('a').css('color', 'black');
		var $ImageURL = ($(this).find('.imgURL').val());
		$(".akt_imgView").html('<img src="'+$ImageURL+'">');
  		$(this).addClass('akt_row_active');
  		$(this).find('a').css('color', '#FFE400');
			
  
	});

	$(".drift_row").mouseleave(function() {
		
		$(".akt_imgView").html('');
  		$(this).removeClass('akt_row_active');
 	 	$(this).find('a').css('color', '#000');
			
		$(".drift_row:first").addClass('akt_row_active');
		$(".drift_row:first").find('a').css('color', '#FFE400');
		var $ImageURL = ($(".drift_row:first").find('.imgURL').val());
		$(".akt_imgView").html('<img src="'+$ImageURL+'">');
			
	});
	
		
		
		/*hoovereffekt artikelpuffar*/
		
		$(".nyhetspuff").mouseenter(function() {							
  		$(this).css('background', '#737373');
  		$(this).find('a').css('color', '#FFE400');
			
  
	});

	$(".nyhetspuff").mouseleave(function() {
		
		
  		$(this).css('background', '#c0c0c0');
 	 	$(this).find('a').css('color', '#000');
					
	});
	
	/*hoovereffekt arkivpuffar*/
		
		$(".arkivpuff").mouseenter(function() {							
  		$(this).css('background', '#737373');
  		$(this).find('a').css('color', '#FFE400');
			
  
	});

	$(".arkivpuff").mouseleave(function() {
		
		
  		$(this).css('background', '#c0c0c0');
 	 	$(this).find('a').css('color', '#000');
					
	});
	
});
