	
if (document.images) {
			
	home = new Image();
	home.src = "images/home.jpg";

	home_on = new Image();
	home_on.src = "images/home_on.jpg";

			
	gallery = new Image();
	gallery.src = "images/gallery.jpg";

	gallery_on = new Image();
	gallery_on.src = "images/gallery_on.jpg";
	
	
	studio = new Image();
	studio.src = "images/studio.jpg";

	studio_on = new Image();
	studio_on.src = "images/studio_on.jpg";


	cv = new Image();
	cv.src = "images/cv.jpg";

	cv_on = new Image();
	cv_on.src = "images/cv_on.jpg";
	
	
	contact = new Image();
	contact.src = "images/contact.jpg";

	contact_on = new Image();
	contact_on.src = "images/contact_on.jpg";
	
}

// Function to 'activate' images.
function imgOn(imgName) {

	if (document.images) {
	
		document[imgName].src = eval(imgName + "_on.src");
		
	}
	
}


// Function to 'deactivate' images.
function imgOff(imgName) {

	if (document.images) {
	
		document[imgName].src = eval(imgName + ".src");
		
	}
	
}



function highlightRecentPaintings(id){

	if(document.getElementById){

		document.getElementById(id).className='homeTableDropShadowHighlight';

	}

}


function unhighlightRecentPaintings(id){

	if(document.getElementById){

		document.getElementById(id).className='homeTableDropShadow';

	}

}
		


function highlightGalleryImage(id){

	if(document.getElementById){
	
		document.getElementById(id).className='gallerySlideDropShadowHighlight';
		document.getElementById('title['+id+']').className='gallerySlideFooterHighlight';
		document.getElementById('link['+id+']').className="thumbnailTextHighlight";
	
	}

}


function unhighlightGalleryImage(id){

	if(document.getElementById){
	
		document.getElementById(id).className='gallerySlideDropShadow';
		document.getElementById('title['+id+']').className='gallerySlideFooter';
		document.getElementById('link['+id+']').className="thumbnailText";
	
	}

}
		
		
function highlightStudioImage(id){

	if(document.getElementById){

		document.getElementById(id).className='studioSlideDropShadowHighlight';

	}

}


function unhighlightStudioImage(id){

	if(document.getElementById){

		document.getElementById(id).className='studioSlideDropShadow';

	}

}


var viewArtwork = null;

function viewArtworkPop(url){
	
	var str = centerWindow(700,800);
		
	viewArtwork = window.open(url, "viewArtwork", "location=no,menubar=no,resizable=yes,scrollbars=yes," + str);
	viewArtwork.focus();	
	
}


var openArtworkInquriy = null;

function openArtworkInquiry(url){
	
	var str = centerWindow(700,450);
		
	openArtworkInquriy = window.open(url, "openArtworkInquiry", "location=no,menubar=no,resizable=yes,scrollbars=yes," + str);
	openArtworkInquriy.focus();

}


var viewStudio = null;

function viewStudioPop(url){
	
	var str = centerWindow(700,720);
		
	viewStudio = window.open(url, "viewStudio", "location=no,menubar=no,resizable=yes,scrollbars=yes," + str);
	viewStudio.focus();	

}


function centerWindow(width,height) {

	if(window.screen){

		if(screen.availHeight-30 <= height){
		
			height = screen.availHeight - 30;
		
		}
	
		if(screen.availWidth-10 <= width){
		
			width = screen.availWidth - 10;
		
		}
	
	}

	var str = "height=" + height + ",innerHeight=" + (height+30);
	str += ",width=" + width + ",innerWidth=" + width;
	
	if (window.screen) {
	
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;

		var xc = (aw - width) / 2;
		var yc = (ah - height) / 2;

    	str += ",left=" + xc + ",screenX=" + xc;
    	str += ",top=" + yc + ",screenY=" + yc;
  	}

  	return str;
	
}
