function my$(id){
	return document.getElementById(id);
}

function IE(version){
	if(!version) version = 'all';
	var msieIndex = navigator.appVersion.indexOf("MSIE");
	if(msieIndex == -1) return false;
	var ieversion = parseFloat(navigator.appVersion.substr(msieIndex + 5,3));
	if(version == 'all' || ieversion <= version) return true;
return false;
}

function nav_menu_on(el){
// 	if(IE(6)) my$(el).style.display = 'block';
}
function nav_menu_off(el){
// 	if(IE(6)) my$(el).style.display = 'none';
}

// if(IE(6)) alert('In order to properly view this page please upgrade to the latest version of Internet Explorer or use Firefox, Safari or Opera browser.');

jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

$(document).ready(function(){

	$('a.miniaturka').lightBox();

// 	$("a.miniaturka").fancybox({ 'zoomSpeedIn': 0, 'zoomSpeedOut': 0, 'overlayShow': true });

	$.preloadImages('/gfx/intro/oko.png');

 	if(!$.cookie('quebec_intro2')){
		$.cookie('quebec_intro2','1');
		var srcs = new Array;
		for(var i = 1; i <= 17; i++){
			$.preloadImages('/gfx/intro/'+i+'.jpg');
			srcs.push({src: '/gfx/intro/'+i+'.jpg'});
		}

		$('body').append('<div id="lighttest"></div><div id="fader"></div><div id="eye"></div><div id="buttons"><a href="/actions/language/change/fr.html">Passer intro</a><div>'); // | <a href="/actions/language/change/en.html">english</a>
		$('#lighttest')
			.width($('html').width()+'px')
			.height($('#body_container').height()+'px');
		$('#eye')
			.css('left',Math.round($('html').width()/2)-325+'px')
			.css('top',Math.round($('html').height()/2)-225+'px')
			.ifixpng();
		$('#buttons')
			.css('left',Math.round($('html').width()/2)-325+'px')
			.css('top',Math.round($('html').height()/2)+225+'px');
		$('#fader')
			.css('left',Math.round($('html').width()/2)-325+'px')
			.css('top',Math.round($('html').height()/2)-225+'px')
			.crossSlide({
				  sleep: 3, //in sec
				  fade: 2   //in sec
				},
				  srcs
			);

		$(window).resize(function(){
			$('#lighttest')
				.width($('html').width()+'px')
				.height($('#body_container').height()+'px');
			$('#eye')
				.css('left',Math.round($('html').width()/2)-325+'px')
				.css('top',Math.round($('html').height()/2)-225+'px');
			$('#buttons')
				.css('left',Math.round($('html').width()/2)-325+'px')
				.css('top',Math.round($('html').height()/2)+225+'px');
			$('#fader')
				.css('left',Math.round($('html').width()/2)-325+'px')
				.css('top',Math.round($('html').height()/2)-225+'px');
		});

 	}


 });
