<!--
opera = (navigator.userAgent.indexOf('Opera') >= 0)? true : false;
dom = (document.getElementById)? true : false;
ie4 = (document.all && !dom)? true : false;
nn4 = (document.layers)? true : false;
isLoaded = false;

function changeImages() {
  if (!document.getElementById) return
  var imgOriginSrc = new Array();
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].setAttribute('srctemp', imgarr[i].getAttribute('src'));
        imgarr[i].onmouseover = function() {
            this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',this.getAttribute('srctemp'))
        }
    }
  }
}

function changeTEXT() {
  if (!document.getElementById) return
  var txtarr = document.getElementsByTagName('p');
  for (var i = 0; i < txtarr.length; i++) {
    if (txtarr[i].className == 'text') {
        txtarr[i].onmouseover = function() {
            this.style.color = '#808080';
        }
        txtarr[i].onmouseout = function() {
            this.style.color = '';
        }
    }
  }
}

function windowsOpen() {
  if (!document.getElementById) return;
  var imgarr = document.getElementsByTagName('img');
  var newwin;
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('osrc')) {
      imgarr[i].onclick = function() {
        if (newwin) {newwin.close();}
        var imgWidth = this.getAttribute('owidth');
        imgWidth = parseInt(imgWidth);
        var imgHeight = this.getAttribute('oheight');
        imgHeight = parseInt(imgHeight);
        var posX=Math.round((screen.width-imgWidth)/2);
        var posY=Math.round((screen.height-imgHeight)/2);
        var posCode = (nn4) ? "screenX="+posX+",screenY="+posY : "left="+posX+",top="+posY;
        var imgSrc = this.getAttribute('osrc');
        newwin = window.open ('','popUp','');
        newwin.close();
        newwin = window.open ('','popUp',"toolbar=no,directories=no,menubar=no,scrollbars=auto,width=" + imgWidth + ",height=" + imgHeight + ",resizable=yes,"+posCode);
	newwin.document.write ("<html><head><title>crjs.ru</title></head><body style='margin: 0px'><img src=" + imgSrc + " border=0></body></html>");
      }
    }
  }
}

function divShowFunc () {
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('dsrc')) {
        imgarr[i].onclick = function() {
        	divShow.src="images/loading.gif";
		if (window.innerWidth || window.innerHeight){
			docwidth = window.innerWidth;
			docheight = window.innerHeight;
		}
		//IE Mozilla
		if (document.body.clientWidth || document.body.clientHeight){
			docwidth = document.body.clientWidth;
			docheight = document.body.clientHeight;
		}
        	divShow.style.left = (docwidth - 400)/2;
        	divShow.style.top = 20;
			divShow.style.visibility = "visible";
        	var imgTemp = new Image();
        	imgTemp.src = this.getAttribute('dsrc');
            divShowImage.setAttribute('src',this.getAttribute('dsrc'))
        }
    }
  }
}

var osection=false, needclose=false;

function doSection (section, needchange){
 if (osection==section) { osection=false; needclose=false; }
 else {
  if (needclose) {
   needclose = false;
   doSection (osection,0);
  }
  needclose = needchange;
  if (needclose) {
   osection = section;
  } else {
   osection = false;
  }
 }

 if (document.getElementById) {
  alltr = document.getElementById(section);
  opened = (alltr.style.display == 'none');
  alltr.style.display = opened?'':'none';
 } else if (document.all) {
  alltr = document.all[section];
  opened = (alltr.style.display == 'none');
  alltr.style.display = opened?'':'none';
 } else if (nn4) {
  alltr = document.getElementById(section);
  opened = (alltr.style.display == 'none');
  alltr.style.display = opened?'table-row':'none';
 }
 return false;
}

function init() {
  changeImages ();
  //changeTEXT();
  windowsOpen ();
  divShowFunc()
}
onload=init;



function rollOver(defaultImage, lightedUp) {
	this.def = new Image();
	this.def.src = defaultImage;
	this.light = new Image();
	this.light.src = lightedUp;
	return this
}
ros = new Array()
ros['menuImg'] = new rollOver("/i/submenu-bg-over.gif","/i/submenu-sep.gif");


function startRunning()
{
	// Pause 
	PhraseNumber = -2;
	// Length of Phrase
	y = 0;
	// First Symbol	
	x = 0;
	Limit = 85;
	
	// Locate Running Field
	if (document.getElementById) 
	{theAnchorObject = document.getElementById("Running"); 
	 goRunning();   	
        }
	else { document.write("<style>.rdiv{display:none;}</style>");
            return true;
	     }
}
// Main-loop
function goRunning()
{
	var TimeOut;  

	if(y == 0)
	{PhraseNumber++;
	 PhraseSummary = Summaries[PhraseNumber].replace(/&quot;/g,'"');
	 theTargetLink = Links[PhraseNumber];
	 theAnchorObject.href = theTargetLink;
	}

   theAnchorObject.innerHTML = "&nbsp;&nbsp;&nbsp;" + (x<3?("<b class='rrun'>"+PhraseSummary.substring(x,y<4?y:3)+"</b>"):"") + (y>3?PhraseSummary.substring(x>4?x:3,y):"") + Writing_Symb();
   

	if (y != PhraseSummary.length) {
		y++;
		TimeOut = SymbolTimeout;
		if (y >= Limit) {  x++;  }
	} else {
		y = 0;
		x = 0;
		PhraseNumber = -1;
		TimeOut = PhraseTimeout;
	}
	setTimeout("goRunning()", TimeOut);
}

function Writing_Symb()
{
	if(y == PhraseSummary.length)
	{
		return Writing_n;
	}

	if((y % 2) == 1)
	{
		return Writing_F;
	}
	else
	{
		return Writing_S;
	}
}


var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.

var punkShow = new Array();
punkShow[0]='tfAboutL';
punkShow[1]='tfNews';
punkShow[2]='tfEvents';
punkShow[3]='tfPartners';
punkShow[4]='tfProjectsL';

var oldargs=-1;
var newsfirst=false;
var pressfirst=false;

function main_DoFSCommand(command, args) {
 if (command == "doSection" && args!=5) {
  oldargs = args;
  doSection (punkShow[args],0);
  if (args==0) {
   doSection ('tfAboutR',0);
  } else if (args==1 && newsfirst) {
 //  doSection(newsfirst,1);
  } else if (args==2) {
//   doSection(pressfirst,1);
  } else if (args==4) {
	  doSection ('tfProjectsR',0);
  }
 }
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub main_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call main_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

-->
