$(function(){
	//alert($('.content').size());//function count
	$('#navs').show('slow');
	$('a').each(function(){
		var t = this.href;
		if(t.substr(t.length-1,1)=='#') this.href = 'javascript:void(0);';
		this.onfocus = function(){this.blur();}});
	//navs
	var navs = $('#navs a');
	navs.each(function(){
		this.onclick = function(){
			navs.each(function(){this.className = '';});
			this.className = 'c';
			$('.content').each(function(){this.style.display = 'none';});
			var boxes = $('.functions');
			boxes.each(function(){this.style.display = 'none';});
			$(boxes[navs.index($(this))]).show(365);
		}
	});
	//functions
	var funcs = $('.functions a');
	funcs.each(function(){
		this.onclick = function(){
			funcs.each(function(){this.className = '';});
			this.className = 'c';
			var boxes = $('.content');
			boxes.each(function(){this.style.display = 'none';});
			$(boxes[funcs.index($(this))]).show(365);
		}
	});
	//IE6 Fixed Bug
	if($.browser.msie && $.browser.version=='6.0')$(window).scroll(function(){$('.message').each(function(){this.className='message';});});
});

function popUp(n){
	var boxes = $('.message');
	if( n > boxes.length ) return;
	for( var i=0; i<boxes.length; i++ )
		if( i != n ) $(boxes[i]).fadeOut('slow');
	$(boxes[n]).slideToggle('slow');
}

function bugReport(form){}
function letterSend(form){
	form.method = 'post';
	form.action = 'http://www.iiHack.com/API.asp?from=TingYuan&model=Letter';
	form.target = '_blank';
	$(form).submit();
	$('#letter').slideUp('slow');
}