function openDataWindow(url){
var dwin = window.open(url,'datawin','scrollbars=yes,resizable=yes,width=600,height=400');
if(dwin) dwin.focus();
}

function openGlsWindow(){
var a = openGlsWindow.arguments;
var key = a[0];
var aNum = "#";
if(a[1]){aNum += a[1];}
var theUrl = '../glossary/' + key + '.html' + aNum;
var gwin = window.open(theUrl,'glswin','scrollbars=yes,resizable=yes,width=300,height=300');
if(gwin) gwin.focus();
}

function openNewsWindow(url){
var nwin = window.open(url,'newswin','status=yes,scrollbars=yes,resizable=yes,width=600,height=400');
if(nwin) nwin.focus();
}

var moveto="";
function openChartWindow(){
var a = openChartWindow.arguments;
var url = a[0];
if(a[1]) moveto="#" + a[1];
openPopupFrame(url,'chartwin',500,520);
}

function openShdWindow(){
var sdir = "";
var a = openShdWindow.arguments;
if(a[1]) sdir=a[1];
if(a[0]) moveto ="#" + a[0];
openPopupFrame(sdir+'share_handling_detail.html','shdwin',600,400);
}

function openPopupFrame(furl, wname, sw, sh){
var pstr = "scrollbars=yes,resizable=yes,width=" +sw+ ",height=" +sh;
var fwin = window.open(furl,wname,pstr);
if(fwin){
fwin.opener=window;
fwin.focus();
}}

var count=0;
function moveToA(){
var timerID = 10;
if((top.opener==null)||(top.opener.closed)||(top.opener.moveto==null)){
if(count <10) {timerID = setInterval("moveToA()",200); count++}else{clearInterval(timerID); }
}else if(top.opener.moveto!=""){
location.href= top.opener.moveto;
top.opener.moveto="";
}
}
