// CONTENTS ====================================================================
/*
- DEFAULT 							- common code that runs on every page.
- NAV								- nav animations
*/

// DEFAULT --------------------------------------------------------------
function InitDefault(){
	
	// call other Init functions
	//InitNav();

	$('#keyword').focus(function() {
		if ($(this).attr('value') == '' || $(this).attr('value') == 'Produktsuche') {	
			$(this).attr('value', '');
		}
	});
	$('#keyword').blur(function() {	
		if ($(this).attr('value') == '') {
			$(this).attr('value', 'Produktsuche');
		}
	});	

	if (window.opera || window.sidebar || window.external) {
		$('.bookmark_link').html('<a class="bookmark" href="#">Lesezeichen f&uuml;r diese Seite anlegen</a> <a class="uk-site" href="http://www.evolutionfasteners.co.uk">Zur UK-Website</a>');
	}

	// add a "rel" attrib if Opera 7+
	if (window.opera) {
		if ($(".bookmark_link").attr("rel") != "") { // don't overwrite the rel attrib if already set
			$(".bookmark_link").attr("rel", "sidebar");
		}
	}

	$(".bookmark").click(function(event) {
		event.preventDefault(); // prevent the anchor tag from sending the user off to the link
		var url = window.document.location;
		var title = 'Evolution Fasteners - ' + window.document.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
		} 

	});	
}

// NAV --------------------------------------------------------------
function InitNav(){
	$('#navigation li a:not(#navigation li.selected a)')
	.css( {backgroundPosition: "100% 0"} )
	.mouseover(function(){
		$(this).stop().animate(
			{backgroundPosition:"(100% -68px)"},
			{duration:600})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(100% 0px)"}, 
			{duration:600})
		})
}

// ======================================================================

