$(document).ready(function(){
/*	// footer position
	$('#leftContent ul:last-child li:last-child').css({"border-bottom":"none"});
	$('#leftContent ul:last-child li:last-child a img').attr({src: "../images/tooltip_without_bottom_line.png"});

	$('#leftContent ul li:last-child a').css({"height":"25px"});
	$('#leftContent h2:first-child').css({"background":"url(../images/left_menu_top_bk.png) no-repeat top left"});
	$('#contentTeasers .teaser:last-child').css({"margin":"0 0 0 0"});

	$('#searchInput').onclick = function(){
		
	}
	if ($('#searchInput').attr("value")=="a"){$('#searchInput').attr("value","SØG");}

	
//	);

	$('#leftMenu li img').bind('mouseover',function(event){
		$(this).parent().addClass('currentSmileyFace');
		$('#leftMenu li.currentSmileyFace div').css({display:"block"});
		$('#leftMenu li img').css('cursor','pointer');				  
	});
	*/	
	
	// ON FOCUS, THE TEXT SETS IN THE VALUE OF THE INPUT DISAPPEARS
	/*$("inputSubject").focus( function(){ 
			
									  
			 })
	*/
	// PNG BACKGROUND IMAGE TRANSPARENCY FIX
		
	$.ifixpng('/images/blank.gif');
	jQuery('#headerContent, #theme, #teasersLeftCol h3, .bigImageInterview h2, .section_2Teasers_small h4, .addPlaceholder h3, .flashVideo, #nextMaggazineImg a img, .backgroundBannerTitle, .contestWizzardStep, .section_bestRated h3, #theme img').ifixpng();
	
	
	
	// TOP MENU ANIMATION
	
	// when the page is loaded first, only the first row of the main links are shown; when the user moves the mouse above, the second line is shown
	// but if the user open a page from the links in the first  row, the second line of the submenus will be shown from the start; no animation necessary

	var noMenuAnimationOnLeave = false; //if the current item has another menu level; them on mouseLeave the menu won't hide
	
	if($("#mainTopMenu > li.activePage").is(":has(ul)")){ 
		$("#mainMenus").css({top:"170px"}); //display the submenu of the current page, if the curent page has subitems
		$("li.activePage ul").addClass("activeSubmenu");
		var noMenuAnimationOnLeave = true;
	}
	
	$("#mainTopMenu > li").mouseover(function(){
											  
			$(this).addClass("activePageHover");
			
			$("#mainTopMenu").find(".activePage").addClass("activePageSuspend");
			
			if($(this).hasClass("activePageSuspend")){
				$(this).removeClass("activePageSuspend");	
			}
			
			$("#mainTopMenu ul").removeClass("activeSubmenu");		  
			$(this).children("ul").addClass("activeSubmenu");
			$(this).css({cursor: 'pointer'});
			if ($(this).is(":has(ul)")) {
				$(this).parent().parent().stop().animate({ 
					top: "170px"
				  }, 300 );
			}else{
				if(noMenuAnimationOnLeave==false){
					$(this).parent().parent().stop().animate({opacity: 1.0},300).animate({ 
						top: "189px"
					}, 300 );	
				}
			}
	});

	$("#mainTopMenu > li").mouseout(function(){
			$(this).removeClass("activePageHover");			
			$("#mainTopMenu .activePage").removeClass("activePageSuspend");
			$("#mainTopMenu ul").removeClass("activeSubmenu");
			$("#mainTopMenu .activePage ul").addClass("activeSubmenu");
			$(this).css({cursor: 'default'});		
			var currentItem = $(this).parent().parent();
			
			
			if(noMenuAnimationOnLeave==false){
				$(this).parent().parent().stop().animate({ 
					opacity: 1.0
					}, 1000, function(){
								$(this).children("ul").removeClass("activeSubmenu");
								$(currentItem).animate({top: "189px"},300);
					
							}
				);	
			}

		})	

			
	/*			
			$(this).parent().parent().stop().animate({opacity: 1.0}, 300)
			
			
			if ($(this).is(":has(ul)")) {
				$(this).parent().parent().animate({ 
					top: "189px"
				  }, 300 );
			}		

			$(this).parent().parent().animate({ 
				top: "189px"
			  }, 300, function(){$(this).children("ul").removeClass("activeSubmenu");});	
	*/
				
	
	
	
	
	// remove some style for the last children of some lists all around the website pages	
	$("#relatedArticleLinks ul li:last h4").css({border : '0'});
	$("#relatedArticleLinks ul:first li:last h4").css({border : '0'});
	$('.latestNews li:has(h3)').css({border : '0'});
	
	
	//ad round corners for the background of the article comments zone
	$("#articleAddComment").corner("8px");
	
	
	
	
	$(".tabSlideContent").hide();
	$("h3.tabContentHidden").mouseover(function(){
        $(this).css({cursor: 'pointer'});
    }).mouseout(function(){
     
    });
	
	
	
	$('.tabContentHidden').toggle(function(event){
		//alert($(this).parent().children('.tabSlideBodyContent'));
			$(this).parent().children(".tabSlideContent").slideDown("slow");
			$(this).removeClass("tabContentHidden");
			$(this).addClass("tabContentShown");

			
		},function(event){
			$(this).parent().children(".tabSlideContent").slideUp("slow");
			$(this).removeClass("tabContentShown");
			$(this).addClass("tabContentHidden");	
	})
});


