
	window.onload = function() {
		
		if(document.getElementById('sendToAFriend')) sendToAFriendPopup();
	}
	
	
	function sendToAFriendPopup() {
		if(document.getElementById('sendToAFriend'))
		{
			var sendToAFriend = document.getElementById('sendToAFriend');
			sendToAFriend.onclick = function() {
			
				window.open ("tellAFriendPopup.php",
				"TACwindow","location=1,status=1,scrollbars=0,width=700,height=550");
				return false;
				}
		}
	}
	
	function replaceContentWithImage(containerID,file,alt,imgClass) {
       
        // if a nonexistant id was passed, get the hell out while we still can
        
		
        if (!document.getElementById(containerID)) return;
        
        // get a reference to the container element
        var el = document.getElementById(containerID)
        
        
        // create an img node, and set it's src and alt attributes
        var imgNode = document.createElement("img");
		
        imgNode.src = file;
		
        if (alt) imgNode.alt = alt;

        if (imgClass) imgNode.className = imgClass;


        // clear out any pre-existing content from the container element, and add in the image
        el.innerHTML = '';
        el.appendChild(imgNode);
		
		
    }