var dO=new Object();
dO.currID=null;
dO.z=0;
dO.xo=0;
dO.yo=0;
dO.ieOld;

if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ 
 var ieversion = new Number(RegExp.$1)
 if (ieversion < 8) { dO.ieOld = true; }
 }

function trackM(e) {
 if(dO.currID != null) {
  if (dO.ieOld) {
   x = event.clientX+document.body.scrollLeft;  // ie < ver 8
   y = event.clientY+document.body.scrollTop; 
  } else {
   x = e.pageX;  // all other browsers
   y = e.pageY; }
 dO.currID.style.top = y-dO.yo+'px';
 dO.currID.style.left = x-dO.xo+'px'; }
 return false; }

function dragM(e) {
 if(dO.currID == null) {
 var tx = parseInt(this.style.left);
 var ty = parseInt(this.style.top);
 dO.currID=this;
 this.style.zIndex = document.images.length+(dO.z++);
  if (dO.ieOld) {
   dO.xo = event.clientX+document.body.scrollLeft-tx;
   dO.yo = event.clientY+document.body.scrollTop-ty;
  }else{
   dO.xo = e.pageX-tx;
   dO.yo = e.pageY-ty; }
 return false; }}

function dragElement(id){
 this.idRef = document.getElementById(id);
 this.idRef.onmousedown = dragM;
 this.idRef.onmouseup = function(){dO.currID=null } }

document.onmousemove = trackM;

/*
function getXY(event){
  if (dO.ieOld) { vertAbs = event.clientY+document.body.scrollTop; } 
  else { vertAbs = e.pageY; }
// scrnY=event.clientY;
} */

function showPic() {
 var i;
 var NoOfItems = showPic.arguments.length;
 for (i=0;i <NoOfItems;i++) {
 var picAll = showPic.arguments[i]
 var pic = picAll;
 if (picAll.indexOf("/") != -1) {
  arrayloc = picAll.split("/");
  pic = arrayloc[1]; }
 var temp = document.getElementById(pic);
 if (temp.style.display == "none") {
  temp.setAttribute('src', 'images' + picAll + '.jpg');
  temp.style.display= "block"; 
  } else { 
  temp.style.display= "none"; 
  temp.setAttribute('src', ''); }} }

