//Pop up a smaller image as a bigger one.
function makeImagebig(elem)
{
	//Set the image path.        
	var newPath = elem.src;
	//newPath = newPath.substring(newPath.indexOf("sku=") + 4, (newPath.indexOf("sku=") + 9));
	
	/*
	Find the position of the elem that fired the event on the screen.
	Split the result into an array for use later.
	*/
	var intPos = findPos(elem);
	
	/*
	Set up the div and image to be displayed.
	*/
	var div;
	var img;
	div = document.getElementById('largerDiv');
	img = document.getElementById('largerImage');
	img.src = "http://www.cablestogo.com/product-image.asp?sku=" + newPath + "&size=200";
	
		
	/*
	This is where you can move the image around.  Just change the int values that are being added or subtracted.
	*/
	
	if(intPos[0] + 225 > document.body.clientWidth){
	    img.style.top = (intPos[1] - 50) + 'px';
	    img.style.left = (intPos[0] - 225) + 'px';
	}
	else{
	    img.style.top = (intPos[1] - 50) + 'px';
	    img.style.left = (intPos[0] + 75) + 'px';
	}
    
	//Toggle the image based if it is displayed or hidden.
	if(div.style.display == "none") {
		div.style.display = "inline";
	} else {
		div.style.display ="none";
	}
}
    
//Finds the TRUE position of an element on a screen.  Cross browswer friendly.
function findPos(obj) 
{
	var curleft = curtop = 0;
	if (obj.offsetParent) 
	{
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) 
		{
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}


/*
This is used by Endeca, please do not remove this.
*/
function searchBoxClearText(elem)
{
    if(elem.value == "Enter Keyword/Part#")
        elem.value = '';

}
