function SWFDelegate(url,width,height,caption) 
{
	//alert(url);
	
   var objLink = document.createElement('a');
   objLink.setAttribute('href',url);
   objLink.setAttribute('rel','lightbox');
   objLink.setAttribute('title',caption);
   if(typeof width != 'undefined') {
      objLink.setAttribute('width',width);
   }
   if(typeof height != 'undefined') {
      objLink.setAttribute('height',height);
   }
	 
   Lightbox.prototype.start(objLink);
	 
}

function GroupDelegate(id) {
   var objLink = document.getElementById(id);
   Lightbox.prototype.start(objLink);
}

function wydrukujOferte(nr_oferty)
{
	var gdzie = "/wydruk_oferty.php5?oferta="+ nr_oferty;
	var ofertaWin = window.open(gdzie,"ofertaWin", "TOOLBAR=no,STATUS=no, LOCATION=no, SCROLLBARS=yes, RESIZABLE=1,width=960, height=600");
	ofertaWin.focus();
}

function kalkulatorKosztow(nr_oferty)
{
	var gdzie = "/kalkulator.php5?oferta="+ nr_oferty;
	var kalkulatorWin = window.open(gdzie,"kalkulatorWin", "TOOLBAR=no,STATUS=no, LOCATION=no, SCROLLBARS=yes, RESIZABLE=1,width=960, height=500");
	kalkulatorWin.focus();
}

function emailScramble(beforeAt, afterAt, cssClass) {
	var a,b,c,d,e;
	a = '<a ';
	if (cssClass != null) {
		a += 'class="' + cssClass + '" ';
	}
	a += 'href="mai';
	b = beforeAt;
	c = '"/>';
	
	a += 'lto:';
	b += '@';
	
	e = '</a>';
	b += afterAt;           
	
	d = b;
	
	document.write(a + b + c + d + e);		
}
