function MM_preloadImages() 
{
  var d=document; 
  if(d.images){if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
		
function replacestr(str, instr, newstr)
{
	var s = '';
	
	while (1) {
		i = str.indexOf(instr);
		if (i >= 0) {
			s = s + str.substr(0, i) + newstr;
			str = str.substr(i + newstr.length);
		} else {
			break;
		}
	}
	return s;
}

function popup_Image(src, w, h)
{
    	
	var Width = w;
	var Height = h;
	
    if (document.all) {
		var xS = screen.width, yS = screen.height;
	} else {
        if (document.layers) { 
			var xS = window.outerWidth, yS = window.outerHeight;
		} else  {
			var xS = 800, yS=600;
		}
	}

    var xPos = (xS - Width)/2, yPos = (yS - Height)/2;
	p = '<html>';
	p += '<head>';
	p += '<style>';
	p += ' body {margin: 0em; padding: 0em; border: 0}';
	p += ' img {margin: 0em; padding: 0em; border: 0}';
	p += '</style>';
	p += '</head>';
	p += '<body>';
	p += '<img width="' + w + '" height="' + h + '" src="' + src + '" />';
	p += '</body>';
	p += '</html>';

    var win = window.open('', '' , 'width = ' + Width + ', height = ' + Height + ', screenX = ' + xPos + ', screenY=' + yPos + ', top = ' + yPos + ', left = ' + xPos + ', copyhistory = no, directories = no, menubar = no, location = no, scrollbars = no, resizable = no, statusbar = no');
	win.document.write(p);

}
