I trying to integrate LiveAgent to Magento 1.7 site and for adding the chat button I need to add Javascript code to Magento
I do not want to edit the source code but simply add the piece of JS to the header via admin panel. is it possible?
Yes - it depends on your theme (the page templates ie 1column.phtml needs to call the after_body_start block) but it should be there;
<?php echo $this->getChildHtml('after_body_start') ?>
You do it in System -> Configuration -> General -> Design -> HTML Head panel in the 'Miscellaneous Scripts' section.