function MM_findObj(n, d)
{
  var p,i,x;  
  
	if(isNN6Min())
		return document.getElementById(n);

  if(!d) d=document; 
  
  if((p=n.indexOf("?"))>0&&parent.frames.length)
  {
		d=parent.frames[n.substring(p+1)].document; 
		n=n.substring(0,p);
	}
  
  if(!(x=d[n])&&d.all) 
		x=d.all[n]; 
	
	for (i=0;!x&&i<d.forms.length;i++) 
		x=d.forms[i][n];
  
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
		x=MM_findObj(n,d.layers[i].document); 
		
	return x;
	
}		
function MM_swapImage()
{
  var i,j=0,x,a=MM_swapImage.arguments; 
  
  document.MM_sr=new Array; 
  
  for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null)
   {
		document.MM_sr[j++]=x; 
		if(!x.oSrc) 
			x.oSrc=x.src; 
			x.src=a[i+2];
		}
}		
function MM_preloadImages() { //v3.0
  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];
				window.status = a[i];
			}
	}
}
function PopupImage(imagesrc,title,imgwidth,imgheight)
{
var left;
var top;
var width = imgwidth;
var height = imgheight;

	if(!isIE())
	{
		width = imgwidth + 4; //add offsets
		height = imgheight + 8; //add offsets
	}

	var windowoptions = "directories=no,location=no,menubar=no,status=no";
	windowoptions += ",titlebar=no,toolbar=no,scrollbars=no";
	windowoptions += ",width=" + width + ",height=" + height + ",resizeable=no";
	
	if(isIEOld())
	  var nw = window.open(imagesrc,"popup",windowoptions);
	else
	{
		var nw = window.open('',"popup",windowoptions);

		if(window.screen.availHeight > height)
			top = window.screen.availHeight/2 - height/2;
		else
			top = 0;
		
		if(window.screen.availWidth > width)
			left = window.screen.availWidth/2 - width/2;
		else
			left = 0;
		
		nw.moveTo(left,top);//x,y
		nw.document.write("<html><head><title>" + title + "</title></head><body  topmargin='0' leftmargin='0'>");
		nw.document.write("<a title='Click to close' href='javascript:window.close()'><img title='Click to close' border=0 width=" + imgwidth + " height=" + imgheight + " src='" + imagesrc + "'></a>");
		nw.document.write("</body></html>");
		nw.document.close();

		nw.focus();
	}
		
}
function PopupLargeImage(imagesrc,title,width,height)
{
var left;
var top;
	var windowoptions = "directories=no,location=no,menubar=no,status=no";
	windowoptions += ",titlebar=no,toolbar=no,scrollbars=yes";
	windowoptions += ",width=" + width + ",height=" + height + ",resizable=yes";
	windowoptions="";
	
	if(isIEOld())
	  var nw = window.open(imagesrc,title,windowoptions);
	else
	{

		var nw = window.open('',title,windowoptions);

		if(window.screen.availHeight > height)
			top = window.screen.availHeight/2 - height/2;
		else
			top = 0;
		
		if(window.screen.availWidth > width)
			left = window.screen.availWidth/2 - width/2;
		else
			left = 0;
		
		nw.moveTo(top,left);//x,y
		nw.document.write("<html><head><title>" + title + "</title></head><body  topmargin='0' leftmargin='0' bgcolor1=Black>");
		nw.document.write("<a title='Click to close' href='javascript:window.close()'><img title='Click to close' border=0 src='" + imagesrc + "'></a>");
		nw.document.write("</body></html>");
		nw.document.close();

		nw.focus();
	}
		
}		
		

function isNav() {
	return (navigator.appName == "Netscape")
}

function isIE() {
	return (navigator.appName == "Microsoft Internet Explorer")
}

// operating system platforms
function isWindows() {
	return (navigator.appVersion.indexOf("Win") != -1)
}

function isWin95NT() {
	return (isWindows() && (navigator.appVersion.indexOf("Win16") == -1 && navigator.appVersion.indexOf("Windows 3.1") == -1))
}

function isMac() {
	return (navigator.appVersion.indexOf("Mac") != -1)
}

function isMacPPC() {
	return (isMac() && (navigator.appVersion.indexOf("PPC") != -1 || navigator.appVersion.indexOf("PowerPC") != -1))
}

function isUnix() {
	return (navigator.appVersion.indexOf("X11") != -1)
}

// browser versions
function isGeneration2() {
	return (parseInt(navigator.appVersion) == 2)
}

function isGeneration3() {
	return (parseInt(navigator.appVersion) == 3)
}

function isGeneration3Min() {
	return (parseInt(navigator.appVersion.charAt(0)) >= 3)
}

function isNavOld() {
	return (isNav() && parseFloat(navigator.appVersion) < 5)
}

function isNav4_7() {
	return (isNav() && parseFloat(navigator.appVersion) == 4.7)
}

function isMSIE4Min() {
	return (isIE() && navigator.appVersion.indexOf("MSIE") != -1)
}

function isMSIE5_5() {
	return (navigator.appVersion.indexOf("MSIE 5.5") != -1)
}

function isNN6Min() {
	return (isNav() && parseInt(navigator.appVersion) >= 5)
}
function isIEOld() {

	return (isIE() && !isMac() && !(navigator.appVersion.indexOf("MSIE 5.5") != -1 || navigator.appVersion.indexOf("MSIE 6.0") != -1))
}
 
  
 
