if(window.opera) {
    if ($("a.jqbookmark").attr("rel") != ""){ // don't overwrite the rel attrib if already set
        $("a.jqbookmark").attr("rel","sidebar");
    }
}
$('aside a.print-page').click(function() {
  window.print();
  return false;
 });
if (window.sidebar || window.external || window.opera) { // Mozilla Firefox Bookmark
    $("aside a.jqbookmark").removeClass('hidden');
}
$("aside 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.');
    }
});
function showLoginForm(){$('#quick-login').show().animate({left:'540px'});}
$("#search input").focus(function() {$(this).parent().find('label').addClass('focus');});
$("#search input").focusout(function() {$(this).parent().find('label').removeClass('focus');});
$('body.search-results #map .gmnoprint:first').live("mousemove", function(){$(this).css('display','none');})
/* $('#login').click(function(e){
	e.preventDefault();
	$(this).css('background','#fff').animate({right: (10 - $('body').outerWidth()) + 'px', opacity:0}, 'slow', function() { showLoginForm(); });
}) */
 if (!Modernizr.input.placeholder){
	 $("#quick-login input, #contact-us input, #contact-us textarea").each(function(){
			if($(this).val()=="" && $(this).attr("placeholder")!=""){
				$(this).val($(this).attr("placeholder"));
				$(this).focus(function(){
					if($(this).val()==$(this).attr("placeholder")) $(this).val("");
				});
				$(this).blur(function(){
				if($(this).val()=="") $(this).val($(this).attr("placeholder"));});
			}
		});
	$('#search input.searchfield, #mini-search input').clearField();
	 var defaults={};//contains default text for each item
	$('#search input.searchfield, #mini-search input').each(function(){
		var value=$(this).attr('rel');
                                    defaults[$(this).attr('id')]=value;
                                    if($(this).val() == ''){
                                        $(this).val(value);
                                    }
                    });
	$('form').submit(function(){$('#search input.searchfield, #mini-search input').each(function(){
                            if(defaults[$(this).attr('id')]==$(this).val()){$(this).val('')}
                        })
	});
}
if(!Modernizr.csstransitions){
        $('span.tooltip').css({bottom:'-80px'});
        $('a.tooltip-wrapper').hover(function() {
        $('span.tooltip').stop().animate({
            bottom:'15px'
        })
     },function() {
        $('span.tooltip').stop().animate({
            bottom:'-80px'
        })
    });
}
    /*
    $('body.home div.features-wrapper').mouseover(function() {
        $(this).find('section.free-listing').fadeTo("slow", 0.5); 
    }, function(){
        $(this).find('section.free-listing').fadeTo("slow", 1);
    });
    
     */

