var current = 0;
                var nr=0;
				var nr=1;
				var session=Math.random();

				function letsgo() {
				  if (document.images) {
				    window.document.images.pippo.src = document.titleForm.PhotoList.value+"?highscore="+nr+"&session="+session;
				    if (nr==32765) {
					nr=0;
					nr=1;
				    }
				    nr++;
				    animstart = window.setTimeout("letsgo()",30000);
				  }
				}

				
                function next_pic() {
                        var max_img = document.titleForm.PhotoList.options.length;
						current++;
                        if (current>=max_img) current = 0;
                        show_pic(current);
                }

                function prev_pic() {
                        var max_img = document.titleForm.PhotoList.options.length;
                        current--;
                        if(current<0) current = max_img - 1;
                        show_pic(current);
                }

        
                function random_pic() {
                        var max_img = document.titleForm.PhotoList.options.length;
                        current = Math.floor(Math.random()*max_img);
                        show_pic(current);
                }

                function show_pic(num) {
                        var sbox = document.titleForm.PhotoList;

						document.images['pic'].src = sbox.options[num].value;
                        sbox.options[num].selected = true;
                        current = num;
                }
                
                function apriS02(mylink, windowname, refocus)
					{
					var trasportiwin, href;
					var apriX = (screen.width/2)-395;
					var apriY = (screen.height/2)-250;
					var pos = "left="+apriX+",top="+apriY;
					
					if (typeof(mylink) == 'string')
					   href=mylink;
					else
					   href=mylink.href;
					   
					   if (screen.width <= 1024)
					      trasportiwin = window.open('', windowname,'status=yes, scrollbars=yes,resizable=no,width=790,height=500,'+pos);
					   else
					      trasportiwin = window.open('', windowname,'status=yes, scrollbars=yes,resizable=no,width=790,height=500,'+pos);
					
					// if we just opened the window
					if (
					   trasportiwin.closed || 
					   (! trasportiwin.document.URL) || 
					   (trasportiwin.document.URL.indexOf("about") == 0)
					   )
					   trasportiwin.location=href;
					else if (focus)
					   trasportiwin.location=href;
					   trasportiwin.focus();
					return false;
					
					}
                
		//function prova()
		{
			
			//defaultStatus = ""
			//-->
		}
