function getElementHeight(Elem) {
	if(document.getElementById) {
			var elem = document.getElementById(Elem);
		} else if (document.all){
			var elem = document.all[Elem];
		}
		xPos = elem.offsetHeight;
		return xPos;
}

function iniciuj()
{
	Custom2.init();
	Custom.init();
}

function menu_transp(str){
       if(str=='r'){
           document.getElementById('main_right_rej').style.height=getElementHeight('main_right_rej')+50+'px';
           document.getElementById('main_right_r').style.height=getElementHeight('main_right_rej')+50+'px';
           document.getElementById('main_right_tlo2').style.height=getElementHeight('main_right_rej')-667+'px';
           document.getElementById('main_right_tlo3').style.top=getElementHeight('main_right_tlo2')+467+'px';
       } else if(str=='s'){
	   //alert(getElementHeight('main_right_str'));
	   document.getElementById('main_right_str').style.height=getElementHeight('main_right_str')+50+'px';
           document.getElementById('main_right_s').style.height=getElementHeight('main_right_str')+50+'px';
           document.getElementById('main_right_tlo2').style.height=getElementHeight('main_right_str')-667+'px';
           document.getElementById('main_right_tlo3').style.top=getElementHeight('main_right_tlo2')+467+'px';
       } else if(str=='s2'){
	   //    alert(getElementHeight('main_right_str'));
	   document.getElementById('main_right_str').style.height=getElementHeight('main_right_str')+250+'px';
           document.getElementById('main_right_s').style.height=getElementHeight('main_right_str')+50+'px';
           document.getElementById('main_right_tlo2').style.height=getElementHeight('main_right_str')-667+'px';
           document.getElementById('main_right_tlo3').style.top=getElementHeight('main_right_tlo2')+467+'px';
       } else if(str=='p'){
           document.getElementById('main_right_prod').style.height=getElementHeight('main_right_prod')+26+'px';
           document.getElementById('main_right_p').style.height=getElementHeight('main_right_prod')+26+'px';
           document.getElementById('main_right_tlo2').style.height=getElementHeight('main_right_prod')-667+'px';
           document.getElementById('main_right_tlo3').style.top=getElementHeight('main_right_tlo2')+467+'px';
       } else if(str=='ps'){
           document.getElementById('main_right_prods').style.height=getElementHeight('main_right_prods')+20+'px';
           document.getElementById('main_right_ps').style.height=getElementHeight('main_right_prods')+20+'px';
           document.getElementById('main_right_tlo2').style.height=getElementHeight('main_right_prods')-667+'px';
           document.getElementById('main_right_tlo3').style.top=getElementHeight('main_right_tlo2')+467+'px';
       } else if(str=='k'){
           document.getElementById('main_right_kosz').style.height=getElementHeight('main_right_kosz')+50+'px';
           document.getElementById('main_right_k').style.height=getElementHeight('main_right_kosz')+50+'px';
           document.getElementById('main_right_tlo2').style.height=getElementHeight('main_right_kosz')-667+'px';
           document.getElementById('main_right_tlo3').style.top=getElementHeight('main_right_tlo2')+467+'px';
       } else if(str=='r2'){
	   document.getElementById('main_right_rej').style.height=getElementHeight('main_right_rej')+100+'px';
           document.getElementById('main_right_rej').style.height=getElementHeight('main_right_rej')+100+'px';
           document.getElementById('main_right_r').style.height=getElementHeight('main_right_rej')+50+'px';
           document.getElementById('main_right_tlo2').style.height=getElementHeight('main_right_rej')-667+'px';
           document.getElementById('main_right_tlo3').style.top=getElementHeight('main_right_tlo2')+467+'px';
       }else if(str=='z'){
	   document.getElementById('main_right_rej').style.height=1600+'px';
           document.getElementById('main_right_rej').style.height=getElementHeight('main_right_rej')+50+'px';
           document.getElementById('main_right_r').style.height=getElementHeight('main_right_rej')+50+'px';
           document.getElementById('main_right_tlo2').style.height=getElementHeight('main_right_rej')-667+'px';
           document.getElementById('main_right_tlo3').style.top=getElementHeight('main_right_tlo2')+467+'px';
       }
}

function zapisz_rej(){
    document.getElementById('rejestr_form').zapisz.value=1;
    document.getElementById('rejestr_form').submit();
}

