function showPic2 (whichpic2) {
if (document.getElementById) {
document.getElementById('placeholder').src = whichpic2.href;
    return false;
 } else {
 return true;
 }
}

var childRef=null;
function showPic(whichpic) {
childRef=window.open(whichpic,'large_image','width=400, height=600, top=100, left=300, resizable=no');
}

// Suppress tooltip display for links that have the classname 'suppress' 
var links = document.getElementsByTagName('a'); 
for (var i = 0; i < links.length; i++) { 
    if (links[i].className == 'suppress') { 
        links[i]._title = links[i].title; 
        links[i].onmouseover = function() {  
            this.title = ''; 
        } 
        links[i].onmouseout = function() {  
            this.title = this._title; 
        } 
    } 
}

function displayDescription(picture){
	var p = $(picture).parent();
	var desc = p.children('div.picture-description');
	if(desc){
		if(desc.html()){
			$('#pdescription_holder').html(desc.html());
		}else{
			$('#pdescription_holder').html('');
		}
	}
}

$(document).ready(function() {
	/*
	 * Gallery page onclick handler
	 */
	$('a.thumbnail').click(function() {
		return false;
	});
	/*
	 * Mouseover handler
	 */
	$('a.thumbnail').mouseover(function() {
		showPic2(this);
		//display picture description
		displayDescription(this);
		return false;
	});
});
