var articlePictures = new Array();
var articlePicturesZoomLink = new Array();
var articlePicturesDescriptions = new Array();
  	addEvent(window, 'load', buildImgPreview);

		function buildImgPreview(){
			// if we only have mainpicture we don't show the img browser
			if(articlePictures.length <= 1){
				return;
			}
			for(i = 0; i < articlePictures.length; i++){
				document.getElementById('pictureBox').innerHTML += '<img onclick="showInMainImg(\''+articlePictures[i]+'&amp;MaxW=200&amp;Border=0\', '+i+', \''+articlePicturesZoomLink[i]+'\')" style="cursor:pointer;margin-bottom:2px;margin-right:2px;" width="47" border="0" src="'+articlePictures[i]+'&amp;MaxW=47&amp;Border=0">';
			}
		}

		function showInMainImg(url, description, zoomUrl){
			document.getElementById('mainPicture').src = url;
			document.getElementById('mainPicture').parentNode.href = zoomUrl;
			document.getElementById('mainPictureCaption').innerHTML = articlePicturesDescriptions[description]
		}

		function addEvent(obj, evType, fn){
		 if (obj.addEventListener){
		   obj.addEventListener(evType, fn, false);
		   return true;
		 } else if (obj.attachEvent){
		   var r = obj.attachEvent("on"+evType, fn);
		   return r;
		 } else {
		   return false;
		 }
	}


var articleGalPictures = new Array();
var articleGalPicturesZoomLink = new Array();
var articleGalPicturesDescriptions = new Array();
  	addGalEvent(window, 'load', buildImgGalPreview1);

		function buildImgGalPreview1(){
			// if we only have mainpicture we don't show the img browser
			if(articleGalPictures.length <= 1){
				return;
			}
			for(o = 0; o < articleGalPictures.length; o++){
				document.getElementById('GalpictureBox').innerHTML += '<img onclick="showGalInMainImg(\''+articleGalPictures[o]+'&amp;MaxW=435&amp;Border=0\', '+o+', \''+articleGalPicturesZoomLink[o]+'\')" style="cursor:pointer;margin-bottom:2px;margin-right:2px;margin-top:12px;margin-left:1px" height="60" border="0" src="'+articleGalPictures[o]+'&amp;MaxH=100&amp;Border=0">';
			}
		}

		function showGalInMainImg(url, description, zoomUrl){
			document.getElementById('mainPicture').src = url;
			document.getElementById('mainPicture').parentNode.href = zoomUrl;
			document.getElementById('mainPictureCaption').innerHTML = articleGalPicturesDescriptions[description]
		}

		function addGalEvent(obj, evType, fn){
		 if (obj.addGalEventListener){
		   obj.addGalEventListener(evType, fn, false);
		   return true;
		 } else if (obj.attachEvent){
		   var r = obj.attachEvent("on"+evType, fn);
		   return r;
		 } else {
		   return false;
		 }
	}