var pics;
var objCount = 0; // количество изображений на  web-странице

function loadbody() {
    pics = new Array();
    preload("imgimport", "images/import.jpg", "images/import_sel.jpg");
    preload("imgrus", "images/rus.jpg", "images/rus_sel.jpg");
    preload("imgvideo", "images/video.jpg", "images/video_sel.jpg");
}

function preload(name, first, second) {
    // предварительная загрузка изображений и размещение их в массиве 
    pics[objCount] = new Array(3);
    pics[objCount][0] = new Image();
    pics[objCount][0].src = first;
    pics[objCount][1] = new Image();
    pics[objCount][1].src = second;
    pics[objCount][2] = name;
    objCount++;
}

function on(name) {
    for (i = 0; i < objCount; i++) {
        if (document.images[pics[i][2]] != null)
            if (name != pics[i][2]) {
            // вернуть в исходное систояние все другие изображения 
            document.images[pics[i][2]].src = pics[i][0].src;
        }
        else {
            // показывать вторую картинку, поскольку курсор пересекает данное изображение
            document.images[pics[i][2]].src = pics[i][1].src;
        }
    }
}

function off() {
    for (i = 0; i < objCount; i++) {
        // вернуть в исходное систо\яние все изображени\я
        if (document.images[pics[i][2]] != null)
            document.images[pics[i][2]].src = pics[i][0].src;
    }
}

function page_navigate(_url) {
    window.location = _url;
}

function menu(obj) {
    obj.className = (obj.className == '') ? 'hover' : '';
}

