function viewPic(p) {
//	if (navigator.userAgent.search("MSIE 6") > -1 && navigator.userAgent.search("MSIE 7") == -1) { location.href = window.location.protocol + "//" + window.location.host + '/i/pictures/'+p+'.jpg'; return; }
  if (!document.getElementById('js')) {
    var b = document.createElement('div');
    b.id = 'js';
    document.body.insertBefore(b, document.body.childNodes[0]);
  }
	var d = viewSize();
	var h = Math.round(d[1] * .75);
	var w = Math.round(h * 1.33333333333333);
	if (w > 800) w = 800;
	if (h > 600) h = 600;
	if (typeof h != 'number') h = 400;
	var t = Math.round((d[1] - (h + 49)) / 2);
  document.getElementById('js').innerHTML = '<div id="screen" onclick="closePic()" style="height:'+d[1]+'px"></div><div id="float-wrapper" onclick="closePic()"><div id="float-box" style="margin-top:'+t+'px;width:'+w+'px"><img src="/i/pictures/'+p+'.jpg" style="height:'+h+'px;width:'+w+'px" alt=""/>Click anywhere to Close</div></div>';
}

function closePic() {
  var b = document.getElementById('js');
  if (b) b.parentNode.removeChild(b);
}

function viewSize() {
  var h = 0, w = 0;
  if (typeof (window.innerWidth) == 'number') { //Non-IE
    h = window.innerHeight;
    w = window.innerWidth;
  } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { //IE 6+ in 'standards compliant mode'
    h = document.documentElement.clientHeight;
    w = document.documentElement.clientWidth;
  }
	return [w,h];
}

