
function copyAi() {
	namepl=document.getElementById('namepl');
	nameen=document.getElementById('nameen');
	namede=document.getElementById('namede');
	namedk=document.getElementById('namedk');
	namefr=document.getElementById('namefr');
	
	nameen.value = namepl.value;
	namedk.value = namepl.value;
	namede.value = namepl.value;
	namefr.value = namepl.value;
}
function copyAn() {
	topicpl=document.getElementById('topicpl');
	topicen=document.getElementById('topicen');
	topicde=document.getElementById('topicde');
	topicdk=document.getElementById('topicdk');
	topicfr=document.getElementById('topicfr');
	
	topicen.value = topicpl.value;
	topicdk.value = topicpl.value;
	topicde.value = topicpl.value;
	topicfr.value = topicpl.value;
}

function addCopyAi(element) {
	link = document.createElement('a');
	link.href="#copythis";
	link.innerHTML='skopiuj';
	addEvent(link,'click',copyAi);
	element.appendChild(link);	
}
function addCopyAn(element) {
	
	link = document.createElement('a');
	link.href="#copythis";
	link.innerHTML='skopiuj';
	//alert(link.innerHTML);
	addEvent(link,'click',copyAn);
	element.appendChild(link);	
}

function startMagic() {
	/*
	link do kopiowania zawartości w formularzach		
	*/
	divs = document.getElementsByTagName('div');
	for(i=0; i<divs.length; i++) {
		if(divs[i].className=='copyai') addCopyAi(divs[i]);
		if(divs[i].className=='copyan') addCopyAn(divs[i]);	
	}
}

addEvent(window,"load",startMagic);

function showGal(id) {
	window.open('/members/gallery/' + id, 'Galeria', 'menubar=no, toolbar=no, statusbar=no,scrollbars=yes,width=700,height=600');
}
