function Init() {
	$(document).ready(function(){
var elements = document.getElementsByName('media');

		$('#calc_button').click(function(){
			fields='';
			foo = true;
			if (document.getElementsByName('circulation')[0].value == '') fields+='\nТираж';
			for(i=0; i<document.getElementsByName('media').length; i++)
				if (document.getElementsByName('media')[i].checked) {
					foo = false;
					break;
				}
			if(foo) fields+='\nНоситель';
			foo = true;
			for(i=0; i<document.getElementsByName('rectype').length; i++)
				if (document.getElementsByName('rectype')[i].checked) {
					foo = false;
					break;
				}
			if(foo) fields+='\nТип записи';
			foo = true;
			for(i=0; i<document.getElementsByName('image').length; i++)
				if (document.getElementsByName('image')[i].checked) {
					foo = false;
					break;
				}
			if(foo) fields+='\nНанесение изображения';
			if (fields!='') alert('Ошибка! Не заполнены следующие обязательные поля:'+fields);
			else {
				$.post('/assets/snippets/calculator/calc_ajax.php', $("#calcform").serialize(), function(data){
					$('#calc_total').html(data);
				}, 'html');

				if (parseInt(document.getElementsByName('circulation')[0].value) >= parseInt(document.getElementById('circulation_limit').value))
					document.getElementById('extra').style.display = 'block';
				else
					document.getElementById('extra').style.display = 'none';
				document.getElementById('message').style.display = 'block';
			}
    		});
        if (navigator.userAgent.indexOf('Opera')!=-1) {var op=1;} else {var op=0;}

		$('#media1_link').hover(

			function(){ if (!isChecked(document.getElementsByName('media'))) $('#media').html('<img src="/assets/templates/main/img/calc/media1.jpg"><br />'+elements[0+op].value); },

			function(){ if (!isChecked(document.getElementsByName('media'))) $('#media').html(''); }

		);

		$('#media1_check').click(function(){

			$('#media').html('<img src="/assets/templates/main/img/calc/media1.jpg"><br />'+document.getElementsByName('media')[0+op].value);

		});

		$('#media2_link').hover(

			function(){ if (!isChecked(document.getElementsByName('media'))) $('#media').html('<img src="/assets/templates/main/img/calc/media2.jpg"><br />'+document.getElementsByName('media')[1+op].value); },

			function(){ if (!isChecked(document.getElementsByName('media'))) $('#media').html(''); }

		);

		$('#media2_check').click(function(){

			$('#media').html('<img src="/assets/templates/main/img/calc/media2.jpg"><br />'+document.getElementsByName('media')[1+op].value);

		});

		$('#media3_link').hover(

			function(){ if (!isChecked(document.getElementsByName('media'))) $('#media').html('<img src="/assets/templates/main/img/calc/media3.jpg"><br />'+document.getElementsByName('media')[2+op].value); },

			function(){ if (!isChecked(document.getElementsByName('media'))) $('#media').html(''); }

		);

		$('#media3_check').click(function(){

			$('#media').html('<img src="/assets/templates/main/img/calc/media3.jpg"><br />'+document.getElementsByName('media')[2+op].value);

		});

		$('#media4_link').hover(

			function(){ if (!isChecked(document.getElementsByName('media'))) $('#media').html('<img src="/assets/templates/main/img/calc/media4.jpg"><br />'+document.getElementsByName('media')[3+op].value); },

			function(){ if (!isChecked(document.getElementsByName('media'))) $('#media').html(''); }

		);

		$('#media4_check').click(function(){

			$('#media').html('<img src="/assets/templates/main/img/calc/media4.jpg"><br />'+document.getElementsByName('media')[3+op].value);

		});

		$('#media5_link').hover(

			function(){ if (!isChecked(document.getElementsByName('media'))) $('#media').html('<img src="/assets/templates/main/img/calc/media5.jpg"><br />'+document.getElementsByName('media')[4+op].value); },

			function(){ if (!isChecked(document.getElementsByName('media'))) $('#media').html(''); }

		);

		$('#media5_check').click(function(){

			$('#media').html('<img src="/assets/templates/main/img/calc/media5.jpg"><br />'+document.getElementsByName('media')[4+op].value);

		});
		$('#image1_link').hover(

			function(){ if (!isChecked(document.getElementsByName('image'))) $('#image').html('<img src="/assets/templates/main/img/calc/image1.jpg"><br />'+document.getElementsByName('image')[0+op].value); },

			function(){ if (!isChecked(document.getElementsByName('image'))) $('#image').html(''); }

		);
		$('#image1_check').click(function(){

			$('#image').html('<img src="/assets/templates/main/img/calc/image1.jpg"><br />'+document.getElementsByName('image')[0+op].value);

		});
		$('#image2_link').hover(

			function(){ if (!isChecked(document.getElementsByName('image'))) $('#image').html('<img src="/assets/templates/main/img/calc/image2.jpg"><br />'+document.getElementsByName('image')[1+op].value); },

			function(){ if (!isChecked(document.getElementsByName('image'))) $('#image').html(''); }

		);
		$('#image2_check').click(function(){

			$('#image').html('<img src="/assets/templates/main/img/calc/image2.jpg"><br />'+document.getElementsByName('image')[1+op].value);

		});
		$('#pack1_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack1.jpg"><br />'+document.getElementsByName('pack')[0+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack1_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack1.jpg"><br />'+document.getElementsByName('pack')[0+op].value);

		});
		$('#pack2_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack2.jpg"><br />'+document.getElementsByName('pack')[1+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack2_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack2.jpg"><br />'+document.getElementsByName('pack')[1+op].value);

		});
		$('#pack3_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack3.jpg"><br />'+document.getElementsByName('pack')[2+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);

		$('#pack3_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack3.jpg"><br />'+document.getElementsByName('pack')[2+op].value);

		});
		$('#pack4_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack4.jpg"><br />'+document.getElementsByName('pack')[3+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack4_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack4.jpg"><br />'+document.getElementsByName('pack')[3+op].value);

		});
		$('#pack5_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack5.jpg"><br />'+document.getElementsByName('pack')[4+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack5_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack5.jpg"><br />'+document.getElementsByName('pack')[4+op].value);

		});
		$('#pack6_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack6.jpg"><br />'+document.getElementsByName('pack')[5+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack6_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack6.jpg"><br />'+document.getElementsByName('pack')[5+op].value);

		});
		$('#pack7_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack7.jpg"><br />'+document.getElementsByName('pack')[6+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack7_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack7.jpg"><br />'+document.getElementsByName('pack')[6+op].value);

		});
		$('#pack8_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack8.jpg"><br />'+document.getElementsByName('pack')[7+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack8_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack8.jpg"><br />'+document.getElementsByName('pack')[7+op].value);

		});
		$('#pack9_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack9.jpg"><br />'+document.getElementsByName('pack')[8+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack9_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack9.jpg"><br />'+document.getElementsByName('pack')[8+op].value);

		});
		$('#pack10_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack10.jpg"><br />'+document.getElementsByName('pack')[9+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack10_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack10.jpg"><br />'+document.getElementsByName('pack')[9+op].value);

		});
		$('#pack11_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack11.jpg"><br />'+document.getElementsByName('pack')[10+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack11_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack11.jpg"><br />'+document.getElementsByName('pack')[10+op].value);

		});
		$('#pack12_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack12.jpg"><br />'+document.getElementsByName('pack')[11+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack12_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack12.jpg"><br />'+document.getElementsByName('pack')[11+op].value);

		});
		$('#pack13_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack13.jpg"><br />'+document.getElementsByName('pack')[12+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack13_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack13.jpg"><br />'+document.getElementsByName('pack')[12+op].value);

		});
		$('#pack14_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack14.jpg"><br />'+document.getElementsByName('pack')[13+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack14_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack14.jpg"><br />'+document.getElementsByName('pack')[13+op].value);

		});
		$('#pack15_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack15.jpg"><br />'+document.getElementsByName('pack')[14+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack15_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack15.jpg"><br />'+document.getElementsByName('pack')[14+op].value);

		});
		$('#pack16_link').hover(

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html('<img src="/assets/templates/main/img/calc/pack16.jpg"><br />'+document.getElementsByName('pack')[15+op].value); },

			function(){ if (!isChecked(document.getElementsByName('pack'))) $('#pack').html(''); }

		);
		$('#pack16_check').click(function(){

			$('#pack').html('<img src="/assets/templates/main/img/calc/pack16.jpg"><br />'+document.getElementsByName('pack')[15+op].value);

		});
		$('#print1_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print1.jpg"><br />'+document.getElementsByName('print1')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);
		$('#print1_check').click(function(){

			if (document.getElementsByName('print1')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print1.jpg"><br />'+document.getElementsByName('print1')[0].value);

			else $('#print').html(PrintUncheck());

		});
		$('#print2_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print2.jpg"><br />'+document.getElementsByName('print2')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);
		$('#print2_check').click(function(){

			if (document.getElementsByName('print2')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print2.jpg"><br />'+document.getElementsByName('print2')[0].value);

			else $('#print').html(PrintUncheck());

		});

		$('#print3_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print3.jpg"><br />'+document.getElementsByName('print3')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print3_check').click(function(){

			if (document.getElementsByName('print3')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print3.jpg"><br />'+document.getElementsByName('print3')[0].value);

			else $('#print').html(PrintUncheck());

		});

		$('#print4_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print4.jpg"><br />'+document.getElementsByName('print4')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print4_check').click(function(){

			if (document.getElementsByName('print4')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print4.jpg"><br />'+document.getElementsByName('print4')[0].value);

			else $('#print').html(PrintUncheck());

		});

		$('#print5_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print5.jpg"><br />'+document.getElementsByName('print5')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print5_check').click(function(){

			if (document.getElementsByName('print5')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print5.jpg"><br />'+document.getElementsByName('print5')[0].value);

			else $('#print').html(PrintUncheck());

		});

		$('#print6_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print6.jpg"><br />'+document.getElementsByName('print6')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print6_check').click(function(){

			if (document.getElementsByName('print6')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print6.jpg"><br />'+document.getElementsByName('print6')[0].value);

			else $('#print').html(PrintUncheck());

		});

		$('#print7_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print7.jpg"><br />'+document.getElementsByName('print7')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print7_check').click(function(){

			if (document.getElementsByName('print7')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print7.jpg"><br />'+document.getElementsByName('print7')[0].value);

			else $('#print').html(PrintUncheck());

		});

		$('#print8_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print8.jpg"><br />'+document.getElementsByName('print8')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print8_check').click(function(){

			if (document.getElementsByName('print8')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print8.jpg"><br />'+document.getElementsByName('print8')[0].value);

			else $('#print').html(PrintUncheck());

		});

		$('#print9_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print9.jpg"><br />'+document.getElementsByName('print9')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print9_check').click(function(){

			if (document.getElementsByName('print9')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print9.jpg"><br />'+document.getElementsByName('print9')[0].value);

			else $('#print').html(PrintUncheck());

		});

		$('#print10_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print10.jpg"><br />'+document.getElementsByName('print10')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print10_check').click(function(){

			if (document.getElementsByName('print10')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print10.jpg"><br />'+document.getElementsByName('print10')[0].value);

			else $('#print').html(PrintUncheck());

		});

		$('#print11_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print11.jpg"><br />'+document.getElementsByName('print11')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print11_check').click(function(){

			if (document.getElementsByName('print11')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print11.jpg"><br />'+document.getElementsByName('print11')[0].value);

			else $('#print').html(PrintUncheck());

		});

		$('#print12_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print12.jpg"><br />'+document.getElementsByName('print12')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print12_check').click(function(){

			if (document.getElementsByName('print12')[0].checked) $('#print').html('<img src="/assets/templates/main/img/calc/print12.jpg"><br />'+document.getElementsByName('print12')[0].value);

			else $('#print').html(PrintUncheck());

		});

		$('#print13_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print13.jpg"><br />'+document.getElementsByName('slipcase')[0].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print13_check').click(function(){

			$('#print').html('<img src="/assets/templates/main/img/calc/print13.jpg"><br />'+document.getElementsByName('slipcase')[0].value);

		});

		$('#print14_link').hover(

			function(){ if (!isPrintChecked()) $('#print').html('<img src="/assets/templates/main/img/calc/print14.jpg"><br />'+document.getElementsByName('slipcase')[1].value); },

			function(){ if (!isPrintChecked()) $('#print').html(''); }

		);

		$('#print14_check').click(function(){

			$('#print').html('<img src="/assets/templates/main/img/calc/print14.jpg"><br />'+document.getElementsByName('slipcase')[1].value);

		});



		$('#service1_link').hover(

			function(){ if (!document.getElementsByName('service3')[0+op].checked) document.getElementById('service1').style.display = 'block'; },

			function(){ if (!document.getElementsByName('service3')[0+op].checked) document.getElementById('service1').style.display = 'none'; }

		);

		$('#service1_check').click(function(){

			if (document.getElementById('service1_check').checked) document.getElementById('service3').style.display = 'block';

			else document.getElementById('service3').style.display = 'none';

		});

		$('#service2_link').hover(

			function(){ if (!document.getElementsByName('service2')[0+op].checked) document.getElementById('service2').style.display = 'block'; },

			function(){ if (!document.getElementsByName('service2')[0+op].checked) document.getElementById('service2').style.display = 'none'; }

		);

		$('#service2_check').click(function(){

			if (document.getElementById('service2_check').checked) document.getElementById('service2').style.display = 'block';

			else document.getElementById('service2').style.display = 'none';

		});

		$('#service3_link').hover(

			function(){ if (!document.getElementsByName('service1')[0+op].checked) document.getElementById('service3').style.display = 'block'; },

			function(){ if (!document.getElementsByName('service1')[0+op].checked) document.getElementById('service3').style.display = 'none'; }

		);

		$('#service3_check').click(function(){

			if (document.getElementById('service3_check').checked) document.getElementById('service1').style.display = 'block';

			else document.getElementById('service1').style.display = 'none';

		});

	});

	for (i=0;i<document.calcForm.rectype.length;i++) {



		document.calcForm.rectype[i].disabled = true;



		document.calcForm.rectype[i].checked = false;



	}

	for (i=0;i<document.calcForm.pack.length;i++) {



		document.calcForm.pack[i].disabled = true;



		document.calcForm.pack[i].checked = false;



	}

	for (i=1;i<=12;i++) {



		document.getElementsByName('print'+i)[0].disabled = true;



		document.getElementsByName('print'+i)[0].checked = false;



	}

	for (i=0;i<document.calcForm.slipcase.length;i++) {



		document.calcForm.slipcase[i].disabled = true;



		document.calcForm.slipcase[i].checked = false;



	}

}

