// JavaScript Document
/*Element.addMethods({
 sliceClassName: function(el)
 {
 var el = $(el);
 return el.className.slice(0,el.className.indexOf(' ')).toString();
 }
 });

 Event.observe(window,'load',function()
 {
 *//**
 * wyczyszczenie pola input z wartości początkowej
 */
/*
	$$('input.formSGInput').each(function(item,count)
	{
		$(item).observe('click',clearInput);
	});
	
 *//**
	 * menu 0.1 beta [do poprawy]
	 */
/*
 * var menuArray = new Array(), menuArrayCssClasses = new
 * Array('bgMenu_sg','bgMenu_of','bgMenu_gk','bgMenu_po','bgMenu_dk','bgMenu_gs','bgMenu_ko');
 * 
 * menuArrayCssClasses.each(function(item,count) {
 * if($('menuDiv').select('[class='+item+']').first())
 * menuArray.push($('menuDiv').select('[class='+item+']').first()); });
 * 
 * menuArray.each(function(item,count) {
 * $(item).observe('mouseover',menuDoOnMouseOver);
 * $(item).observe('mouseout',menuDoOnMouseOut); }); });
 * 
 * function clearInput(event) { event.stop() $(this).clear();
 * $(this).stopObserving(); }
 * 
 * function menuDoOnMouseOver(event) { event.stop();
 * $(this).addClassName($(this).className+'Over');
 * //$(this).down().addClassName($(this).down().className+'Over'); }
 * 
 * function menuDoOnMouseOut(event) { event.stop();
 * $(this).removeClassName($(this).sliceClassName()+'Over');
 * //$(this).down().removeClassName($(this).down().sliceClassName()+'Over'); }
 */

$(document)
		.ready( function() {
			// add a "rel" attrib if Opera 7+
				if (window.opera) {
					if ($("a.jqbookmark").attr("rel") != "") { // don't
																// overwrite the
																// rel attrib if
																// already set
						$("a.jqbookmark").attr("rel", "sidebar");
					}
				}

				$("a.jqbookmark")
						.click( function(event) {
							event.preventDefault(); // prevent the anchor tag
													// from sending the user off
													// to the link
								var url = this.href;
								var title = this.title;

								if (window.sidebar) { // Mozilla Firefox
														// Bookmark
									window.sidebar.addPanel(title, url, "");
								} else if (window.external) { // IE Favorite
									window.external.AddFavorite(url, title);
								} else if (window.opera) { // Opera 7+
									return false; // do nothing - the
													// rel="sidebar" should do
													// the trick
								} else { // for Safari, Konq etc - browsers
											// who do not support bookmarking
											// scripts (that i could find
											// anyway)
									alert('Niestety Twoja przeglądarka nie obsługuje dodawania zakładek.');
								}

							});
			});



