
/* Lista adresów dostawy klienta (client-addresses - client_addresses_list) [53417]*/

function client_addresses_list_confirmdelete() {
    return confirm('Are you sure you want to delete the selected delivery address?');
}
/* Wyszukiwarka - podpowiedzi brane z drugiego wezla nawigacji (layout_right - menu_search) [58121]*/

var QuickSearchTop = {
    selectFields: {},
    highlightTextSelect: '',

    findText: function(e) 
    {
        var txt = document.getElementById('quicksearchtop_text').value;
      //  if (!e) { 
     //       e = window.event;

    //    }
        
    //    var key = e.keyCode || e.which; 
var key = 100;
        if (key == 38 || key == 40) {
            // wcisnieto klawisz
            if (document.getElementById('q_find-text-1-div')) {
  
                document.getElementById('quicksearchtop_findtext').style.display = 'block';
                if (! QuickSearchTop.highlightTextSelect) {
                    QuickSearchTop.highlightText(1);
                } else if (key == 38 && document.getElementById('q_find-text-'+(QuickSearchTop.highlightTextSelect-1)+'-div')) {
                    QuickSearchTop.highlightText(QuickSearchTop.highlightTextSelect-1);
                } else if (key == 40 && document.getElementById('q_find-text-'+parseInt(QuickSearchTop.highlightTextSelect+1)+'-div')) {
                    QuickSearchTop.highlightText(QuickSearchTop.highlightTextSelect+1);
                }
            } else if (txt.length > 1) {
                QuickSearchTop.prepareFindText();
            }
        } else if ((key == 13 || key == 39) && QuickSearchTop.highlightTextSelect) {
           QuickSearchTop.selectText(QuickSearchTop.highlightTextSelect);
        } else {
            if (txt.length > 1) {
               QuickSearchTop.prepareFindText();
            }
        }
    },
    
    checkEnter: function()
    {
        if (QuickSearchTop.highlightTextSelect) {
            QuickSearchTop.selectText(QuickSearchTop.highlightTextSelect);
            return false;
        } else {
            return true;
        }
    },
    
    highlightText: function(i) 
    {
        if (QuickSearchTop.highlightTextSelect) {
            document.getElementById('q_find-text-'+QuickSearchTop.highlightTextSelect+'-div').style.backgroundColor = '';
        }
        QuickSearchTop.highlightTextSelect = i;
        document.getElementById('q_find-text-'+i+'-div').style.backgroundColor = '#FFEEAA';
    },
    
    sendSubmit: function()
    {
        QuickSearchTop.highlightTextSelect = '';
        document.getElementById('quicksearchtop_form').submit();
    },
    
    prepareFindText: function() 
    {
        var txt = document.getElementById('quicksearchtop_text').value;
        QuickSearchTop.highlightTextSelect = 0;
        var text = '';
        var re = new RegExp(txt.toLowerCase(), "gi");
        var find = 0;
        for (id in SelectorCategoryLinks) {
            if (SelectorCategoryLinks[id].match(re)) {
                find += 1
                text = text + '<div id="q_find-text-'+find+'-div" style="cursor: pointer;" onmouseover="QuickSearchTop.highlightText(\''+find+'\');" onclick="QuickSearchTop.selectText(\''+find+'\');"><input type="hidden" value="'+SelectorCategoryLinks[id]+'" id="q_find-text-'+find+'">'+SelectorCategoryLinks[id].replace(re, '<b>$&</b>')+'</div>';
                if (find > 10) {
                    break;
                }
            }
        }
        if (find > 0) {
            document.getElementById('quicksearchtop_findtext').style.display = 'block';
            document.getElementById("quicksearchtop_findtext").innerHTML = text;
        } else {
            document.getElementById('quicksearchtop_findtext').style.display = 'none';
        }   
    },
    
    selectText: function (id)
    {
        document.getElementById('quicksearchtop_text').value = document.getElementById('q_find-text-'+id).value;
        document.getElementById('quicksearchtop_findtext').style.display = 'none';
        QuickSearchTop.highlightTextSelect = '';
        document.getElementById('quicksearchtop_form').submit();
    },  
};
/* Order 1 Nowy z wyborem płatności ver 3.5 (order1 - order1) [53506]*/

function wite(description) {

desc.innerHTML = description;

}


function order1_shop_payformdiv(show, id)
{


var wartosc;
if (id.value){
wartosc = id.value;
}
else{
wartosc = id.innerHTML;
}

if (document.getElementById('comment_cont'))
{
document.getElementById('comment_cont').innerHTML = document.getElementById(wartosc).innerHTML;
}
else
{
//setTimeout('order1_shop_payformdiv('+show+', ''+id+'')', 2000);
}


    if (show) {
        document.getElementById('payform_div').style.display = 'block';
    } else {
        document.getElementById('payform_div').style.display = 'none';
        document.getElementById('payform_id').selectedIndex = 0;

        allDivs = document.getElementsByTagName("div");
        for (i = 0; i < allDivs.length; i++) {
            if ((/^newpayment_form_/).test(allDivs[i].id) == true) {
                allDivs[i].style.display = 'none';
            }
        }
    }
}

function order1_changepayform()
{
    selVal = document.getElementById('payform_id').value;
    allDivs = document.getElementsByTagName("div");

    for (i = 0; i < allDivs.length; i++) {
        if ((/^newpayment_form_/).test(allDivs[i].id) == true) {
            allDivs[i].style.display = 'none';
        }
    }

    if (document.getElementById('newpayment_form_'+selVal) ) {
        document.getElementById('newpayment_form_'+selVal).style.display = 'block';
    }
}
/* <b style="font-size:12px;color:red; text-decoration:blink">&gt;</b>Formularz dodawania nowego klienta 3.5 (client-new - client_new_form) [53700]*/

function clientnew_delivery_addr() {
    if (document.getElementById('deliver_to_billingaddr').checked) {
        document.getElementById('delivery_address_form').style.display = 'none';
    } else {
        document.getElementById('delivery_address_form').style.display = 'block';
    }
}

function clientnew_firm() {
    if (document.getElementById('firm_data').checked) {
        document.getElementById('firm_data_inputs').style.display = 'block';
    } else {
        document.getElementById('firm_data_inputs').style.display = 'none';
    }
}
/* menu kategorii 3.5 mednatur (layout_left - menu_categories) [53935]*/

function menu_categories_toggle(id) {
     if (document.getElementById(id).style.display == 'block') {
           document.getElementById(id).style.display='none'
     } else {
           document.getElementById(id).style.display='block'
     }
}
/* nowy koszyk - work in progress (basketedit - basketedit_productslist) [53828]*/

function viewGroupEdit(group_id, item_id)
{
    element = document.getElementById('div_group_edit');
    element.style.display='block';
    //element.style.display='none';
    //Effect.SlideDown('div_product_edit');
   document.getElementById('group_' + group_id).style.display = 'block';
   document.getElementById('item_' + item_id).style.display = 'block';
}

var product_id    = 0;
var size_id         = 0;
var price            = 0;

function baskQuantity()
{
    sel_sz = document.getElementById('select_sizes_'+product_id);
    div_nr_n = document.getElementById('div_num_'+product_id+'_'+size_id);
    div_nr_b = document.getElementById('div_num_'+product_id+'_'+sel_sz.value);
    sel_nr_n = document.getElementById('select_num_'+product_id+'_'+size_id);
    sel_nr_b = document.getElementById('select_num_'+product_id+'_'+sel_sz.value);
    div_nr_n.style.display = 'none';
    div_nr_b.style.display = 'block';
    sel_nr_n.disabled = true;
    sel_nr_b.disabled = false;
    size_id = sel_sz.value;

    // cena
    div_pr = document.getElementById('div_price');
    inp_pr = document.getElementById('price_'+product_id+'_'+sel_sz.value);
    inp_cr = document.getElementById('cur_sign');
    if (inp_pr.value != '') {
        div_pr.innerHTML = inp_pr.value+inp_cr.value;
    } else {
        div_pr.innerHTML = inp_pr.value;
    }
}


function hideGroupEdit()
{
    element = document.getElementById('div_group_edit');
    element.style.display='none';
}

