	function OpenCompare(){
		var selected = document.cookie;
		selected = selected.substr(9);
		if (selected == ''){
			alert('Список сравнения пуст! Выберите несколько моделей для сравнения.');
		}else{
			hand=window.open('/compare.php', 'compare', 'top=50, left=50, height=500, width=800, status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
			hand.focus();
		}
	}
	function setCompare(item, flag){
		var action;
		if (document.forms["compare"].elements["eq["+item+"]"].checked){
			action = '1';
		}else{
			action = '2';
		}
		window.open('/compare.php?item='+item+'&action='+action, 'compare', 'top=50, left=50, height=500, width=800, status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		focus();
	}
	function Show(id){
		document.getElementById('A'+id).style.display='';
		document.getElementById('B'+id).bgColor='#e6ebeb';
		document.getElementById('C'+id).style.display='';
	}
	function Hide(id){
		document.getElementById('A'+id).style.display='none';
		document.getElementById('B'+id).bgColor='#FFFFFF';
		document.getElementById('C'+id).style.display='none';
	}
	function Show_Index(id){
		document.getElementById('A'+id).style.display='';
		document.getElementById('B'+id).bgColor='#e6ebeb';
		document.getElementById('C'+id).style.display='';
		document.getElementById('D'+id).style.display='';
		document.getElementById('E'+id).style.display='none';
		document.getElementById('F'+id).style.display='none';

		document.getElementById('type_main_pic').src = '/images/type_main_pic_'+id+'.gif';
		document.getElementById('main_pic').style.display='';
	}
	function Hide_Index(id){
		document.getElementById('A'+id).style.display='none';
		document.getElementById('B'+id).bgColor='#FFFFFF';
		document.getElementById('C'+id).style.display='none';
		document.getElementById('D'+id).style.display='none';
		document.getElementById('E'+id).style.display='';
		document.getElementById('F'+id).style.display='';

		document.getElementById('main_pic').style.display='';
		document.getElementById('type_main_pic').src = '/images/type_main_pic_2.gif';
	}

	function setFull(id){
		if (id == 1){
			document.forms["sel"].elements["rotation"].removeAttribute('disabled','disabled');
		}else{
			document.forms["sel"].elements["rotation"].setAttribute('disabled', 'disabled');
			document.forms["sel"].elements["rotation"].selectedIndex = 0;
		}
	}
	
	function initOnLoad(mtype, full){
		if (mtype <=4 || mtype == 9){
			document.forms["sel"].elements["mader"].setAttribute('disabled', 'disabled');
			document.forms["sel"].elements["power"].setAttribute('disabled', 'disabled');
			document.forms["sel"].elements["full"].setAttribute('disabled', 'disabled');
			document.forms["sel"].elements["rotation"].setAttribute('disabled', 'disabled');
			document.forms["sel"].elements["voltage"].setAttribute('disabled', 'disabled');
			document.forms["sel"].elements["performance"].setAttribute('disabled', 'disabled');
			document.forms["sel"].elements["run"].setAttribute('disabled', 'disabled');
			document.forms["sel"].elements["mobile"].setAttribute('disabled', 'disabled');
			document.forms["sel"].elements["electrode"].setAttribute('disabled', 'disabled');

			setFull(full);
		}
		initOption(mtype);
		
	}
	function setSelect(mtype, full){
		document.forms["sel"].elements["mader"].selectedIndex = 0;
		document.forms["sel"].elements["mader"].setAttribute('disabled', 'disabled');
		document.forms["sel"].elements["power"].selectedIndex = 0;
		document.forms["sel"].elements["power"].setAttribute('disabled', 'disabled');
		document.forms["sel"].elements["full"].selectedIndex = 0;
		document.forms["sel"].elements["full"].setAttribute('disabled', 'disabled');
		document.forms["sel"].elements["rotation"].selectedIndex = 0;
		document.forms["sel"].elements["rotation"].setAttribute('disabled', 'disabled');
		document.forms["sel"].elements["voltage"].selectedIndex = 0;
		document.forms["sel"].elements["voltage"].setAttribute('disabled', 'disabled');
		document.forms["sel"].elements["performance"].selectedIndex = 0;
		document.forms["sel"].elements["performance"].setAttribute('disabled', 'disabled');
		document.forms["sel"].elements["run"].selectedIndex = 0;
		document.forms["sel"].elements["run"].setAttribute('disabled', 'disabled');
		document.forms["sel"].elements["mobile"].selectedIndex = 0;
		document.forms["sel"].elements["mobile"].setAttribute('disabled', 'disabled');
		document.forms["sel"].elements["electrode"].selectedIndex = 0;
		document.forms["sel"].elements["electrode"].setAttribute('disabled', 'disabled');

		setFull(full);
		initOption(mtype);
	}

	function initOption(mtype){
		if (mtype == 1){
			document.forms["sel"].elements["mader"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["full"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["voltage"].removeAttribute('disabled', 'disabled');
			document.sel.performance.options[1].text = 'Открытые';
			document.sel.performance.options[2].text = 'В кожухе';
			document.forms["sel"].elements["performance"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["run"].removeAttribute('disabled','disabled');
			document.sel.power.options[1].text = 'от 15 до 50';
			document.sel.power.options[2].text = 'от 50 до 100';
			document.sel.power.options[3].text = 'от 100 до 200';
			document.sel.power.options[4] = new Option('от 200 и более', '4');

			ShowCeilMenu('Maders', mtype);
			ShowCeilMenu('Full', mtype);
			ShowCeilMenu('Voltage', mtype);
			ShowCeilMenu('Performance', mtype);
			ShowCeilMenu('Run', mtype);
			
			
		}else if (mtype == 2){
			document.forms["sel"].elements["mader"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["power"].removeAttribute('disabled','disabled');
			document.forms["sel"].elements["full"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["voltage"].removeAttribute('disabled', 'disabled');
			document.sel.performance.options[1].text = 'Открытые';
			document.sel.performance.options[2].text = 'В кожухе';
			document.forms["sel"].elements["performance"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["run"].removeAttribute('disabled','disabled');
			document.sel.power.options[1].text = 'от 3 до 7';
			document.sel.power.options[2].text = 'от 7 до 15';
			document.sel.power.options[3].text = 'от 15 и больше';
			document.sel.power.options[4] = null;

			ShowCeilMenu('Maders', mtype);
			ShowCeilMenu('Full', mtype);
			ShowCeilMenu('Voltage', mtype);
			ShowCeilMenu('Performance', mtype);
			ShowCeilMenu('Run', mtype);
			
			
			
		}else if (mtype == 3){
			document.forms["sel"].elements["mader"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["power"].removeAttribute('disabled','disabled');
			document.forms["sel"].elements["full"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["voltage"].removeAttribute('disabled', 'disabled');
			document.sel.performance.options[1].text = 'Открытые';
			document.sel.performance.options[2].text = 'В кожухе';
			document.forms["sel"].elements["performance"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["mobile"].removeAttribute('disabled','disabled');
			document.forms["sel"].elements["run"].removeAttribute('disabled','disabled');
			document.sel.power.options[1].text = 'от 15 до 50';
			document.sel.power.options[2].text = 'от 50 до 100';
			document.sel.power.options[3].text = 'от 100 до 200';
			document.sel.power.options[4] = new Option('от 200 и более', '4');

			ShowCeilMenu('Maders', mtype);
			ShowCeilMenu('Full', mtype);
			ShowCeilMenu('Voltage', mtype);
			ShowCeilMenu('Performance', mtype);
			ShowCeilMenu('Run', mtype);
			
		}else if (mtype == 4){
			document.forms["sel"].elements["mader"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["full"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["voltage"].removeAttribute('disabled', 'disabled');
			document.sel.performance.options[1].text = 'Открытые';
			document.sel.performance.options[2].text = 'В кожухе';
			document.forms["sel"].elements["performance"].removeAttribute('disabled', 'disabled');
			document.forms["sel"].elements["run"].removeAttribute('disabled','disabled');
			document.forms["sel"].elements["electrode"].removeAttribute('disabled','disabled');

			ShowCeilMenu('Maders', mtype);
			ShowCeilMenu('Full', mtype);
			ShowCeilMenu('Voltage', mtype);
			ShowCeilMenu('Performance', mtype);
			ShowCeilMenu('Run', mtype);
			
		}else if (mtype == 5){
			ShowCeilMenu('Maders', mtype);
		}else if (mtype == 9){
			document.forms["sel"].elements["mader"].removeAttribute('disabled', 'disabled');
			document.sel.power.options[1].text = 'до 5 кВА';
			document.sel.power.options[2].text = 'от 5 до 15 кВА';
			document.sel.power.options[3].text = 'от 15 до 50 кВА';
			document.sel.power.options[4] = new Option('от 50 кВА и больше', '4');
			document.forms["sel"].elements["power"].removeAttribute('disabled','disabled');
			document.forms["sel"].elements["voltage"].removeAttribute('disabled', 'disabled');
			document.sel.performance.options[1].text = 'Для помещения';
			document.sel.performance.options[2].text = 'Уличное';
			document.forms["sel"].elements["performance"].removeAttribute('disabled', 'disabled');

			ShowCeilMenu('Maders', mtype);
			ShowCeilMenu('Voltage', mtype);
			ShowCeilMenu('Performance', mtype);
			
		}
		
		
	}

	function ShowCeilMenu(MenuObject, id){
		if (document.getElementById('Ceil_'+MenuObject+'_'+id).style.display == ''){
			document.getElementById('Ceil_'+MenuObject+'_'+id).style.display = 'none';
			document.getElementById('Sel_'+MenuObject+'_'+id).src='/images/plus.gif';
		}else{
			document.getElementById('Ceil_'+MenuObject+'_'+id).style.display = '';
			document.getElementById('Sel_'+MenuObject+'_'+id).src='/images/minus.gif';
		}
		
	}

