
// Function to zoom a given word
var feedbackLink = "http://fanforum.ghpg.net/sendmessage.php";
function include(lyr,word,fullWord){

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// EDIT PATH LOCATIONS HERE:

// Location of full images (this server)
imgloc = "full";
imgloc = "images/full";

// Location of Yahoo feedback link (goes in every zoomed text box)

// Feedback link text (goes in every zoomed text box)
feedbackText = "© GHPG.net";

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// Location of text file
url = "text/"+word+".html";

// Location of image
imgurl = imgloc + "/" + word + ".jpg";

// Replace any encoded ampersands in word
var re = new RegExp ("&", 'gi') ;
var re2 = new RegExp ("%26", 'gi') ;
url = url.replace(re, "and") ;

// Form the content string
picString = "<table cellpadding='6' width='246' bgcolor='#FFFFFF'><tr><td class='black'>";
picString += "<img src='"+imgurl+"' width='227' height='149' border='1'><br>";
picString += "<span class='title'>"+fullWord+"</span><br>";

// End of content string (close button & comments link)
ender = "<br><br><table width='230' cellpadding='0' cellspacing='0'><tr><td class='black' width='125'>";
ender += "<b>"+feedbackText+"</b>";
ender += "</td><td align='right' class='black'>[ <a href='javascript:toggleZoom(\"hidden\")'>Close</a> ]";
ender += "</td></tr></table>";
ender += "</td></tr></table>";

if (document.all) 
{
  // IE version
  try {
	  var xml = new ActiveXObject("Microsoft.XMLHTTP");
	  xml.Open( "GET", url, false );
	  xml.Send();
	 
	  // Translate any encoded ampersands
	  content = xml.responseText.replace(re, "and");
	  content = content.replace(re2, "and");
		
	  picString +=  content + ender;
		
	  document.getElementById(lyr).innerHTML=picString;
   }
  catch (e){
	  var xml = new ActiveXObject("MSXML2.XMLHTTP.4.0");
	  xml.Open( "GET", url, false );
	  xml.Send();
	  
	  // Translate any encoded ampersands
	  content = xml.responseText.replace(re, "and");
	  content = content.replace(re2, "and");
		
	  picString +=  content + ender;
	  document.getElementById(lyr).innerHTML=picString;
  }
  
}
else
{
  // Mozilla/Netscrap 6+ version
	var xml=new XMLHttpRequest();
	xml.open("GET",url,false);
	xml.send(null);
	
	// Translate any encoded ampersands
	content = xml.responseText.replace(re, "and");
	content = content.replace(re2, "and");
	
	picString +=  content + ender;
	document.getElementById(lyr).innerHTML=picString;
}

// Make visible
toggleZoom("visible");
}

// Function to toggle visibility of zoom box
function toggleZoom(setVisibility){ 

if (document.layers){ 
   var whichLayer; 
   if(parentID){ 
	 whichLayer = eval('document.' + '.document.Zoom.document');
   }else{ 
	 whichLayer = document.layers["Zoom"].document; 
   } 
   if(document.layers['Zoom'].document){
	 whichLayer.style.visibility = setVisibility;
	}	    
 }else if (parseInt(navigator.appVersion)>=5&&navigator.appName=="Netscape"){ 
   document.getElementById("Zoom").style.visibility = setVisibility;
 }else if (document.all){
	if(document.all['Zoom']){
		document.all["Zoom"].style.visibility = setVisibility;
	}
  }
}

// Function to switch the word that's currently selected
function swapWord(word){

// Replace any encoded ampersands in word
var re = new RegExp ("%26", 'gi') ;
word = word.replace(re, "&amp;") ;

if (document.layers){ 
   var wordLayer; 
   if(parentID){ 
	 wordLayer = eval('document.' + '.document.' + 'SelectedWord' + '.document'); 
   }else{ 
	 wordLayer = document.layers['SelectedWord'].document; 
   } 
   wordLayer.open(); 
   wordLayer.write(word); 
   wordLayer.close(); 
 }else if (parseInt(navigator.appVersion)>=5&&navigator.appName=="Netscape"){ 
   document.getElementById('SelectedWord').innerHTML = word; 
 }else if (document.all){
	document.all['SelectedWord'].innerHTML = word ;
  }
}
function popup(w){
window.open(feedbackLink+w+"/","comments","toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=450,height=600");
}

