
	//opens a window and centers it
	function openWin(sPage,w,h,scrollbars,status,resize,title){
		var winL = (screen.width - w) / 2;
		var winT = (screen.height - h) / 2;
		
		var myWin = window.open(sPage,'','height=' + h + ',width=' + w + ',left=' + winL + ',top=' + winT + ',status=' + status + ',scrollbars=' + scrollbars + ',resizable=' + resize);
		
		return myWin;
	}


			function reloadParent(qs){
			var url = getParentPageName(qs);
			
			if (url != null){
				window.opener.location.href = url;
			}else{
				window.opener.location.href = window.opener.location.href;
			}	
			}

// Current Page Reference
// copyright Stephen Chapman, 1st Jan 2005
// you may copy this function but please keep the copyright notice with it
function getParentURL(uri) {
uri.dir = window.opener.location.href.substring(0, window.opener.location.href.lastIndexOf('\/'));
uri.dom = uri.dir; if (uri.dom.substr(0,7) == 'http:\/\/') uri.dom = uri.dom.substr(7);
uri.path = ''; var pos = uri.dom.indexOf('\/'); if (pos > -1) {uri.path = uri.dom.substr(pos+1); uri.dom = uri.dom.substr(0,pos);}
uri.page = window.opener.location.href.substring(uri.dir.length+1, window.opener.location.href.length+1);
pos = uri.page.indexOf('?');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
pos = uri.page.indexOf('#');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
uri.ext = ''; pos = uri.page.indexOf('.');if (pos > -1) {uri.ext =uri.page.substring(pos+1); uri.page = uri.page.substr(0,pos);}
uri.file = uri.page;
if (uri.ext != '') uri.file += '.' + uri.ext;
if (uri.file == '') uri.page = 'index';
uri.args = window.opener.location.search.substr(1).split("?");
return uri;
}

function getParentPageName(queryString){
var uri = new Object();
getParentURL(uri);
//alert(uri.page);
return uri.page + '.aspx?' + queryString;
}
                  