/**
* @version		$Id: imagetitle.php 2008-02-01 Nicola Delbono $
* @package		Joomla!
* @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* Usage:
*
* ImageTitle is a Joomla! 1.5 native plugin that replaces tag text content with an image, displaying
* the same text in a more actractive way (using any font) with a bit of antialiasing.
* Just install the plug in and publish it in "Extension > Plugin Manager"
*
* From http://www.qubus.it/joomla/plugins/imagetitle
* This Joomla! plugin is downloadable upon 2€ fee. Consider 2€ is really a lot less than a hour of hard work.
*/

  function so_clearInnerHTML(obj) {
	// perform a shallow clone on obj
	nObj = obj.cloneNode(false);
	// insert the cloned object into the DOM before the original one
	obj.parentNode.insertBefore(nObj,obj);
	// remove the original object (hide)
	obj.style.display = 'none';
	//obj.parentNode.removeChild(obj);
	return nObj;
}


	//function setT(classname, title, id, mosConfig_live_site, option){
	function setT(classname, mosConfig_live_site, option){

	
  var cnames = classname.split(',');
	cnameslength = cnames.length;
	for(i=0; i<cnameslength; i++){
      // static counter
        if ( typeof counter == 'undefined' ) {
            counter = 0;
        }
        // title replacement
      		var items = $$('.'+cnames[i]);
      		if(items.length>0){
      		for(ic = 0; ic<items.length; ic++){
          var content = items[ic].innerHTML;
      		  newitem = so_clearInnerHTML(items[ic]);
            var newdiv = document.createElement("div");
			
			if(mosConfig_live_site=="") mosConfig_live_site = "http://www.volleyeuro2011.com";
			//if(mosConfig_live_site=="") mosConfig_live_site = "http://localhost/Volleynet&20(oevv)/!webroot_volleyeuro";
			
			
            var imagetitle = '<img src="'+mosConfig_live_site+'/index.php?display=1&jsImageTitleCssClassName='+escape(cnames[i])+'&jsImageTitleContent='+escape(content)+'" border="0">';
            //prompt('',imagetitle);
            newdiv.innerHTML = imagetitle;
            newitem.appendChild(newdiv);
            }
          }
      }
  }

