// Functions used for the gallery
//
//  Include using this in the HEAD sections
//  <SCRIPT LANGUAGE="JavaScript" SRC="myscript.js">
//  </SCRIPT>

$(document).ready(function() {

    // animate left and right buttons
    $('#leftbutton')[0].onmouseover = function() {
        $(this).css('position','relative');
        $(this).animate({
            left:"-=10px"
        },150).animate({
            left:"+=10px"
        },150).animate({
            left:"-=5px"
        },150).animate({
            left:"+=5px"
        },150);
    };

    $('#rightbutton')[0].onmouseover = function() {
        $(this).css('position','relative');
        $(this).animate({
            right:"+=10px"
        },150).animate({
            right:"-=10px"
        },150).animate({
            right:"+=5px"
        },150).animate({
            right:"-=5px"
        },150);
    };

    // jiggle links
    $('.portfolio-button').each(function () {
       this.onmouseover = function() {
           $(this).css('position','relative');
           $(this).animate({top:"-=4px"},150).animate({top:"+=4px"},80);
       };
    });
});

// Changes the image called 'picture' to given filename
function doButtons(picimage) {

    document['picture'].src=picimage;

}

// Preloads all the given images
function MM_preloadimages() { //v3.0

    var d=document;
    if(d.images){
        if(!d.MM_p) {
            d.MM_p=new Array();
        }
        var i,j=d.MM_p.length,a=MM_preloadimages.arguments;
        for(i=0; i<a.length; i++)

            if (a[i].indexOf("#")!=0){
                d.MM_p[j]=new Image; 
                d.MM_p[j++].src=a[i];
        }
    }
}