function countAnnuityZagiel(account, amount)
{ 
window.open('http://www.zagiel.com.pl/kalkulator/index_smart.php?action=getklientdet_si_rata&shopNo=' + account + '&goodsValue=' + amount, 'count_zagiel', 'width=630,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
}
function validate_Zagiel()
{
var zagielconfirm = document.getElementById('zagiel_confirm');
  if (zagielconfirm.checked) {
    return true;
  } else {
    alert(zagielnotconfirmed)
    return false;
  }
}

function countAnnuityZagiel(account, amount)
{ 
window.open('http://www.zagiel.com.pl/kalkulator/index_smart.php?action=getklientdet_si_rata&shopNo=' + account + '&goodsValue=' + amount, 'count_zagiel', 'width=630,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
}
function validate_Zagiel()
{
var zagielconfirm = document.getElementById('zagiel_confirm');
  if (zagielconfirm.checked) {
    return true;
  } else {
    alert(zagielnotconfirmed)
    return false;
  }
}






function countAnnuityZagiel(account, amount)
{ 
window.open('http://www.zagiel.com.pl/kalkulator/index_smart.php?action=getklientdet_si_rata&shopNo=' + account + '&goodsValue=' + amount, 'count_zagiel', 'width=630,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
}
function validate_Zagiel()
{
var zagielconfirm = document.getElementById('zagiel_confirm');
  if (zagielconfirm.checked) {
    return true;
  } else {
    alert(zagielnotconfirmed)
    return false;
  }
}
/* <span style="color:blue;font-weight:bold;">ZALECANY</span> Wyszukiwarka zaawansowana (searching - searching) [56189]*/
// ID div'ow od SELECTA (po przecinku) do ukrycia np('cont_series','cont_sizes','cont_1213701896'):

var Searching_hideselectsArray = new Array();
var ChangeDivPosition = {};
var ns = document.getElementById && !document.all;

function positiontip(e) {
   
    ChangeDivPosition.pageX =(ns)?e.pageX : event.clientX+document.documentElement.scrollLeft;
    ChangeDivPosition.pageY  =(ns)?e.pageY : event.clientY+document.documentElement.scrollTop;

    var obj = document.getElementById(ChangeDivPosition.id);
    if (obj) {
         var x = ChangeDivPosition.marginLeft + (ChangeDivPosition.pageX - parseInt(ChangeDivPosition.startX));
         var y = ChangeDivPosition.marginTop + (ChangeDivPosition.pageY - parseInt(ChangeDivPosition.startY));
         if (x > ChangeDivPosition.maxX) {
             x = ChangeDivPosition.maxX;
         } else if (x < 0) {
            x = 0;
         }
 
        if (y > ChangeDivPosition.maxY) {
             y = ChangeDivPosition.maxY;
         } else if (y < 0) {
              y = 0;
         }

         var r = ChangeDivPosition.maxX; // przedział
         var PriceMax = document.getElementById('max_price_start').value;
         var PriceMin = document.getElementById('min_price_start').value;

         var price = parseInt(PriceMin) + parseInt((PriceMax - PriceMin)*x/r);

         if  (obj.id == 's1') {
             var obj2 = document.getElementById('s2');
         } else {
             var obj2 = document.getElementById('s1');
         }
         if (parseInt(obj2.style.marginLeft.replace('px', '')) > x) {
             // cena minimalna
             if (PriceMin >= price) {
                 document.getElementById('pricelimitmin').value = '';
             } else {
                 document.getElementById('pricelimitmin').value = price;
             }
             document.getElementById('min_price_text').innerHTML = price + '.00';
         } else { 
             // cena maksymalna
             if (PriceMax <= price) {
                 document.getElementById('pricelimitmax').value = '';
             } else {
                 document.getElementById('pricelimitmax').value = price;
             }
             document.getElementById('max_price_text').innerHTML = price + '.00';
         }
 

         obj.style.marginLeft = x + 'px';
  
         var left1 = parseInt(obj2.style.marginLeft.replace('px', ''));
         var left2 = x;
         
        if (left2 > left1) {
             document.getElementById('s3').style.marginLeft = (left1+10) + 'px';
             if ((left2 - left1-10) > 0) {
                 document.getElementById('s3').style.width = (left2 - left1-10) + 'px';
             } else {
                 document.getElementById('s3').style.width = '0px';
             }
         } else {
             document.getElementById('s3').style.marginLeft = (left2+10) + 'px';
             if ((left1 - left2-10) > 0) {
                 document.getElementById('s3').style.width = (left1 - left2-10) + 'px'; 
             } else {
                 document.getElementById('s3').style.width = '0px';
             }
         }
    }
}

function StartDrag(obj, contenerId)  {
    ChangeDivPosition.id = obj.id
    ChangeDivPosition.startX = ChangeDivPosition.pageX;
    ChangeDivPosition.startY = ChangeDivPosition.pageY;
    ChangeDivPosition.wait = 3;

    if (! obj.style.marginLeft) {
        if (obj.offsetLeft) {
            obj.style.marginLeft= obj.offsetLeft + 'px';
        } else {
            obj.style.marginLeft= '0px';
        }
    }
    if (! obj.style.marginTop) {
        if (obj.offsetTop) {
            obj.style.marginTop= obj.offsetTop+ 'px';
        } else {
            obj.style.marginTop= '0px';
        }
    }
    if (! obj.style.width) {
        if (obj.offsetWidth) {
            obj.style.width = obj.offsetWidth + 'px';
        } else {
            obj.style.width= '0px';
        }
    }
    ChangeDivPosition.marginLeft  = parseInt(obj.style.marginLeft.replace('px', ''));
    ChangeDivPosition.marginTop =  parseInt(obj.style.marginTop.replace('px', ''));

    var contener = document.getElementById(contenerId);

    if (! contener.style.width) {
        if (contener.offsetWidth) {
            contener.style.width= contener.offsetWidth + 'px';
        } else {
            contener.style.width= '0px';
        }
    }
    if (! contener.style.height) {
        if (contener.offsetHeight) {
            contener.style.height= contener.offsetHeight + 'px';
        } else {
            contener.style.height = '0px';
        }
    }

    ChangeDivPosition.maxX = parseInt(contener.style.width.replace('px', '')) - parseInt(obj.style.width.replace('px', ''));;
    ChangeDivPosition.maxY = parseInt(contener.style.height.replace('px', '')) - parseInt(obj.style.height.replace('px', ''));

}

function StartDrag2(obj) {
    if (ChangeDivPosition.id) {
        ChangeDivPosition.wait = 3;
    }
}

function StopDrag(obj, wait) {
     if (ChangeDivPosition.wait == 3 && wait ==2) {
         ChangeDivPosition.wait =2;
     }
     if (wait < 1) {
         ChangeDivPosition.id = '';
         Searching.send('price');
     } else if (ChangeDivPosition.id && ChangeDivPosition.wait != 3) {
         setTimeout("StopDrag ('', '"+(wait-1)+"')", 200);
     }
}

var Searching = {
    selectFields: {},
    highlightTextSelect: '',
    
    startPricePosition: function(contenerId)
    {
        var contener = document.getElementById(contenerId);
        if (! contener.style.width) {
            if (contener.offsetWidth) {
                contener.style.width= contener.offsetWidth + 'px';
            } else {
                contener.style.width= contener.currentStyle['width'];
            }
        }
        if (! contener.style.height) {
            if (contener.offsetHeight) {
                contener.style.height= contener.offsetHeight + 'px';
            } else {
                contener.style.height = contener.currentStyle['height'];
            }
        }
        if (! document.getElementById('s2').style.width) {
            if (document.getElementById('s2').offsetWidth) {
                document.getElementById('s2').style.width= document.getElementById('s2').offsetWidth + 'px';
            } else {
                document.getElementById('s2').style.width= document.getElementById('s2').currentStyle['width'];
            }
        }
        var r = parseInt(contener.style.width.replace('px', '')) - parseInt(document.getElementById('s2').style.width.replace('px', ''));;

        var PriceMax = document.getElementById('max_price_start').value;
        var PriceMin = document.getElementById('min_price_start').value;

        var price = document.getElementById('pricelimitmin').value;
        document.getElementById('s1').style.marginLeft = '0px';
        document.getElementById('s2').style.marginLeft = r + 'px';

        document.getElementById('s3').style.marginLeft = 10 + 'px';
        document.getElementById('s3').style.width = r + 'px'; 
    },

    send: function()
    {
        var name = arguments[0];
        if (name == 'traits' && arguments[1]) {
            name = name +'[' + arguments[1] + ']';
        }
        if (name == 'text') {
            setTimeout("document.getElementById('find-text').style.display = 'none';", 500) ;
        }

        Searching.selectFields[name] = 1;
        
        document.getElementById('searchingPreloader2').style.display = '';
        var txt = '';
        
        var active = true;
        for(nameTmp in Searching.selectFields) {
            var form = document.getElementsByName(nameTmp);
            if (nameTmp == 'price') {
                if (active) {
                    txt = txt + '&pricelimitmin=' + document.getElementById('pricelimitmin').value;
                    txt = txt + '&pricelimitmax=' + document.getElementById('pricelimitmax').value;
                } 
            } else if (nameTmp == 'date') {
                if (active) {
                    txt = txt + '&day=' + document.getElementById('date_d').value;
                    txt = txt + '&month=' + document.getElementById('date_m').value;
                    txt = txt + '&year=' + document.getElementById('date_y').value;
                }
            } else if (form[0].type == 'select-one' && form[0].name) {
                if (active) {
                    if (form[0].value) {
                        txt = txt + '&' + form[0].name + '=' + form[0].value;
                    }
                } else {
                    form[0].selectedIndex = 0;
                }
            } else if (form[0].type == 'checkbox') {
                if (active) {
                    if (form[0].checked) {
                        txt = txt + '&' + form[0].name + '=' + form[0].value;
                    }
                } else {
                    form[0].checked = false;
                }
            } else if (nameTmp == 'text') {
                if (active) {
                    txt = txt + '&text=' + document.getElementById('searching_text').value;
                } else {
                    form[0].value = '';
                }
            } else if (form[0].name && form[0].value) {
                if (active) {
                    txt = txt + '&' + form[0].name + '=' + form[0].value;
                } else {
                    form[0].value = '';
                }
            }
            
            if (name == nameTmp) {
               active = false;
            }
        }
        IAI_Ajax.Request('ajax/search.php?ajax=true&selectAll=t&change_name='+ name + txt , '', {onSuccess:'Searching.prepareForms'});
    },
    
    prepareForms: function(x)
    {
        document.getElementById('searchingPreloader2').style.display = 'none';
        try {
            var response = eval('(' + x + ')');
        } catch (e) {
            return false;
        }
        Searching.highlightTextSelect = 0;
        var form = document.getElementById('searching_form').elements;
        if (response['countProducts'] >0) {
            document.getElementById('select_products_info').style.display = 'none';
        } else {
            document.getElementById('select_products_info').style.display = 'block';
        }
        for (i=0; i<form.length; i++) {
           var display = false; 
           if (! form[i].name) {
                display = 'hidden';
                if (form[i].id == 'searching_category_1' && !form[i].value) {
                   display = false;
                    // kategorie traktujemy inaczej 
                    SearchingCategory2 = {};
                    if (response['category']) {
                            display = true;
                            for (j in response['category']) { 
                                 SearchingCategory2[j] = SearchingCategory[j];
                                 for (k in SearchingCategoryParents[j]) {
                                     if (SearchingCategoryParents[j][k]) {
                                         SearchingCategory2[SearchingCategoryParents[j][k]] = SearchingCategory[SearchingCategoryParents[j][k]];
                                    }
                                }
                            }

                            
                            for(j=1; j<form[i].options.length; j++) {
                                // zaczynamy od 1 gdyz "wszystkie" zawsze ma pozostac
                                if (form[i].options[j].value && !SearchingCategory2[form[i].options[j].value]) {
                                    form[i].options[j].style.display = 'none';
                                } else if (form[i].options[j].value) {
                                    form[i].options[j].style.display = '';
                                }
                            }
 
                    }
                }
                
            } else if (form[i].type == 'select-one') {
                if (form[i].value) {
                    display = true;
                } else if (!response[form[i].name] || response[form[i].name].length <= 2) {
                    display = false;
                } else if (response[form[i].name]) {
                    var tmpI = 1;
                    var copySelectId = 'copy_'+form[i].name;
                    if (document.getElementById(copySelectId)) {
                        // kopia selecta
                        var countTmpOptions = form[i].options.length;
                        for(j=1; j<countTmpOptions; j++) {
                            // usuwanie wszystkiego
                            form[i].removeChild(form[i].options[1]);
                        }
                       
                        for(j=1; j<document.getElementById(copySelectId).options.length; j++) {
                            var optionTmp = document.getElementById(copySelectId).options[j];
                            if (response[form[i].name][optionTmp.value]) {
                                // wstawiamy opcje 
                                display = true;
                                var t = Searching.addOption(form[i]);
                                t.id = optionTmp.id;
                                t.value = optionTmp.value;
                                t.textContent = optionTmp.textContent;
                                t.text = optionTmp.text;
                                tmpI++
                            }
                        }
                    }
                    if (tmpI <= 2)  {
                         display = false;
                    }
                }
            } else if (form[i].type == 'checkbox') {
                display = true;
                if (!form[i].checked) {
                    if (!response[form[i].name]) {
                        display = false;
                    } else if(response[form[i].name].length < 2) {
                        display = false;
                    }
                }
            } else {
                display = true;
            }
            if (display == 'hidden') {
                //
            } else if (display == true) {
                form[i].disabled = '';
            } else {
                form[i].disabled = 'disabled';
            }
        }
        if (response['day'] && response['month'] && response['year'] && response['change_name'] != 'date' ) {
            document.getElementById('date_d').value = response['day'];
            document.getElementById('date_m').value = response['month'];
            document.getElementById('date_y').value = response['year'];
            
            //Calendar('DatePicker_begin', document.getElementById('date'));
            document.getElementById('date').value = response['year'] +  '-' + response['month'] + '-' +response['day'];
        }
        if (response['pricemin'] && response['pricemax']  && response['change_name'] != 'price' ) {
            var errorprice = 0;
            for(nameTmp in Searching.selectFields) {
                if (nameTmp ==  'price' ) {
                    // cena byla juz zawezona wczesniej
                    errorprice = 1;
                } else if (response['change_name'] == nameTmp && errorprice == 1) {
                     // zawezanie elementu bylo po zawezeniu ceny
                     errorprice = 2;
                }
            }
            if (response['pricemin'] == response['pricemax']) {
                errorprice = 2;
            }
            if (errorprice != 2 || (document.getElementById('pricelimitmax').value ==document.getElementById('max_price_start').value && document.getElementById('pricelimitmin').value == document.getElementById('min_price_start').value)) {
             if (response['pricemin'] != response['pricemax'] ) {
                 document.getElementById('contener3').style.display = 'block';
                 document.getElementById('contener4').style.display = 'none';
                 document.getElementById('pricelimitmin').value = response['pricemin'];
                 document.getElementById('pricelimitmax').value = response['pricemax'];
                 document.getElementById('min_price_text').innerHTML = response['pricemin'];
                 document.getElementById('max_price_text').innerHTML = response['pricemax'];
                 document.getElementById('min_price_start').value = response['pricemin'];
                 document.getElementById('max_price_start').value = response['pricemax'];
                 Searching.startPricePosition('contener');
            } else {
                 document.getElementById('contener3').style.display = 'none';
                 document.getElementById('min_price_text_2').innerHTML = response['pricemax'];
                 document.getElementById('contener4').style.display = 'block';
            }
          }
        }
    },

    findText: function(e) 
    {
        var txt = document.getElementById('searching_text').value;
        if (!e) e = window.event;
        var key = e.keyCode || e.which; 
        if (key == 38 || key == 40) {
            // wcisnieto klawisz
            if (document.getElementById('find-text-1-div')) {
                if (! Searching.highlightTextSelect) {
                    Searching.highlightText(1);
                } else if (key == 38 && document.getElementById('find-text-'+(Searching.highlightTextSelect-1)+'-div')) {
                    Searching.highlightText(Searching.highlightTextSelect-1);
                } else if (key == 40 && document.getElementById('find-text-'+parseInt(Searching.highlightTextSelect+1)+'-div')) {
                    Searching.highlightText(Searching.highlightTextSelect+1);
                }
            }
        } else if (key == 13 && Searching.highlightTextSelect) {
            Searching.selectText(Searching.highlightTextSelect);
        } else {
            if (txt.length > 1) {
                IAI_Ajax.Request('ajax/search-name.php?ajax=true&text=' + txt , '', {onSuccess:'Searching.prepareFindText'});
            }
        }
    },
    
    checkEnter: function()
    {
        if (Searching.highlightTextSelect) {
            Searching.selectText(Searching.highlightTextSelect);
            return false;
        } else {
            return true;
        }
    },
    
    highlightText: function(i) 
    {
        if (Searching.highlightTextSelect) {
            document.getElementById('find-text-'+Searching.highlightTextSelect+'-div').style.backgroundColor = '';
        }
        Searching.highlightTextSelect = i;
        document.getElementById('find-text-'+i+'-div').style.backgroundColor = '#FFEEAA';
    },
    
    sendSubmit: function()
    {
        Searching.highlightTextSelect = '';
        document.getElementById('searching_form').submit();
    },
    
    prepareFindText: function(x) 
    {
        try {
            var response = eval('(' + x + ')');
        } catch (e) {
            return false;
        }
        Searching.highlightTextSelect = 0;
        var text = '';
        var re = new RegExp(response.text.toLowerCase(), "gi");
        if (response.products_name.length > 0) {
            document.getElementById('select_products_info').style.display = 'none';
            document.getElementById('find-text').style.display = 'block';
            var j = response.products_name.length;
            for(var i=1; i<=j; i++) {
                var tmpTxt = response.products_name[i-1];   
                if (! response.products_name[i-1]) {
                    i--; j--;
                    continue;
                }
                text = text + '<div id="find-text-'+i+'-div" style="cursor: pointer;" onmouseover="Searching.highlightText(\''+i+'\');" onclick="Searching.selectText(\''+i+'\');"><input type="hidden" value="'+tmpTxt+'" id="find-text-'+i+'">'+tmpTxt.replace(re, '<b>$&</b>')+'</div>';
            }
        } else {
            document.getElementById('find-text').style.display = 'none';
            document.getElementById('select_products_info').style.display = 'block';
        }
        document.getElementById("find-text").innerHTML = text;
    },
    
    selectText: function (id)
    {
        document.getElementById('searching_text').value = document.getElementById('find-text-'+id).value;
        document.getElementById('find-text').style.display = 'none';
        Searching.highlightTextSelect = '';
        document.getElementById('searching_form').submit();
    },

    changeSelectCategory: function(obj, number) 
    {
        var selectId = obj.value;
        if (selectId) {
            document.getElementById('category').value = selectId;
        } else {
            if (number == 1) {
                document.getElementById('category').value = '';
            } else if (number == 2) {
                document.getElementById('category').value = document.getElementById("searching_category_1").value;
            } else if (number == 3) {
                document.getElementById('category').value = document.getElementById("searching_category_2").value;
            } else {
                document.getElementById('category').value = document.getElementById("searching_category_3").value;
            }
        } 
        if (number < 4) {
            document.getElementById("searching_category_4").style.display = "none";
             if (number < 3) {
                  document.getElementById("searching_category_3").style.display = "none";
                  if (number < 2) {
                      document.getElementById("searching_category_2").style.display = "none";
                  }
            }
        }
        var idtmp = "searching_category_"+(1+number);
        if (selectId) {
             document.getElementById(idtmp).selectedIndex = 0;
             var j = document.getElementById(idtmp).options.length;
             while (j>1) {
                  j--;
                  document.getElementById(idtmp).removeChild(document.getElementById(idtmp).options[j]);
             }

            var ile = 0;

            for (k in SearchingCategory2[selectId]) {
                   k = parseInt(k);
                   if (k > 0) {
                       var t = Searching.addOption(document.getElementById(idtmp));
                       t.id = SearchingCategory2[selectId][k]["id"];
                       t.value = SearchingCategory2[selectId][k]["id"];
                       t.textContent = SearchingCategory2[selectId][k]["name"];
                       t.text = SearchingCategory2[selectId][k]["name"];
                       ile++;
                   }
            }
            if (ile) {
                document.getElementById("searching_category_2").style.display = "";
                if (number < 2) {
                     document.getElementById("searching_category_3").style.display = "none";
                 } else {
                     document.getElementById("searching_category_3").style.display = "";
                }
                if (number < 3) {
                     document.getElementById("searching_category_4").style.display = "none";
                } else {
                    document.getElementById("searching_category_4").style.display = "";
                }   
            } else {
                 document.getElementById(idtmp).style.display = "none";
             }
        }
        Searching.send('category');
    }, 

    addOption: function (p) 
    { 
        var t;
        p.appendChild(t = document.createElement('option'));
        return t;
    },
    
    hideCalendar: function()
    {
        document.getElementById('calendar').innerHTML = '';
        if (document.getElementById('calendar_frame')) {
            document.getElementById('calendar_frame').parentNode.removeChild(document.getElementById('calendar_frame')); 
        }
        document.getElementById('calendar').style.display='none';
    },

	hideselects: function ()
	{
		for (i = 0; i<Searching_hideselectsArray.length; i++) 
		{
			document.getElementById(Searching_hideselectsArray[i]).style.display = 'none';
		}
	
	}
};


function validateDate(obj)
{
}


function Calendar(E, T) {
	var i, j, tBody, Row, od, Do, d, dt, z=0, zeroAllowed=false;
    
	function cEl(t, p, h, cl) {
		p.appendChild(t = document.createElement(t));
		if (h) {
			t.innerHTML = h;
		}
                if (cl) {
                    t.className = cl;
                }
		return t;
	}

	function cB(x, E, T) {
with (IaiCld) {
            if (x == 0) {
                R--;
            } else if (x == 1) {
                R++;
            } else if (x == 2) {
                M--;
                if (M < 0) {
                    M = 11;
                    R--;
                }
            } else if (x == 3) {
                M++;
                if (M > 11) {
                    M = 0;
                    R++;
                }
            }
            od = Date.UTC(R, M, 1);
            Do = Date.UTC(R, M+1, 1);
}
           draw(E, T);
	}

    function draw(E, T)
    {
        while (E.childNodes.length) {
            E.removeChild(E.firstChild); 
        }
        table = cEl('table', E, '', 'calendar_table_header');
        table.cellSpacing = "4";
        table.cellPadding = "0";
        var tBody = cEl('tbody', table);
        tBody.onmouseup = function() {draw(E, T);}
        tBody.onmousemove = function() { 
            if (window.getSelection) {
                window.getSelection().removeAllRanges(); /* FF */
            }
            if (document.selection) {
                document.selection.empty(); /* IE */
            }
        }
                // wiersz z przwijaniem lat
                Row = cEl('tr', tBody);
                var tmp = cEl('td', Row, '', 'calendar_select_year_left').onmousedown = function () {cB(0, E, T);}
                tmp.id = 'calendar_select_year_left';
		cEl('th', Row, IaiCld.R, 'calendar_year');
		var tmp = cEl('td', Row, '', 'calendar_select_year_right').onmousedown = function () {cB(1, E, T);}  
                tmp.id = 'calendar_select_year_right';

                // wiersz z przewijaniem miesiecy
		Row = cEl('tr', tBody);
		var tmp = cEl('td', Row, '', 'calendar_select_month_left').onmousedown= function () {cB(2, E, T);} 
                tmp.id = 'calendar_select_month_left';
		cEl('th', Row, IaiCld.month[IaiCld.M], 'calendar_month');
		var tmp = cEl('td', Row, '', 'calendar_select_month_right').onmousedown = function () {cB(3, E, T);}
                tmp.id = 'calendar_select_month_right';

                var R = IaiCld.R;
                var M = IaiCld.M;
                var selectY = document.getElementById(T.id + "_y").value;
                var selectM = document.getElementById(T.id  + "_m").value-1;
                var selectD = document.getElementById(T.id  + "_d").value;			

                var table2 = cEl('table', E, '', 'calendar_table');
                table2.cellSpacing = "4";
                table2.cellPadding = "0";
		tBody = cEl('tbody', table2);
		Row = cEl('tr', tBody);
		for (i = 0 ; i < 7 ; i++) { 
                    cEl('th', Row, IaiCld.day[i], i==6 ? 'calendar_days_sunday' : 'calendar_days');
                }

		for (i = od ; i < Do ; i += 86400000) {
			with (new Date(i)) {
				d = getUTCDate();
				dt = getUTCDay();
			}
			if (dt == 1 || i == od) {
				Row = cEl('tr',tBody);
			}
			if (dt != 1 && d == 1) {
				for (j = 1 ; j < (dt ? dt : 7); j++) {
					cEl('th',Row);
				}
			}
			dt = cEl('td', Row, d);
			dt.onmousedown = function(x) {

				x=+this.innerHTML;
				with (IaiCld) {
				    a = x;
                                    document.getElementById(T.id + "_y").value = R;
                                    document.getElementById(T.id  + "_m").value =  (x = M + 1) < 10 ? '0' + x : x;
                                    document.getElementById(T.id  + "_d").value = a < 10 ? '0' + a : a;				
                                    document.getElementById(T.id).value = R +  '-' + ((x = M + 1) < 10 ? '0' + x : x) + '-' + (a < 10 ? '0' + a : a)  ;
                                    document.getElementById('calendar').innerHTML = '';
                                    if (document.getElementById('calendar_frame')) {
                                        document.getElementById('calendar_frame').parentNode.removeChild(document.getElementById('calendar_frame'));
                                    }
                                    document.getElementById('calendar').style.display = 'none';
                                    Searching.send(T.id);
			      }
			}

			if (d == selectD && M == selectM && R == selectY) {
			    dt.id="calendar_checked_day";
			} else {
                             dt.className="calendar_normal_day";
                        }
			
		}

		IaiCld.B = 1;
        var valueT = 0, valueL = 0, cont = T;
        do {
            valueT += cont.offsetTop  || 0;
            valueL += cont.offsetLeft || 0;
            cont = cont.offsetParent;
        } while (cont);
        valueL += T.offsetWidth + 2;
        var mh = !!(window.attachEvent && !window.opera) ? 172 : 151; // max height: IE / rest
        if ((valueT + mh) > document.body.offsetHeight) {
            valueT = document.body.offsetHeight - mh;
        }
        //E.style.top = valueT + 'px';
        //E.style.left = valueL + 'px';
	E.style.display = 'block';
    }

   if ((arguments.length >= 3) && arguments[2]) { 
        zeroAllowed = true;
    }
	with (IaiCld) {
    core = T.id;

    R = document.getElementById(core + "_y").value;
    M = document.getElementById(core + "_m").value - 1; 
    D.setFullYear(R, M, document.getElementById(core + "_d").value);
    if ((R <= 0) && (M <= -1)) {
      M = new Date().getMonth();
      R = new Date().getFullYear();
    }
    od = Date.UTC(R, M, 1);
		Do = Date.UTC(R, M + 1, 1);
        var frame;
        document.getElementById("calendar").parentNode.appendChild(frame = document.createElement('iframe'));
        frame.id = 'calendar_frame';
	}
    
    draw(document.getElementById("calendar"), T);
    document.getElementById('calendar').style.display = 'block';
}
IaiCld={
	day: new Array('pn', 'wt', 'śr', 'cz', 'pt', 's', 'n'),
	month: new Array('Styczeń', 'Luty', 'Marzec', 'Kwiecień', 'Maj', 'Czerwiec', 'Lipiec', 'Sierpień', 'Wrzesień', 'Październik', 'Listopad', 'Grudzień'),
	D:new Date(),
	M:new Date().getMonth(),
	R:new Date().getFullYear()
}
/* Detale produktu NOWA KARTA (ostateczna) (mednatur) (projector - projector_details) [57152]*/
// START Z ROZMIAREM CZY NIE (0 - start bez rozmiaru, 1 - z rozmiarem)
var rozmiar_start = 1;

// JEDNOSTKI MIAR PRZY CENIE (0 - tak, 1 -nie)
var unit_start = 1;

// KOSZTY DOSTAWY (0 - tak, 1 -nie)
var delivery_start = 1;


// PODAJ ILOSC (0 - tak, 1 -nie)
var number_start = 0;

// POKAZ ILOSC (0 - tak, 1 -nie)
var amount_start =1;

// POKAZ CENE NETTO (0 - tak, 1 -nie)
var pricenetto_start =1;

var txt_niemastanu = 'Produkt niedostępny';
var txt_status_24 = 'w ciągu 24h';
var txt_status_natychmiast = 'w ciągu 24 godzin';
var txt_days = ' dni'
var txt_za = ' za ';
var txt_taniej = 'Taniej o ';
var txt_oszczedzasz = 'oszczędzasz ';
var txt_wybrany_rozmiar = 'Rozmiar:  ';
var txt_wysylka = '';
var txt_wysylka_za = 'w ciągu ';
var txt_dostepny = 'Dostawa  ';
var txt_dostepny_za = 'Dostawa za ';
var txt_pkt = ' pkt.';
var txt_tylkotel = 'Skontaktuj się ze sprzedawcą';
var txt_niedostepny = 'Produkt niedostępny';
var txt_status_amount_full = 'większa ilość';
var txt_status_amount_null = 'brak w magazynie';
var txt_forpointsonly ='Produkt możesz kupić za punkty';
var txt_forpoints_txt = 'Zaznacz jak chcesz kupić za punkty';
var txt_disable_desc = '<a href=\"contact.php\">Skontaktuj się z nami</a>';
/**
TESTER
*/

function tester()
{
var itemz='';
for(n in selectSizes)
{
		itemz += n + ' - ' + selectSizes[n] + '<br />';
}

var mycode='<div style=\"background:#fff;position:fixed;top:0;right:0;padding:10px;border:1px solid;\">' +itemz +'</div>';

var tester_id = document.getElementById("'tester");
tester_id.innerHTML = mycode;
}


/**
Alert
*/

var Alertek = {

	alert_cover   : '',
	
	getScrollXY : function () {
		  var scrOfX = 0, scrOfY = 0;
		  if( typeof( window.pageYOffset ) == 'number' ) {
		    //Netscape compliant
		    scrOfY = window.pageYOffset;
		    scrOfX = window.pageXOffset;
		  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		    //DOM compliant
		    scrOfY = document.body.scrollTop;
		    scrOfX = document.body.scrollLeft;
		  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		    //IE6 standards compliant mode
		    scrOfY = document.documentElement.scrollTop;
		    scrOfX = document.documentElement.scrollLeft;
		  }
		  return scrOfY;
	},	

	pageHeight : function () {
	var heighter = window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;
	return heighter =  heighter + Alertek.getScrollXY();
	},
	

	
	show_alert : function (txt) {
		Alertek.alert_cover = document.getElementById('alert_cover');
		Alertek.alert_cover.innerHTML = txt;	
		Alertek.alert_cover.style.display='block';

		Alertek.alert_cover.style.top = Alertek.pageHeight() / 2 + 'px';
		Alertek.alert_cover.style.left = ns6? ((Popup.pageSizes()[2] / 2) - (Alertek.alert_cover.clientWidth / 2)) + "px" : ((Popup.pageSizes()[2] / 2) - (Alertek.alert_cover.clientWidth / 2)) + "px";
	
	if (navigator.appVersion.indexOf("MSIE")!=-1){
		temp=navigator.appVersion.split("MSIE");
		ver_brow=parseFloat(temp[1]);

				if (ver_brow<7.0) {
				 Alertek.alert_cover.style.left = (document.body.clientWidth / 2) - (Alertek.alert_cover.clientWidth /2 ) + 'px';
				 }
				if (ver_brow==7.0)
				 {
				 Alertek.alert_cover.style.top = (document.body.clientHeight / 2) - (Alertek.alert_cover.clientHeight) + 'px';
				 Alertek.alert_cover.style.left = (document.body.clientWidth / 2) - (Alertek.alert_cover.clientWidth /2 ) + 'px';
				 }
		 }	
		 
	setTimeout('Alertek.hide_alert()', 3000);		 
	
	},
	
	hide_alert : function () {	
		Alertek.alert_cover = document.getElementById('alert_cover');
		Alertek.alert_cover.style.display='none';
	} 	

}

/**
  Projector
*/


var Projector = {
	displayed   : '',
	price_cont  : '',
	phoneprice_cont   :  '',
	sizes_cont  : '',	
	sizes_cont_onesize  : '',		
	price_cont_yousave  : '',	
	proj_btn    : '',
	proj_img_cover_sub    : '',		
	proj_status_gfx    : '',	
	proj_status_desc    : '',	
	forpoints_check	   : '',
	status_amount    : '',
	msg_alert : '',
	temp  : '',
	
	//START  ZEROWY
	start_zero : function () {

	if(zm1 == '1') 
	{
		if(zm2 == 'onesize')
		{
			Projector.start('onesize','onesize');
		}
		else
		{
			Projector.start(zm2);
			Projector.menus('sizes_menu_list',0,zm3);			
		}

	}
	else
	{
		if(rozmiar_start == 0 && zm1 != '1')
		{
			Projector.start();
		}
		else
		{
			Projector.start(zm2);
			Projector.menus('sizes_menu_list',0,zm3);
		}
	}


	},
		
	
	start : function (rozm, onesize) {
	
	// CHECKING IF XML TRUE
	var itnum=0;
	for(n in selectSizes)
	{
			itnum++;
	}
	if(itnum == 0) 
	{
		document.getElementById('projector_ALL_component').style.display = 'none';
		Alertek.show_alert('XML ERROR ' + itnum);
		return false;
		
	}
	
	// DEFINICJA WSZYTSKICH ELEMENTOW DO UZYTKU POZNIEJ
	Projector.sizes_cont_onesize = document.getElementById('projector_sizes_cont_onesize');
	Projector.sizes_cont = document.getElementById('projector_sizes_cont');
	Projector.proj_status_cont = document.getElementById('projector_status_cont');
	Projector.proj_status_gfx = document.getElementById('projector_status_gfx');
	Projector.proj_status_gfx_cont = document.getElementById('projector_status_gfx_cont');
	Projector.proj_status_desc = document.getElementById('projector_status_description');
	Projector.proj_status_desc_title = document.getElementById('projector_status_description_title');
	Projector.proj_status_desc2 = document.getElementById('projector_status_description2');	
	Projector.price_cont = document.getElementById('projector_price_cont');
	Projector.price_maxprice = document.getElementById('projector_status_maxprice');
	Projector.price_cont_yousave = document.getElementById('projector_price_cont_yousave');		
	Projector.phoneprice_cont = document.getElementById('projector_phoneprice_cont');
	Projector.forpoints_cont = document.getElementById('projector_forpoints');
	Projector.forpoints_check = document.getElementById('forpoints_check');	
	Projector.pricepoints_sub = document.getElementById('projector_pricepoints_cont');	
	Projector.pricepoints_value = document.getElementById('projector_pricepoints_cont_value');	
	Projector.delivery_sub = document.getElementById('projector_delivery_cont');	
	Projector.delivery_value = document.getElementById('projector_delivery_cont_value');	
	Projector.deliveryfree = document.getElementById('projector_deliveryfree_cont');
	Projector.number_sub = document.getElementById('projector_number_cont');	
	Projector.number_value = document.getElementById('projector_number_value');		
	Projector.amount_sub = document.getElementById('projector_amount_cont');	
	Projector.amount_value = document.getElementById('projector_amount_cont_value');	
	Projector.pricenetto_sub = document.getElementById('projector_pricenetto_cont');	
	Projector.pricenetto_value = document.getElementById('projector_pricenetto_cont_value');	
	
	
		// UZUPELNIENIE FORMUALRZA 
		document.getElementById('form_projector').size.value = rozm;
	
		// ZMIANA OSZCZEDZASZ NA STARCIE
		if(projector_first_price[4] != '' && projector_first_price[5] != '')
		{
			Projector.price_cont_yousave.innerHTML = txt_taniej + projector_first_price[5] + '%, '+ txt_oszczedzasz + projector_first_price[4] + projector_currency;	
		}	
	
	
		// ZMIANA PROMOCJI NA STARCIE
		if(projector_first_price[2] != '') 
		{
			Projector.price_maxprice.innerHTML = projector_first_price[2] + projector_currency;
		}
		
		// ZMIANA CENY NA STARCIE	
		if(projector_first_price[0] == projector_first_price[1] && projector_first_price[0] != 0)
		{
		
				// ZMIANA CENA NETTO NA STARCIE
				if(pricenetto_start == '0' && projector_pricenetto != '') 
				{
					Projector.pricenetto_sub.style.display = "block";
					Projector.pricenetto_value.innerHTML = projector_pricenetto + projector_currency;
				}	
				else
				{
					Projector.pricenetto_sub.style.display = "none";		
				}
				
			Projector.phoneprice_cont.style.display = 'none';		
			Projector.price_cont.innerHTML = projector_first_price[0] + projector_currency;		
		}
		else
		{
			if(projector_first_price[0] != projector_first_price[1] && projector_first_price[0] != 0)
			{
			
				Projector.price_cont.innerHTML = projector_first_price[0] + '-' +projector_first_price[1] + projector_currency;	
			}		
			if(projector_first_price[0] == 0)
			{
				Projector.price_cont.style.display = 'none';
				Projector.phoneprice_cont.style.display = 'block';
			}
		}
		
		//JEDNOSTKA MIARY
		if(projector_unit != '' && unit_start == '0')
		{
			Projector.price_cont.innerHTML += " / " + projector_unit;
		}		
	
		if(rozm) Projector.status_change(rozm, onesize);

		
	},		
	
	
	status_change : function (rozm, onesize) {
	
	// ZMIENNE
	var status_price = selectSizes[rozm][0];
	var status_price_netto = selectSizes[rozm][1];
	var status_price_yousavepercent = selectSizes[rozm][2];
	var status_price_yousave = selectSizes[rozm][3];
	var status_price_maxprice = selectSizes[rozm][4];	
	var status_status = selectSizes[rozm][5];	
	var status_devilery_days = selectSizes[rozm][6];
	var status_desc = selectSizes[rozm][7];
	var status_desc_tel = selectSizes[rozm][8];
	var status_gfx_src = selectSizes[rozm][9];	
	var status_name = selectSizes[rozm][10];	
	var status_phoneprice = selectSizes[rozm][11];	
	var status_forpoints = selectSizes[rozm][12];	
	var status_points = selectSizes[rozm][13];	
	var status_delivery = selectSizes[rozm][14];	
	
	Projector.status_amount = selectSizes[rozm][15];	
	var status_gfx_tel = selectSizes[rozm][16];		
	
	//PODMIANA GRAFIKI  ORAZ TXT CENA NA TEL IF EXIST
	if(status_gfx_tel != '' || status_desc_tel != '')
	{
		if(status_gfx_tel != '')
		{
			Projector.phoneprice_cont.innerHTML = '<img id=\"projector_gfx_phoneprice\" src=\"blank.gif\" alt=\"' + status_desc_tel + '\"/>';
			document.getElementById('projector_gfx_phoneprice').src = status_gfx_tel;
		}
		else if(status_desc_tel != '')
		{
			Projector.phoneprice_cont.innerHTML = status_desc_tel;
		}		
	}

	
	//PUNKTY JEZELI ZALOGWANY
	if(status_forpoints == 'true' && status_status != 'disabled')
	{
		Projector.forpoints_cont.style.display = "block";
	}
	else
	{
		Projector.forpoints_cont.style.display = "none";	
	}
	
	//PUNKTY - WYSWEILERNIE
	if(status_points != '')
	{
		Projector.pricepoints_sub.style.display = "block";
		Projector.pricepoints_value.innerHTML = status_points + txt_pkt;
	}
	else
	{
		Projector.pricepoints_sub.style.display = "none";	
	}
	
	//ILOSC - WYSWIETLENIE
	if(Projector.status_amount != '' && amount_start == '0')
	{
		Projector.amount_sub.style.display = "block";
		if(Projector.status_amount == '0')
		{
			Projector.amount_value.innerHTML = txt_status_amount_null;
		}
		if(Projector.status_amount == '-1')
		{
			Projector.amount_value.innerHTML = txt_status_amount_full;
		}	
		if(parseInt(Projector.status_amount) > 0)
		{
			Projector.amount_value.innerHTML = Projector.status_amount;
		}
	}
	else
	{
		Projector.amount_sub.style.display = "none";	
	}		
	
	//KOSZTY DOSTAWY
	if(status_delivery != '' && delivery_start == '0')
	{
		if(parseInt(status_delivery) > 0)
		{
			Projector.deliveryfree.style.display = "none";		
			Projector.delivery_sub.style.display = "block";
			Projector.delivery_value.innerHTML = status_delivery + projector_currency;
		}
		else
		{
			Projector.delivery_sub.style.display = "none";
			Projector.deliveryfree.style.display = "block";	
		}
	}
	else
	{
		Projector.pricepoints_sub.style.display = "none";	
	}	
	
	//PODAWANIE ILOSCI - WIDOCZNOSC
	if(number_start == '0' && status_status != 'disable')
	{
		Projector.number_sub.style.display = "block";
		Projector.number_value.value = 1;
	}
	else
	{
		Projector.number_sub.style.display = "none";	
	}		


	// UKRYCIE WIDOCZNOSCI SELECTA IF ONESIZE ORAZ WYPISANIE JEDNEGO ROZMIARU JEZELI ROZNY OD ONESIZE
	if(onesize == 'onesize')	
	{	
		if(rozm != 'onesize')
		{
			Projector.sizes_cont_onesize.style.display='block';	
			Projector.sizes_cont_onesize.firstChild.innerHTML = txt_wybrany_rozmiar + status_name;		
		}
		Projector.sizes_cont.style.display='none';
	}
	else
	{
		Projector.sizes_cont.style.display='block';	
	}	
	
	// WLACZENIE WIDOCZNOSCI CONTENERA STATUSU
	Projector.proj_status_cont.style.display = 'block';
	
	
	// ZMIANA CENY
	if(status_price_maxprice != '') 
	{
		Projector.price_maxprice.innerHTML = status_price_maxprice + projector_currency;
	}
	
	if(status_phoneprice == 'true')
	{

		Projector.price_cont.style.display = 'none';		
		Projector.phoneprice_cont.style.display = 'block';	
	}
	else
	{
		Projector.price_cont.style.display = 'block';		
		Projector.phoneprice_cont.style.display = 'none';
		Projector.price_cont.innerHTML = status_price + projector_currency;		
	}
	
	// ZMIANA CENA NETTO
	if(pricenetto_start == '0' && status_price_netto != '' && status_phoneprice != 'true') 
	{
		Projector.pricenetto_sub.style.display = "block";
		Projector.pricenetto_value.innerHTML = status_price_netto + projector_currency;
	}	
	else
	{
		Projector.pricenetto_sub.style.display = "none";		
	}	

	//JEDNOSTKA MIARY
	if(projector_unit != '' && unit_start == '0')
	{
		Projector.price_cont.innerHTML += " / " + projector_unit;
	}
	
	// ZMIANA OSZCZEDZASZ
	if(status_price_yousavepercent != '' && status_price_yousave != '')
	{
		Projector.price_cont_yousave.innerHTML = txt_taniej + status_price_yousavepercent + '%, '+ txt_oszczedzasz + status_price_yousave + projector_currency;	
	}
		
	// ZMIANA GRAFIKI STATUSU
	if(status_gfx_src != '')
	{
		Projector.proj_status_gfx_cont.style.display = "block";
		Projector.proj_status_gfx.innerHTML = '<img src=\"blank.gif\" />';
		status_imageObj = new Image();
		status_imageObj.src = status_gfx_src;
		Projector.proj_status_gfx.firstChild.src = status_gfx_src;
	}
	else
	{
		Projector.proj_status_gfx_cont.style.display = "none";	
	}

	// ZMIANA TXT STATUSU I DNI
	Projector.proj_status_desc.innerHTML ='';
	Projector.proj_status_desc_title.style.display = "block";	
	
	if(status_status == 'enable' || status_status == 'order')
	{
		if(status_desc != '')
		{	
			Projector.proj_status_desc.innerHTML = status_desc;	
		}		
	}
	
	if(status_status == 'disable')
	{
		if(status_desc != '')
		{	
			Projector.proj_status_desc.innerHTML = status_desc;	
			if(status_devilery_days != '')
			{
			
				if(status_devilery_days == '0')
				{
					Projector.proj_status_desc.innerHTML += txt_status_natychmiast;
				}
				if(status_devilery_days == '1')
				{
					Projector.proj_status_desc.innerHTML += txt_za + txt_status_24;
				}	
				if(status_devilery_days > '1')
				{
					Projector.proj_status_desc.innerHTML += txt_za + status_devilery_days + txt_days;
				}				
			}
		}	
		else
		{
			Projector.proj_status_desc.innerHTML += txt_disable_desc;			
		}
		Projector.proj_status_desc_title.style.display = "none";
	
		
	}
	
	//TXT DOSTAWY np. DOSTAWA ZA 2 DNI
	if(status_status == 'enable' || status_status == 'order' && status_devilery_days != '')
	{	
		Projector.proj_status_desc2.innerHTML = Projector.fun_delivery_days(status_devilery_days, status_status);
	}
	
	// AKTYWACJA LUB NIE BUTTONA DODAJ DO KOSZYKA  i ULUBIONYCH
	Projector.button_act(status_status, status_phoneprice, status_forpoints);
	
	
	},	
	
	// FUNKCJA ZWRACAJACA TXT WYSYLKI X DNI
	fun_delivery_days : function (days,status) {
		var rezult;
		
		if(status == 'disable' && days != '' && parseInt(days) > 1)
		{
			rezult = txt_dostepny_za;
		}
		else if(status == 'disable' && days != '' && parseInt(days) <= 1)
		{
			rezult = txt_dostepny;
		}
		else
		{
			rezult = '';
		}
		
		if(status == 'enable' || status == 'order')
		{
			if(days != '' && parseInt(days) > 1)
			{
				rezult = txt_wysylka_za;
			}
			if(days != '' && parseInt(days) <= 1)
			{
				rezult = txt_wysylka;
			}			
		}		
	
			
			if(days == '0')
			{
				rezult += txt_status_natychmiast;
			}
			if(days == '1')
			{
				rezult += txt_status_24;
			}	
			if(days > '1')
			{
				rezult += days + txt_days;
			}	
		
		return rezult;
	},
	
	imagerotate : function (id) {
		if (Projector.displayed == '') {
			document.getElementById('img_1').style.display = 'none';
		} 
	   else {
	       document.getElementById(Projector.displayed).style.display = 'none';
	   }
	   document.getElementById(id).style.display = '';
	   Projector.displayed = id;
	},
	
	button_act : function (status, phone, points) {

		Projector.forpoints_cont.removeAttribute("onclick");	

		if(status == 'disable' || phone == 'true')
		{		

			Projector.button_deact(txt_niedostepny);
			
			if(phone != '' && phone == 'true')
			{
				Projector.button_deact(txt_tylkotel);
			}
			if(points != '')
			{
				
				if(points == 'true' && phone == 'true') 
				{
					Projector.forpoints_check.disabled = 'disabled';	
					Projector.forpoints_check.checked = true;
					msg_alert = txt_forpointsonly;
					Projector.forpoints_cont.onclick = Projector.onclicker_3;	
					
					Projector.proj_btn = document.getElementById('projector_button_basket');
					Projector.proj_btn.style.cursor ='pointer';
					Projector.proj_btn.onclick = Projector.onclicker_1;						

				}
				else
				{
					Projector.button_deact(txt_tylkotel);
				}
			}
		}
		else
		{
			Projector.forpoints_check.disabled = '';
			Projector.forpoints_check.checked = false;	
			msg_alert = txt_forpoints_txt;
			Projector.forpoints_cont.removeAttribute("onclick");
			
			Projector.proj_btn = document.getElementById('projector_button_basket');
			Projector.proj_btn.style.cursor ='pointer';
			Projector.proj_btn.onclick = Projector.onclicker_1;
		
		}
			// DLA OBSERVE
			var zo = "document.getElementById('iemode').value=2;document.getElementById('form_projector').submit();";
			Projector.proj_btn_observe = document.getElementById('projector_button_observe');	
			Projector.proj_btn_observe.style.cursor ='pointer';		
			Projector.proj_btn_observe.onclick = Projector.onclicker_2;			

		
	},
	
	onclicker_false : function()
	{
		return false;
	},	
	
	onclicker_1 : function()
	{
		document.getElementById('iemode').value=1;
		document.getElementById('form_projector').submit();
	},
	
	onclicker_2 : function()
	{
		document.getElementById('iemode').value=2;
		document.getElementById('form_projector').submit();
	},	
	
	onclicker_3 : function()
	{
		Alertek.show_alert(msg_alert);
		return false;
	},		
	
	button_deact : function (msg) {
		
		msg_alert = msg;
		Projector.proj_btn = document.getElementById('projector_button_basket');
		Projector.proj_btn.style.cursor ='not-allowed';
		Projector.proj_btn.onclick = Projector.onclicker_3;	
	},	
	
	if_isanumber  : function(test)
	{
			if(test.match("^[1-9]{1}[0-9]{0,9}$") || test ==''){
				return test;
			}else
			{
				test = test.substring(0, test.length-1);
				return test;
			}	
	
	},
	
	number_check  : function()
	{
	
		Projector.number_value.value = Projector.if_isanumber(Projector.number_value.value);
		
		if(Projector.number_value.value >= parseInt(Projector.status_amount) && isFinite(Projector.status_amount) && Projector.status_amount != '-1')
		{
			Projector.number_value.value = parseInt(Projector.status_amount);
		}
		else
		{
			return false;	
		}
	},
	
	number_up  : function()
	{
		if(isNaN(parseInt(Projector.number_value.value))) Projector.number_value.value = 1;
		if(Projector.number_value.value >= parseInt(Projector.status_amount) && isFinite(Projector.status_amount) && Projector.status_amount != '-1')
		{
			return false;
		}
		else
		{
			Projector.number_value.value = parseInt(Projector.number_value.value) + 1;		
		}
	},
	
	number_down  : function()
	{
		if(isNaN(parseInt(Projector.number_value.value))) Projector.number_value.value = 1;
		if(Projector.number_value.value > 1)
		{
			Projector.number_value.value = parseInt(Projector.number_value.value) - 1;
		}
	},	
	
	onmouseover_img : function()
	{
		this.style.display = 'none';
	},		
	
	
	img_cover : function (id) {
	
		/*Projector.proj_img_cover_sub = document.getElementById('projector_img_cover_sub');		
		if(Projector.proj_img_cover_sub.style.display == 'block')
		{
			Projector.proj_img_cover_sub.style.display = 'none';	
		}
		else
		{
			Projector.proj_img_cover_sub.style.display = 'block';	
		}
		if(id != 'null')
		{
			temp = id.getAttribute("onclick");		
			Projector.proj_img_cover_sub.onmouseover = Projector.onmouseover_img;
			Projector.proj_img_cover_sub.style.top = id.firstChild.clientHeight / 2 - 10 + 'px';
			//alert(id.firstChild.clientWidth + ' ---- ' +Projector.proj_img_cover_sub.clientWidth);
			Projector.proj_img_cover_sub.style.left = (id.firstChild.clientWidth  / 2) - (Projector.proj_img_cover_sub.clientWidth / 2) + 'px';		
		} */
	},
	
	menus : function (menu,switc, name) { 

		if(switc==1)
		{
			if(document.getElementById(menu))document.getElementById(menu).style.display='block';
		}
		else
		{
			if(document.getElementById(menu))document.getElementById(menu).style.display='none';	
			
			if (name != 0)
			{

					if(document.getElementById('results_size_lista'))document.getElementById('results_size_lista').innerHTML=name;	
					if(document.getElementById('bok_results_size'))document.getElementById('bok_results_size').innerHTML=name;	
			}
		}
	},
	
	forpoints : function () { 
		if(Projector.forpoints_cont)
		{
			if(Projector.forpoints_cont.className == 'n53486_points')
			{
				Projector.forpoints_cont.className = 'n53486_points_active'
			}
			else
			{
				Projector.forpoints_cont.className = 'n53486_points'
			}			
		
		
		}
		
	}
		
}


/**
  Popup _ NOWA GALERIA
*/

var ns6=document.getElementById&&!document.all;
var ie=document.all;
var html = document.getElementsByTagName("html");
var Popup = {
        url :'http://' + location.host,
	link   : '',
	width  : 0,
	height : 0,
        loaded : 0,
	show : function (link,x,y) {
		Popup.link = link;
		Popup.width = x;
		Popup.height = y;
        Popup.loaded = 1;
		if (document.getElementById('big_photo')) {
			document.getElementById('big_photo').style.display = "none";
			document.getElementById('big_photo').src = Popup.link;
		}
		if (basecount < 2 || !basecount) {
			document.getElementById('popup_next_prev').style.visibility = "hidden";
		}
		var edit = document.getElementById('show_popup_photo_sub');		
        edit.style.width = parseInt(x) + "px";
        edit.style.height = parseInt(y) + "px";			
		
		if (!ns6) {Popup.hideSelects(1);}
		Popup.creatLayers();
	},
    reload : function () {
              if (Popup.loaded) {
                     Popup.resize(Popup.link,Popup.width,Popup.height);
              }
        },
    next_img : function () {
		Popup.link = document.getElementById('big_photo').src;
                if(Popup.link.indexOf(Popup.url) != '-1') Popup.link= Popup.link.substr(Popup.url.length+1,Popup.link.length);
	        for(n=1; n <= basecount; n++)
			{
				if(Popup_enclosures[n][0] == Popup.link) {
				    n++;
					if(n <= basecount){
						Popup.resize(Popup_enclosures[n][0], Popup_enclosures[n][1],Popup_enclosures[n][2]);
						Popup.link = Popup_enclosures[n][0];
						return false;
					}
					else
					{
						Popup.resize(Popup_enclosures[1][0], Popup_enclosures[1][1],Popup_enclosures[1][2]);
						Popup.link = Popup_enclosures[1][0];
						return false;
					}
				}
			} 

           
        },		
    prev_img : function () {
		Popup.link = document.getElementById('big_photo').src;	
                if(Popup.link.indexOf(Popup.url) != '-1') Popup.link= Popup.link.substr(Popup.url.length+1,Popup.link.length);
	        for(n=basecount; n <= basecount; n--)
			{

				if(Popup_enclosures[n][0] == Popup.link) {
					n--;
					if(n >= 1){
						Popup.resize(Popup_enclosures[n][0], Popup_enclosures[n][1],Popup_enclosures[n][2]);
						Popup.link = Popup_enclosures[n][0];
						return false;
					}
					else
					{
						Popup.resize(Popup_enclosures[basecount][0], Popup_enclosures[basecount][1],Popup_enclosures[basecount][2]);
						Popup.link = Popup_enclosures[basecount][0];
						return false;
					}					
				}
			}
            
        },			
	resize : function (sciezka, width, height) {
		document.getElementById('big_photo').style.display='none';		
		var edit = document.getElementById('show_popup_photo_sub');
		var edit2 = document.getElementById('show_popup_photo');		
        document.getElementById('big_photo').src = sciezka;
        edit.style.width = parseInt(width) + "px";
        edit2.style.width = parseInt(width) + "px";		
        edit.style.height = parseInt(height) + "px";		
		edit2.style.left = ns6? (Popup.pageSizes()[2] - (edit2.clientWidth + 10))/2 + html[0].scrollLeft +"px" : (Popup.pageSizes()[2] - (edit2.clientWidth + 10))/2 + "px";		

	},
	hide : function () {
		var edit = document.getElementById('show_popup_photo');
        var edit_close = document.getElementById('show_popup_photo_close');
		var cover = document.getElementById('cover');
		edit.style.display = "none";
        edit_close.style.display = "none";
		cover.style.display = "none";
        Popup.loaded = 0;
		if (!ns6) {Popup.hideSelects(0);}
	},
	cover : function (wartosc) {
		var cover = document.getElementById('cover');
	    ns6? cover.style.opacity = '.' + wartosc  :  cover.style.filter = "alpha(Opacity=" +wartosc+")";
	    if (window.opera) {
			cover.style.opacity = '.' + wartosc;
		}
	},	
	creatLayers : function () {


var edit = document.getElementById('show_popup_photo');
var edit_close = document.getElementById('show_popup_photo_close');
		edit.style.position = 'absolute';
	    edit.style.display = "block";
	    edit_close.style.display = "block";
		edit.style.width = (Popup.width) + "px";
	    edit.style.left = ns6? (Popup.pageSizes()[2] - (Popup.width + 10))/2 + html[0].scrollLeft +"px" : (Popup.pageSizes()[2] - (Popup.width + 10))/2 + "px";

var ver_brow=0;
if (navigator.appVersion.indexOf("MSIE")!=-1){
temp=navigator.appVersion.split("MSIE");
ver_brow=parseFloat(temp[1]);

if (ver_brow<7.0)
 {
edit.style.top = ((((Popup.pageSizes()[3] - (Popup.height + 10))/2) - 100  + document.body.scrollTop) < 0) ? "50px" : (((Popup.pageSizes()[3] - (Popup.height + 10))/2) - 100  + document.body.scrollTop + 50) + "px";
          }
else
{
edit.style.top = ((((Popup.pageSizes()[3] - (Popup.height + 10))/2) - 100  + html[0].scrollTop) < 0) ? "50px" : (((Popup.pageSizes()[3] - (Popup.height + 10))/2) - 100  + html[0].scrollTop + 50) + "px";
}
}
            else
{
edit.style.top = ((((Popup.pageSizes()[3] - (Popup.height + 10))/2) - 100  + html[0].scrollTop) < 0) ? "50px" : (((Popup.pageSizes()[3] - (Popup.height + 10))/2) - 100  + html[0].scrollTop + 50) + "px";
}



        edit.style.zIndex = 1000;
		edit.style.Background = '#FFFFFF';

	    //'cover'- div do blokowania elementow innych niz edit
	    var cover = document.getElementById('cover');
	    cover.style.display = "block";
        cover.style.position = "absolute";
	    cover.style.zIndex = 900;
	    ns6? cover.style.opacity = .5 :  cover.style.filter = "alpha(Opacity=50)";
	    if (window.opera) {
			cover.style.opacity = .5;
		}
		cover.style.left = "0px";
	    cover.style.top = "0px";
            offsetX = 0;
            if (!ns6 && !window.opera) {
                  offsetX = 20;
            }
	    cover.style.width = ns6? (Popup.pageSizes()[0] - 16) + "px" : Popup.pageSizes()[0] - offsetX + "px"; //ns6? html[0].offsetWidth +"px" : document.body.offsetWidth + "px";
	    cover.style.height = Popup.pageSizes()[1] + "px" //ns6? html[0].offsetHeight +"px" : document.body.offsetHeight + "px";
	},
	pageSizes : function () {
		var xScroll, yScroll;
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else {
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		var windowWidth, windowHeight;
		if (self.innerHeight) {
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) {
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
		if(xScroll < windowWidth){	
			pageWidth = windowWidth;
		} else {
			pageWidth = xScroll;
		}
		arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
		return arrayPageSize;
	},
	hideSelects : function (flag) {
		var selects = document.getElementsByTagName('SELECT');
		if (flag == 1) {
			for (i = 0; i < selects.length; i++) {
				selects[i].style.display = 'none';
			}
		} else {
			for (i = 0; i < selects.length; i++) {
				selects[i].style.display = '';
			}
		}
	}
}
window.onresize = function() {if (Popup.loaded == 1) {Popup.reload();}}
/* <span style="color:blue;font-weight:bold;">ZALECANY</span> Wybór płatność  - Formularz (order-newpayment - newpayment_form) [53474]*/

function orderpayment(id) {

document.getElementById('idle_payment').style.display = 'none';
    allDivs = document.getElementsByTagName("div");

    for (i = 0; i < allDivs.length; i++) {
        if ((/^newpayment_form_/).test(allDivs[i].id) == true) {
            allDivs[i].style.display = 'none';
        }
    }

    if (document.getElementById('newpayment_form_'+id) ) {
        document.getElementById('newpayment_form_'+id).style.display = 'block';
    }
}
/* Nagłówek Mednatur nowy (layout_top - menu_top) [54335]*/

function search_blur(x) {
         if (x.value == '') {
                 x.value = searchtxt;
         }
}
function search_focus(x) {
         if (x.value != '') {
                 x.value = '';
         }
}
/* <span style="color:blue;font-weight:bold;">ZALECANY</span> Javascript (layout_top - menu_javascript) [56297]*/

var IAI_Ajax={
    cO: function()
    {
        var r;
        try {
            r=new ActiveXObject("Msxml2.XMLHTTP");
        } catch(e) {
            try {
                r=new ActiveXObject("Microsoft.XMLHTTP");
            } catch(oc) {
                r=null;
            }
        }
        if (!r&&typeof XMLHttpRequest!="undefined") {
            r=new XMLHttpRequest();
        }
        return r;
    },

    Request: function(url, pd, fun)
    {
        var x;
        x=IAI_Ajax.cO();

        x.open("POST",url,true);
        x.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        x.setRequestHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");
        x.setRequestHeader("X-IAI-Version", "1.0");
        
        x.onreadystatechange=function()
        {
            if (x.readyState == 4) {
                if (x.status >= 200 && x.status < 300) {
                    if (fun) {
                        if (fun.onSuccess) {
                            if (fun.arg) {
                                eval(fun.onSuccess+'(\'' +x.responseText+ '\', \''+fun.arg+'\');');
                            } else {
                                eval(fun.onSuccess+'(\'' +x.responseText+ '\');');
                            }
                        }
                    }
                } else {
                    // narazie brak
                }
            }
        }
        x.send(pd);
        delete x;
    }
}
/* Ukrywacz bez img - na grafice tła dla mednatur (projector - projector_components_hiding) [53944]*/

var components = new Array("component_projector_longdescription","component_projector_opinions","component_projector_addopinions","component_projector_photos","component_projector_incategory","component_projector_suggestproduct","component_projector_askforproduct");

var components2 = new Array("component_projector_ordered","component_projector_associated");


function showButtons()
{
    var i = 0;
    var activeButtons = components.length;
    for (i = 0; i < components.length; i++) {
        if (document.getElementById(components[i])) {
            document.getElementById('projector_components_hidding').style.display = 'block';
            if (document.getElementById('hide_'+components[i])) {
                document.getElementById('hide_'+components[i]).style.display = 'block';
            }
        }
   if (document.getElementById(components2[i])) {
            document.getElementById('projector_components_hidding2').style.display = 'block';
            if (document.getElementById('hide_'+components2[i])) {
                document.getElementById('hide_'+components2[i]).style.display = 'block';
            }
        }
    }
    setTimeout("showButtons()", 2000);
}


function components_hidding(component)
{

showed = 'hide_' + component;
 for (i = 0; i < components.length; i++) {
        if (document.getElementById(components[i])) {
            if (document.getElementById('hide_'+components[i])) {
                document.getElementById('hide_'+components[i]).className = 'hide_'+components[i];
            }
        }
    }
document.getElementById(showed).className=showed+'2';

    if (document.getElementById(component) ) {
        for (i = 0; i < components.length; i++) {
            if (document.getElementById(components[i]) ) {
                document.getElementById(components[i]).style.display = 'none';
            }
        }
        document.getElementById(component).style.display = 'block';
    }
}


function components_hidding2(component)
{

showed = 'hide_' + component;
 for (i = 0; i < components2.length; i++) {
        if (document.getElementById(components2[i])) {
            if (document.getElementById('hide_'+components2[i])) {
                document.getElementById('hide_'+components2[i]).className = 'hide_'+components2[i];
            }
        }
    }
document.getElementById(showed).className=showed+'2';

    if (document.getElementById(component) ) {
        for (i = 0; i < components2.length; i++) {
            if (document.getElementById(components2[i]) ) {
                document.getElementById(components2[i]).style.display = 'none';
            }
        }
        document.getElementById(component).style.display = 'block';
    }
}

showButtons();
/* Długi opis HTML ver 3.0 (projector - projector_longdescription) [53383]*/

function menu_prod(show)
{
	i = 1;
            while(document.getElementById('menu_prod' + i)) {
	    document.getElementById('menu_prod'+i).style.display = 'none';
		document.getElementById('menu_item'+i).className = 'menu_prod_idle';
	    i++;
	    }
		
		document.getElementById('menu_prod'+show).style.display='block';
		document.getElementById('menu_item'+show).className = 'menu_prod_active';
		
}
/* <b style="font-size:12px;color:red; text-decoration:blink">&gt;</b>Formularz newslettera 3.5 [jeden przycisk dodaj] (layout_left - menu_newsletter) [53936]*/
var letatxt = 'Wpisz adres e-mail';
function leta_blur(x) {
         if (x.value == '') {
                 x.value = letatxt;
         }
}
function leta_focus(x) {
         if (x.value == letatxt) {
                 x.value = '';
         }
}
/* Formularz kontaktu z tematem input (contact - contact_mailform) [50201]*/

if (typeof(newstxt) == "undefined") {
var alert_txt = 'Nie podano żadnego adresu e-mail.';
} 

function checkOnSubmit()
{
    if ((/^[0-9a-zA-Z._\-]+\@[0-9a-zA-Z._\-]+\.[0-9a-zA-Z]+$/).test(document.getElementById("from").value) == false || document.getElementById("from").value.length == 0){
        alert(alert_txt);
        return false;
    }
    return true;
}
/* Newsletter (contact - contact_newsletter) [44013]*/

if (typeof(newstxt) == "undefined") {

} 




function newsletter_blur(x) {
         if (x.value == '') {
                 x.value = contact_newstxt;
         }
}
function newsletter_focus(x) {
         if (x.value == contact_newstxt) {
                 x.value = '';
         }
}
/* Zadaj pytanie o produkt 3.0 (projector - projector_askforproduct) [53316]*/

function askforproduct()
{
    if (document.getElementById("askforproduct_email") ) {
        if ((/^[0-9a-zA-Z.-_]+@[0-9a-zA-Z.-_]+.[0-9a-zA-Z]+$/).test(document.getElementById("askforproduct_email").value) == false || document.getElementById("email").value.length == 0){
            alert('Nie wpisałeś poprawnie adresu e-mail na który mielibyśmy wysłać Ci odpowiedź.');
            return false;
        } else {
            return true;
        }
    }
}
function hideaskforproduct()
{
    if (document.getElementById('projector_askforproduct_table').style.display == 'none') {
        document.getElementById('projector_askforproduct_table').style.display = 'block';
    } else {
        document.getElementById('projector_askforproduct_table').style.display = 'none';
    }
}
/* Opinie BEZ FORMULARZA dla mednatur (projector - projector_opinions) [53946]*/

var x;

function showOpinion(id)
{
    element = document.getElementById(id);
    element.style.display='block';
}

function hideOpinion(id)
{
    element = document.getElementById(id);
    element.style.display='none';
}