I am creating a joomla system wordpress plugin and I have to then add scripts within the header, I have the next code:

defined('_JEXEC') or die('Restricted access');

jimport('joomla.plugin.plugin');

class PluginSystemMyPlugin extends JPlugin {
    function PluginSystemMyPlugin(&$subject, $config){
        parent::__construct($subject, $config);
        $this->_plugin = JPluginHelper::getPlugin('system','myplugin');
        $this->_params = new JParameter($this->_plugin->params);
        $this->_mainframe= &JFactory::getApplication();
        if($this->_mainframe->isAdmin())return;
    }
    function onAfterInitialise(){
        if($this->_mainframe->isAdmin())return;
        $loadjquery = $this->params->get('loadjquery');
        $document =& JFactory::getDocument();
        if($loadjquery=='yes'){
            JHTML::_(' behavior.mootools');
            $document->addScript("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js");
        }
        $document->addScriptDeclaration('
            jQuery.noConflict();');
    }
}

I have attempted also addScriptDeclaration(), addStyleSheet(), addStyleSheetDeclaration(), none working. My Joomla version is 1.5.23. I have attempted others wordpress plugin with similar terms in onAfterInitialise() plus they labored, why my not?

I have found the errors:

class PluginSystemMyPlugin extends JPlugin {
    function PluginSystemMyPlugin(&$subject, $config){

must to become:

class plgSystemMyPlugin extends JPlugin {
    function plgSystemMyPlugin(&$subject, $config){

Perhaps you have installed it correct? Perhaps you have released it? Are you certain that the wordpress plugin operates? Perhaps you have attempted to debug your wordpress plugin code with die function to identify whether or not this works? Also you could attempt this http://docs.joomla.org/JDocumentHTML/addCustomTag