function DisplayComparisonSelection(URL){
	Width=590;
	Height=414;
	var Left=(screen.availHeight-Height)/2;
	var Top=(screen.availWidth-Width)/2;
	window.name='main_gear';
	Comparison=window.open(URL,'comparison','top='+Top+',left='+Left+',width='+Width+',height='+Height+',menubar=no,toolbar=no,resizable=yes,scrollbars=no,location=no,status=no');
	Comparison.moveTo(Top,Left);
	Comparison.focus();
}

function HandleWindow(Height){
/*
	window.innerHeight=Height;
	window.screenY=(screen.availHeight-Height)/2;
*/
	return false;
}

function SelectAllSets(){
	var i=0;
	Checked=document.getElementById('all_sets').checked;
	while(CheckBox=document.getElementById('set_number_'+(i++)))
		if(!CheckBox.disabled)CheckBox.checked=Checked;
}

function DeleteConformity(ConformityID){
	if(!(Form=document.getElementById('clear_list')))
		return false;
	Form.delete_conformity.value=ConformityID;
	if(ConformityID)
		Form.action='';
	Form.submit();
	return false;
}

var IsSameHidden=false;

function HideSame(){
	Count=0;
	while(Line=document.getElementById('same_'+Count)){
		Line.style.display=(IsSameHidden?'':'none');
		if(!JSSections[JSSames[Count]])
			if(Divider=document.getElementById('same_divider_'+Count))
				Divider.style.display=(IsSameHidden?'none':'');
		Count++;
	}

	WasNewFirstSection=false;
	for(i=0;i<JSSections.length;i++){
		if(JSSections[i]){
			Section=document.getElementById('section_'+i);
			Section.style.display=IsSameHidden?'':'none';
		}

		if(i && JSSections[i-1] && document.getElementById('section_div_'+(i-1)).className=='the_first'){
			document.getElementById('section_div_'+i).className=IsSameHidden?'not_first':'';
			WasNewFirstSection=true;
		}
	}

	if(IsSameHidden){
		Bold=document.getElementById('same_show');
		Link=document.getElementById('same_hide');
	}
	else {
		Link=document.getElementById('same_show');
		Bold=document.getElementById('same_hide');
	}
	Bold.innerHTML='<b>'+Bold.innerHTML.replace(/<[^>]+>/,'')+'</b>';
	Link.innerHTML='<a href="#" onclick="return HideSame();">'+Link.innerHTML.replace(/<[^>]+>/,'')+'</a>';

	IsSameHidden=!IsSameHidden;
	return false;
}