if(typeof(window.external) != 'undefined'){

	//yes, this is evil browser sniffing, but only IE has this bug

	document.getElementsByName = function(name, tag){

		if(!tag) tag = '*';

		var elems = document.getElementsByTagName(tag);

		var res = []

		for(var i=0;i<elems.length;i++){

			att = elems[i].getAttribute('name');

			if(att == name) res.push(elems[i]);

		}
		return res;
	}
}

function isChecked(radioGroup) {

	for (i=0;i<radioGroup.length;i++)

		if (radioGroup[i].checked) return true;

	return false;

}

function isPrintChecked() {

	for (i=1;i<=12;i++)

		if (document.getElementsByName('print'+i)[0].checked) return true;

	if (document.getElementsByName('slipcase')[0].checked) return true;

	if (document.getElementsByName('slipcase')[1].checked) return true;

	return false;

}

function PrintUncheck() {

	for (i=1;i<=12;i++)

		if (document.getElementsByName('print'+i)[0].checked)

			return '<img src="/assets/templates/main/img/calc/print'+i+'.jpg"><br />'+document.getElementsByName('print'+i)[0].value;

	if (document.getElementsByName('slipcase')[0].checked)

		return '<img src="/assets/templates/main/img/calc/print13.jpg"><br />'+document.getElementsByName('slipcase')[0].value;

	if (document.getElementsByName('slipcase')[1].checked)

		return '<img src="/assets/templates/main/img/calc/print14.jpg"><br />'+document.getElementsByName('slipcase')[1].value;

	return '';

}

