/*
 * jqBookmark - a jquery Bookmark script
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file license.txt.
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to calisza@gmail.com so we can send you a copy immediately.
 *
 */

/*
 *
 * Moddified by rustycircuits@gmail.com
 *
*/

$(document).ready(function(){
	// add a "rel" attrib if Opera 7+
	/* originally:
	if(window.opera) {
		if ($("a.jqbookmark").attr("rel") != ""){
			$("a.jqbookmark").attr("rel","sidebar");
		} 
	}*/

	if(window.opera) {
		if ($("a.jqbookmark").attr("rel") != ""){
			$("a.jqbookmark").attr("rel","sidebar");
		} 
	}


	//added for "Bookmark this" button
	$("button.zp-jqbookmark, a.zp-jqbookmark").click(function(event){
		event.preventDefault(); 
		var url = window.location; //to get just the portion after the "domain.com" put ".pathname" after "location"
		var title = document.title;
		
		if (window.sidebar) { // Mozilla Firefox Bookmark
			//window.sidebar.addPanel(title, url,"");
			alert("Due to security restrictions placed in Firefox, we are unable to automatically add a bookmark.\nPlease press: CTRL+D or use the Bookmarks Menu to add one manually.");
			
			
		} else if( window.external ) { // IE Favorite
			window.external.AddFavorite( url, title);
		} else if(window.opera) { // Opera 7+
			return false; // do nothing
		} else { 
			 alert('Unfortunately, this browser does not support the requested action,'
			 + ' please bookmark this page manually.');
		}

	});
/*
$(document).keydown(
  function(e){
    //var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
    var key = e.charCode || e.keyCode || 0;
    alert(key);
  }
//ubuntu ff: ctrl:17, d:68
//ubuntu win vm ff/ie: ctrl:17, d:68
);*/


});