
window.onload = function(){
		
		relatedProducts();
		
}

function relatedProducts()	{
	
	/* check the browser is capable of recognising the DOM objects
	   we need to implement the script - otherwise return false and allow the normal link to be executed */
	   
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById("productPartNumber")) return false;
	
	/* get the reference to the relatedProducts object and then create an array 
	   of all the <a> tags found in the array. To each tag assign a function to
	   the onmouseover and onmouseout events - which calls the createLargeImage function. */
	
	var menu = document.getElementById("productPartNumber");
	var menulinks = menu.getElementsByTagName("a");

		for(i = 0; i < menulinks.length; i++) {

			menulinks[i].onclick = function() {
									

				createLargeImage(this)
				
				
				// return false to prevent the href value in the original <a> tag from being followed
				return false;
		
			}
			
		
		}
		
	document.getElementById("productPartNumber").style.visibility = "visible"
	
		
}













function createLargeImage(thisProduct)	{





		var finalWidth = 820
		var finalHeight = 600


		var screenRes = window.screen.width /2

		var viewerScreen = window.screen.width

		var leftAnchor = screenRes - (finalWidth / 2) -8

		//var thisSign = "product_display.asp?mod=" + thisProduct.getAttribute("name") + "&prod=" + thisProduct.getAttribute("alt")
		var thisSign = "product_display.asp?" + thisProduct.getAttribute("id")

		var newWin = window.open("","","status=no,toolbar=no,title=no,location=no,scrollbars=yes,resizable=yes,screenX=100,left=" + leftAnchor + ", top=210")
		
		newWin.window.resizeTo(finalWidth,finalHeight)

		newWin.location = thisSign

		newWin.document.close()
				
					

}


