/* ============================================================================== css
*/
$(function(){
	$('#timeschedule dd:last').addClass('last');
	//$('tr:odd').addClass('rowTint');//for table row

	//$('tr:odd td').css({background: '#eee'});//for table row for IE hack
	$('#innerPage h3 + h4:first').css({marginTop: '0', paddingTop: '0'});
	$('.pictList').css({clear: 'both'});
	$('.pictList li:nth-child(3n), #innerPage .clear div.bx:nth-child(2n), #aboutClass li:last').css({marginRight: '0'});
});

/* ============================================================================== makeBlankLink
*/
$(function(){
	$('.blankLink').click(function(){
		this.target = '_blank';
	});
});

/* ============================================================================== popupWindows
*/
jQuery('a.popup').live('click', function(){
	newwindow=window.open($(this).attr('href'),'','height=200,width=150');
	if (window.focus) {newwindow.focus()}
	return false;
});


/* ============================================================================== rollover
*/
$(function(){
    $("img.rollover").mouseover(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_o$2"))
    }).mouseout(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)_o(\.[a-z]+)$/, "$1$2"));
    }).each(function(){
        $("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_o$2"))
    })
});

/* ============================================================================== smoothScroll
*/
$(function(){
	$('a[href^=#]').click(function() {  
		var hash = this.hash;  
		if(!hash || hash == '#')  
			return false;  
		$($.browser.safari ? 'body' : 'html')  
			.animate({scrollTop: $(hash).offset().top}, 1000, 'swing');  
		return false;  
	});
});

/* ============================================================================== sameHeight
*/
$.fn.sameHeight = function(){
  var h = 0;
  return this.each(function(){
    h = Math.max(h, $(this).outerHeight());
  }).height(h);
}

$(function() {
	$('.sameHeight').sameHeight();
});

/* ============================================================================== fadeEffect
*/
$(function(){
	$('.fade, #bannerNav img').load(function(){
		$(this).fadeTo(100, 1);
	});
	$('.fade, #bannerNav img').hover(
		function(){ $(this).fadeTo(100, .6);
		},
		function(){ $(this).fadeTo(100, 1);
	});
});

$(function(){
	$('#innerpageNav dl ul img').load(function(){
		$(this).fadeTo(100, 1);
	});
	$('#innerpageNav dl ul img').hover(
		function(){ $(this).fadeTo(100, 0);
		},
		function(){ $(this).fadeTo(100, 1);
	});
});

/* ============================================================================== tabs
*/
$(function () {
	var tabContainers = $('div.tabs > div');
	tabContainers.hide().filter(':first').show();
	
	$('div.tabs ul.tabNav a').click(function () {
		tabContainers.hide();
		tabContainers.filter(this.hash).show();
		$('div.tabs ul.tabNav a').removeClass('selected');
		$(this).addClass('selected');
		return false;
	}).filter(':first').click();
});

