function getId(id) {
  if (typeof(document.getElementById) != "undefined") {
    return document.getElementById(id);
  } else {
    return document.all[id];
  }
}
function getBrowser()
	{
    var b = navigator.appName;
    var name = null ;
    if (b=='Netscape')
    	{name = 'N';}
    else if (b=='Microsoft Internet Explorer')
    	{name = 'IE';}
    else if (b=='Opera')
    	{name = 'O';}
    return name;
    }
function popupW(Path){
    var arg = 'toolbar=no,';
    arg+= 'location=no,';
    arg+= 'directories=no,';
    arg+= 'status=yes,';
    arg+= 'menubar=no,';
    arg+= 'scrollbars=no,';
    arg+= 'resizable=yes,';
    arg+= 'copyhistory=no,';
    arg+= 'width=10,';
    arg+= 'height=10';
    window.open(Path,'',arg);
    }

function popupImage(imagePath){
    var w = '/popup.php?pic='+imagePath;
    var arg = 'toolbar=no,';
    arg+= 'location=no,';
    arg+= 'directories=no,';
    arg+= 'status=yes,';
    arg+= 'menubar=no,';
    arg+= 'scrollbars=no,';
    arg+= 'resizable=yes,';
    arg+= 'copyhistory=no,';
    arg+= 'width=10,';
    arg+= 'height=10';
    window.open(w,'',arg);
    }

function loadImage() {
    var addr = document.location.toString() ;
    var reg = '\?pic=';
    var pic = addr.split(reg);
	im = getId('targetImage');    //document.writeln(pic[1]);
    im.src = pic[1];
    }

function windowResize(w , h) {
    var n = getBrowser();
    if (n=='N'){
	    window.innerWidth = w;
	    window.innerHeight = h;
    }else if (n=='IE'){
        window.resizeTo(w , h);
    }else if (n=='O'){
        window.resizeTo(w+10 , h+30);
        }
    }


function sortCurrency(field )
	{
    n = getId('sorter');
    f = n.sort.value ;
    if (f==field)
    	{
        o = n.order.value;
	    if (o=='a')
	        {n.order.value='d';}
	    else if (o=='d')
	        {n.order.value='a';}
        }
    else
    	{n.sort.value = field;}
    }
function sendAnalData(mode)
	{
    f = getId('analIndata');
    f.show.value = mode;
    f.submit();
    }
function showHide(elemId)
	{
    n=getId(elemId);
    if (n==false)
    	{return false;}
    if (n.style.display=='none')
    	{n.style.display='block';}
    else
    	{n.style.display='none';}
    return true;
    }