function show_large($new_src) { 
	document.getElementById('large_img').src='/templates/img/products/larges/'+$new_src;
}

function MM_openBrWindow(theURL,winName,features) { // Used to open product thumb image in new window
  window.open(theURL,winName,features);
}

function doNothing() { // Intentionally empty
}

function checkEnter(e) // Enable forms to be submitted with 'enter' even if the buttons a graphic
{ //e is event object passed from function invocation
	var characterCode
	if(e && e.which)
	{ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}
	else
	{
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	
	if(characterCode == 13)
	{ //if generated character code is equal to ascii 13 (if enter key)
		document.forms[0].submit() //submit the form
		return false 
	}
	else
	{
		return true 
	}
}

// Product-info page function which opens new image window for large product shots
function getImageXtraLarge(pExistingImageID, ImageURL, imageWidth, imageHeight)
{
	$imageLink = document.getElementById(pExistingImageID).src; // Get image link using the img id (placeholder)
	
	$imageName=$imageLink.split("/"); // Because the link contains directorys, use split to create an array
	
	$arrayLength=$imageName.length-1; // We only need the last array value so obtain it using length minus 1.
	
	// Open new window with the url created with [PRD_XTRA_LARGE_LINK] and the image name (taken from the created array)
	newwindow=window.open("/library/image_popup/popup.php?url="+ImageURL+$imageName[$arrayLength]+"&clTxt=Click on image to close window", "mywindow","menubar=1,resizable=1"); // ,'name','height='+imageWidth+', width='+imageHeight+', location=yes'

	if (window.focus) 
	{
		newwindow.focus()
	}
}

// Function to get medium image and display it on product info page.
function getImage(pExistingImageID, pImageURL) // Pass in div id (placeholder) and image url
{ 

	var zoomimage = '/library/ZoomImage.php?src=';
    var img = document.createElement('img'); // Build image element
    
    img.onload = function (evt) // Create a function which is run when the image loads and appends our existing page (without having to reload it).
    {
        document.getElementById(pExistingImageID).src=this.src;
        document.getElementById(pExistingImageID).width=this.width;
        document.getElementById(pExistingImageID).height=this.height;
    }
    img.src = zoomimage+pImageURL;
}

