
$(document).ready(function()
{

	// 一些初始化
	$("#form1").validate();
	
	$('.date-pick').datepick({
	  yearRange: '-5:+5',
	  dateFormat: 'yy-mm-dd'});
	  
	$('#start_time').datepick({
	  yearRange: '-5:+5',
	  dateFormat: 'yy-mm-dd'});
	  
	$('#end_time').datepick({
	  yearRange: '-5:+5',
	  dateFormat: 'yy-mm-dd'});

	$('iframe').load(function()
    {
    	if(this.contentWindow.document.body.offsetHeight>800) {    		
			this.style.height =
			(this.contentWindow.document.body.offsetHeight+50) + 'px';
      	}
    });
	/**/
	
	var browser=navigator.appName;
	if(browser == "Microsoft Internet Explorer") $.fx.off = false;
	
	// menu 的初始設定
	$('#mymenu').menu({ 
		content: $('#mymenu').next().html(), // grab content from this page
		flyOut: true
	});
	
	// hint 的設定
	$('div#hint').toggle(function() {
		$('div#hint div#hint-content').slideDown();
	}, function() {
		$('div#hint div#hint-content').slideUp();
	});
	
	// hint 的設定
	$('div#filter').toggle(function() {
		$('div#filter-content').slideDown();
	}, function() {
		$('div#filter-content').slideUp();
	});

	// 排序table
	if($("table.auto"))	{$("table.auto").tablesorter();}

	// Google Analytics Code
	var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-18629514-3']);
	_gaq.push(['_setDomainName', '.ites-incubator.net']);
	_gaq.push(['_trackPageview']);

	(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	})();
	
});

