function getVideo(videoid,width,height) {	
    if (videoid != '') {
        var url = '/app/modules/youtube_videos/xml/getvideo.php';

        var myRequest = new ajaxObject(url);
        myRequest.callback = function(responseText, responseStatus, responseXML) {
            if (responseStatus==200) {
                document.getElementById('tv-holder').innerHTML = responseText;
            }
        }
        myRequest.update('videoid='+videoid+'&width='+width+'&height='+height);
    }
}

function toggleVideo(videoid, direc, total) {
    if (videoid != '') {
        switch(direc){
            case 'prev':
                id = (videoid == 0) ? (total*1)-(1*1) : (videoid*1)-(1*1);
                break;
            case 'next':
                id = (videoid == (total*1)-(1*1)) ? 0 : (videoid*1)+(1*1);
                break;
        }

        document.getElementById('video'+videoid).style.display = 'none';
        document.getElementById('video'+id).style.display = '';
    } else
        return false;
}
