 	    	 		    var hrefnames = new Array("http://mirdm.ru/int_Dogtas_MOTO_KIDS.php?id=2&pid=12","http://mirdm.ru/int-julia-smail-a.php?id=2&pid=10","http://mirdm.ru/int-paidi-ondo.php?id=2&pid=10","http://mirdm.ru/int-paidi-ondo.php?id=2&pid=10","http://mirdm.ru/int-paidi-ondo.php?id=2&pid=10","http://mirdm.ru/int-paidi-ondo.php?id=2&pid=10");
 	    		        var prefix = "";
						var postfix = "";
                        var photos = new Array("http://mirdm.ru/pict/MOTOKID_011.jpg","http://mirdm.ru/pict/int-julia-smail-a.jpg","http://mirdm.ru/upload/images/pict_1248093221.jpg","http://mirdm.ru/upload/images/pict_1242823071.jpg","http://mirdm.ru/upload/images/pict_1242822867.jpg","http://mirdm.ru/upload/images/pict_1242822589.jpg");
						var index = 0;
						var show = false;
						var timeout = 2500; //ms
						var startText = "<font color='#cc3333'>Старт</font>";
						var stopText = "<font color='#cc3333'>Стоп</font>";
						var galleryImg = "gallery_img";
						var galleryHref = "gallery_href";
						var startStop = "but";


						function nextPhoto() {
							var imgEl = document.getElementById(galleryImg);
							var hrefEl = document.getElementById(galleryHref);
							if (index >= (photos.length - 1)) {
								index = 0;
							} else {
								index++;
							}
							imgEl.src = photos[index];
							hrefEl.href = prefix + hrefnames[index] + postfix;
						}

						function prevPhoto() {
							var imgEl = document.getElementById(galleryImg);
							var hrefEl = document.getElementById(galleryHref);
							if (index <= 0) {
								index = photos.length - 1;
							} else {
								index--;
							}
							imgEl.src = photos[index];
							hrefEl.href = prefix + hrefnames[index] + postfix;

						}

						function startGallery() {
							var el = document.getElementById(startStop);
							el.innerHTML = stopText;
							el.onclick =
								function onclick(event) {
									stopGallery();
									return false;
								};
							show = true;
							proccessGallery();


						}

						function proccessGallery() {
							var el = document.getElementById(startStop);
							nextPhoto();
							if (el.innerHTML != startText) {
								setTimeout("proccessGallery();", timeout);
							}
						}

						function stopGallery() {
							var el = document.getElementById(startStop);
							el.innerHTML = startText;
							el.onclick =
								function onclick(event) {
									startGallery();
									return false;
								};
						}
