



function user_disable_faktura(dis)
{
	//alert(document.user_edit1.faktura.value);
	if(document.dane_podstawowe.faktura_nazwa_firmy.disabled==true)
	{
		document.dane_podstawowe.faktura_nazwa_firmy.disabled=false;
		document.dane_podstawowe.faktura_ulica.disabled=false;  	
		document.dane_podstawowe.faktura_nr_domu.disabled=false;  	 	
		document.dane_podstawowe.faktura_nr_lokalu.disabled=false;  	
		document.dane_podstawowe.faktura_kod.disabled=false;  		
		document.dane_podstawowe.faktura_miasto.disabled=false;  	
		//document.dane_podstawowe.faktura_poczta.disabled=false;  	 
		document.dane_podstawowe.faktura_id_kraju.disabled=false;  	 	
		document.dane_podstawowe.faktura_id_wojewodztwa.disabled=false;  	
		document.dane_podstawowe.faktura_nip.disabled=false;  	
	}
	else
	{
		document.dane_podstawowe.faktura_nazwa_firmy.disabled=true;
		document.dane_podstawowe.faktura_ulica.disabled=true;  	
		document.dane_podstawowe.faktura_nr_domu.disabled=true;		 	
		document.dane_podstawowe.faktura_nr_lokalu.disabled=true;
		document.dane_podstawowe.faktura_kod.disabled=true;	
		document.dane_podstawowe.faktura_miasto.disabled=true;
		//document.dane_podstawowe.faktura_poczta.disabled=true; 
		document.dane_podstawowe.faktura_id_kraju.disabled=true; 	
		document.dane_podstawowe.faktura_id_wojewodztwa.disabled=true;
		document.dane_podstawowe.faktura_nip.disabled=true;
	}
}



function kalendarium_dom(id,link)
{
	link=link.replace('*wizytowka*',id);
	document.location=link;
}

function kalendarium_limit(limit,link)
{
	link=link.replace('*limit*',limit);
	document.location=link;
}

function kat_aukcyjny_wyswietl(wyswietl,link)
{
	link=link.replace('*wyswietl*',wyswietl);
	document.location=link;
}

function artysci_lista_szukaj(artysta,link)
{
	link=link.replace('*artysta*',artysta);
	document.location=link;
}

function PopupStaleLicytacja(link,amount,errLi,errMsg,minimum,x,y)
{
	//
	if(amount.value<minimum || !IsNumeric(amount.value))
	{
		amount.style.border='1px solid red';
		errMsg=errMsg.replace('*minimum*',minimum);
		errLi.style.display='block';
		errLi.innerHTML=errMsg;
	}
	else
	{
		amount.style.border='1px solid black';
		errLi.style.display='none';
		errLi.innerHTML='';
		
		link=link.replace('*param1*',amount.value);
		okno = 'width=' + x + ',height=' + y + ',toolbar=no,left='+(screen.availWidth-x)/2+',top='+(screen.availHeight-y)/2+',status=1';
		with(window.open(link, '', okno))
		{
  			focus();
		}
		
	}
	
}

function IsNumeric(strString) //  check for valid numeric strings 
{
	var strValidChars = "0123456789.-";
	var strChar;
	var blnResult = true;

	if (strString.length == 0) return false;

	for (i = 0; i < strString.length && blnResult == true; i++)
    {
    	strChar = strString.charAt(i);
		if (strValidChars.indexOf(strChar) == -1)
        {
        	blnResult = false;
		}
	}
	return blnResult;
}

function UrlReplace(link,param1)
{
	link=link.replace('*param1*',param1);
	document.location=link;
}

function UrlReplace2(link,param1,param2)
{
	//alert(param2);
	link=link.replace('*param1*',param1);
	link=link.replace('*param2*',param2);
	document.location=link;
}

function UrlReplace3(link,param1,param2,param3)
{
	//alert(param2); 
	link=link.replace('*param1*',param1);
	link=link.replace('*param2*',param2);
	link=link.replace('*param3*',param3);
	document.location=link;
}

function UrlReplace4(link,param1,param2,param3,param4)
{
	//alert(param2); 
	link=link.replace('*param1*',param1);
	link=link.replace('*param2*',param2);
	link=link.replace('*param3*',param3);
	link=link.replace('*param4*',param4);
	document.location=link;
}

function UrlReplace5(link,param1,param2,param3,param4,param5)
{
	//alert(param1); 
	link=link.replace('*param1*',param1);
	link=link.replace('*param2*',param2);
	link=link.replace('*param3*',param3);
	link=link.replace('*param4*',param4);
	link=link.replace('*param5*',param5);
	document.location=link;
}

function UrlReplace7(link,param1,param2,param3,param4,param5,param6,param7)
{
	link=link.replace('*param1*',param1);
	link=link.replace('*param2*',param2);
	link=link.replace('*param3*',param3);
	link=link.replace('*param4*',param4);
	link=link.replace('*param5*',param5);
	link=link.replace('*param6*',param6);
	link=link.replace('*param7*',param7);
	document.location=link;
}

function UrlReplace8(link,param1,param2,param3,param4,param5,param6,param7,param8)
{
	link=link.replace('*param1*',param1);
	link=link.replace('*param2*',param2);
	link=link.replace('*param3*',param3);
	link=link.replace('*param4*',param4);
	link=link.replace('*param5*',param5);
	link=link.replace('*param6*',param6);
	link=link.replace('*param7*',param7);
	link=link.replace('*param8*',param8);
	document.location=link;
}

