// JavaScript Document
var sURL = unescape(window.location.pathname);
function doLoad()
{
    // the timeout value should be the same as in the "refresh" meta-tag
    setTimeout( "refresh()", 2*500 );
}
function refresh()
{
    //  This version of the refresh function will cause a new
    //  entry in the visitor's history.  It is provided for
    //  those browsers that only support JavaScript 1.0.
    //
    window.location.href = sURL;
}

function hideEmail(){
document.getElementById('sender_name').value = "";
document.getElementById('sender_email').value = "";
document.getElementById('recipient_name').value = "";
document.getElementById('recipient_email').value = "";
document.getElementById('from_name').innerHTML = "&lt;sender name&gt;";
document.getElementById('from_email').innerHTML = "address";
document.getElementById('to_name').innerHTML = "&lt;recipient name&gt;";
document.getElementById('to_email').innerHTML = "address";
document.getElementById('sender_nme').innerHTML = "&lt;sender name&gt;";
document.getElementById('sub_sender').innerHTML = "&lt;sender name&gt;";
document.getElementById('message').value = "I saw this on the Smith & Nephew site and thought you might be interested.";
document.getElementById('sub').innerHTML = "<span id='sub_sender'>&lt;sender name&gt;</span> is sending you a link</span>"
document.getElementById('emailPage').style.display='none';
doLoad();
popClose('imagePop');
}

function showEmail() {
	document.getElementById('emailPage').style.display='block';
}

function updateInfo(obj, val){
			document.getElementById(obj).innerHTML = val.value;
		}

/* popup functions: show/hide popup layer */

function popImage(link) {
	popOpen('imagePop'); // open popup
}

function popOpen(id) {
	var topOffset = 60;
	setSize(topOffset);
	var overShade = document.getElementById(id);
	var topPad =  pos+topOffset;
	// height-padding = div height
	overShade.style.height = (ph - topPad) + 'px'; /* remove topPad from height */
	overShade.style.width = pw + 'px';
	overShade.style.paddingTop = topPad + 'px';
	overShade.style.display = 'block';
}
function popClose(id) {
	document.getElementById(id).style.display = "";		
}

function setSize(topOffset) { /* sets size of shade */
	if (window.pageYOffset != null) { /* moz and safari */
		pos = window.pageYOffset;
		ph = document.documentElement.scrollHeight;
		pw = document.documentElement.scrollWidth;
		if (document.body.scrollHeight > document.documentElement.scrollHeight) {
			ph = document.body.scrollHeight;
			pw = document.body.scrollWidth;
		}
	} else if (document.documentElement.scrollTop > document.body.scrollTop) { /* ie, catch if Standards compliance mode */
		pos = document.documentElement.scrollTop;
		ph = document.documentElement.scrollHeight;
		pw = document.documentElement.scrollWidth;
		if (document.documentElement.clientHeight > document.documentElement.scrollHeight) {
			ph = document.documentElement.clientHeight;
		}
	} else if (document.body != null) { /* if IE 5.5 */
		pos = document.body.scrollTop;
		ph = document.body.scrollHeight;
		pw = document.body.scrollWidth;
		if (document.documentElement.scrollHeight > document.body.scrollHeight) {
			ph = document.documentElement.scrollHeight;
		}
		ph = ph + pos + topOffset; /* fix box model */
	}
}	