	document.write("<div id=\"popup_background\" style=\"position:absolute; visibility:hidden; -moz-opacity:0; filter: alpha(opacity:100); background-color:#963338;\"></div>");
	document.write("<div id=\"popup_picture\" style=\"position:absolute; display:none; text-align:center; background-color:#963338; border:3px solid #ffffff;\">");
	document.write("  <div id=\"popup_title\" class=\"sectionTitleWhite\" style=\"height:24; padding-top:3px; font-size:16px;\"></div>");
	document.write("  <div id=\"popup_image\" style=\"background-color:#ffffff;z-index:5001;\"></div>")
	document.write("  <div style=\"height:24; padding-right:0px; padding-top:3px; text-align:right; vertical-align:bottom;\"><input type=\"button\" class=\"frmSubmit\" style=\"width:80px;\" value=\"close\" onClick=\"closePopup()\"></div>")
	document.write("</div>");
	ie5  = (document.all && document.getElementById);
	ns6 = (!document.all && document.getElementById);

	function openPopup(img, a, w, h){
		
		p_bg = document.getElementById("popup_background");
		//alert(navigator.appName + " - " + navigator.appVersion);
		if (!w, !h){
			window.open(img);
		} else {
			if(navigator.appName == "Microsoft Internet Explorer" && !p_bg.filters){
				openPopupx(img, a, w, h);
			} else {
				p_picture = document.getElementById("popup_picture");
				p_image_source = document.getElementById("popup_image_source");
				
				x = getPageSize();
				p_bg.style.top = 0;
				p_bg.style.height=x[1];
				p_bg.style.width=x[0];
				p_bg.style.top = 0;
				p_bg.style.left = 0;
		
				if(p_bg.filters){
					p_bg.filters.alpha.opacity = 0;
				} else {
					p_bg.style.MozOpacity = 0/100;
				}
				
				
				p_bg.op = 0;
				p_bg.style.visibility = "visible";
		
				//p_picture.style.width = 0;
				
				//p_picture.style.left = (x[0] / 2) - (w/ 2) - 13;
				//p_picture.style.top = (x[1] / 2) - (h/ 2) - 30;
		
		
				//p_picture.style.top = 200 + document.body.scrollTop;
				//p_image_source.src = img;
		
				//p_image_source.style.width = w;
				//p_image_source.style.height = h;
				p_picture.title = a;
				p_picture.img = img;
				p_picture.ow = w;
				p_picture.oh = Number(h) + 27 + 27;
				p_picture.cw = 0;
				p_picture.ch = 0;
				p_picture.x0 = x[0];
				p_picture.x1 = x[1];
				p_picture.x2 = x[2];
				p_picture.x3 = x[3];
		
				animOpacity();
			}
		}
	}
	function animOpacity(){
		p_bg = document.getElementById("popup_background");

		if (p_bg.op < 80){
			p_bg.op += 40;
			if (p_bg.filters){ //IE
				p_bg.filters.alpha.opacity = p_bg.op;
			} else {
				p_bg.style.MozOpacity = p_bg.op / 100;
			}
			setTimeout("animOpacity()", 1);
		} else {
			p_picture.style.visibility = "visible";
			p_picture.style.display = "block";			
			animWidth();
			animHeight();
		}
	}
	function animWidth(){
		p_picture = document.getElementById("popup_picture"); 
		if (p_picture.cw <= p_picture.ow){
			p_picture.cw += 40;
			if (p_picture.cw > p_picture.ow){
				p_picture.style.width = p_picture.ow;
			} else {
				p_picture.style.width = p_picture.cw;
			}
			setTimeout("animWidth()", 1);
			p_picture.style.left = (p_picture.x0 / 2) - (p_picture.cw/ 2);
		} else {
			if (p_picture.ow > p_picture.oh){
				showPicture();
			}
		}
	}
	function showPicture(){
		p_picture = document.getElementById("popup_picture");
		document.getElementById("popup_image").innerHTML = "<img alt=\"Close\" style=\"cursor:hand\" onClick=\"closePopup()\" src=\"" + p_picture.img + "\">";
		p_title = document.getElementById("popup_title");
		p_title.innerHTML = p_picture.title;	
	}
	function animHeight(){
		p_picture = document.getElementById("popup_picture");
		p_image = document.getElementById("popup_image");
		
		if (p_picture.ch <= p_picture.oh){
			p_picture.ch += 40;
			if (p_picture.ch > p_picture.oh){
				p_picture.style.height = p_picture.oh;
				x = Number(p_picture.oh) - 27 - 27;
				if (x > 0){
					p_image.style.height = x;
				}
			} else {
				p_picture.style.height = p_picture.ch;
				x = Number(p_picture.ch) - 27 - 27;
				if (x > 0){
					p_image.style.height = x;
				}
			}
			p_picture.style.top = (p_picture.x3 / 2) - (p_picture.ch/ 2) + document.body.scrollTop + 10;
			setTimeout("animHeight()", 1);
		} else {
			if (p_picture.ow < p_picture.oh){
				showPicture();
			}
		}
	}
	function closePopup(){
		p_bg = document.getElementById("popup_background");
		p_picture = document.getElementById("popup_picture");
		p_image = document.getElementById("popup_image");
		p_image_source = document.getElementById("popup_image_source");
		p_title = document.getElementById("popup_title");
		p_title = "";
		document.getElementById("popup_image").innerHTML = "";
		p_image.style.height = 0;
		animDownWidth();
		animDownHeight();
		p_title = document.getElementById("popup_title");
		p_title.innerHTML = "";
		//p_bg.style.visibility = "hidden";
		//p_picture.style.visibility = "hidden";
		//p_picture.style.display = "none";
		//
	}
	function animDownHeight(){
		p_picture = document.getElementById("popup_picture");
		if (p_picture.ch > 100){
			p_picture.ch -= 40;
			if (p_picture.ch > p_picture.oh){
				p_picture.style.height = p_picture.oh;
			} else {
				p_picture.style.height = p_picture.ch;
			}
			p_picture.style.top = (p_picture.x1 / 2) - (p_picture.ch/ 2);
			setTimeout("animDownHeight()", 1);
		} else {
			if (p_picture.ow < p_picture.oh){
				hideImageHolder();
			}
		}
	}
	function animDownWidth(){
		p_picture = document.getElementById("popup_picture");
		if (p_picture.cw > 100){
			p_picture.cw -= 40;
			if (p_picture.cw > p_picture.ow){
				p_picture.style.width = p_picture.ow;
			} else {
				p_picture.style.width = p_picture.cw;
			}
			p_picture.style.left = (p_picture.x0 / 2) - (p_picture.cw/ 2);
			setTimeout("animDownWidth()", 1);
		} else {
			if (p_picture.ow > p_picture.oh){
				hideImageHolder();
			}
		}
	}
	function hideImageHolder(){
		p_picture = document.getElementById("popup_picture");
		p_picture.style.visibility = "hidden";
		p_picture.style.display = "none";	
		animDownOpacity();
	}
	function animDownOpacity(){
		p_bg = document.getElementById("popup_background");
		if (p_bg.op > 0){
			p_bg.op -= 30;
			if(p_bg.filters){//IE
				p_bg.filters.alpha.opacity -= p_bg.op;
			} else {
				p_bg.style.MozOpacity = p_bg.op / 100;
			}
			setTimeout("animDownOpacity()", 10);
		} else {
			p_bg = document.getElementById("popup_background");
			p_bg.style.visibility = "hidden";
		}
	}	
	function getPageSize(){
		
		var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		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;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = windowWidth;
		} else {
			pageWidth = xScroll;
		}
	
	
		arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
		return arrayPageSize;
	}