function getMovie() {
	var MS =  navigator.appName.indexOf("Microsoft")!=-1
	return (MS ? window : document)["BridgeMovie"]
}

//Получаем известие от флеша, что ролик закончился и удаляем флешку		
function recieveFromFlash() {
	$("#black").remove();
    //запускаем перебор картинок
	$("#headerimg1").css("background-image",'url("images/bkg/1.jpg")');
	playBkg();
}

(function($) {
  var cache = [];
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)
 

$("document").ready(function(){
	//Прелоад фоновых изображений
	jQuery.preLoadImages(path + "images/bkg/1.jpg", path + "images/bkg/2.jpg", path + "images/bkg/3.jpg", path + "images/bkg/4.jpg");
	
	if(!playintro) $("#headerimg1").css("background-image",'url("images/bkg/1.jpg")');
	
//	var langDivClicked = false;
	//Убираем слой с роликом
	if(!playintro){
		$("#intro1").remove();
		recieveFromFlash();
	}
	$(".skipintro").click(function(){
			recieveFromFlash();
	});
	
	//Наводим мышкой на меню
	$("td.menu").mouseover(function(){
		$(this).css("background-color","#a47ab0")
	});	

	$("td.menu").mouseout(function(){
		$(this).css("background", "none");
	});	

/*	$("#language").click(function(){
		langDivClicked = true;
	});*/

	$("td.menu").click(function(){
		obj = $(this).children()[0];
		if ($(this).children()[1] != undefined) var obj = $(this).children()[1];

		link = obj;
	
//		if (!langDivClicked){
			if (obj.target == ''){ 
				window.location.href = link;
			}
			else window.open(link,"_blank");
//	  	return false;
//		}
	});	
});
