/*

*/
var flashvars = {};
var params = {
	wmode: "transparent",
	menu: "false",
	bgcolor:	"none"
};


swfobject.embedSWF("/flash/lampa.swf", "flash_lampa", "212", "122", "8.0.0","/flash/expressInstall.swf", flashvars, params, {id:"flash_lampa", name:"flash_lampa"});
swfobject.embedSWF("/flash/switch.swf", "flash_switch", "55", "72", "8.0.0","/flash/expressInstall.swf", flashvars, params, {id:"flash_switch", name:"flash_switch"});


function thisMovie(movieName)
{
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}

function makeCall(str)
{
	if( str=="off" ) thisMovie("flash_lampa").switchOff(str);
	if( str=="on" ){
		$("#shade_off").remove()
		thisMovie("flash_lampa").switchOn(str);
		thisMovie("flash_switch").switchOn();
	}
}

function sunset(mode)
{
	if( mode=="start" )
	{
		$("body").prepend('<div id="screen_shade">&nbsp;</div>');
		//$("#screen_shade").css({width:"100%", height:"100%", zIndex:"1050", opacity:"0.4"});
		
		
		$("#screen_shade").css({
				backgroundColor:	"#000000",
				opacity:			"0.4",
				width:				$(document).width(),
				height:				$(document).height()
			}).fadeIn(1000, function(){addShadeText();});
		
		$('#screen_shade').css({
					width:		$(document).width(),
					height:		$(document).height()
		});

			$(window).resize(function() {
				// Style overlay and show it
				$('#screen_shade').css({
					width:		$(document).width(),
					height:		$(document).height()
				});
			});
			// If window was scrolled, calculate the new overlay dimensions
			$(window).scroll(function() {
				// Style overlay and show it
				$('#screen_shade').css({
					width:		$(document).width(),
					height:		$(document).height()
				});
			});
	}
}
function sunrise(mode)
{
	$("#screen_shade_text").fadeOut(1000,function(){removeElm("#screen_shade_text");});
		$("#shade_off").fadeOut("fast",function(){removeElm("#shade_off");});
		$("#screen_shade").fadeOut(2000,function(){removeElm("#screen_shade");});
}
function removeElm(elm)
{
	$(elm).remove();
}
function addShadeText()
{
	$("body").append('<div id="screen_shade_text"><div id="screen_shade_content" class="scroll-pane"></div><div id="shade_off" onclick="makeCall(\'on\');"></div></div>');
	$("#screen_shade_text").hide();
	$("#screen_shade_text").css({zIndex:"1060"});
	$("#screen_shade_text").fadeIn("slow");
	fGetContent(1, 'lichtdesign',"#screen_shade_content","scrollerNice");
}
function scrollerNice()
{
	$('#screen_shade_content').jScrollPane({showArrows:true});
}


