function start_slideshow() {
	 var x = document.getElementById('row').value;
	inpictures_curr_frame = x;	
	setTimeout(switch_slides(), inpictures_delay);
}

function goto_slide(frame) {
    if (frame != inpictures_curr_frame) {
        Effect.Fade('slideshow' + inpictures_curr_frame);
        change_link(frame, inpictures_curr_frame);
        setTimeout("Effect.Appear('slideshow" + frame + "');", 850);
        clearTimeout(inpictures_curr_delay);
        inpictures_curr_frame = frame;
        inpictures_curr_delay = setTimeout(switch_slides(), inpictures_delay + 859);
    }
}
                        
function switch_slides() {
    return ( function() {
        frame = inpictures_curr_frame;
        Effect.Fade('slideshow' + frame);
        if (frame == inpictures_end_frame) { inpictures_curr_frame = inpictures_start_frame; } else { inpictures_curr_frame = frame + 1; }
        change_link(inpictures_curr_frame, frame);
        setTimeout("Effect.Appear('slideshow" + inpictures_curr_frame + "');", 850);
        inpictures_curr_delay = setTimeout(switch_slides(), inpictures_delay + 850);
    } )
}

function change_link(frame, prev) {
    inpictures_id1 = document.getElementById('inpictures_link'+prev);
    inpictures_id1.style.cssText= 'width:36px; height:36px; border:1px solid #666666; margin:2px 0 0 0px;';
    inpictures_id1 = document.getElementById('inpictures_link'+frame);
    inpictures_id1.style.cssText= 'width:42px; height:42px; border:2px solid #b00; margin:-1px 0 0 0px;';
}

function stop_slideshow() {
	clearTimeout(inpictures_curr_delay);
}

function resume_slideshow() {
	inpictures_curr_delay = setTimeout(switch_slides(), inpictures_delay - 1000);
}

function SG_openPopup( url, name, widgets, openerUrl )
{
	// sample usage:
	// SG_openPopup(url,'childwindowname','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=620,height=360');
	var host = location.hostname;
	if (window == top) { window.top.name = "opener"; }
	var popupWin = window.open( url, name, widgets );
	if ( popupWin && popupWin.opener ) {
		if ( openerUrl )
		{
			popupWin.opener.location = openerUrl;
		}
	}
	if ( popupWin) {
		popupWin.focus();
	}
}

