         function openWin(theURL,winName,features) { //v1.2
                        xrz = window.open(theURL,winName,features);
                        if(navigator.appCodeName == "Mozilla")
                        xrz.focus();
        }
        function tisk() {
              bV = parseInt(navigator.appVersion)
               if (bV >= 4) self.print()
        }
        
        function paramDsc(id) { 
                        theUrl = "paramdsc.php?param_id="+id;
                        winName="paramWin"+Math.ceil((Math.random()*1000));
                        features="width=300,height=200,menubar=no,resizable=no";
                        openWin(theUrl, winName, features);
        }
        function resumeCart (input_id, form_name) {
            val = this.document.getElementById(input_id).value;
            if (val > 0) {
                this.document.getElementById(form_name).submit();
            }
        }
        
        function clearSearch(input) {
            if (input.value == "hledaný text")
                input.value = "";
        }
        
        function openCalendar(childName, dateName) {
        
            props = "width=150,height=140,menubar=no,resizable=no,status=no";
        
            d_part = "day="+document.getElementsByName(dateName+"_d")[0].value;
            m_part = "month="+document.getElementsByName(dateName+"_m")[0].value;
            y_part = "year="+document.getElementsByName(dateName+"_y")[0].value;
            
            dateName = "elemName="+dateName;
            
            child = open("open_calc.php?"+d_part+"&amp;"+m_part+"&amp;"+y_part+"&amp;"+dateName, "dateName", props);
//            child.opener = self;
            child.window.focus();
        }
        
        function updateParent(d_name, m_name, y_name, d_val, m_val, y_val) {        
            if (opener != null) {
                opener.document.getElementsByName(d_name)[0].value = d_val;
                opener.document.getElementsByName(m_name)[0].value = m_val;
                opener.document.getElementsByName(y_name)[0].value = y_val;
                opener.window.focus();
            }
            else {
                alert("chyba!");
            }            
            window.close();
        }
        
        function updateParentSelect(elName, elVal, el2Name, el2Val) {        
            if (opener != null) {
                opener.document.getElementsByName(elName)[0].value = elVal;
                ar = opener.document.getElementsByName(el2Name)
                
                for (i = 0; i < ar.length; i++) 
                {
                    ar[i].value = el2Val;
                }
                
                opener.window.focus();
            }
            else {
                alert("chyba!");
            }            
            window.close();
        }
        
        function openSelect(childName, elName, tabName, atts, attribname) {
        
            props = "width=500,height=300,menubar=no,resizable=yes,status=no,scrollbars=yes";
        
            h_part = "elVal="+document.getElementsByName(elName)[0].value;
            t_part = "tabName="+tabName;
            a_part = "atts="+atts;
            attrib_part = "attribname="+attribname;
                        
            elName = "elemName="+elName;
            
            child = open("open_select.php?"+h_part+"&amp;"+t_part+"&amp;"+a_part+"&amp;"+elName+"&amp;"+attrib_part, "selectName", props);
//            child.opener = self;
            child.window.focus();
        }
