  function showpopupimg(id, imgid){
    var objLoadingImage = document.getElementById(id);
    var windowWidth, windowHeight;
    
 	if (self.innerHeight)
        {	// all except Explorer
		windowWidth = self.innerWidth - 60;
		windowHeight = self.innerHeight - 60;
	}
        else if (document.documentElement && document.documentElement.clientHeight)
        { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth - 60;
		windowHeight = document.documentElement.clientHeight - 60;
	} else if (document.body)
        { // other Explorers
		windowWidth = document.body.clientWidth - 60;
		windowHeight = document.body.clientHeight - 60;
	}


	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	var xScroll;

	if (self.pageXOffset) {
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollLeft){	 // Explorer 6 Strict
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		xScroll = document.body.scrollLeft;
	}

    objLoadingImage.src = imgid + '&width=' + windowWidth + '&height=' + windowHeight;
    var iw = objLoadingImage.width;
    var ih = objLoadingImage.height;

    //document.getElementById(id).style.visibility = "visible";
    //document.getElementById(id).style.left = ((windowWidth / 2) - (iw / 2)) + xScroll + 'px';
    //document.getElementById(id).style.top = ((windowHeight / 2) - (ih / 2)) + yScroll + 'px';
    //document.getElementById(id).style.zIndex = 30;
    document.getElementById("imgclassframe").style.visibility = "visible";
    document.getElementById("imgclassframe").style.left = ((windowWidth / 2) - (iw / 2)) - 27 + xScroll + 'px';
    document.getElementById("imgclassframe").style.top = ((windowHeight / 2) - (ih / 2)) - 27 + yScroll + 'px';
    document.getElementById("imgclassframe").style.zIndex = 30;
    document.getElementById("darkfilter").style.display = "block";
    document.getElementById("flash").style.visibility = "hidden";
    document.getElementById("darkfilter").style.top = yScroll+ 'px';
    document.getElementById("darkfilter").style.left = xScroll+ 'px';
  }

  function centerpopupimg(id)
  {
    	var objLoadingImage = document.getElementById(id);
        var iw = objLoadingImage.width;
        var ih = objLoadingImage.height;

	var windowWidth, windowHeight;

	if (self.innerHeight)
        {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	}
        else if (document.documentElement && document.documentElement.clientHeight)
        { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body)
        { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}


	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	var xScroll;

	if (self.pageXOffset) {
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollLeft){	 // Explorer 6 Strict
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		xScroll = document.body.scrollLeft;
	}

    //document.getElementById(id).style.left = ((windowWidth / 2) - (iw / 2)) + xScroll + 'px';
    //document.getElementById(id).style.top = ((windowHeight / 2) - (ih / 2)) + yScroll + 'px';
    document.getElementById("imgclassframe").style.left = ((windowWidth / 2) - (iw / 2)) - 27 + xScroll + 'px';
    document.getElementById("imgclassframe").style.top = ((windowHeight / 2) - (ih / 2)) - 27 + yScroll + 'px';
    document.getElementById("darkfilter").style.top = yScroll+ 'px';
    document.getElementById("darkfilter").style.left = xScroll+ 'px';
  }

  function showpopupimgclass(imgid){
    showpopupimg("imgclass", imgid);
  }

  function hidepopupimg(id){
    //document.getElementById(id).style.visibility = "hidden";
    document.getElementById("darkfilter").style.display = "none";
    document.getElementById("imgclassframe").style.visibility = "hidden";
    document.getElementById(id).src = "Loading.png";
    document.getElementById("flash").style.visibility = "visible";
   }

