/**
 * Hishop 丹青 080614
 * 获取控件的值
 */
//文本方式的值
//_ID 键名
//_textControlID 文本框控件的ID
//所属上级的ID，比如购物车项ID之类的。一般用于分组保存、获取
function HishopInputType(_id,_textControlId,_parentId)
{
    this.Id= _id;
	this.ParentId=_parentId;
	this.TextControl=document.getElementById(_textControlId);
	
//单选方方式
//_listControlId 控件的ID
//_listControlType Radio还是DropDownList
//_countNum 总共有几个项，根据控件ID_index 来访问具体的内容	
this.GetQueryString=function()
	{
		if (this.TextControl!=null)
		{			
			return this.Id+"="+ escape(this.TextControl.value);
		}
		else
			return this.Id+"= ";
	}
}

//单选方方式
//_listControlId 控件的ID
//_listControlType Radio还是DropDownList
//_countNum 总共有几个项，根据控件ID_index 来访问具体的内容
function HishopRadioType(_id,_listControlId,_listControlType,_countNum,_parentId)
{
	this.Id= _id;
	this.ListControlType=_listControlType;
	this.ListControlId = _listControlId;
	this.CountNum=_countNum;
	this.ParentId=_parentId;

	this.GetQueryString=function()
	{
		if (this.ListControlType=="DropDownList")
		{
			//如果是个下拉列表
			var _drop=document.getElementById(this.ListControlId);
			if (_drop!=null){
			for(var i=0;i<_drop.options.length;i++)
			{
				if (_drop.options[i].selected)
				{
					return this.Id+"="+_drop.options[i].value;
				}
			}
			}
		}
		else if (this.ListControlType=="Radio")
		{
			for(var i=0;i<this.CountNum;i++)
			{
				var _control=document.getElementById(this.ListControlId+"_"+i );
				if (_control!=null){
				if (_control!=null && _control.checked)
				{
					return this.Id+"="+_control.value;
				}
				}
			}
		}
		
		return this.Id+"=00000000-0000-0000-0000-000000000000";
	}
}

//多选方
function HishopMultionType(_id,_listControlId,_countNum,_parentId)
{
	this.Id= _id;	
	this.ListControlId = _listControlId;
	this.CountNum=_countNum;
	this.ParentId=_parentId;
	
	this.GetQueryString=function()
	{
	    var myList=new Array();
        
		var _selectValues="";
		for(var i=0;i<this.CountNum;i++)
		{
			var _control=document.getElementById(this.ListControlId+"_"+i );
			if (_control!=null && _control.checked)
			{
			    myList.push(_control.value);				
			}
		}
		if (myList.length==0)
		    return this.Id+"=00000000-0000-0000-0000-000000000000";
		else
		    return this.Id+"="+myList.join(",");
	}
}
