function select_artist()
{
        
    // get the height of the page to set the cloak size
    var height = getPageSizeWithScroll();
    document.getElementById('cloak').style.height = height + 'px';
    document.getElementById('cloak').style.display = 'block';
    
    
    
    document.getElementById('select-artist').style.display = 'block';
    // could set location of div here with mouse click event ?
    

    
    
    
    
    /* AJAX THE THUMBS */
    
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    } catch (e) {
        // Internet Explorer
        try {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    xmlHttp.onreadystatechange=function() {
        if (xmlHttp.readyState==4) {
            document.getElementById('select-artist-thumbs').innerHTML =
                                                        xmlHttp.responseText;
        }
    }
    xmlHttp.open("GET","/artists/select_artist.php",true);
    xmlHttp.send(null);
}   






function email_friend()
{
    document.getElementById('email-friend').style.display = 'block';

}


function change_artwork(filename, width, height, title, alt, caption, dimensions, medium, price, artist_name, work_id)
{
    //document.getElementById('artwork-image').style.display = 'none';
    document.getElementById('op1').style.display = 'none';

    document.getElementById('artwork-loading').innerHTML = 'Loading artwork "'+ title + '"';
    
    document.getElementById('artwork-image').src = filename;
    document.getElementById('artwork-image').alt = alt;
    document.getElementById('artwork-image').width = width;
    document.getElementById('artwork-image').height = height;
    
    document.getElementById('artwork-title').innerHTML = title;
    document.getElementById('artwork-caption').innerHTML = caption;
    document.getElementById('artwork-dimensions').innerHTML = dimensions;
    document.getElementById('artwork-medium').innerHTML = medium;
    document.getElementById('artwork-price').innerHTML = price;
    
    document.getElementById('artwork-link').href = '/artists/' + artist_name + '/gallery/' + work_id + '/';
    document.getElementById('artwork-title-link').href = '/artists/' + artist_name + '/gallery/' + work_id + '/';
    
    
    // change url for bookmark?
    // location.href='/artists/andrew_may/234';
}


function artwork_onload()
{
    document.getElementById('artwork-loading').innerHTML = '';
    document.getElementById('op1').style.display = 'block';
}




// http://codylindley.com/Webdev/295/javascript-get-page-height-with-scroll

function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	//return arrayPageSizeWithScroll;
	
	// my edit
	return yWithScroll;
}
