PositionX = 100;
PositionY = 100;

defaultWidth  = 500;
defaultHeight = 500;

var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToimage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToimage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToimage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}

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];}}
}
/*---------------------------------------------------------------------------------*/



var popup_window = null;
function popup(status,url) {
   if(status != 0) {
      if(popup != null) popup.focus(); 
      else { 
         var popup = open(url, "Popup", "scrollbars=no,width=780,height=420");
         popup_window = popup;
      }
   } else {
      if(popup_window != null) popup_window.close();
   }
}

popWindow=null;

function open_window(url,width,height) {

	windowName="popoup";
	agent=navigator.appVersion;
	version=parseInt(agent);
	
	//figure out the top/left of the screen
	//taking the menu bar into consideration
	if (version>=4) {
		leftCorner=screen.width/2 - width/2;
		topCorner=screen.height/2 - height/2;
	}else{
		leftCorner=20;
		topCorner=20;
	}
	features=",screenX="+leftCorner+",screenY="+topCorner+",left="+leftCorner+",top="+topCorner;
	features=features+",titlebar=1";
	if (popWindow==null) {
		popWindow=open(url,windowName, "width="+width+",height="+height+ features);
		// for IE3, focus, closed, and opener doesn't work, so we have to tell
		// the window opened who's the opener
		if (version<3) 
			setTimeout("popWindow.mama=window",250);
	}else{
		if (version<3) {
			popWindow.close();
			popWindow=null;
			setTimeout("open_window('"+url+"',"+width+","+height+")", 250);
			setTimeout("popWindow.mama=window",500);
		}else if (!popWindow.closed){
			popWindow.close();
			popWindow=null;
			setTimeout("open_window('"+url+"',"+width+","+height+")", 250);
			
		}else{
			popWindow=null;
			popWindow=open(url,windowName, "width="+width+",height="+height+features);
		}
	}
}

function pop_window(url,width,height) {
    
agt=navigator.userAgent.toLowerCase()
major = parseInt(navigator.appVersion)
nav  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1)
        && (agt.indexOf('compatible') == -1)))
navonly = (nav && (agt.indexOf(";nav") != -1))
ie   = (agt.indexOf("msie") != -1)  
win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) )
mac    = (agt.indexOf("mac")!=-1)

if (mac && ie) {
    width=width - 15;
    height=height - 15;    
    open_window(url,width,height);
    }
else {
    open_window(url,width,height);
    }
}

// done hiding -->

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];}}
}
