var $j = jQuery.noConflict();

$j(function(){
	//#don't use bold text for nav links on mac
	var os = navigator.platform.toLowerCase();
	if(os.indexOf('mac')!=-1)
	{
		$j('#nav').css('font-weight','normal');
	}		
	//#rounded corners
	$j('#nav li').corner('top');
	$j('#wrapper > h1').corner('top 20px');
	//#footer and main not working in IE alas :(
	//$j('h1,#footer').corner('top 20px');
	//$j('#main').corner('bottom 20px');
	//$j('body.home #main').corner('top 20px');
	
	//#email links
	$j('.mailto').defuscate();
});

/*
 * Email Defuscator - jQuery plugin 1.0-beta2
 *
 * Copyright (c) 2007 Joakim Stai
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id$
 *
 */

//#usage: put non linked email address in page 
//#in format user(put whatever you want here)domain with span.mailto around it 
//#http://plugins.jquery.com/project/defuscator
/**
 * Converts obfuscated email addresses into normal, working email addresses.
 *
 * @name defuscate
 * @param Boolean link If true, all defuscated email addresses will be turned into links, defaults to true (optional)
 * @param String find The regular expression used to search for obfuscated email addresses (optional)
 * @param String replace Replacement text for defuscating email addresses (optional)
 * @descr Converts obfuscated email addresses into normal, working email addresses
 */

jQuery.fn.defuscate = function( settings ) {
    settings = jQuery.extend({
        link: true,
        find: /\b([A-Z0-9._%-]+)\([^)]+\)((?:[A-Z0-9-]+\.)+[A-Z]{2,6})\b/gi,
        replace: '$1@$2'
    }, settings);
    return this.each(function() {
        if ( $j(this).is('a[@href]') ) {
            $j(this).attr('href', $j(this).attr('href').replace(settings.find, settings.replace));
            var is_link = true;
        }
        $j(this).html($j(this).html().replace(settings.find, (settings.link && !is_link ? '<a href="mailto:' + settings.replace + '">' + settings.replace + '</a>' : settings.replace)));
    });
};
