﻿
//update display of the large image
function displayImage(domAAroundImgThumb)
{
	if (!domAAroundImgThumb.hasClass('shown'))
	{
		if (domAAroundImgThumb.attr('href'))
		{
			var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large');
			$('#bigpic').fadeOut('fast', function(){
				$(this).attr('src', newSrc);
				$(this).fadeIn('fast');
			});
			$('#scroll_begin_Right li a').removeClass('shown');
			$(domAAroundImgThumb).addClass('shown');
		}
	}
}

$(document).ready(function(){
	$('#scroll_begin_Right li a').hover(
			function(){displayImage($(this));},
			function(){}
		);
});

// ID Tabs

$(function () {
	var tabContainers = $('div.yTabs > div');
	tabContainers.hide().filter(':first').show();
	$('div.yTabs ul.tabNavigation a').click(function () {
		tabContainers.hide();
		tabContainers.filter($(this).attr("href")).show();
		//tabContainers.filter(this.hash).show();
		$('div.yTabs ul.tabNavigation a').removeClass('selected'); //移除样式
		$(this).addClass('selected');  //给当前点击的连接 添加样式
		return false;                  //超链接不跳转
	}).filter(':first').click();       //调用click函数
});

// Input Focus //////////////////////////////////////////////////////////////////////////////////////////
$(document).ready(function(){
    //if ($.browser.msie){
        $("input[@type='text'], input[@type='password'], textarea, select").focus(function(){
        $(this).parent("div").addClass("allfocus")}).blur(function(){
           $(this).parent("div").removeClass("allfocus");
           });
		//}
    })

// Menubar  ///////////////////////////////////////////////////////////////////////////////////////

var obj = null;
function checkHover() {
	if (obj) {
		obj.find('ul').fadeOut('fast');	
	} //if
} //checkHover

$(document).ready(function() {
	$('#nav > li').hover(function() {
		if (obj) {
			obj.find('ul').fadeOut('fast');
			obj = null;
		} //if
		
		$(this).find('ul').fadeIn('fast');
	}, function() {
		obj = $(this);
		setTimeout(
			"checkHover()",
			400);
	});
});
