//createPhotoBlock.js
function CreatePhotoBlock( PhotoID,PhotoURL,PhotoTag )
{
  var d = document.getElementById(PhotoID);
  
 	var photoString = "";
 
	photoString = '<table bgcolor="#3B3C30" border="0" width="468" cellpadding="0" cellspacing="0">';
	photoString += '<tr>';
	photoString += '<td colspan="3"><img src="' + PhotoURL + '" border="0" width="468" height="234" alt="' + PhotoTag + '"></td>';
	photoString += '</tr>';
	photoString += '<tr>';
	photoString += '<td colpsan="3"><img src="images/spacer.gif" border="0" width="1" height="5" alt=""></td>';
	photoString += '</tr>';
	photoString += '<tr>';
	photoString += '<td width="5"><img src="images/spacer.gif" border="0" width="3" height="1" alt=""></td>';
	photoString += '<td width="458" class="whiteText">' + PhotoTag + '</td>';
	photoString += '<td width="5"><img src="images/spacer.gif" border="0" width="3" height="1" alt=""></td>';
	photoString += '</tr>';
	photoString += '<tr>';
	photoString += '<td colpsan="3"><img src="images/spacer.gif" border="0" width="1" height="5" alt=""></td>';
	photoString += '</tr>';
	photoString += '</table>';
	
	d.innerHTML = photoString;
}

function openPopup(thisFolder) {
	var win = new Object;
	var x = (700 - width)/2;
	var y = (500 - height)/2;
	var width = 700;
	var height = 500;

	if (screen) {
		y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
	}
	
	if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - width)/2; 
	}
	
	win = window.open( 'http://media.curling.ca/upload/index.php?' + thisFolder + '', 'Gallery', 'width=' + width + ',height=' + height + ',status=no,scrollbars=no,resizable=no,screenX=' + x + ',screenY=' + y + ',top=' + y + ',left=' + x );
	win.focus();
}
