var i=0;

$(document).ready(function(){
  $("#topcontacts").html('<h3>Контактная информация:</h3><p align="center"><div style="width: 450px; text-align: left;"><br><p>Московская область, Одинцовский район,<br>пос. Большие Вяземы, Можайское шоссе, 2а, офис 105</p><p>Телефон: +7 (495) 504-15-06, 580-83-25<br>Телефон / Факс: +7 (495) 598-20-46, 597-01-50 (доб. 111, 122)<br>Факс: +7 (495) 597-41-10</div></p>');
  $("#liveinternet").html('<a href="http://www.liveinternet.ru/click" '+'target=_blank><img src="http://counter.yadro.ru/hit?t12.11;r'+escape(document.referrer)+((typeof(screen)=='undefined')?'':';s'+screen.width+'*'+screen.height+'*'+(screen.colorDepth?screen.colorDepth:screen.pixelDepth))+';u'+escape(document.URL)+';i'+escape('Жж'+document.title)+';'+Math.random()+'" '+'border=0 width=88 height=31></a>');
  $(".spanlinkimg").hover(function (){ $(this).css({'color':'#FF0000','text-decoration':'none'}); }, function (){ $(this).css({'color':'#0066cc','text-decoration':'underline'}); });
  $(".spanlinkimg").click(function (){ if (( $(this).attr('target').text != '' ) && ( $(this).attr('target').text != 'undefined' )) { window.open( $(this).attr('target') ); }  });
  $("#rambler").html('<a href="http://top100.rambler.ru/top100/"><img src="http://counter.rambler.ru/top100.cnt?916734" alt="" width=1 height=1 border=0></a><a href="http://top100.rambler.ru/top100/"><img src="http://top100-images.rambler.ru/top100/banner-88x31-rambler-orange2.gif" alt="Rambler\'s Top100" width=88 height=31 border=0></a>');

  $(".spanlink").hover(function (){
  	if ( $(this).hasClass('spanlink') ) { $(this).removeClass('spanlink'); }
  	$(this).addClass('spanlinkSel');
  }, function (){
  	if ( $(this).hasClass('spanlinkSel') ) { $(this).removeClass('spanlinkSel'); }
  	$(this).addClass('spanlink');
  });

  $(".spanlink").click(function (){
	if ( ( $(this).attr('target') != null ) )
	{
	  	if ( (( $(this).attr('target').text != '' ) && ( $(this).attr('target').text != 'undefined' ) ) )
		{
			if ( $(this).attr('target').substr(0,4) == 'http' )
			{
				window.open($(this).attr('target'));
			}
			else
				document.location=$(this).attr('target');
		}
	}
	else if ( ( $(this).attr('function') != null ) )
	{
		if (( $(this).attr('function').text != '' ) && ( $(this).attr('function').text != 'undefined' ))
		{
			eval( $(this).attr('function') );
		}
	}
  
  });
 
  $("#tabs").tabs();
  setTimeout("slideit()",3000);
});

function slideit()
{
	if (i++ == 3) i=0;

	switch( i )
	{
		case 0: $("#container2").css({'background':'url(/images/palette1.sm.jpg)'});
		break;
		case 2: $("#container2").css({'background':'url(/images/palette2.sm.jpg)'});
		break;
		case 1: $("#container2").css({'background':'url(/images/title.jpg)'});
		break;
//		case 3: $("#container2").css({'background':'url(/images/title.jpg)'});
//		break;
	}

	setTimeout("slideit()",3000);
}

function showImage( ind )
{
	var dv = document.getElementById('brick-' + ind);
	dv.style.display = 'block';
}

function closeImage( ind )
{
	var dv = document.getElementById('brick-' + ind);
	dv.style.display = 'none';
}

function mOvr(src,clrOver) {src.style.cursor = "default"; src.style.background=clrOver;}
function mOut(src,clrIn) {src.style.cursor = "default"; src.style.background=clrIn;}

