/* CMSMS-Users: This file's path is supposed to be modules/Album/templates/db/js/ by default */
/*
SIMPLE GALLERY SCRIPT
by Caspar Huebinger, http://chariotweb.net
Author e-mail: mail@chariotweb.net
*/

function changePic (CurrSrc, CurrAlt, CurrTitle) { // set parameters
	var BigSrc = CurrSrc.replace('thumb_','');// remove "thumb_" from img URI
	var MainPic = document.getElementById('mainpic');// get big img 
	MainPic.setAttribute('src', BigSrc);// set new URI for big img
	MainPic.setAttribute('alt', CurrAlt);// get alt-text containing the user-given name
	MainPic.setAttribute('title', CurrTitle);// get title-text containing the user-given comment
	var NewName = document.createTextNode(CurrAlt);// create new text-node for img name
	document.getElementById('mainpicname').replaceChild(NewName, document.getElementById('mainpicname').firstChild);// replace img name
	var NewComment = document.createTextNode(CurrTitle);// create new text-node for img comment
	document.getElementById('mainpiccomment').replaceChild(NewComment, document.getElementById('mainpiccomment').firstChild);// replace img comment
}