/**
* Bookmark Me 
* Based on Bookmark Us, Joomla Add to Bookmarks Module, by Michael Carico
* http://developer.joomla.org/sf/projects/bookmarkus
* (released under GNU/GPL License - http://www.gnu.org/copyleft/gpl.htm)
* merged with the ideas of http://www.howtocreate.co.uk exposed at
* http://www.howtocreate.co.uk/tutorials/index.php?tut=0&part=13
* 
**/

<!-- 
	
var agent = navigator.userAgent.toLowerCase();
var this_page = location.href;
var doc_title = document.title;
var first_hyphen = doc_title.indexOf("-");
var last_hyphen = doc_title.lastIndexOf("-");
var no_end = doc_title.substring(doc_title.lastIndexOf("-")-1, 0);

if (window.external)
	{
	var fav_bkm = 'favoritos';
	} else
	{
	var fav_bkm = 'marcadores';
	}
	
var tooltip_title = "Incluye esta p&aacute;gina entre tus " + fav_bkm;
var text_link = "A&ntilde;adir esta p&aacute;gina a " + fav_bkm;

if (first_hyphen != last_hyphen)
	{
	var no_beg = no_end.substr(no_end.indexOf("-")+2);
	var page_title = "Poraqui.net - " + no_beg;
	} else
	{
	var page_title = "Poraqui.net - " + no_end;
	}



if ((agent.indexOf("opera") != -1)) 
	{
	 document.write("<a href=\""+this_page+"\" title=\"" + page_title + "\" rel=\"sidebar\">" + text_link + "</a>");
	} else
	{
	  document.write("<a href=\"javascript:addBookmark('"+page_title+"','"+this_page+"');\" title=\"" + tooltip_title + "\" >" + text_link + "</a>");
	}


function addBookmark(title,url) {

  var msg_other = 'Lo siento, tu navegador no ejecuta esta opción.\n' +
		'Utiliza la función para añadir marcadores de tu navegador manualmente'
  var agent = navigator.userAgent.toLowerCase();


  if (agent.indexOf("opera") != -1) 
  {
    if (window.opera && window.print)
    {
      return true;
    } else 
    {
      alert(msg_other);
    }
  }  	
	else if ( window.sidebar && window.sidebar.addPanel ) {
		window.sidebar.addPanel( title, url, '' );
	} 
	else if( window.external && ( navigator.platform == 'Win32' ||
		  ( window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1 ) ) ) {
		window.external.AddFavorite( url, title );
	}
	 else if( document.layers ) {
			window.alert( 'Lo siento, tu navegador no ejecuta esta opción.\n' +
		'Para agregar esta dirección a tus marcadores,\n' +
		'pulsa Marcadores (Bookmarks)\n' +
		'y después Añadir marcador (File Bookmark).' );
		} else {
			window.alert(msg_other);
		}
}
// -->