window.onload = function() {
	if (navigator.appName == 'Microsoft Internet Explorer'){
	}
	else
	{
		var logo = document.getElementById('RightLogo').style;
		logo.right = 24;


		var menu_right = document.getElementById('RightMenu').style;
		menu_right.right = 29;
		
		var header_right = document.getElementById('HeaderRightTop').style;
		header_right.right = 30;


	}
}

	var selectedTab = '1';
	
	function res()
	{
		var w;
		w = document.body.clientWidth - 360;
		if (w > 630)
		{
			document.getElementById('tab1c').style.width = w + 'px';
			document.getElementById('tab2c').style.width = w + 'px';
			document.getElementById('tab3c').style.width = w + 'px';
			document.getElementById('tab4c').style.width = w + 'px';
			document.getElementById('tab5c').style.width = w + 'px';
			
			

		}
		document.title = w;
					
	}
	
	function tabout(tab, index)
	{
		if (selectedTab != index)												
		{
			document.getElementById(tab).style.marginTop = '0px';
		}
	}
	
	function tabover(tab, index)
	{
		if (selectedTab != index)												
		{
			document.getElementById(tab).style.marginTop = '-4px';
		}

	}
	
	function tabclick(tab)
	{
		switch (tab)
		{
		    case 'tab1':
		        document.getElementById('tab1').style.marginTop = '-7px';
		        document.getElementById('tab2').style.marginTop = '0px';
		        document.getElementById('tab3').style.marginTop = '0px';
		        document.getElementById('tab4').style.marginTop = '0px';
		        document.getElementById('tab5').style.marginTop = '0px';
		        
		        document.getElementById('tab1').style.backgroundColor = '#ffc277';
		        document.getElementById('tab2').style.backgroundColor = '#eb9962';
		        document.getElementById('tab3').style.backgroundColor = '#eb9962';
		        document.getElementById('tab4').style.backgroundColor = '#eb9962';
		        document.getElementById('tab5').style.backgroundColor = '#eb9962';
		        
		        document.getElementById('tab1c').style.zIndex = '150';
		        document.getElementById('tab2c').style.zIndex = '140';
		        document.getElementById('tab3c').style.zIndex = '140';
		        document.getElementById('tab4c').style.zIndex = '140';
		        document.getElementById('tab5c').style.zIndex = '140';
		        
				document.getElementById('tab1c').style.visibility = 'visible';
				document.getElementById('tab2c').style.visibility = 'hidden';
				document.getElementById('tab3c').style.visibility = 'hidden';
				document.getElementById('tab4c').style.visibility = 'hidden';
				document.getElementById('tab5c').style.visibility = 'hidden';
		        
		        document.getElementById('tab1c').style.position = 'relative';
				document.getElementById('tab2c').style.position = 'absolute';
				document.getElementById('tab3c').style.position = 'absolute';								
				document.getElementById('tab4c').style.position = 'absolute';
				document.getElementById('tab5c').style.position = 'absolute';								
				
				document.getElementById('tab1c').style.width = '100%';
				document.getElementById('tab2c').style.width = '620px';
				document.getElementById('tab3c').style.width = '620px';				
				document.getElementById('tab4c').style.width = '620px';
				document.getElementById('tab5c').style.width = '620px';				


		        break;
		         
	        case 'tab2':
	        	document.getElementById('tab1').style.marginTop = '0px';
		        document.getElementById('tab2').style.marginTop = '-7px';
		        document.getElementById('tab3').style.marginTop = '0px';
		        document.getElementById('tab4').style.marginTop = '0px';
		        document.getElementById('tab5').style.marginTop = '0px';
		        
		        document.getElementById('tab1').style.backgroundColor = '#eb9962';
		        document.getElementById('tab2').style.backgroundColor = '#ffc277';
		        document.getElementById('tab3').style.backgroundColor = '#eb9962';
		        document.getElementById('tab4').style.backgroundColor = '#eb9962';
		        document.getElementById('tab5').style.backgroundColor = '#eb9962';
		        
   		        document.getElementById('tab1c').style.zIndex = '140';
		        document.getElementById('tab2c').style.zIndex = '150';
		        document.getElementById('tab3c').style.zIndex = '140';
		        document.getElementById('tab4c').style.zIndex = '140';
		        document.getElementById('tab5c').style.zIndex = '140';
		        
		        document.getElementById('tab1c').style.visibility = 'hidden';
				document.getElementById('tab2c').style.visibility = 'visible';
				document.getElementById('tab3c').style.visibility = 'hidden';
				document.getElementById('tab4c').style.visibility = 'hidden';
				document.getElementById('tab5c').style.visibility = 'hidden';

				document.getElementById('tab1c').style.position = 'absolute';
				document.getElementById('tab2c').style.position = 'relative';
				document.getElementById('tab3c').style.position = 'absolute';	
				document.getElementById('tab4c').style.position = 'absolute';
				document.getElementById('tab5c').style.position = 'absolute';								
				
				document.getElementById('tab1c').style.width = '620px';
				document.getElementById('tab2c').style.width = '100%';
				document.getElementById('tab3c').style.width = '620px';						
				document.getElementById('tab4c').style.width = '620px';
				document.getElementById('tab5c').style.width = '620px';				

		        
		        break;

	        
	        case 'tab3':
	        	document.getElementById('tab1').style.marginTop = '0px';
		        document.getElementById('tab2').style.marginTop = '0px';
		        document.getElementById('tab3').style.marginTop = '-7px';
		        document.getElementById('tab4').style.marginTop = '0px';
		        document.getElementById('tab5').style.marginTop = '0px';
		        
		        document.getElementById('tab1').style.backgroundColor = '#eb9962';
		        document.getElementById('tab2').style.backgroundColor = '#eb9962';
		        document.getElementById('tab3').style.backgroundColor = '#ffc277';
		        document.getElementById('tab4').style.backgroundColor = '#eb9962';
		        document.getElementById('tab5').style.backgroundColor = '#eb9962';
		        
   		        document.getElementById('tab1c').style.zIndex = '140';
		        document.getElementById('tab2c').style.zIndex = '140';
		        document.getElementById('tab3c').style.zIndex = '150';
		        document.getElementById('tab4c').style.zIndex = '140';
		        document.getElementById('tab5c').style.zIndex = '140';
		        
		        document.getElementById('tab1c').style.visibility = 'hidden';
				document.getElementById('tab2c').style.visibility = 'hidden';
				document.getElementById('tab3c').style.visibility = 'visible';
				document.getElementById('tab4c').style.visibility = 'hidden';
				document.getElementById('tab5c').style.visibility = 'hidden';
				
				document.getElementById('tab1c').style.position = 'absolute';
				document.getElementById('tab2c').style.position = 'absolute';
				document.getElementById('tab3c').style.position = 'relative';								
				document.getElementById('tab4c').style.position = 'absolute';
				document.getElementById('tab5c').style.position = 'absolute';								
				
				document.getElementById('tab1c').style.width = '620px';
				document.getElementById('tab2c').style.width = '620px';
				document.getElementById('tab3c').style.width = '100%';
				document.getElementById('tab4c').style.width = '620px';
				document.getElementById('tab5c').style.width = '620px';				

		        
		        break;


	        case 'tab4':
	        	document.getElementById('tab1').style.marginTop = '0px';
		        document.getElementById('tab2').style.marginTop = '0px';
		        document.getElementById('tab3').style.marginTop = '0px';
		        document.getElementById('tab4').style.marginTop = '-7px';
		        document.getElementById('tab5').style.marginTop = '0px';
		        
		        document.getElementById('tab1').style.backgroundColor = '#eb9962';
		        document.getElementById('tab2').style.backgroundColor = '#eb9962';
		        document.getElementById('tab3').style.backgroundColor = '#eb9962';
		        document.getElementById('tab4').style.backgroundColor = '#ffc277';
		        document.getElementById('tab5').style.backgroundColor = '#eb9962';
		        
   		        document.getElementById('tab1c').style.zIndex = '140';
		        document.getElementById('tab2c').style.zIndex = '140';
		        document.getElementById('tab3c').style.zIndex = '140';
		        document.getElementById('tab4c').style.zIndex = '150';
		        document.getElementById('tab5c').style.zIndex = '140';
		        
		        document.getElementById('tab1c').style.visibility = 'hidden';
				document.getElementById('tab2c').style.visibility = 'hidden';
				document.getElementById('tab3c').style.visibility = 'hidden';
				document.getElementById('tab4c').style.visibility = 'visible';
				document.getElementById('tab5c').style.visibility = 'hidden';
				
				document.getElementById('tab1c').style.position = 'absolute';
				document.getElementById('tab2c').style.position = 'absolute';
				document.getElementById('tab3c').style.position = 'absolute';								
				document.getElementById('tab4c').style.position = 'relative';
				document.getElementById('tab5c').style.position = 'absolute';								
				
				document.getElementById('tab1c').style.width = '620px';
				document.getElementById('tab2c').style.width = '620px';
				document.getElementById('tab3c').style.width = '620px';				
				document.getElementById('tab4c').style.width = '100%';
				document.getElementById('tab5c').style.width = '620px';				

		        
		        break;

		    case 'tab5':
		        document.getElementById('tab1').style.marginTop = '0px';
		        document.getElementById('tab2').style.marginTop = '0px';
		        document.getElementById('tab3').style.marginTop = '0px';
		        document.getElementById('tab4').style.marginTop = '0px';
		        document.getElementById('tab5').style.marginTop = '-7px';

		        document.getElementById('tab1').style.backgroundColor = '#eb9962';
		        document.getElementById('tab2').style.backgroundColor = '#eb9962';
		        document.getElementById('tab3').style.backgroundColor = '#eb9962';
		        document.getElementById('tab4').style.backgroundColor = '#eb9962';
		        document.getElementById('tab5').style.backgroundColor = '#ffc277';

		        document.getElementById('tab1c').style.zIndex = '140';
		        document.getElementById('tab2c').style.zIndex = '140';
		        document.getElementById('tab3c').style.zIndex = '140';
		        document.getElementById('tab4c').style.zIndex = '140';
		        document.getElementById('tab5c').style.zIndex = '150';

		        document.getElementById('tab1c').style.visibility = 'hidden';
		        document.getElementById('tab2c').style.visibility = 'hidden';
		        document.getElementById('tab3c').style.visibility = 'hidden';
		        document.getElementById('tab4c').style.visibility = 'hidden';
		        document.getElementById('tab5c').style.visibility = 'visible';

		        document.getElementById('tab1c').style.position = 'absolute';
		        document.getElementById('tab2c').style.position = 'absolute';
		        document.getElementById('tab3c').style.position = 'absolute';
		        document.getElementById('tab4c').style.position = 'absolute';
		        document.getElementById('tab5c').style.position = 'relative';

		        document.getElementById('tab1c').style.width = '620px';
		        document.getElementById('tab2c').style.width = '620px';
		        document.getElementById('tab3c').style.width = '620px';
		        document.getElementById('tab4c').style.width = '620px';
		        document.getElementById('tab5c').style.width = '100%';


		        break;

		}
		
	}

	
	function hideall()
	{
		document.getElementById('sp1').style.zIndex='50';
		document.getElementById('sp2').style.zIndex='50';
		document.getElementById('sp3').style.zIndex='50';
		document.getElementById('sp4').style.zIndex='50';
		document.getElementById('sp5').style.zIndex='50';
		/*document.getElementById('sp6').style.zIndex='50';*/
		document.getElementById('sp7').style.zIndex='50';
		document.getElementById('sp8').style.zIndex='50';
		document.getElementById('sp9').style.zIndex='50';
		document.getElementById('sp10').style.zIndex='50';
		document.getElementById('sp11').style.zIndex='50';
		document.getElementById('sp12').style.zIndex='50';
		
		
		document.getElementById('sp1h').style.backgroundColor='#ffc277';
		document.getElementById('sp2h').style.backgroundColor='#ffc277';
		document.getElementById('sp3h').style.backgroundColor='#ffc277';
		document.getElementById('sp4h').style.backgroundColor='#ffc277';
		document.getElementById('sp5h').style.backgroundColor='#ffc277';
		/*document.getElementById('sp6h').style.backgroundColor='#ffc277';*/
		document.getElementById('sp7h').style.backgroundColor='#ffc277';
		document.getElementById('sp8h').style.backgroundColor='#ffc277';
		document.getElementById('sp9h').style.backgroundColor='#ffc277';
		document.getElementById('sp10h').style.backgroundColor='#ffc277';
		document.getElementById('sp11h').style.backgroundColor='#ffc277';
		document.getElementById('sp12h').style.backgroundColor='#ffc277';

	}
	
	function showDiv(param1, param2)
	{
		document.getElementById(param1).style.zIndex='100'; 
		document.getElementById(param2).style.backgroundColor='#e4976a';
	}

