
$(document).ready(function(){

	///////----------------------------------------------------------------------------------
	// Product mini gallery - changes the source of #productImg to the source of the hovered
	// thumb image in #thumbs li img - on mouseout swaps it back to the origianl image src 
	/////////////////////////////////////////////////////////////////////////////////////////
	
	// get the original product image source
	var origImage = $('#productImg').attr('src');
	
	// do the swapping here
	$('#thumbs li img').hover(function(){
		$('#productImg').attr('src', this.src);
		$(this).css('cursor', 'pointer');
	},function() { 
		$('#productImg').attr('src', origImage); // reset back to the original image src
	});
});

// introduced in order to satisfy the xhtml 1.0 strict doctype
// which don't allow any target="_blank" attribute
function externalLinks() 
{  
	if (!document.getElementsByTagName) 
	{
		return;
	}
	var anchors = document.getElementsByTagName("a");  
	for (var i = 0; i < anchors.length; i++) 
	{  
		var anchor = anchors[i];  
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
		{
			anchor.target = "_blank";
		}
	}
}  
window.onload = externalLinks;

function openPopUpImage(popuplink,width, height)
{
	window.open(popuplink,'detail','width='+width+',height='+height+',status=no,menu=no,toolbar=no,location=no,scrollbars=yes,resizable=no')	
}

function openPopUpText(popuptext,width, height)
{
	window.open(popuptext,'detail','width='+width+',height='+height+',status=no,menu=no,toolbar=no,location=no,scrollbars=yes,resizable=no')
}

function emptySearch()
{
	document.getElementById("searchField").value="";
}

function HideContent(d) 
{
if(d.length < 1) { return; }
document.getElementById(d).style.display = 'none';
}

