// JavaScript Document

var _aMenuWidth = new Array(130,200,100,100,130,100);
$(document).ready(function(){
	$('#ModuleBar').children('li').children('a').hover(
		function(){
			var index = $(this).parent().attr('class').substr(1);
			$(this).parent().css('background-image', 'url(http://www.cs360.cn/changsongzongbu/image/bar_'+index+'_1.jpg)');
		},
		function(){
			var index = $(this).parent().attr('class').substr(1);
			$(this).parent().css('background-image', 'url(http://www.cs360.cn/changsongzongbu/image/bar_'+index+'.jpg)');
		}
	);
	$('.ModulePanel').children('.Title').children('.More').children('a').children('img').hover(
		function(){$(this).attr('src', 'http://www.cs360.cn/changsongzongbu/image/more_1.jpg');},
		function(){$(this).attr('src', 'http://www.cs360.cn/changsongzongbu/image/more.jpg');}
	);
	$('.ModulePanel_Full').children('.Title').children('.More').children('a').children('img').hover(
		function(){$(this).attr('src', 'http://www.cs360.cn/changsongzongbu/image/more_1.jpg');},
		function(){$(this).attr('src', 'http://www.cs360.cn/changsongzongbu/image/more.jpg');}
	);
	
	$('.ChildMenu').hover(function(){}, function(){$(this).hide('fast');});
	$('.ChildMenu').children('ul').children('li').hover(function(){$(this).css('background-image', 'url(http://www.cs360.cn/changsongzongbu/image/childmenuback.jpg)');}, function(){$(this).css('background-image', '');});
	
	initChildMenu();
	
	
	//2011-5-21Ìí¼Ó
	$('.LeftPanel').children('.Item').children('a').hover(function(){$(this).parent().css('background-image', 'url(http://www.cs360.cn/changsongzongbu/image/item_1.jpg)');}, function(){$(this).parent().css('background-image', 'url(http://www.cs360.cn/changsongzongbu/image/item.jpg)');});
	$('.TrPanel:even').css('background-color', '#f9f9f9');
	$('li.time1:odd').css('color', '#A50C14');

});

function initChildMenu(){
	for(var index = 1; index<=6; index++){
		var width = _aMenuWidth[index - 1];
		$('#ChildMenu_'+index).css('width', width+'px');
		$('#ChildMenu_'+index).children('ul').css('width', width+'px');
		$('#ChildMenu_'+index).children('ul').children('li').each(function(){
			$(this).css('width', (width - 50)+'px');
		});
	}
}
var _oldChildMenu = '';
function showChildMenu(index){
	if (_oldChildMenu != '' && _oldChildMenu != index){
		$('#ChildMenu_'+_oldChildMenu).hide('fast');
	}
	var o=eval("document.all.Menu"+index);
    //ÏÔÊ¾µÄÎ»ÖÃ
    x=o.offsetLeft;
    y=o.offsetTop;
    while(o=o.offsetParent)
    {
        x+=o.offsetLeft;
        y+=o.offsetTop;
    }
	y+=33;
	$('#ChildMenu_'+index).css('left', x);
	$('#ChildMenu_'+index).css('top', y);
	$('#ChildMenu_'+index).show('fast');
	
	_oldChildMenu = index;
}