function wydarzenia_get_date()
{
	var rok;
	var data=new Date();

	rok=document.getElementById('rok').value;
	miesiac=document.getElementById('miesiac').value;
	
	//if(rok==0) rok=data.getYear();
	if(rok>0 && rok<2000) rok=rok+1900;
	
	
	if(miesiac==0 && rok>0) miesiac='00'
	//miesiac=data.getMonth()+1;
	
	return (rok+'-'+miesiac+'-00');
	
	//alert('dd');
}



function printpreview(url) 
{
	window.open(url, 'Druk', 'scrollbars=1,left=160,top=10,width=800,height=550');
}


function fullpicture(x,y,img,desc)
{
	x=x+50;
	y=y+70;	
	html='<html><head><title>Galeria</title></head>';
	html= html  + '<body style=\"margin:0;\">';
	html= html + '<table border=\"0\" width=\"'+x+'\">';
	html= html + '<tr><td align=\"center\">';
	html= html + '<img src=\"'+ img +'\"';
	html= html + '</td></tr>';		
	html= html + '<tr><td align=\"center\">';
	html= html + '<span style=\"font-size:11px;font-family:Tahoma\">' + desc + '</span>';
	html= html + '</td></tr>';		
	html= html + '<tr><td align=\"center\">';
	html= html + '<span style=\"font-size:11px;font-family:Tahoma\"><a href=\"javascript:window.close();\">Zamknij</a></span>';
	html= html + '</td></tr>';		
	html= html + '</table>';		
	html= html + '</body></html>';
	okno = 'width=' + x + ',height=' + y + ',toolbar=no,left='+(screen.availWidth-x)/2+',top='+(screen.availHeight-y)/2+',status=1';
	with(window.open('about:blank', '', okno))
	{
  		document.open();
  		document.write(html);
  		document.close();
  		focus();
	}
									
}

function fullwindow(x,y,url)
{
	okno = 'width=' + x + ',height=' + y + ',toolbar=no,left='+(screen.availWidth-x)/2+',top='+(screen.availHeight-y)/2+',status=1,scrollbars=1';
	with(window.open(url, '', okno))
	{
  		focus();
	}
	
	
	
}


function polec()
{
	var polec=document.getElementById('polec');
	if(polec.style.display=='block')
		polec.style.display='none';
	else
		polec.style.display='block';
		
}		

function WhenOffGoToUrl(obj,link)
{
	if(obj.checked==0) document.location=link;
	
}


function WhenOnTurnOff(obj1,obj2)
{
	if(obj1.checked==1) 
	{
		obj2.checked=0;
	}
}

function showAnswerFrm()
{
	var frm = document.getElementById('commentFrm');
	if(frm.style.display == 'none' || frm.style.display == '')
	{
		frm.style.display = 'block'; 
	}
	else
	{
		frm.display = 'none';
	}
}	

function onKeyPress (e)
{
    if(window.event) // IE
    {
        //alert("IE"+window.event.keyCode);
        keynum = window.event.keyCode
    }
    if(e.which) // Netscape/Firefox/Opera
    {
        //alert("FF"+e.which);
        keynum = e.which
    }
    if (keynum == 13) 
    {
        return false;  // Enter
    }
}


function koszyk_przelicz(indeks)
{
	var formularz=document.getElementById('koszyk_form');
	var action=document.getElementById('koszyk_action');
	var param=document.getElementById('koszyk_param');
	action.value='przelicz';
	param.value=indeks;
	formularz.submit();
}

function koszyk_usun()
{
	var formularz=document.getElementById('koszyk_form');
	var action=document.getElementById('koszyk_action');
	action.value='usun';
	formularz.submit();
	return false;
}

/*
function switchFrm()
{
	var cName = document.getElementById('companyName');
	var cAddress = document.getElementById('companyAddress');
	var cCode = document.getElementById('companyCode');
	var cCity = document.getElementById('companyCity');
	var cCountry = document.getElementById('companyCountry');
	var cNIP = document.getElementById('companyNIP');
	var chck = document.getElementById('companyChckBox');
	if(chck.checked == false)
	{
		cName.disabled = true;
		cName.style.backgroundColor = "#555555";
		cAddress.disabled = true;
		cAddress.style.backgroundColor = "#555555";
		cCode.disabled = true;
		cCode.style.backgroundColor = "#555555";
		cCity.disabled = true;
		cCity.style.backgroundColor = "#555555";
		cCountry.disabled = true;
		cCountry.style.backgroundColor = "#555555";
		cNIP.disabled = true;
		cNIP.style.backgroundColor = "#555555";
	}
	else
	{
		cName.disabled = false;
		cName.style.backgroundColor = "";
		cAddress.disabled = false;
		cAddress.style.backgroundColor = "";
		cCode.disabled = false;
		cCode.style.backgroundColor = "";
		cCity.disabled = false;
		cCity.style.backgroundColor = "";
		cCountry.disabled = false;
		cCountry.style.backgroundColor = "";
		cNIP.disabled = false;
		cNIP.style.backgroundColor = "";
	}	
}
*/
