function loadPics(picId) {
	// init vars
	var image;
	
	// ignore is already selected
	if (picId != curImage) {
		// loader gif
		$('photo_detail').src = appWebPath + 'images/ajax-loader.gif';
		
		// reset the class of the current thumb
		if (curImage % 6 == 0) {
			$('aphoto' + curImage).className = 'thumb_last';
		} else {
			$('aphoto' + curImage).className = 'thumb';
		}
		
		// get the image from array
		image = picArray[picId - 1];
		
		// load the image
		$('photo_detail').src = image;
		
		// set selected class of thumb
		if (picId % 6 == 0) {
			$('aphoto' + picId).className = 'thumb_last_slct';
		} else {
			$('aphoto' + picId).className = 'thumb_slct';
		}
		
		// set image to curImage
		curImage = picId;
	}
}

// newsletter registration via AJAX (prototype)
function newsletterSignUp(scriptPath) {
	// collect data from form
	var params = Form.serialize(document.fnewsletter);
	
	$("block_newsletter_error").hide();
	$("block_newsletter_form").hide();
	$("block_newsletter_process").show();
	
	new Ajax.Request(scriptPath + 'ajax/nl_process.php',
	{
		//method:'post',
		parameters: params,
		onSuccess: function(transport) {
			
			// load the response, and convert JSON into regular array
			var response = transport.responseText;
			var jsonObj = response.evalJSON();
			
			if (jsonObj.status == 'ok') {
				// load the confirm message
				$("block_newsletter_error").innerHTML = '<span style="color:red;">' + jsonObj.detail + '</span><br />';
				$("block_newsletter_process").hide();
				$("block_newsletter_error").show();
				
				document.fnewsletter.name.value = '';
				document.fnewsletter.email.value = '';
				
				// wait 3 secs, and hide confirm + show form
				setTimeout("$(\"block_newsletter_error\").hide(); $(\"block_newsletter_form\").show();", 3000);
			} else {
				$("block_newsletter_error").innerHTML = '<span style="color:red;">' + jsonObj.detail + '</span><br />';
				$("block_newsletter_process").hide();
				$("block_newsletter_error").show();
				$("block_newsletter_form").show();
			}
		},
		onFailure: function() {
			alert('Error in communication with server!');
		}
	});
}