function DoMedia() {



	for (i=0;i<document.calcForm.rectype.length;i++) {

		document.calcForm.rectype[i].disabled = true;

		document.calcForm.rectype[i].checked = false;

	}

	for (i=0;i<document.calcForm.pack.length;i++) {

		document.calcForm.pack[i].disabled = true;

		document.calcForm.pack[i].checked = false;
	}

	for (i=1;i<=12;i++) {

		document.getElementsByName('print'+i)[0].disabled = true;

		document.getElementsByName('print'+i)[0].checked = false;

	}

	for (i=0;i<document.calcForm.slipcase.length;i++) {

		document.calcForm.slipcase[i].disabled = true;

		document.calcForm.slipcase[i].checked = false;

	}



	for (i=0;i<document.calcForm.media.length;i++)



		if (document.calcForm.media[i].checked) { index = i; break; }



	switch (index) {



		case 0:



		case 1:



		case 2:



			document.calcForm.rectype[0].disabled = false;



			document.calcForm.rectype[1].disabled = false;



			for (i=0;i<document.calcForm.pack.length;i++)



				document.calcForm.pack[i].disabled = false;



			for (i=1;i<=12;i++)



				document.getElementsByName('print'+i)[0].disabled = false;



			break;



		case 3:



		case 4:



			document.calcForm.rectype[0].disabled = false;



			document.calcForm.pack[5].disabled = false;



			for (i=9;i<=11;i++)



				document.getElementsByName('print'+i)[0].disabled = false;



			break;



	}



}



