


inSearch=0;

function checkSea(id,p) {
	var cont=document.getElementById('sea_cont_'+id);
	if (cont) {
		if (cont.className=='pMS' && p!='pMS') {
			cont.className='pPL';
			cont.title=G_lng[5];
			hideDIV('sea_resu_'+id);
		} else {
			if (p!='pPL') {
				cont.title=G_lng[4];
				cont.className='pMS';
				showDIV('sea_resu_'+id);
			}
		}
	}
}


function checkSeaAll(max) {
	var cont=document.getElementById('sea_cont_all');
	if (!max) {max=20;}
	if (cont) {
		if (cont.className=='pMS') {
			cont.className='pPL';
			cont.title=G_lng[5]+' '+G_lng[6];
			for(var i=1;i<max+1;i++) checkSea(i,'pPL');
		} else {
			cont.title=G_lng[4]+' '+G_lng[6];
			cont.className='pMS';
			for(var i=1;i<max+1;i++) checkSea(i,'pMS');
		}
	}
}


function reloadSEG(n) {
	var param='';
	if (document.getElementById('sea_p1')){
		param =document.getElementById('sea_p0').checked?'1':'0';
		param+=document.getElementById('sea_p1').checked?'1':'0';
		param+=document.getElementById('sea_p2').checked?'1':'0';
		param+=document.getElementById('sea_p3').checked?'1':'0';
		param+=document.getElementById('sea_p4').checked?'1':'0';
		param+=document.getElementById('sea_p5').checked?'1':'0';
		param+=document.getElementById('sea_p6').checked?'1':'0';
		param+=document.getElementById('sea_p7').checked?'1':'0';
		param+=document.getElementById('sea_p8').checked?'1':'0';
		param+=document.getElementById('sea_p9').checked?'1':'0';
		param+=document.getElementById('sea_p10').checked?'1':'0';
		param+=document.getElementById('sea_p11').checked?'1':'0';
		var h=document.getElementById('sea_h').checked?'1':'0';
		var c=document.getElementById('sea_c').checked?'1':'0';
		if (h=='0' && c=='0') {
			h='1';
			document.getElementById('sea_h').checked=true;
		}
		param+=h+c;
	}
	if (param!='') {param='&bsp='+param;}
	var bsg=eClear(document.getElementById('sea_id').value);
	if (bsg=='') {bsg='SjdoDFJf';}
	switch (inSearch) {
		case 4: lS('info.php?'+param+'&bsg='+urlEncodeData(bsg), 'id_search' ); break;
		default: location.replace( '?bsg='+urlEncodeData(bsg)+param );
	}
}

function checkAll(t) {
	switch (t) {
	case 1:
		var c=document.getElementById('sea_all').checked;
		for (i=0;i<13;i++) {
			if (document.getElementById('sea_p'+i)) {
				document.getElementById('sea_p'+i).checked=c;
			}
		}
		break;
	case 0:
		var c=true;
		for (i=0;i<13;i++) {
			if (document.getElementById('sea_p'+i)) {
				if (!document.getElementById('sea_p'+i).checked) {c=false;}
			}
		}
		document.getElementById('sea_all').checked=c;
		break;
	}
}


