<%@ Page Language="C#" MasterPageFile="~/admin/admin_page.master" AutoEventWireup="true" CodeBehind="productother_list.aspx.cs" Inherits="YXShop.Web.admin.product.productother_list" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="../style/validator.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/validate.js"></script>
    <link rel="stylesheet" href="../style/toolbar.css" type="text/css" />
    <script language="javascript" type="text/javascript">
    function Del(id)
    { 
       if(confirm('确定要永久删除该信息吗?删除后将不能被恢复!'))
       {
            var param = "Option=del&id=" + id;
            var options = 
            { method: 'post',parameters: param,onComplete:
                 function(transport)
                 {
                     var retv = transport.responseText;
                     window.location.reload();
                 }
            }
        }
        else
        {
            return false;
        }
        new Ajax.Request('productbrand_list.aspx', options);
    }
    
    //添加选中的项目
function AddItem(sel,seled)
{   
   var selectItemID=document.getElementById(sel).options.selectedIndex;
   var selectItemValue=document.getElementById(sel).options;
   var Selected=document.getElementById(seled);
   
   if  (selectItemID!=0&&selectItemID!=-1)
   {        
        for(var i = 0,j=0; i < selectItemValue.length,j<selectItemValue.length; i++) 
        {
          if(selectItemValue[i].selected)
           {
                var exist=false;
                for(var k = 0; k < Selected.options.length; k++) 
                {
                    if(Selected.options[k].value == selectItemValue[i].value) 
                    {
                        exist=true;
                        break;
                    }
                }
                if  (exist==false)
                {  
                    Selected.options.add(new Option(selectItemValue[i].text, selectItemValue[i].value, true,true)); 
                    j++;
                }
            }
        }
   }
}
//全部添加
function AddAllItem(sel,seled)
{
    //备选项列表
    var selectItemValue=document.getElementById(sel).options;
    //已列表
    var Selected=document.getElementById(seled);
    for(var i = 1,j = 0; i < selectItemValue.length,j < selectItemValue.length; i++) 
    {           
        var exist=false;
        for(var k = 0; k < Selected.options.length; k++) 
        {
            if(Selected.options[k].value == selectItemValue[i].value) 
            {
                exist=true;
                break;
            }
        }
        if  (exist==false)
        {  
            Selected.options.add(new Option(selectItemValue[i].text, selectItemValue[i].value, true,true)); 
            j++;
        }
    }
}
//移除所选项
function DelItem(selName)
{
    var Selected=document.getElementById(selName).options;
    for(var i = 0; i < Selected.length; i++) 
    {        
        if(Selected[i].selected==true)
        {
            Selected.remove(i);
        }
    }
}

//移除所有已经选择好的项目
function DelAllItem(selName)
{
    var colls = [];       //对select标记options的引用
    var selectTag = document.getElementById(selName); //获取select标记        
    colls = selectTag.options; //获取引用
    if(colls.length > 0)
    {
         clearOptions(colls);
    }   
}
//清空options集合
function clearOptions(colls)
{
    var length = colls.length;
    for(var i=length-1;i>=0;i--)
    {
           colls.remove(i);
    }
}
    </script>
    <script src="../scripts/images.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="pagetitle" runat="server">类型品牌
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="pageinfo" runat="server">添加类型品牌
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="workspace" runat="server">
    <table border="0" cellpadding="1" cellspacing="1" width="60%">
        <tr>
            <td style="width: 20%; text-align: right">
                <div id="divBrandList">
                    <asp:Literal ID="ltBrandList" runat="server"></asp:Literal>
               </div>
            </td>
            <td style="width: 10%; text-align: right">
                <input type="button" style="width: 60%" value=">>>" onclick="AddAllItem('selBrandId','selBrandIdSelected');" />
                <br />
                <br />
                <br />
                <input type="button" style="width: 60%" value=">" onclick="AddItem('selBrandId','selBrandIdSelected');" />
                <br />
                <br />
                <br />
                <input type="button" style="width: 60%" value="<" onclick="DelItem('selBrandIdSelected');" />  
                <br />
                <br />
                <br />
                <input type="button" style="width: 60%" value="<<<" onclick="DelAllItem('selBrandIdSelected');" />
            </td>
            <td style="width: 20%; text-align: right">
                <div id="divSelBrandList">
                   <asp:Literal ID="ltBrandSelected" runat="server"></asp:Literal>
                </div>
            </td>
        </tr>
    </table>
    <table class="form_table_input" border="0" width="100%" cellspacing="0" cellpadding="0">
        <tr>
		    <td colspan="4" align="center">
                <asp:Button ID="Back" runat="server" CssClass="inputbutton" Text="上一步" 
                    onMouseOver="javascript:document.getElementById(this.id).className='inputbutton_a'" 
                    
                    onMouseOut="javascript:document.getElementById(this.id).className='inputbutton'" 
                    onclick="Back_Click"/>
                <asp:Button ID="button4" runat="server" CssClass="inputbutton" Text="下一步" 
                    onMouseOver="javascript:document.getElementById(this.id).className='inputbutton_a'" 
                    
                    onMouseOut="javascript:document.getElementById(this.id).className='inputbutton'" 
                    onclick="button4_Click" />
            </td>
	    </tr>
    </table>
</asp:Content>

