function changemission(){
	if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent))
	{
		return false;
	}else{
		if(document.getElementById('mission-text'))
			document.getElementById('mission-text').style.position = 'absolute';
	}
}

function hide_about()
{	
	document.getElementById('mission-text').style.display='none';	
	return false;
}

function show_about()
{	
	if(document.getElementById('mission-text').style.display=='block'){
		document.getElementById('mission-text').style.display='none';
	}else{
		document.getElementById('mission-text').style.display='block';		
	}
	return false;
}
	
function show_login(){					
	if(document.getElementById('opt').style.zIndex == '0' || document.getElementById('opt').style.zIndex == '' || document.getElementById('opt').style.zIndex == '-1'){
		document.getElementById('opt').style.zIndex = '2000';	
		document.getElementById('at_bitrix').style.display = 'block';		
		document.getElementById('at_opt').style.display = 'block';		
		document.getElementById('opts').style.zIndex = '-1';	
		document.getElementById('s_bitrix').style.display = 'none';				
		document.getElementById('s_opt').style.display = 'none';						
	}else{
		document.getElementById('opt').style.zIndex = '-1';	
		document.getElementById('at_bitrix').style.display = 'none';		
		document.getElementById('at_opt').style.display = 'none';		
	}	
	return false;
}

function show_search(){	
	if(document.getElementById('opts').style.zIndex == '0' || document.getElementById('opts').style.zIndex == '' || document.getElementById('opts').style.zIndex == '-1'){
		document.getElementById('opts').style.zIndex = '2000';	
		document.getElementById('s_bitrix').style.display = 'block';		
		document.getElementById('s_opt').style.display = 'block';				
		document.getElementById('opt').style.zIndex = '-1';	
		document.getElementById('at_bitrix').style.display = 'none';				
		document.getElementById('at_opt').style.display = 'none';						
	}else{
		document.getElementById('opts').style.zIndex = '-1';	
		document.getElementById('s_bitrix').style.display = 'none';		
		document.getElementById('s_opt').style.display = 'none';		
	}		
	return false;
}



// JavaScript Document
function slide() {	
	this.FadeProgress = 0; 
	this.FadeCounter; 
	this.FadeTimeout;
	this.FadeStatus = "Hidden"; 
	this.FadeBusy = false;
	this.Window;
	this.Total;
	this.Tracker = 1;
	this.OverideID = "";
	this.Play = true;
	this.Active = true;
	
	this.start = init;	
	this.fadeIn = fadeIn; 
	this.fadeOut = fadeOut; 
	this.show = showWindow; 
	this.hide = hideWindow;
	this.loadSlide = loadSlide;
	this.nextSlide = nextSlide;
	this.previousSlide = previousSlide;
	this.playStatus = playStatus;
	
	function fadeIn() {
		this.Window.style.opacity = this.FadeProgress/10;
		this.Window.style.filter = 'alpha(opacity=' + this.FadeProgress*10 + ')';
		this.FadeProgress = this.FadeProgress + 1;
		if (this.FadeProgress > 10) { 
			window.clearInterval(this.FadeCounter);
			this.FadeProgress = 10;
			this.FadeBusy = false;
			if (this.Play == true) this.FadeTimeout = window.setTimeout("SlideShow.hide();",4000);
		}
	}
	function fadeOut() {
		this.Window.style.opacity = this.FadeProgress/10;
		this.Window.style.filter = 'alpha(opacity=' + this.FadeProgress*10 + ')';
		this.FadeProgress = this.FadeProgress - 1;
		if (this.FadeProgress < 0) { 
			window.clearInterval(this.FadeCounter);
			this.FadeProgress = 0;
			this.Window.style.display = "none";
			this.FadeBusy = false;
			if (this.Tracker == this.Total) { this.Tracker = 1; }
			else { this.Tracker++; }
			if (this.OverideID != "") { this.Tracker = this.OverideID; this.OverideID = ""; }
			this.show();
		}
	}
	function showWindow() {		
		if ((this.FadeStatus != "Visible") && (this.FadeBusy != true)) {			
			this.FadeStatus = "Visible";
			this.FadeBusy = true;
			this.Window = document.getElementById("Image"+this.Tracker);									
			this.Window.style.display = "block";			
			this.FadeCounter = window.setInterval('SlideShow.fadeIn()',50);
		}
	}
	function hideWindow() {
		if ((this.FadeStatus == "Visible")  && (this.FadeBusy != true)) {
			this.Window = document.getElementById("Image"+this.Tracker);
			this.FadeStatus = "Hidden";
			this.FadeBusy = true;
			this.FadeCounter = window.setInterval('SlideShow.fadeOut()',50);
		}
	}
	function loadSlide(id) {
		//alert(id);
		if (this.FadeStatus == "Visible") {
			this.OverideID = id.replace("Image",""); 
			if (this.FadeTimeout != "") {
				window.clearInterval(this.FadeTimeout);
				SlideShow.hide();
			}
			//alert(this.Window.id);
		}
	}
	function nextSlide() {
		if (this.FadeStatus == "Visible") {
			//this.OverideID = id.replace("Image",""); 
			if (this.FadeTimeout != "") {
				window.clearInterval(this.FadeTimeout);
				SlideShow.hide();
			}
		}
	}
	function previousSlide() {
		if (this.FadeStatus == "Visible") {
			if (this.Tracker == 1) this.OverideID = this.Total; 
			else this.OverideID = this.Tracker - 1; 
			if (this.FadeTimeout != "") {
				window.clearInterval(this.FadeTimeout);
				SlideShow.hide();
			}
		}
	}
	function playStatus(element) {			
		if (this.FadeStatus == "Visible") {
			if (this.Play == true) {
				element.innerHTML = '<img src="/images/stop.gif" alt="Play" border="0">';
				this.Play = false;
				if (this.FadeTimeout != "") {
					window.clearInterval(this.FadeTimeout);
				}
			}
			else {
				element.innerHTML = '<img src="/images/stop2.gif" alt="Stop" border="0">';
				this.Play = true;
				SlideShow.hide();
			}
		}
	}
	
	function init() {								
		i = 1;
		arPics = new Array();
		while(document.getElementById("Image"+i)) { 
			arPics[i] = new Image();
			arPics[i].src = document.getElementById("Image"+i).src.replace('http://'+location.host,'');
			document.getElementById("Image"+i).style.opacity = "0";
			document.getElementById("Image"+i).style.filter = 'alpha(opacity=0)';
			i++;
		}		
		this.Total = i-1;		
		if(this.Total == 1) {
			document.getElementById("Image1").style.display = "block";
			document.getElementById("Image1").style.opacity = "1";
			document.getElementById("Image1").style.filter = 'alpha(opacity=1)';
			this.Active = false;
		}
		else if(this.Total != 0) {
			//window.setTimeout("alert('yabber');",1000);
			document.getElementById("SlideshowControls").style.display = "block";			
			this.show();
		}
	}
}

var SlideShow = new slide();
SlideShow.Play = false;
