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";
    li3=document.getElementById('opinie_li');
    li3.className="za3";
    
    document.getElementById('text_opis').style.display="block";
    document.getElementById('text_spectfikacja').style.display="none";
    document.getElementById('text_opinie').style.display="none";
}

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

function show_opinie(){
    li=document.getElementById('opis_li');
    li.className="za1";
    li2=document.getElementById('spec_li');
    li2.className="za2";
    li3=document.getElementById('opinie_li');
    li3.className="za3_act";
    
    document.getElementById('text_opis').style.display="none";
    document.getElementById('text_spectfikacja').style.display="none";
    document.getElementById('text_opinie').style.display="block";
}

/*function zamien_fote(id_foty, roz, id_produktu,wys,szer){
    document.getElementById('glowna_fota_link').href="/pub/produkty/"+id_produktu+"/"+id_foty+"_big."+roz;
    if(szer>wys){
	    document.getElementById('glowna_fota_img').src="/pub/produkty/"+id_produktu+"/"+id_foty+"_med."+roz;
	    document.getElementById('glowna_fota_img').className="wys";
    }
    if(szer<wys){
	    document.getElementById('glowna_fota_img').src="/pub/produkty/"+id_produktu+"/"+id_foty+"_med."+roz;
	    document.getElementById('glowna_fota_img').className="szer";
    }
    Shadowbox.init();
}*/

function zamien_fote(id_foty, roz, id_produktu,wys,szer){
    
    //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 nipOK(input_data)
{
if ( !input_data.match( /^[0-9]{3}-[0-9]{2}-[0-9]{2}-[0-9]{3}$/ )
&& !input_data.match( /^[0-9]{3}-[0-9]{3}-[0-9]{2}-[0-9]{2}$/ )
&& !input_data.match( /^[0-9]{10}$/ ) )
return false;
var my_nums = input_data.replace(/-/g,'');
var valid_nums = "657234567";
var sum=0;
for (var temp=8;temp>=0;temp--)
sum += (parseInt(valid_nums.charAt(temp)) * parseInt(my_nums.charAt(temp)));
if ( (sum % 11) == 10 ? false : ((sum % 11) == parseInt(my_nums.charAt(9))) )
return true;
else
return false;
}

function zapal_polec(){
	document.getElementById('polec').style.display='block';
	document.getElementById('zadaj').style.display='none';
}
function zapal_zadaj(){
	document.getElementById('zadaj').style.display='block';
	document.getElementById('polec').style.display='none';
}

function zapal(co,ie6sux){
	document.getElementById(co).style.display='block';
	if(ie6sux){document.getElementById('k').style.display='none';
	document.getElementById('r').style.display='none';}
}
function zgas(co,ie6sux){document.getElementById(co).style.display='none';if(ie6sux){document.getElementById('k').style.display='inline';document.getElementById('r').style.display='inline';}}

