function arte_print_value(form_name, var_name, var_value)
{
	var form_obj = eval("document." + form_name);
	form_obj[var_name].value = var_value;
}

function show_photo(file_type, id_parent, id_file, width, height)
{
	var parametry = "TOOLBAR=no,STATUS=no, width="+width+", height="+(height+20);
	var gdzie = "pic_show.php?photo="+id_file + "&parent="+id_parent + "&type=" + file_type;
	
	if (typeof show_photo_window == "object")
		show_photo_window.close();

	show_photo_window = window.open(gdzie,"", parametry);
}

function displayWindow(url, width, height) 
{
	var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no,toolbar=no,location=no,directories=no' );
}


function drukuj_koszty()
{
	var kwota = document.getElementById("oferta_cena");
	var kwota2 = 0;
	if(kwota)
		kwota2 = kwota.value;
	
	if(kwota2 > 0)
	{
		var wlasnosc = document.getElementById("rodzaj_wlasnosci").value;
		var typ = document.getElementById("typ_oferty").value;
		var prowizja = document.getElementById("prowizja_procent").value;
		
		var parametry = "TOOLBAR=no,STATUS=no, RESIZABLE=1,width=700, height=500";
		var gdzie = "koszty_wydruk.php?kwota="+ kwota2 + "&wlasnosc=" + wlasnosc + "&typ=" + typ + "&prowizja=" + prowizja;
		var kosztyWin = window.open(gdzie,"kosztyWin", parametry);
		kosztyWin.focus();
	}
}


function createFlash(flashSrc, width, height, bgcolor) {
	
	html = "<object ";    
	html += " codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" ";
	html += " width=\"" + width + "\" ";
	html += " height=\"" + height + "\" ";
	html += " align=\"middle\" ";
	html += " >";
	
	html += " <param name=\"allowScriptAccess\" value=\"sameDomain\" /> ";	
	html += " <param name=\"movie\" value=\"" + flashSrc + "\" /> ";
	html += " <param name=\"quality\" value=\"high\" /> ";
	html += " <param name=\"bgcolor\" value=\"" + bgcolor + "\" />";
	
	html += "<embed src=\"" + flashSrc + "\" ";
	html += " quality=\"high\" ";
	html += " bgcolor=\"" + bgcolor + "\" ";
	html += " width=\"" + width + "\" ";
	html += " height=\"" + height + "\" ";
	html += " align=\"middle\" ";
	html += " allowScriptAccess=\"sameDomain\" ";
	html += " type=\"application/x-shockwave-flash\" ";
	html += " pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
	html += " />";
	
	html += "</object>";
	
	document.writeln(html);
}

