
var thisImg = 0;

function handleps (form)
{
        var s = form.flight;
	idx = s.selectedIndex;
	val = s.options[idx].value;

	s = val.replace(/png/i, "ps");

//        var flight = "";
//        for (var i = 0; i<s.options.length; i++)
//                if (s.options[i].selected)
//                        val = s.options[i].value;

//	a = val.split(' ');
//	flight = a[3];
//	year = a[2];
	var img = document.flightimage;

	url='/gmd/webdata/ozwv/ozsondes/spo/images/profiles/' + s;
//        alert (url);
	location.href=url;

}

function handleit (form) {
        var s = form.flight;

	idx = s.selectedIndex;
        thisImg = s.selectedIndex;
	val = s.options[idx].value;

	var img = document.flightimage;

//	img.src='/gmd/webdata/ozwv/ozsondes/images/profiles/' + year + '/oz' + flight + '.png';
	img.src='/gmd/webdata/ozwv/ozsondes/spo/images/profiles/' + val;
//        alert (img.src);
}

////////////////////////////////////////////////////
function handlespo (form) {
        var s = form.flight;

	idx = s.selectedIndex;
        thisImg = s.selectedIndex;
	val = s.options[idx].value;

	var img = document.flightimage;

//	img.src='/gmd/webdata/ozwv/ozsondes/images/profiles/' + year + '/oz' + flight + '.png';
	img.src='/gmd/webdata/ozwv/ozsondes/spo/iadv/' + val;
//        alert (img.src);

        if ( thisImg == 0) {
                document.getElementById("B4").disabled = true;
                document.getElementById("B5").disabled = false;
        } else if ( thisImg == s.length - 1) {
                document.getElementById("B5").disabled = true;
                document.getElementById("B4").disabled = false;
        } else {
                document.getElementById("B4").disabled = false;
                document.getElementById("B5").disabled = false;
        }
}

////////////////////////////////////////////////////
function frameAdvance()
{
	document.o3form.flight.selectedIndex--;
	handlespo(document.o3form);
}

////////////////////////////////////////////////////
function frameBack()
{
	document.o3form.flight.selectedIndex++;
	handlespo(document.o3form);
}

