
function openNewWindow(URLtoOpen, windowName, windowFeatures){
	newWindow=window.open(URLtoOpen, windowName, windowFeatures); 
}
/*
example:
var img_array = ['first','second','third'];
imgLoader('about/prefix_',img_array,'gif');
image naming would be prefix_first_a.gif and prefix_first_i.gif
both located in /images/about/
*/
//image pre-loader
function imgLoader(pth,iNames,ext){
	if (document.images) {
		var act=['a','i'];
		for (i=0;i<iNames.length;i++){
			for (j=0;j<2;j++){
				eval(iNames[i]+act[j]+"= new Image();");
				eval(iNames[i]+act[j]+".src = '/images/"+pth+iNames[i]+"_"+act[j]+"."+ext+"';");
			}
		}
	}
}

var pop_n = null;

function OpenCenteredWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  features = 'width='+myWidth+',height='+myHeight+','+features;
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=',left='+myLeft+',top='+myTop;
  }
	window.open(theURL,winName,features);
}

function old_doPopup(theURL,winName,features,myWidth,myHeight,isCenter){
	if (window.pop_n){
		window.pop_n.close();
	}
	pop_n = OpenCenteredWindow(theURL,winName,features,myWidth,myHeight,isCenter);
}

function doPopup(theURL,winName,features,myWidth,myHeight,isCenter){
  features = 'width='+myWidth+',height='+myHeight+','+features;
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=',left='+myLeft+',top='+myTop;
  }
  if(pop_n == null || pop_n.closed){
    pop_n = window.open(theURL,winName,features);
  }else{
    pop_n.close();
    pop_n = window.open(theURL,winName,features);
  }
  pop_n.focus();
}

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
