function objOver(obj) {
	var img = obj.getElementsByTagName('IMG')[0];
	var sName = obj.getAttribute('basename');
	var sDir = obj.getAttribute('basedir');
	
	img.src = sDir + sName + 'Over.gif';
}

function objOut(obj) {
	var img = obj.getElementsByTagName('IMG')[0];
	var sName = obj.getAttribute('basename');
	var sDir = obj.getAttribute('basedir');
	
	img.src = sDir + sName + '.gif';
}

function objSel(obj) {
	var img = obj.getElementsByTagName('IMG')[0];
	var sName = obj.getAttribute('basename');
	var sDir = obj.getAttribute('basedir');
	
	img.src = sDir + sName + 'Sel.gif';
}

function objPaletteOver(obj) {
	if (obj.getAttribute('status')=='1') {
		return;
	}
	obj.parentNode.className=obj.parentNode.getAttribute('baseclass') + 'Over';
}

function objPaletteOut(obj) {
	if (obj.getAttribute('status')=='1') {
		return;
	}
	obj.parentNode.className=obj.parentNode.getAttribute('baseclass');
}

function objPrint(obj) {
	self.print();
   return false;
}

function calculateOpts(w, h) {
var tp = null, lf = null;
var opts = 'width=' + Number(w).toString() + ',height=' + Number(h).toString() + ',location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,directories=no,channelmode=no';

	if (screen != null) {
	   if (screen.height <= 600) {
	        tp = 0;	
           } else {                	
    	   	tp = screen.height;
	        if (tp != null) {
			tp = (tp - h) / 2 - 25; 
	        }
           } 
	   if (screen.height <= 600) {
	        lf = 20;	
           } else {                	
  	        lf = screen.width;
  	        if (lf != null) {
		   lf = (lf - w) / 2; 
  	        }
      } 
	}
			 
	if (lf != null) {
		opts = opts + ',left=' + new Number(lf).toString();
	}
		
	if (tp != null) {
		opts = opts +  ',top=' + new Number(tp).toString();
	}	

   return (opts);
}

function openWindowURL(url, tgt, w, h) {
   window.open(url, tgt, calculateOpts(w, h));
   return false;
}

function openWindowImage(img, tgt, w, h, pre) {
   var w = window.open('about:blank', tgt, calculateOpts(w, h));
   w.document.open();
   w.document.write (pre);
   w.document.write ('<IMG SRC="' + img + '">');
   w.document.write ('</BODY>');
   w.document.close();
   return false;
}