function zapisz_new(){
    document.getElementById('news_form').zapisz.value=1;
    document.getElementById('news_form').submit();
}
function wypisz_new(){
    document.getElementById('news_form').wypisz.value=1;
    document.getElementById('news_form').submit();
}
function zapisz_pass(){
    document.getElementById('pass_form').zapisz.value=1;
    document.getElementById('pass_form').submit();
}
function zapisz_edyc(){
    document.getElementById('edycja_form').zapisz.value=1;
    document.getElementById('edycja_form').submit();
}
function zapisz_pol(){
    document.getElementById('polec_form').zapisz.value=1;
    document.getElementById('polec_form').submit();
}
function zapisz_opi(){
    document.getElementById('opinia_form').zapisz1.value=1;
    document.getElementById('opinia_form').submit();
}
function super_submit(){
    document.getElementById('rejestr_form').submit();
}

function my_submit(formsik){
    form=document.getElementById(formsik);
    form.wyslij.value='t';
    form.submit();
}

function my_submit_scrolltop(formsik){
    form=document.getElementById(formsik);
    form.document_body_scrolltop.value=document.body.scrollTop;
    form.submit();
}

function nl_zapisz(formsik, co){
    form=document.getElementById(formsik);
    form.nl_co.value=co;
    form.submit();
}

function show_opis(){
    li=document.getElementById('opis_li');
    li.className="za1_act";
    li2=document.getElementById('spec_li');
    li2.className="za2";
    
    document.getElementById('text_opis').style.display="block";
    document.getElementById('text_spectfikacja').style.display="none";
}

function show_spec(){
    li=document.getElementById('opis_li');
    li.className="za1";
    li2=document.getElementById('spec_li');
    li2.className="za2_act";
    
    document.getElementById('text_opis').style.display="none";
    document.getElementById('text_spectfikacja').style.display="block";
}

function zamien_fote(id_foty, roz, id_produktu){
    
    //alert(glowna_fota_link);
    
    document.getElementById('glowna_fota_link').href="/pub/produkty/"+id_produktu+"/"+id_foty+"_big."+roz;
    //alert(document.getElementById('glowna_fota_link').href);
    document.getElementById('glowna_fota_img').src="/pub/produkty/"+id_produktu+"/"+id_foty+"_med."+roz;
    Shadowbox.init();
    
    
}

function aktywuj(ktory){
    for(i=1;i<=3;i++){
	buttonek=document.getElementById('menu_prawe_'+i);
	boksik=document.getElementById('box_'+i);
	if(i==ktory){
	    buttonek.className='za'+i+'_akt';
	    boksik.style.display="block";
	}else{
	    buttonek.className='za'+i;
	    boksik.style.display="none";
	}
    }
    
    
}

function koszyk_zamow(){
    if(document.getElementById('reg_check').checked==false){
	alert('Musisz zaakceptować regulamin, aby dokonać zakupu');
    }else{
	document.location.replace('/zamow/');
    }
}

function pokaz_faq(co,ile)
{
    for (i=1;i<=ile;i++)
    {
	document.getElementById('faq'+i).style.display='none'
    }
    //alert(document.getElementById('faq'+co))
    document.getElementById('faq'+co).style.display='block'
}



function zapal_1(){
	document.getElementById('main_right_prod_opin').style.display='block';
	document.getElementById('main_right_prod_opinadd').style.display='none';
	document.getElementById('main_right_prod_form').style.display='none';
}
function zapal_2(){
	document.getElementById('main_right_prod_opin').style.display='none';
	document.getElementById('main_right_prod_opinadd').style.display='block';
	document.getElementById('main_right_prod_form').style.display='none';
}
function zapal_3(){
	document.getElementById('main_right_prod_opin').style.display='none';
	document.getElementById('main_right_prod_opinadd').style.display='none';
	document.getElementById('main_right_prod_form').style.display='block';
}


function zgas_1(co,link){
	document.getElementById(co).style.display='none';
	window.location = link;
}
function zgas_2(co,link){
	document.getElementById(co).style.display='none';
	//document.location.replace(id);
	window.location = link;

}

function zoomer(co) {
	LeftPosition = (screen.width) ? (screen.width-450)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-560)/2 : 0;
	window.open('/zoomer/'+co,'','width=450,height=560,scrollbars=yes'+',top='+TopPosition+',left='+LeftPosition);
}
