//setup scroll pane 
jQuery(document).ready(function() {
        //Sets up the tooltip functionality
        jQuery(".holder a").tooltip({
                x_offset:-20,
                y_offset:60
        });
        //This fixes the scrollbar in IE
        try {
                document.execCommand('BackgroundImageCache', false, true);
        }
        catch(e) {
        }
        init_scroll_pane("#pane1");
        jQuery("#roster_loading_text").hide();
        jQuery("#roster_loading").hide(function() {
                jQuery("#roster_loading_text").hide();
        });
});
//This is the function to call the scroll pane setup
function init_scroll_pane(pane_id) {
        //return false;
        jQuery(pane_id).jScrollPane({
                showArrows:true, 
                scrollbarWidth:15,
                arrowSize:10 
        });
}
//This is the callback handler for the ajax artist roster resorting
var callback = {
        startRequest:function() {
                jQuery().tooltip_close();
                jQuery("#roster_loading").show();
                jQuery("#roster_loading_text").show();
        },
        handleSuccess:function(my_data) {
                jQuery("#roster_loading_text").hide();
                jQuery("#roster_loading").hide();
                jQuery("#main_page_roster_name").html(jQuery("#status").children("[@selected]").text());
                //jQuery("#pane1").html(jQuery(my_data.responseText).find("#pane1").html()).innerHTML = my_data.responseText;;
                //document.getElementById("pane1").innerHTML = my_data.responseText;
                jQuery("#pane1").html(my_data.responseText);
                //init_scroll_pane("#pane1");
                jQuery(".holder a").tooltip({
                        x_offset:-20,
                        y_offset:60
                });
        }
}

//This was for the more and less buttons on the artist bio
function display_more() {
        document.getElementById("bio_close").style.display = "";
        document.getElementById("bio_last").style.display = "";
        document.getElementById("bio_more").style.display = "none";
        document.getElementById("dots").style.display = "none";
        return false;
}
function display_less() {
        document.getElementById("bio_close").style.display = "none";
        document.getElementById("bio_last").style.display = "none";
        document.getElementById("bio_more").style.display = "";
        document.getElementById("dots").style.display = "";
        return false;
}

var fileBottomNavCloseImage = "/images/template/close_btn.gif";
var x;
var y;
//This function keeps your current scroll 
function saveScrollCoordinates() {
        x = (document.all)?document.body.scrollLeft:window.pageXOffset;
        y = (document.all)?document.body.scrollTop:window.pageYOffset;
        if (y < 450) {
                window.scroll(0, 450);
        }
}
//This function takes you back to your last scroll
function restoreScroll() {
        window.scroll(x, y);
}

/*
This function is used to switch out the videos for youtube
*/
function show_video(player_id, video_id, youtube_id, width, height, filename, url) {
        document.getElementById(player_id).innerHTML = '<a name="vid"><object width="'+width+'" height="'+height+'"><param name="movie" value="http://www.youtube.com/v/'+youtube_id+'"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'+youtube_id+'" type="application/x-shockwave-flash" wmode="transparent" width="'+width+'" height="'+height+'"></embed></object></a>';
        if (filename != "") {
                var callback = new Object();
                callback.handleSuccess = function() {
                }
                ajax.connect(callback, url);
        }
        return false;
}
