// JavaScript Document


function view_language_select ()
{	
	var windowHeight = $(window).height();
	$('#shade').css('opacity', 0);
	$('#shade').css('display', 'block').css('height', windowHeight+'px').fadeTo('normal', 0.85,
		function ()
		{
			$('#lang_test').fadeIn('normal');
		}
	);
}

function hide_language_select ()
{
	$('#lang_test').fadeOut('normal',
		function ()
		{
			$('#shade').fadeOut('normal',
				function ()
				{
					$('#shade').css('display', 'none');	
				}
			);	
		}
	);
}

function setPageHeight () 
{
	var windowHeight = $(window).height();
	var bodyHeight 	 = $('#page').height();
	
	if (bodyHeight < windowHeight)
	{
		$('#window').css("height", windowHeight+"px");
	} else
	{
		$('#window').css("height", "auto");
	}
}


$(document).ready (
	function ()
	{	
		//IE6
		if(document.all && !window.opera)
		{
			$('.sepia').css('display', 'none');
		}
		
		// Opera
		if (window.opera)
		{
			if(typeof sIFR == "function"){
				sIFR.setup();
				sIFR.replaceElement("h1", named({sFlashSrc: "/cms_sifr/viner_2.swf", sWmode: "transparent", sColor: "#752424"}));
				sIFR.replaceElement("#menu li", named({sFlashSrc: "/cms_sifr/viner_2.swf", sWmode: "transparent", sColor: "#752424"}));
			};	
		}
		
		
		//All Browsers
		$('#lang_select').click(function() {view_language_select(); return false;});
		$('#shade').click(function(){hide_language_select();});
		setPageHeight();
		$(window).resize(function () {setPageHeight()});
		
	}
);
