function mine(t, a) {
	if(a=='add') {
		d = new Date();
		d.setYear(d.getYear() < 1900? d.getYear() + 1901: d.getYear() + 1);
		document.cookie='mine[' + t + ']='+ t + ';expires='+d.toGMTString()+';path=/';
		alert('Oferta została dodana do listy Państwa ofert. W każdym momencie będą mogli Państwo do nich powrócić.');
	}
	if(a=='remove') document.cookie='mine[' + t + ']=0;expires=;path=/';
}

function img_fwd(i) {
	img_c += i;
	if(img_c >= img_data.length) img_c = img_c - img_data.length;
	img_draw();
}

function img_rew(i) {
	img_c -= i;
	if(img_c < 0) img_c = img_data.length + img_c;
	img_draw();
}

function img_draw() {
	document.getElementById('img').src='/img/_null.gif';
	document.getElementById('img_i').style.background='url('+img_data[img_c][0]+') no-repeat center';
	document.getElementById('img').title=desc[img_data[img_c][1]];
	if(img_data.length) document.getElementById('img_nav').innerHTML = '<a href="javascript:img_rew(1);" class="prev">'+(img_c+1)+'<\/a> z <'+'a href="javascript:img_fwd(1);" class="next">'+img_data.length+'<\/a>'+desc[img_data[img_c][1]];
}

var scroll;

function scroll_fwd(s) {
	if(s) scroll = true;
	document.getElementById('img_scroll').scrollLeft+=5;
	if(scroll) setTimeout("scroll_fwd()",10)
}

function scroll_rew(s) {
	if(s) scroll = true;
	document.getElementById('img_scroll').scrollLeft-=5;
	if(scroll) setTimeout("scroll_rew()",10)
}

function scroll_pop(adres) {
	window.open(adres, 'zdjecie', 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=900,height=650');
}
function images_pop(adres,width,height) {
	window.open(adres, 'zdjecie2', 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,width='+width+',height='+height+'');
}
function o(o, i) {
	if(!i) i = 'details';
	if(!o.id) o = document.getElementById(o);
	t_d = document.getElementById(o.id+'_d');

	if(t_d.style.display=='inline') {
		if(o) o.src = eval('b_'+i+'_u.src');
		t_d.style.display='none';
		document.cookie='lista[' + t_d.id + ']=;expires=;path=/';
	} else {
		if(o) o.src = eval('b_'+i+'_d.src');
		t_d.style.display='inline'
		document.cookie='lista[' + t_d.id + ']=1;path=/';
	}
}

var b_details_u = new Image;
var b_details_d = new Image;

var b_regions_u = new Image;
var b_regions_d = new Image;

b_details_u.src = '/img_s/_btn-details-d.gif';
b_details_d.src = '/img_s/_btn-details-u.gif';

b_regions_u.src = '/img_s/_btn-regions-d.gif';
b_regions_d.src = '/img_s/_btn-regions-u.gif';

var p = false;
function sw(i) {
	document.getElementById('t'+last).style.display="none";
	document.getElementById('t'+i).style.display="inline";
	if(last) document.getElementById('a_t'+last).className="";
	document.getElementById('a_t'+i).className="c";
	last = i;
}

function ar(o, i) {
	if(hgw[i][0]) e('t'+o+'_c').innerHTML = hgw[i][0];
	if(hgw[i][1]) e('t'+o+'_ioz').innerHTML = '<h3>Opcje zakwaterowania<\/h3>'+hgw[i][1]+'<br\/><br\/>';
	if(hgw[i][2]) e('t'+o+'_cz').innerHTML = '<h3>Cena zawiera<\/h3>'+hgw[i][2]+'<br\/><br\/>';
	if(hgw[i][3]) e('t'+o+'_cnz').innerHTML = '<h3>Cena nie zawiera<\/h3>'+hgw[i][3]+'<br\/><br\/>';
	if(hgw[i][4]) e('t'+o+'_u').innerHTML = '<h3>Uwagi<\/h3>'+hgw[i][4]+'<br\/><br\/>';
	if(hgw[i][5]) e('t'+o+'_w').innerHTML = '<h3>Wyżywienie<\/h3>'+hgw[i][5]+'<br\/><br\/>';
	if(hgw[i][6]) e('t'+o+'_rid').value = hgw[i][6];
	if(hgw[i][6]) e('t'+o+'_qid').value = hgw[i][6];
}
function zoom(szerokosc,wysokosc,adres) {
	szerokosc+=10;
	wysokosc+=10;
	//if (ie)
	{
	NewWindow=window.open('', '','width='+szerokosc+',height='+wysokosc+',toolbar=no,directories=no,menubar=no,locations=no,status=no,scrollbars=no,resizable=no,fullscreen=no,top=50,left=50');
	NewWindow.document.open();
	NewWindow.document.writeln("<html>\n<head>\n<title>Zoom</title></head>");
	NewWindow.document.writeln("<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">");
	NewWindow.document.writeln("<table width=\"100%\" height=\"100%\" border=\"0\">");
	NewWindow.document.writeln("<tr><td valign=\"center\" align=\"center\">\n<a href=\"javascript:window.close();\"><img src=\""+adres+"\" border=\"0\"></a></td></tr>");
	NewWindow.document.writeln("</table>");
	NewWindow.document.writeln("</body>\n</html>\n");
	NewWindow.document.close();
	NewWindow.focus();
	}
	return;
	}