//
function loadAwards(image, title){
	$("#awardsDisplayBg").css({opacity:0.7});
	if(FlashDetect.installed){
		var html = '<embed src="./assets/title.swf" width="500" height="36" wmode="transparent" flashvars="color='+mainColor+'&text='+title+'"></embed>';
		$("#awardsDisplayTitle").html(html);
		$("#awardsDisplayTitle").css({left:46,top:72});
	}
	$("#awardsDisplayText a").css({color:mainColor});
	$("#awardsDisplayText .tint").css({color:mainColor});
	$("#awardsDisplay").css({opacity:0,visibility:"hidden"});
	awardsControllers();
	changeBg(image);
	BgOnComplete = awardsFadeIn;
}
function awardsFadeIn(){
	$("#awardsDisplay").css({visibility:"visible"}).delay(10).animate({opacity:1},350);
}
function awardsControllers(){
	var visibility = ($("#awardsDisplayText").height() > $("#awardsDisplayTextMask").height()) ? "visible" : "hidden";
	$("#awardsListControllers").css({visibility:visibility});
	if(visibility == "visible"){
		awardsControllersControl();
		$("#awardsListControllers #prev #on").css({opacity:0,display:"block"});
		$("#awardsListControllers #next #on").css({opacity:0,display:"block"});
		$("#awardsListControllers #prev").mouseover(function (){
			if($(this).css("cursor") == "pointer"){
				$(this).children("#off").stop(true).animate({opacity:0},150);
				$(this).children("#on").stop(true).animate({opacity:1},150);
			}
		});
		$("#awardsListControllers #prev").mouseout(function (){
			if($(this).css("cursor") == "pointer"){
				$(this).children("#off").stop(true).animate({opacity:1},150);
				$(this).children("#on").stop(true).animate({opacity:0},150);
			}
		});
		$("#awardsListControllers #next").mouseover(function (){
			if($(this).css("cursor") == "pointer"){
				$(this).children("#off").stop(true).animate({opacity:0},150);
				$(this).children("#on").stop(true).animate({opacity:1},150);
			}
		});
		$("#awardsListControllers #next").mouseout(function (){
			if($(this).css("cursor") == "pointer"){
				$(this).children("#off").stop(true).animate({opacity:1},150);
				$(this).children("#on").stop(true).animate({opacity:0},150);
			}
		});
		$("#awardsListControllers #next").click(function (){
			if($(this).css("cursor") == "pointer"){
				awardsChangePage(-1);	
			}
		});
		$("#awardsListControllers #prev").click(function (){
			if($(this).css("cursor") == "pointer"){
				awardsChangePage(1);
			}
		});
	}
}
function awardsChangePage(value){
	$("#awardsDisplayText").stop(true);
	var top = $("#awardsDisplayText").position().top+(352*value);
	$("#awardsDisplayText").css({top:top,opacity:0});
	//$("#awardsDisplayText").html($("#awardsDisplayText").html());
	//$("#awardsDisplayText").css({font:"NeuzeitGroTOTLigRegular"});
	awardsControllersControl();
	$("#awardsDisplayText").delay(50).animate({opacity:1},75);
}
function awardsControllersControl(){
	if($("#awardsDisplayText").position().top >= 0){
		$("#awardsListControllers #prev").mouseout();
		$("#awardsListControllers #prev").css({cursor:"auto",opacity:0.3});
	}else{
		$("#awardsListControllers #prev").css({cursor:"pointer",opacity:1});
	}
	if($("#awardsDisplayText").position().top+$("#awardsDisplayText").height() <= $("#awardsDisplayTextMask").height()){
		$("#awardsListControllers #next").mouseout();
		$("#awardsListControllers #next").css({cursor:"auto",opacity:0.3});
	}else{
		$("#awardsListControllers #next").css({cursor:"pointer",opacity:1});
	}
}
