//-------------------------------------------------------//
// Author:Rodolfo Machon
// Company:WebSoft, SA de CV 
// Nombre del archivo: ley_articulos_gdfl.js
// Created: 2016-08-03
// Updates: 2016-08-03
// Copyright - All Rights Reserved
//-------------------------------------------------------//
//-------------------------------------------------------//
var isIE = document.all?true:false;
var isNS = document.layers?true:false;
var OpenWindow;
var element;
//-------------------------------------------------------//
window.onload = function(){
	
};
//-------------------------------------------------------//
// LEVEL 1
function ConstructArticulo(ele){
    element=ele;
    if (!OpenWindow || OpenWindow.closed){
	OpenWindow =window.open('','Rod','top=200,left=350,width=500,height=40,scrollbars=no,resizable=no,toolbar=no,menubar=no');
	OpenWindow.document.open();
	OpenWindow.document.write("<html>");
	OpenWindow.document.write("<head><title>Contructor de Articulo</title>");
	OpenWindow.document.write("</head>");
	OpenWindow.document.write("<body>");
	OpenWindow.document.write("<form name=IDContructor>");
	OpenWindow.document.write("<DIV ID=span0  style=position:absolute;left:10px;top:40px;visibility:visible><SELECT class=inputext size=1 cols=4 NAME=nivel onchange=opener.hidden(document.IDContructor.nivel.value)><OPTION value=0>NIVEL</OPTION><OPTION value=01>1<OPTION value=02>2<OPTION value=03>3<OPTION value=04>4<OPTION value=05>5<OPTION value=06>6<OPTION value=07>7<OPTION value=08>8<OPTION value=09>9<OPTION value=10>10</SELECT></DIV>");
	OpenWindow.document.write("<DIV ID=span1  style=position:absolute;left:80px;top:40px;visibility:hidden><SELECT class=inputext size=1 cols=4 NAME=sel01><OPTION value=01>01</OPTION><OPTION value=02>02</OPTION><OPTION value=03>03</OPTION><OPTION value=04>04</OPTION><OPTION value=05>05</OPTION><OPTION value=06>06</OPTION><OPTION value=07>07</OPTION><OPTION value=08>08</OPTION><OPTION value=09>09</OPTION><OPTION value=10>10</OPTION><OPTION value=11>11</OPTION><OPTION value=12>12</OPTION><OPTION value=13>13</OPTION><OPTION value=14>14</OPTION><OPTION value=15>15</OPTION><OPTION value=16>16</OPTION><OPTION value=17>17</OPTION><OPTION value=18>18</OPTION><OPTION value=19>19</OPTION><OPTION value=20>20</OPTION><OPTION value=21>21</OPTION><OPTION value=22>22</OPTION><OPTION value=23>23</OPTION><OPTION value=24>24</OPTION><OPTION  value=25>25</OPTION><OPTION value=26>26</OPTION><OPTION value=27>27</OPTION><OPTION value=28>28</OPTION><OPTION value=29>29</OPTION><OPTION value=30>30</OPTION><OPTION value=31>31</OPTION><OPTION value=32>32</OPTION><OPTION value=33>33</OPTION>value=34>34</OPTION><OPTION value=35>35</OPTION><OPTION value=36>36</OPTION><OPTION value=37>37</OPTION><OPTION value=38>38</OPTION><OPTION value=39>39</OPTION><OPTION value=40>40</OPTION></select></DIV>");
	OpenWindow.document.write("<DIV ID=span2  style=position:absolute;left:120px;top:40px;visibility:hidden><SELECT class=inputext size=1 cols=4 NAME=sel02><OPTION value=01>01</OPTION><OPTION value=02>02</OPTION><OPTION value=03>03</OPTION><OPTION value=04>04</OPTION><OPTION value=05>05</OPTION><OPTION value=06>06</OPTION><OPTION value=07>07</OPTION><OPTION value=08>08</OPTION><OPTION value=09>09</OPTION><OPTION value=10>10</OPTION><OPTION value=11>11</OPTION><OPTION value=12>12</OPTION><OPTION value=13>13</OPTION><OPTION value=14>14</OPTION><OPTION value=15>15</OPTION><OPTION value=16>16</OPTION><OPTION value=17>17</OPTION><OPTION value=18>18</OPTION><OPTION value=19>19</OPTION><OPTION value=20>20</OPTION><OPTION value=21>21</OPTION><OPTION value=22>22</OPTION><OPTION value=23>23</OPTION><OPTION value=24>24</OPTION><OPTION value=25>25</OPTION><OPTION value=26>26</OPTION><OPTION value=27>27</OPTION><OPTION value=28>28</OPTION><OPTION value=29>29</OPTION><OPTION value=30>30</OPTION><OPTION value=31>31</OPTION><OPTION value=32>32</OPTION><OPTION value=33>33</OPTION>value=34>34</OPTION><OPTION value=35>35</OPTION><OPTION value=36>36</OPTION><OPTION value=37>37</OPTION><OPTION value=38>38</OPTION><OPTION value=39>39</OPTION><OPTION value=40>40</OPTION></select></DIV>");
	OpenWindow.document.write("<DIV ID=span3  style=position:absolute;left:160px;top:40px;visibility:hidden><SELECT class=inputext size=1 cols=4 NAME=sel03><OPTION value=01>01</OPTION><OPTION value=02>02</OPTION><OPTION value=03>03</OPTION><OPTION value=04>04</OPTION><OPTION value=05>05</OPTION><OPTION value=06>06</OPTION><OPTION value=07>07</OPTION><OPTION value=08>08</OPTION><OPTION value=09>09</OPTION><OPTION value=10>10</OPTION><OPTION value=11>11</OPTION><OPTION value=12>12</OPTION><OPTION value=13>13</OPTION><OPTION value=14>14</OPTION><OPTION value=15>15</OPTION><OPTION value=16>16</OPTION><OPTION value=17>17</OPTION><OPTION value=18>18</OPTION><OPTION value=19>19</OPTION><OPTION value=20>20</OPTION><OPTION value=21>21</OPTION><OPTION value=22>22</OPTION><OPTION value=23>23</OPTION><OPTION value=24>24</OPTION><OPTION value=25>25</OPTION><OPTION value=26>26</OPTION><OPTION value=27>27</OPTION><OPTION value=28>28</OPTION><OPTION value=29>29</OPTION><OPTION value=30>30</OPTION><OPTION value=31>31</OPTION><OPTION value=32>32</OPTION><OPTION value=33>33</OPTION>value=34>34</OPTION><OPTION value=35>35</OPTION><OPTION value=36>36</OPTION><OPTION value=37>37</OPTION><OPTION value=38>38</OPTION><OPTION value=39>39</OPTION><OPTION value=40>40</OPTION></select></DIV>");
	OpenWindow.document.write("<DIV ID=span4  style=position:absolute;left:200px;top:40px;visibility:hidden><SELECT class=inputext size=1 cols=4 NAME=sel04><OPTION value=01>01</OPTION><OPTION value=02>02</OPTION><OPTION value=03>03</OPTION><OPTION value=04>04</OPTION><OPTION value=05>05</OPTION><OPTION value=06>06</OPTION><OPTION value=07>07</OPTION><OPTION value=08>08</OPTION><OPTION value=09>09</OPTION><OPTION value=10>10</OPTION><OPTION value=11>11</OPTION><OPTION value=12>12</OPTION><OPTION value=13>13</OPTION><OPTION value=14>14</OPTION><OPTION value=15>15</OPTION><OPTION value=16>16</OPTION><OPTION value=17>17</OPTION><OPTION value=18>18</OPTION><OPTION value=19>19</OPTION><OPTION value=20>20</OPTION><OPTION value=21>21</OPTION><OPTION value=22>22</OPTION><OPTION value=23>23</OPTION><OPTION value=24>24</OPTION><OPTION value=25>25</OPTION><OPTION value=26>26</OPTION><OPTION value=27>27</OPTION><OPTION value=28>28</OPTION><OPTION value=29>29</OPTION><OPTION value=30>30</OPTION><OPTION value=31>31</OPTION><OPTION value=32>32</OPTION><OPTION value=33>33</OPTION>value=34>34</OPTION><OPTION value=35>35</OPTION><OPTION value=36>36</OPTION><OPTION value=37>37</OPTION><OPTION value=38>38</OPTION><OPTION value=39>39</OPTION><OPTION value=40>40</OPTION></select></DIV>");
	OpenWindow.document.write("<DIV ID=span5  style=position:absolute;left:240px;top:40px;visibility:hidden><SELECT class=inputext size=1 cols=4 NAME=sel05><OPTION value=01>01</OPTION><OPTION value=02>02</OPTION><OPTION value=03>03</OPTION><OPTION value=04>04</OPTION><OPTION value=05>05</OPTION><OPTION value=06>06</OPTION><OPTION value=07>07</OPTION><OPTION value=08>08</OPTION><OPTION value=09>09</OPTION><OPTION value=10>10</OPTION><OPTION value=11>11</OPTION><OPTION value=12>12</OPTION><OPTION value=13>13</OPTION><OPTION value=14>14</OPTION><OPTION value=15>15</OPTION><OPTION value=16>16</OPTION><OPTION value=17>17</OPTION><OPTION value=18>18</OPTION><OPTION value=19>19</OPTION><OPTION value=20>20</OPTION><OPTION value=21>21</OPTION><OPTION value=22>22</OPTION><OPTION value=23>23</OPTION><OPTION value=24>24</OPTION><OPTION value=25>25</OPTION><OPTION value=26>26</OPTION><OPTION value=27>27</OPTION><OPTION value=28>28</OPTION><OPTION value=29>29</OPTION><OPTION value=30>30</OPTION><OPTION value=31>31</OPTION><OPTION value=32>32</OPTION><OPTION value=33>33</OPTION>value=34>34</OPTION><OPTION value=35>35</OPTION><OPTION value=36>36</OPTION><OPTION value=37>37</OPTION><OPTION value=38>38</OPTION><OPTION value=39>39</OPTION><OPTION value=40>40</OPTION></select></DIV>");
	OpenWindow.document.write("<DIV ID=span6  style=position:absolute;left:280px;top:40px;visibility:hidden><SELECT class=inputext size=1 cols=4 NAME=sel06><OPTION value=01>01</OPTION><OPTION value=02>02</OPTION><OPTION value=03>03</OPTION><OPTION value=04>04</OPTION><OPTION value=05>05</OPTION><OPTION value=06>06</OPTION><OPTION value=07>07</OPTION><OPTION value=08>08</OPTION><OPTION value=09>09</OPTION><OPTION value=10>10</OPTION><OPTION value=11>11</OPTION><OPTION value=12>12</OPTION><OPTION value=13>13</OPTION><OPTION value=14>14</OPTION><OPTION value=15>15</OPTION><OPTION value=16>16</OPTION><OPTION value=17>17</OPTION><OPTION value=18>18</OPTION><OPTION value=19>19</OPTION><OPTION value=20>20</OPTION><OPTION value=21>21</OPTION><OPTION value=22>22</OPTION><OPTION value=23>23</OPTION><OPTION value=24>24</OPTION><OPTION value=25>25</OPTION><OPTION  value=26>26</OPTION><OPTION value=27>27</OPTION><OPTION value=28>28</OPTION><OPTION value=29>29</OPTION><OPTION value=30>30</OPTION><OPTION value=31>31</OPTION><OPTION value=32>32</OPTION><OPTION value=33>33</OPTION>value=34>34</OPTION><OPTION value=35>35</OPTION><OPTION value=36>36</OPTION><OPTION value=37>37</OPTION><OPTION value=38>38</OPTION><OPTION value=39>39</OPTION><OPTION value=40>40</OPTION></select></DIV>");
	OpenWindow.document.write("<DIV ID=span7  style=position:absolute;left:320px;top:40px;visibility:hidden><SELECT class=inputext size=1 cols=4 NAME=sel07><OPTION value=01>01</OPTION><OPTION value=02>02</OPTION><OPTION value=03>03</OPTION><OPTION value=04>04</OPTION><OPTION value=05>05</OPTION><OPTION value=06>06</OPTION><OPTION value=07>07</OPTION><OPTION value=08>08</OPTION><OPTION value=09>09</OPTION><OPTION value=10>10</OPTION><OPTION value=11>11</OPTION><OPTION value=12>12</OPTION><OPTION value=13>13</OPTION><OPTION value=14>14</OPTION><OPTION value=15>15</OPTION><OPTION value=16>16</OPTION><OPTION value=17>17</OPTION><OPTION value=18>18</OPTION><OPTION value=19>19</OPTION><OPTION value=20>20</OPTION><OPTION value=21>21</OPTION><OPTION value=22>22</OPTION><OPTION value=23>23</OPTION><OPTION value=24>24</OPTION><OPTION value=25>25</OPTION><OPTION value=26>26</OPTION><OPTION value=27>27</OPTION><OPTION value=28>28</OPTION><OPTION value=29>29</OPTION><OPTION value=30>30</OPTION><OPTION value=31>31</OPTION><OPTION value=32>32</OPTION><OPTION value=33>33</OPTION>value=34>34</OPTION><OPTION value=35>35</OPTION><OPTION value=36>36</OPTION><OPTION value=37>37</OPTION><OPTION value=38>38</OPTION><OPTION value=39>39</OPTION><OPTION value=40>40</OPTION></select></DIV>");
	OpenWindow.document.write("<DIV ID=span8  style=position:absolute;left:360px;top:40px;visibility:hidden><SELECT class=inputext size=1 cols=4 NAME=sel08><OPTION value=01>01</OPTION><OPTION value=02>02</OPTION><OPTION value=03>03</OPTION><OPTION value=04>04</OPTION><OPTION value=05>05</OPTION><OPTION value=06>06</OPTION><OPTION value=07>07</OPTION><OPTION value=08>08</OPTION><OPTION value=09>09</OPTION><OPTION value=10>10</OPTION><OPTION value=11>11</OPTION><OPTION value=12>12</OPTION><OPTION value=13>13</OPTION><OPTION value=14>14</OPTION><OPTION value=15>15</OPTION><OPTION value=16>16</OPTION><OPTION value=17>17</OPTION><OPTION value=18>18</OPTION><OPTION value=19>19</OPTION><OPTION value=20>20</OPTION><OPTION value=21>21</OPTION><OPTION value=22>22</OPTION><OPTION value=23>23</OPTION><OPTION value=24>24</OPTION><OPTION value=25>25</OPTION><OPTION value=26>26</OPTION><OPTION value=27>27</OPTION><OPTION value=28>28</OPTION><OPTION value=29>29</OPTION><OPTION value=30>30</OPTION><OPTION value=31>31</OPTION><OPTION value=32>32</OPTION><OPTION value=33>33</OPTION>value=34>34</OPTION><OPTION value=35>35</OPTION><OPTION value=36>36</OPTION><OPTION value=37>37</OPTION><OPTION value=38>38</OPTION><OPTION value=39>39</OPTION><OPTION value=40>40</OPTION></select></DIV>");
	OpenWindow.document.write("<DIV ID=span9  style=position:absolute;left:400px;top:40px;visibility:hidden><SELECT class=inputext size=1 cols=4 NAME=sel09><OPTION value=01>01</OPTION><OPTION value=02>02</OPTION><OPTION value=03>03</OPTION><OPTION value=04>04</OPTION><OPTION value=05>05</OPTION><OPTION value=06>06</OPTION><OPTION value=07>07</OPTION><OPTION value=08>08</OPTION><OPTION value=09>09</OPTION><OPTION value=10>10</OPTION><OPTION value=11>11</OPTION><OPTION value=12>12</OPTION><OPTION value=13>13</OPTION><OPTION value=14>14</OPTION><OPTION value=15>15</OPTION><OPTION value=16>16</OPTION><OPTION value=17>17</OPTION><OPTION value=18>18</OPTION><OPTION value=19>19</OPTION><OPTION value=20>20</OPTION><OPTION value=21>21</OPTION><OPTION value=22>22</OPTION><OPTION value=23>23</OPTION><OPTION value=24>24</OPTION><OPTION value=25>25</OPTION><OPTION value=26>26</OPTION><OPTION value=27>27</OPTION><OPTION value=28>28</OPTION><OPTION value=29>29</OPTION><OPTION value=30>30</OPTION><OPTION value=31>31</OPTION><OPTION value=32>32</OPTION><OPTION value=33>33</OPTION>value=34>34</OPTION><OPTION value=35>35</OPTION><OPTION value=36>36</OPTION><OPTION value=37>37</OPTION><OPTION value=38>38</OPTION><OPTION value=39>39</OPTION><OPTION value=40>40</OPTION></select></DIV>");
	OpenWindow.document.write("<DIV ID=span10 style=position:absolute;left:440px;top:40px;visibility:hidden><SELECT class=inputext size=1 cols=4 NAME=sel10><OPTION value=01>01</OPTION><OPTION value=02>02</OPTION><OPTION value=03>03</OPTION><OPTION value=04>04</OPTION><OPTION value=05>05</OPTION><OPTION value=06>06</OPTION><OPTION value=07>07</OPTION><OPTION value=08>08</OPTION><OPTION value=09>09</OPTION><OPTION value=10>10</OPTION><OPTION value=11>11</OPTION><OPTION value=12>12</OPTION><OPTION value=13>13</OPTION><OPTION value=14>14</OPTION><OPTION value=15>15</OPTION><OPTION value=16>16</OPTION><OPTION value=17>17</OPTION><OPTION value=18>18</OPTION><OPTION value=19>19</OPTION><OPTION value=20>20</OPTION><OPTION value=21>21</OPTION><OPTION value=22>22</OPTION><OPTION value=23>23</OPTION><OPTION value=24>24</OPTION><OPTION value=25>25</OPTION><OPTION value=26>26</OPTION><OPTION value=27>27</OPTION><OPTION value=28>28</OPTION><OPTION value=29>29</OPTION><OPTION value=30>30</OPTION><OPTION value=31>31</OPTION><OPTION value=32>32</OPTION><OPTION value=33>33</OPTION>value=34>34</OPTION><OPTION value=35>35</OPTION><OPTION value=36>36</OPTION><OPTION value=37>37</OPTION><OPTION value=38>38</OPTION><OPTION value=39>39</OPTION><OPTION value=40>40</OPTION></select></DIV>");
	OpenWindow.document.write("<DIV ID=span11 style=position:absolute;left:10px;top:5px;visibility:visible><input type=button name=aceptar value=Aceptar class=button onClick=opener.Cod()></DIV>");                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
	OpenWindow.document.write("</form></body></html>");
    }else{OpenWindow.focus();}
}
function Cod(){
    var Ncodigo="";
    n_v=OpenWindow.document.IDContructor.nivel.value;
    for (a=1;a<=n_v;a++){
	    if(a<10){b="0"+a;}else{b=a;}
	    Mvar = "OpenWindow.document.IDContructor.sel"+b+".value";
	    codigo= eval(Mvar);
	    Ncodigo=Ncodigo+codigo+"-";
    }
    Ncodigo = Ncodigo.substring(0,Ncodigo.length-1);
    document.master.c32_articulo_id.value=Ncodigo;
    OpenWindow.close();
}
function GetClase(){
    var TipoClase = document.master.c1_tipo_tarifa_id.options[document.master.c1_tipo_tarifa_id.selectedIndex].text.toLowerCase();
    var TipoClases = TipoClase+"s";
    if(TipoClase===""){alert("Escojer el Tipo de Clase Primero");return;}
    var GetBackStream	 = "c2_"+TipoClase+"_id|c2_codigo_id,v64_"+TipoClase+"|v64_codigo";
    if ((TipoClase=="tipo_impuesto")||(TipoClase=="tipo_actividad_economica")){
        parent.list.GetBack('gmfl',TipoClases,GetBackStream,'parent.opener.parent.form.master',300,100,'','','scrollbars=yes,toolbar=no,menu=no');
    }else{
        parent.list.GetBack('LIST',TipoClases,GetBackStream,'parent.opener.parent.form.master',300,100,'','','scrollbars=yes,toolbar=no,menu=no');
    }
}
//-------------------------------------------------------//
// AUXLIAR
