var o_con=new Array();
var i_length=0;

function GetSelect(id,name)
{
  if(typeof(o_con[id])=="undefined")
  {
    var o=new Object();
    o.id=id;
    o.name=name;
    o_con[id]=o;
    i_length++; 
  }
  
  $('spntip').innerHTML=i_length;
}

function ClearSelect(id)
{
	o_con[id]=undefined;
	i_length--;
	$('spntip').innerHTML=i_length;
}

function SubmitData()
{
  if(i_length==0)
  {
    alert("请选择记录！");
  }
  else
  {
    parent.SetItem(o_con);
    parent.popup_close();
  }
}

function SelectItem(i_sel)
{
	$('ahrcls').className="";
	$('ahrcnt').className="";
	$('freclass').style.display="none";
	$('fresearch').style.display="none";
	if(i_sel==0)
	{
		$('ahrcls').className="click";
		$('freclass').style.display="";		
	}
	else
	{
		$('ahrcnt').className="click";
		$('fresearch').style.display="";		
		frames["fresearch"].location.reload();
	}
}

function ClearData()
{
	o_con=new Array();
	i_length=0;
	$('spntip').innerHTML="0";
	
	frames["freclass"].document.getElementById('frmitem').reset();
	
	if(typeof(frames["fresearch"])!= "undefined")
	{
		frames["fresearch"].document.getElementById('frmitem').reset();
	}	
}
