/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage, myname, w, h, scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll
	win = window.open(mypage,myname,settings)
	win.focus();
}

function OpenLinkWnd(link_url) {
	link_wnd = window.open(link_url);
	link_wnd.focus();
}

function replaceAll(oldStr, findStr, repStr) {
	var srchNdx = 0;
	var newStr = "";
	while (oldStr.indexOf(findStr,srchNdx) != -1) {
		newStr += oldStr.substring(srchNdx,oldStr.indexOf(findStr,srchNdx));
		newStr += repStr;
		srchNdx = (oldStr.indexOf(findStr,srchNdx) + findStr.length);
	}
	newStr += oldStr.substring(srchNdx,oldStr.length);
	return newStr;
}
