function light(id) {
		document.getElementById(id).style.filter='alpha(opacity='+boxOpacity+')';
		document.getElementById(id).style.opacity='.'+boxOpacity;
}
	
var count = document.links.length;

if (topOrBottom)
{
	for(x=0;x<count;x++)
	{
				
		if (document.links[x].parentNode.name && ((typeof(document.links[x].onmouseover) == 'undefined' || typeof(document.links[x].onmouseover) == 'object')))
		{	
		
			mapnum = /_0([1-5])/;
			map = mapnum.exec(document.links[x].parentNode.name);
			
			if(map) {
				if (map[1]==1||map[1]==2)
					target = "top";
				else if (map[1]==3||map[1]==4)
					target = "bottom";
				else if (map[1]==5)
				{
				var coords = document.links[x].coords.split(",");
				var x1 = parseInt(coords[1]);
				var hh = H * .5;
				if (x1 < hh)
				target = "top";
				else
				target = "bottom";
				}
				
				if (!document.links[x].href.match("lg_display") && !document.links[x].href.match("mailto:") && document.links[x].href.match("\\?") && document.links[x].className != 'notarget')
					document.links[x].href = document.links[x].href + "&target="+target;
					
				else if (!document.links[x].href.match("lg_display") && !document.links[x].href.match("mailto:") && document.links[x].className != 'notarget' && document.links[x].target != '_blank')
					document.links[x].href = document.links[x].href + "?target="+target;		

			}
			
		}
	}
}



if (enabled == 1)  {
	
	hh = H * .5;
	ww = W * .5;
	var aWin = document.body.clientWidth;
	var margn = 0;
	var count = document.links.length;
	var divcount = 1;
	for(x=0;x<count;x++) {
		
				
		if (document.links[x].parentNode.name && document.links[x].className != 'nobox'  && (( typeof(document.links[x].onmouseover) == 'undefined' || typeof(document.links[x].onmouseover) == 'object')|| document.cookie.indexOf('proof=1') > -1))	{	
			mapnum = /_0([1-5])/;
			map = mapnum.exec(document.links[x].parentNode.name);
			
			if(map) {
			
			if (map[1] == 1 || map[1] == 5)
				adjust = "0,0,0,0";
			else if (map[1] == 2)
				adjust = ww+",0,"+ww+",0";
			else if (map[1] == 3)
				adjust = "0,"+hh+",0,"+hh;
			else if (map[1] == 4)
				adjust = ww+","+hh+","+ww+","+hh;
			
			if (adjust && document.links[x].coords) {
				var coords = document.links[x].coords.split(",");
				var factor = adjust.split(",");
				
				var x1 = parseInt(coords[0]) + parseInt(factor[0]) + leftAdjust;
				var y1 = parseInt(coords[1]) + parseInt(factor[1]) + topAdjust;
				var x2 = parseInt(coords[2]) + parseInt(factor[2]) + rightAdjust;
				var y2 = parseInt(coords[3]) + parseInt(factor[3]) + bottomAdjust;	
				
				if (y2-y1 <= 0)  {
					var y1 = parseInt(coords[3]) + parseInt(factor[3]) + topAdjust;
					var y2 = parseInt(coords[1]) + parseInt(factor[1]) + bottomAdjust;
				}
				
				if ((boxOrBorder == "border" || boxOrBorder == "both") && document.links[x].className != "highlight_sku") {
					x1= x1 - borderWidth;
					y1= y1 - borderWidth;
					x2= x2 - borderWidth;
					y2= y2 - borderWidth;
				}
				
				var w = x2-x1;
				var h = y2-y1;
				
				x1 = x1 - 0 + margn;
				
				message = '<div id="div'+divcount+'" class="'+document.links[x].className+'" style="left:'+x1+'px;top:'+y1+'px;width:'+w+'px;height:'+h+'px;position:absolute;';
				divcount = divcount + 1;
				if (boxOrBorder == "box" && alwaysOn == "no"  || boxOrBorder == "both")
					message = message + 'background:'+boxColor+';filter:alpha(opacity=0);opacity:0;" onmouseover="light(this.id)" onmouseout="this.style.filter=\'alpha(opacity=0)\';this.style.opacity=\'.0\';">';
				else if (boxOrBorder == "box" && alwaysOn == "yes"  || boxOrBorder == "both")
					message = message + 'background:'+boxColor+';filter:alpha(opacity='+boxOpacity+');opacity:.'+boxOpacity+';">';
				else
					message = message + '">';
				
				message = message + '<a href="'+document.links[x].href+'" rel="'+document.links[x].lang+'" target="'+document.links[x].target+'" class="product_ids"><IMG SRC="images/clear.gif" border="0" title="'+document.links[x].title+'" width="'+w+'" height="'+h+'" title="'+document.links[x].title+'" ';
				
				if (boxOrBorder=="border" || boxOrBorder == "both")
					message = message + 'onmouseover="this.style.border=\''+borderWidth+'px '+ borderStyle + ' '+borderColor+'\'" onmouseout="this.style.border=\'none\'"';
				
				message = message + ">";
				message = message + '</a></div>';
				document.write(message);
				}
			}
		}
	}
}
