var titles = {
'index.html':'',
'he/':'http://hd0006578.ourhost.cn/template/images/title_he.jpg',
'news/':'http://hd0006578.ourhost.cn/template/images/title_about.jpg',
'pse/':'http://hd0006578.ourhost.cn/template/images/title_pse.jpg',
'ice/':'http://hd0006578.ourhost.cn/template/images/title_ice.jpg',
'nce/':'http://hd0006578.ourhost.cn/template/images/title_nce.jpg',
'cyle/':'http://hd0006578.ourhost.cn/template/images/title_cyle.jpg',
'training':'http://hd0006578.ourhost.cn/template/images/title_training.jpg',
'join/':'http://hd0006578.ourhost.cn/template/images/title_join.jpg',
'order/':'http://hd0006578.ourhost.cn/template/images/title_order.jpg',
'other/11.html':'http://hd0006578.ourhost.cn/template/images/title_about.jpg',
'other/12.html':'http://hd0006578.ourhost.cn/template/images/title_contact.jpg',
'hr/':'http://hd0006578.ourhost.cn/template/images/title_hr.jpg',
'help/':'http://hd0006578.ourhost.cn/template/images/title_about.jpg'
};
var flash = {
'index.html':'',
'he/':'http://hd0006578.ourhost.cn/template/flash/about.swf',
'news/':'http://hd0006578.ourhost.cn/template/flash/about.swf',
'pse/':'http://hd0006578.ourhost.cn/template/flash/pse.swf',
'ice/':'http://hd0006578.ourhost.cn/template/flash/ice.swf',
'nce/':'http://hd0006578.ourhost.cn/template/flash/nce.swf',
'cyle/':'http://hd0006578.ourhost.cn/template/flash/cyle.swf',
'training':'http://hd0006578.ourhost.cn/template/flash/training.swf',
'join/':'http://hd0006578.ourhost.cn/template/flash/join.swf',
'order/':'http://hd0006578.ourhost.cn/template/flash/order.swf',
'other/11.html':'http://hd0006578.ourhost.cn/template/flash/about.swf',
'other/12.html':'http://hd0006578.ourhost.cn/template/flash/contact.swf',
'hr/':'http://hd0006578.ourhost.cn/template/flash/hr.swf',
'help/':'http://hd0006578.ourhost.cn/template/flash/contact.swf'
};
var banner = {
'other/':'bg_about',
'hr/':'bg_hr',
'training':'bg_training',
'he/':'bg_he',
'news/':'bg_about',
'pse/':'bg_pse',
'ice/':'bg_about',
'nce/':'bg_about',
'cyle/':'bg_about',
'join/':'bg_about',
'order/':'bg_about',
'admissions/':'bg_about',
'help/':'bg_about'
};
var gray=new Array("/","about/","news/","rate/","adv/","product/");
$(document).ready(function(){
	var currentUrl = window.location.href;
	var b = true;
	for(var name in titles){
		if(currentUrl.match(name)){
			$(".sideleft .box").addClass(banner[name]);

			$("#titleImg").attr("src",titles[name]);
			//$("#bannerImg").attr("src",banner[name]);//??
			$('#flash').html('').flash(
				{ src: flash[name],
				  width: 960,
				  height: 150 },
				{ version: 8 }
			);
			//$("#paramFlash").attr("value",flash[name]);//flash
			//$("#embedFlash").attr("src",$("#paramFlash").attr("value"));//flash
			b = false;
			break;
		}
	}
	var temp;
	var attr =$(".nav a");
	attr.each(function(i){
		if(i<gray.length && $(this).attr("href").match(gray[i])){
			$(this).addClass("gray");
		}
	});
	if(b){
		$($(".nav a")[0]).removeClass("gray");
		$($(".nav a")[0]).addClass("home");
		$("#titleImg").attr("src",titles['index']);
		//$("#bannerImg").attr("src",banner['index']);
		return;
	}
	attr.removeClass("home").each(function(i){
		if(i<attr.length-1){
		var href = $(this).attr('href');
		if(href=='http://www.af112.com/online.html'&&currentUrl.match(href)){
			$(this).addClass("home");
			$(this).removeClass("gray");
		}else{
			href = href.replace('http://www.af112.com','');
			href = href.substring(0,href.lastIndexOf('/'));
			 if(href&&href!=''&&currentUrl.match(href)){
				$(this).addClass("home");
				$(this).removeClass("gray");
			}
		}
		}
	});
	if(currentUrl =='http://www.af112.com/index.html'){	
		$($(".nav a")[0]).addClass("home");
		$($(".nav a")[0]).removeClass("gray");
	}
});
function size(obj){}
