//ł

var wymiary_okna = wymiary_okna();

function galeria_to_center()
{
var koszyk_w = new String()
var koszyk_h = new String()
koszyk_w=document.getElementById('foto_galeria').style.width
koszyk_h=document.getElementById('foto_galeria').style.height
koszyk_w=koszyk_w.substring(0, (koszyk_w.length-2))
koszyk_h=koszyk_h.substring(0, (koszyk_h.length-2))
var koszyk_x=Math.round(wymiary_okna['width']/2) - (koszyk_w/2) +'px'
var koszyk_y=Math.round(wymiary_okna['height']/2) - (koszyk_h/2) + 'px'

document.getElementById('foto_galeria').style.left=koszyk_x
document.getElementById('foto_galeria').style.top='20%'
}

function wymiary_okna()
{
 var viewportwidth;
 var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }

var okno = new Array() 
okno['width']=viewportwidth
okno['height']=viewportheight

return okno
}

function show_hide(element) 
{
if(document.getElementById(element).style.display=='block')
document.getElementById(element).style.display='none'
else
document.getElementById(element).style.display='block'
}


function przechwyc_enter(e) {
    var kod = (window.event) ? window.event.keyCode : e.which    
    kod==13 ? document.getElementById('loguj').click() : void(0)
}

function strona_nieaktywna(off)
{
document.getElementById('alert').style.display='block'
if(off)
document.getElementById('alert').style.display='none'
}

function czysc_komunikat()
{
document.getElementById('komunikat').innerHTML=''
}

function adres_dostawy()
{
if(document.getElementById('adres_dostawy'))
  {if(document.getElementById('adres_dostawy'))
    {
    var out='&adres_dostawy='+document.getElementById('adres_dostawy').value
    return out
	}
  }
}


function row_high_light_2(id, off)
{
if(!off)
{
document.getElementById(id).style.backgroundColor="#faf6de"
}
else
{
document.getElementById(id).style.backgroundColor="#E4D4ED"
}
}

function js_select_rozwin(id)
{
if(document.getElementById('js_select_lista_' + id))
  {
  if(document.getElementById('js_select_lista_' + id).style.display=='block')
    document.getElementById('js_select_lista_' + id).style.display='none'
  else
	document.getElementById('js_select_lista_' + id).style.display='block'
  }
}

function js_select_wybierz(id, wybor_id, wybor_wartosc)
{
document.getElementById('js_select_selected_name_' + id).innerHTML=wybor_wartosc
document.getElementById(id).value=wybor_id
js_select_rozwin(id)
}
