var largeImageBox;
var showImageBoxOnLoad = false;

function initLargeImage() {
	// Initialize the temporary Panel to display while waiting for external content to load
	document.getElementById( 'largeImagePopup' ).style.display = '';
	largeImageBox = new YAHOO.widget.Panel("largeImagePopup",  
											{
											  width:"622px", 
											  height:"485px", 
											  fixedcenter:true, 
											  close:false, 
											  draggable:false, 
											  modal:true,
											  visible:false,
											  underlay:"none",
											  effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:0.5} 
											} 
										);

	largeImageBox.render(document.body);
	
	if( showImageBoxOnLoad )
		largeImageBox.show();

}

function showLargeImage( imgSrc, productName, productDesc ) {
	document.getElementById( 'largeProductImagePhoto' ).src = imgSrc;
	document.getElementById( 'largeProductImageName' ).innerHTML = productName;
	document.getElementById( 'largeProductImageDesc' ).innerHTML = productDesc;
	
	// Show the Panel
	if( typeof largeImageBox != "undefined" )
		largeImageBox.show();
	else
		showImageBoxOnLoad = true

}

function hideLargeImage() {
	// Hide the Panel
	if( typeof largeImageBox != "undefined" )
		largeImageBox.hide();
}

function writeEmail( account, txt ) {
	if ( typeof txt == 'undefined' ) {
		txt = account + '@' + 'somethingf' + 'ishy' + '.uk' + '.com';
	}
	document.write( '<a h' + 'ref' + '\="mai' + 'lto:' + account + '@' + 'somethingf' + 'ishy' + '.uk' + '.com">' + txt + '</a>' );
}