// Send to a Friend and Print Functions
var newWindow;

function printme(){
	newWindow = window.open("","Print Document");
	var documentId=document.getElementById('c1');
	var documentHeader="<hrml><head></head><body>";
	var documentFooter = "</body></html>";
	var textToPrint = documentId.innerHTML;
	var textCompleted=documentHeader+textToPrint+documentFooter;
	newWindow.document.write (textCompleted);
	
	//setTimeout('cleanUp()', 1000);
}


function cleanUp() {
	var elementToRemove = newWindow.document.getElementById('sendandprint');
	newWindow.document.body.removeChild(elementToRemove);
	var imageToRemove = newWindow.document.getElementById('topImage');	
	if (imageToRemove) newWindow.document.body.removeChild(imageToRemove);
	var logicalPathToRemove = newWindow.document.getElementById('logical_path');	
	if (logicalPathToRemove) newWindow.document.body.removeChild(logicalPathToRemove);

	newWindow.print();
}


function sendToFriend(location){
	var newWindow = window.open("/phpscripts/friend.php?link="+location);
}

function onemail(obj){
	var el = document.getElementById('email-details');
	if (el.className == "hidden") {
		el.className = "visible";
	} else if (el.className == "visible" && obj.value.length == 0) {
		el.className = "hidden";
	}
}