$(document).ready(function(){
	$('a[rel=external]').click(function(){
		window.open(this.href);		
		return false;
	});
	
	$('#main .note').click(function(){
		
		if($('#main .note-txt').is(':visible'))
		{
			$('body').css('backgroundPosition', '0 0')
			$('#main').css('height', $.browser.msie?'650px':'566px')
			$('#main .note-txt').hide()
			$('#wrap').css('height', $.browser.msie?'650px':'566px');
			
		}
		else
		{
			$('body').css('backgroundPosition', '0px 110px')
			$('#main').css('height', $.browser.msie || $.browser.webkit?'750px':'666px')
			$('#main .note-txt').show()
			$('#wrap').css('height', $.browser.msie || $.browser.webkit?'750px':'666px')
		}
		
		return false;
	})
	
	// ------------- CUFON START
	var ca = [
		'.cufon',
		'#inner .right ul li',
		'#inner .right h1',
		'#inner .right .underbtn',
		'#inner .right .underbtn2',
		'#inner .right .btn'
	];
	
	Cufon.replace(ca.join(','), {'fontFamily':'neosans', hover:true});
	// ------------- CUFON END
	setTimeout("remove_cufon('.delcufon')", 200);
	
	$('.ga').click(function(){

		if($(this).attr('rel') == 'external') $(this).unbind('click');
		
		_gaq.push(['_trackPageview', $(this).attr('data-link')]);
		
		if($(this).attr('target') == '_blank' || $(this).attr('rel') == 'external')
			setTimeout('window.open("'+$(this).attr('href')+'")', 300)
		else
			setTimeout('window.location = "'+$(this).attr('href')+'"', 300)
		
		return false;
	})
	
});


function remove_cufon(selector) {
    $(selector).html( cufon_text(selector) );
    return true;
}

function cufon_text(selector) {
    var g = '';
    $(selector +' cufon cufontext').each(function() {
        g = g + $(this).html();
    }); 
    return $.trim(g);
}


