//show a hidden layer
function showLayer(strName){
	if (w3c) document.getElementById(strName).style.visibility = "visible";
	else if (ie) eval(strName).style.visibility = "visible";
	else if (ns) document.layers[strName].visibility = "show";
}

//hide a shown layer
function hideLayer(strName){
	if (w3c) document.getElementById(strName).style.visibility = "hidden";
	else if (ie) eval(strName).style.visibility = "hidden";
 	else if (ns) document.layers[strName].visibility = "hide";
}

var xPos = 0;
var yPos = 0;

function selectImage(layerName,img,header,closeTxt){
	showLayer(layerName);
	//innerHtmlCode = "<a href=javascript:hideLayer('" + layerName + "');><img src=" + img + " border='0'></a>";
	innerHtmlCode = '<table border="0" cellpadding="0" cellspacing="0">';
		innerHtmlCode = innerHtmlCode + '<tr>';
			innerHtmlCode = innerHtmlCode + '<td><img src="/ms/img/buying_guide/zoom_image/topleft.gif" alt="" border="0"></td>';
			innerHtmlCode = innerHtmlCode + '<td background="/ms/img/buying_guide/zoom_image/topmid.gif">';
				innerHtmlCode = innerHtmlCode + '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
					innerHtmlCode = innerHtmlCode + '<tr>';
						innerHtmlCode = innerHtmlCode + '<td class="zoomImageHeader"><img src="/ms/img/misc/s1x1.gif" width="3" height="1" border="0">' + header + '</td>';
						innerHtmlCode = innerHtmlCode + '<td align="right" nowrap><a href=javascript:hideLayer("' + layerName + '"); class="zoomImageCloselink">' + closeTxt + '<img src="/ms/img/misc/s1x1.gif" width="6" height="12" border="0"></a></td>';
						innerHtmlCode = innerHtmlCode + '<td width="30"><a href=javascript:hideLayer("' + layerName + '"); class="zoomImageCloselink"><img src="/ms/img/buying_guide/zoom_image/close.gif" width="30" height="32" alt="" border="0"></a></td>';
					innerHtmlCode = innerHtmlCode + '</tr>';
				innerHtmlCode = innerHtmlCode + '</table>';
			innerHtmlCode = innerHtmlCode + '</td>';
			innerHtmlCode = innerHtmlCode + '<td><img src="/ms/img/buying_guide/zoom_image/topright.gif" alt="" border="0"></td>';
		innerHtmlCode = innerHtmlCode + '</tr>';
		innerHtmlCode = innerHtmlCode + '<tr>';
			innerHtmlCode = innerHtmlCode + '<td background="/ms/img/buying_guide/zoom_image/midleft.gif"></td>';
			innerHtmlCode = innerHtmlCode + '<td><img src=' + img + ' border="0"></td>';
			innerHtmlCode = innerHtmlCode + '<td background="/ms/img/buying_guide/zoom_image/midright.gif"></td>';
		innerHtmlCode = innerHtmlCode + '</tr>';
		innerHtmlCode = innerHtmlCode + '<tr>';
			innerHtmlCode = innerHtmlCode + '<td><img src="/ms/img/buying_guide/zoom_image/botleft.gif" alt="" border="0"></td>';
			innerHtmlCode = innerHtmlCode + '<td background="/ms/img/buying_guide/zoom_image/botmid.gif"></td>';
			innerHtmlCode = innerHtmlCode + '<td><img src="/ms/img/buying_guide/zoom_image/botright.gif" alt="" border="0"></td>';
		innerHtmlCode = innerHtmlCode + '</tr>';
	innerHtmlCode = innerHtmlCode + '</table>';

	if (ie){
		eval(layerName).style.pixelTop = yPos -100 + document.body.scrollTop;
		window.eval(layerName).innerHTML=innerHtmlCode;
	}
	else if (w3c){
		document.getElementById(layerName).style.top = yPos -100;
		document.getElementById(layerName).innerHTML=innerHtmlCode;
	}
	else if (ns){
		document.layers[layerName].top = yPos -100;
		document.layers[layerName].document.open()
		document.layers[layerName].document.write(innerHtmlCode)
		document.layers[layerName].document.close()
	}
}

function initLargeImage() {
	if (ns||w3c && ie!=true) {
		document.captureEvents(Event.MOUSEMOVE);
	}
	document.onmousemove = setValue;
}

function setValue(evt) {
	if (ie) {
		yPos = event.y;
	}
	else if (w3c||ns) {
		yPos = evt.pageY;
	}
}
