var menuskin = "LightDrop"; // skin0, or skin1
var display_url = 0; // Show URLs in status bar?
// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  return true
}


  
 function showbigimage(imgName, picname, artist){
	
	//alert ('here');
	document.getElementById("picRollover").innerHTML = "<TABLE><TR><TD><img src='stock/"+imgName+"' ALT='Downloading Image...'></TD></TR></TABLE><DIV id=rollovertextL>" + picname + "<BR>" + artist + "</DIV>";
	
	if (document.body.clientWidth > 1000){
		var newleft = Math.round((document.body.clientWidth - 970)/2);
	
	} else {
		var newleft = 0;
	}

	//alert (document.body.clientWidth);

	if (IE) {
		document.getElementById("picRollover").style.left = newleft;

	}

	if (!document.documentElement.scrollTop) {
		topY = document.body.scrollTop;
	} else {
		topY = document.documentElement.scrollTop;
	}

	document.getElementById("picRollover").style.top = topY + 120;
	//document.getElementById("picRollover").style.left = document.getElementById("picRollover").offsetLeft;
	document.getElementById("picRollover").style.visibility = "visible";

}

function hidebigimage(){
	
	document.getElementById("picRollover").innerHTML = "off";
	document.getElementById("picRollover").style.visibility = "hidden";
}


function showlightbox(stockid, stockname, count, e) {

	var rightedge = document.body.clientWidth-tempX;
	var bottomedge = document.body.clientHeight-tempY;	

	for (i=0;i<count;i++){
		document.getElementById("stockid" + i).value = stockid
		document.getElementById("stockname" + i).value = stockname
	}
	//document.getElementById("stockid" + count).value = stockid

	
	if (rightedge < document.getElementById('LightBoxMenu').offsetWidth)
		leftpos = document.body.scrollLeft + tempX - document.getElementById('LightBoxMenu').offsetWidth;
	else
		leftpos =  document.body.scrollLeft + tempX;

	 document.getElementById('LightBoxMenu').style.left = leftpos + "px"

	
	if (bottomedge < document.getElementById('LightBoxMenu').offsetHeight)
		toppos = document.body.scrollTop + tempY - document.getElementById('LightBoxMenu').offsetHeight;
	else
		toppos = document.body.scrollTop +tempY;
		
	document.getElementById('LightBoxMenu').style.top = toppos + "px"
	
	document.getElementById('LightBoxMenu').style.visibility = "visible";
	return false;
}

function hidelightbox() {
	document.getElementById('LightBoxMenu').style.visibility = "hidden";
}

function highlight() {
	if (event.srcElement.className == "lightitem") {
		event.srcElement.style.backgroundColor = "#cccccc";
		event.srcElement.style.color = "black";
	if (display_url)
		window.status = event.srcElement.url;
	}
}

function lowlight() {

if (event.srcElement.className == "lightitem") {
	event.srcElement.style.backgroundColor = "";
	event.srcElement.style.color = "white";
	window.status = "";
   }
}

function jumpto(form) {

if (event.srcElement.className == "lightitem") {
			form.submit();
   }
}



