var isMouseDown;
var timerId;
function getBrouserName(){
var ua="";
if (window.navigator.userAgent.indexOf ("Opera") >= 0)
ua = 'Opera';
else
if (window.navigator.userAgent.indexOf ("Gecko") >= 0) // (Mozilla, Netscape, FireFox)
ua = 'Netscape';
else
if (window.navigator.userAgent.indexOf ("MSIE") >= 0)
ua = 'Explorer';
else
ua = window.navigator.appName; // Неизвестные мне браузеры
return ua;
}
function loadImage(src, title, width, height){
loader = document.getElementById('image_loader');
if (title!="")
title = "
"+title+"
";
loader.innerHTML = '
'+title;
closer = document.getElementById('image_closer');
setCorrectImagePosition(width, height);
$('.image').animate({opacity:'0.5'},1000);
$('#image_loader').animate({opacity:'1'},1500);
$('#image_closer').animate({opacity:'1'},1100);
loader.style.zIndex=1;
closer.style.zIndex=1;
}
function fadeLoader(){
loader = document.getElementById('image_loader');
closer = document.getElementById('image_closer');
$('.image').animate({opacity:'1'},1000);
$('#image_closer').animate({opacity:'0'},100);
$('#image_loader').animate({opacity:'0'},1000);
setTimeout("hideLoader()", 1000);
}
function hideLoader(){
loader.style.zIndex=-2;
closer.style.zIndex=-2;
}
function preLoad(gwidth){
var wwidth=(window.innerWidth)?window.innerWidth:
((document.all)?document.body.offsetWidth:null);
if (getBrouserName()=='Opera'){
$.support.opacity = true;
}
if (getBrouserName()=='Explorer'){
$('.substrate').animate({width:wwidth-30},0);
// set default tags opacity
$('.opacity').animate({opacity:'0.5'}, 0);
}
// set default gallery properties
var gleft = wwidth-gwidth;
if (wwidth<1200 && getBrouserName()=='Netscape') {
wwidth = wwidth - 20;
gleft = gleft - 20;
}
if (gleft<0)
$('.gallery').animate({left:gleft},0);
$('.gallery').animate({width:gwidth},0);
//$('.substrate').animate({width:wwidth},0);
// set default taglist position
$('.taglist').animate({width:wwidth},0);
$('#start').animate({width:wwidth/2-90},0);
$('#previous').animate({width:64},0);
$('#next').animate({width:wwidth/2-90},0);
$('#finish').animate({width:30},0);
if (document.getElementById('ajax_loader')!=null)
document.getElementById('ajax_loader').style.display="none";
if (document.getElementById("div_title")!=null)
document.getElementById("div_title").style.display="block";
if (document.getElementById("menu_table")!=null)
document.getElementById("menu_table").style.display="block";
if (document.getElementById("substrate")!=null)
document.getElementById("substrate").style.display="block";
if (document.getElementById("tag_row_0")!=null)
document.getElementById("tag_row_0").style.display="block";
if (document.getElementById("tag_row_1")!=null)
document.getElementById("tag_row_1").style.display="block";
if (document.getElementById("tag_row_2")!=null)
document.getElementById("tag_row_2").style.display="block";
if (document.getElementById("gallery_table")!=null)
document.getElementById("gallery_table").style.display="block";
if (document.getElementById("arrows")!=null)
document.getElementById("arrows").style.display="block";
if (document.getElementById("code_div")!=null)
document.getElementById("code_div").style.display="block";
leaveMouse();
}
function setCorrectImagePosition(width, height){
var wwidth=(window.innerWidth)?window.innerWidth:
((document.all)?document.body.offsetWidth:null);
var wheight=(window.innerHeight)?window.innerHeight:
((document.all)?document.body.offsetHeight:null);
var itop = getBodyScrollTop() + wheight/2 - height/2;
if (itop<30) itop=30;
$('#image_loader').animate({left:wwidth/2 - width/2},0);
$('#image_loader').animate({top:itop},0);
$('#image_closer').animate({left:wwidth/2 + width/2 + 15},0);
$('#image_closer').animate({top:itop-17},0);
}
function getBodyScrollTop() {
return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
function getBodyScrollLeft() {
return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}
function galleryMoveLeft(gwidth){
var gallery = document.getElementById('gallery');
var table = document.getElementById('gallery_table');
if (gallery.offsetWidth