$().ready(function(){
	$("input.label").focus(function(){
		if ($(this).attr('rel') == $(this).val()) {
			$(this).val('');
		}
	});
	$("input.label").blur(function(){
		if ($(this).val() == '') {
			$(this).val($(this).attr('rel'));
		}
	});
	$('.confirm').click(function(){return confirm($(this).attr('rel'))})
	$('.focusnow').focus();
	$('a[rel*=target-blank]').click(function(){
		window.open(this.href);
		return false;
	});
	$('.fancybox').fancybox();
	$('#btn-view-longer-footer').click(function() {
		$('#additional-footer').slideToggle('fast');
		$(this).toggleClass('active');
		if ($(this).hasClass('active')) {
			$("html").animate({ scrollTop: $(document).height() }, "slow")	
		}
		return false;
	});
	
	$('#menu>li').hover(function(){
		$(this).find('ul').show();
	},function(){
		$(this).find('ul').hide();
	});
	
	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('Unfortunately, this browser does not support the requested action,'
			 + ' please bookmark this page manually.');
		}

	});
	
})