function DoPack() {



	for (i=1;i<=12;i++) {

		document.getElementsByName('print'+i)[0].disabled = true;

		document.getElementsByName('print'+i)[0].checked = false;

	}

	for (i=0;i<document.calcForm.slipcase.length;i++) {

		document.calcForm.slipcase[i].disabled = true;

		document.calcForm.slipcase[i].checked = false;



	}



	for (i=0;i<document.calcForm.pack.length;i++)



		if (document.calcForm.pack[i].checked) { index = i; break; }



	switch (index) {
		case 0:
			document.getElementsByName('print4')[0].disabled = false;
			document.getElementsByName('print6')[0].disabled = false;
			document.getElementsByName('print7')[0].disabled = false;
			break;

		case 1:
		case 3:
			document.getElementsByName('print4')[0].disabled = false;
			document.getElementsByName('print6')[0].disabled = false;
			document.getElementsByName('print7')[0].disabled = false;
			document.getElementsByName('print8')[0].disabled = false;
			document.getElementsByName('print9')[0].disabled = false;
			document.calcForm.slipcase[0].disabled = false;
			break;
		case 2:
		case 4:
			document.getElementsByName('print4')[0].disabled = false;
			document.getElementsByName('print6')[0].disabled = false;
			document.getElementsByName('print7')[0].disabled = false;
			document.getElementsByName('print8')[0].disabled = false;
			document.calcForm.slipcase[0].disabled = false;
			break;
		case 5:
			document.getElementsByName('print4')[0].disabled = false;
			document.getElementsByName('print11')[0].disabled = false;
			break;
		case 6:
		case 7:
		case 8:
		case 9:
		case 10:
		case 11:
			document.getElementsByName('print4')[0].disabled = false;
			document.getElementsByName('print5')[0].disabled = false;
			document.calcForm.slipcase[1].disabled = false;
			break;
		case 12:



		case 13:



			document.calcForm.slipcase[0].disabled = false;



			break;



		case 14:



		case 15:



			document.calcForm.slipcase[1].disabled = false;



			break;



	}



}



function DoPrint() {



	for (i=0;i<document.calcForm.slipcase.length;i++) {



		document.calcForm.slipcase[i].disabled = true;



		document.calcForm.slipcase[i].checked = false;



	}



	for (i=1;i<=12;i++)



		if (document.getElementsByName('print'+i)[0].checked) { index = i; break; }



	switch (index) {



		case 2:



			document.calcForm.slipcase[0].disabled = false;



			document.calcForm.slipcase[1].disabled = false;



			break;



		case 4:



			document.calcForm.slipcase[1].disabled = false;



			break;



		case 5:



		case 6:



		case 7:



		case 8:



			document.calcForm.slipcase[0].disabled = false;



			break;



	}



}