/*
* Javascript控制图片缩略
* Date: 2008-09-27
* Author: NinJa911
* Email: ninja911@qq.com
* HomePage: http://www.ninja911.com
*/
<!--
var flag = false;	//默认不缩略
function DrawImage(ImgD)
{
    var image = new Image();
	image_w = 178;	//宽度
	image_h = 188;	//高度
    image.src = ImgD.src;
    if (image.width > 0 && image.height > 0)
    {
        flag = true;
        if (image.width / image.height >= image_w / image_h)
        {
            if (image.width > image_w)
            {
                ImgD.width = image_w;
                ImgD.height = (image.height * image_w) / image.width;
            }
            else
            {
                ImgD.width = image.width;
                ImgD.height = image.height;
            }
            ImgD.alt = image.width + "×" + image.height;	//可以注释此行
        }
        else
        {
            if (image.height > image_h)
            {
                ImgD.height = image_h;
                ImgD.width = (image.width * image_h) / image.height;
            }
            else
            {
                ImgD.width = image.width;
                ImgD.height = image.height;
            }
            ImgD.alt = image.width + "×" + image.height;	//可以注释此行
        }
    }
}

//常见问题答题
 function SwitchMenu(obj){
  if(document.getElementById){
  var el = document.getElementById("Menu_"+obj);
  var ar = document.getElementById("Menu").getElementsByTagName("div");
   if(el.style.display != "block"){
    for (var i=0; i<ar.length; i++){
     if (ar[i].className=="submenu")
     ar[i].style.display = "none";
     document.getElementById("Menu"+(i+1)).className="Menutbg_1 cursor"
    }
    el.style.display = "block";
    document.getElementById("Menu"+obj).className="Menutbg_2 cursor"
   }else{
    el.style.display = "none";
    document.getElementById("Menu"+obj).className="Menutbg_1 cursor"
   }
  }
 }

//日期
function writeDateInfo() {
         var day="";  var month=""; var ampm=""; var ampmhour=""; var myweekday=""; var year=""; 
		  mydate=new Date(); myweekday=mydate.getDay(); mymonth=mydate.getMonth()+1;  myday= mydate.getDate();  myyear= mydate.getYear();  year=(myyear > 200) ? myyear : 1900 + myyear; 
		   if(myweekday == 0)weekday=" 星期日"; 
		    else if(myweekday == 1)  weekday=" 星期一"; 
			 else if(myweekday == 2)  weekday=" 星期二";
			  else if(myweekday == 3)  weekday=" 星期三"; 
			   else if(myweekday == 4)  weekday=" 星期四"; 
			    else if(myweekday == 5)  weekday=" 星期五"; 
				  else if(myweekday == 6) weekday=" 星期六"; 
				   document.write(year+"年"+mymonth+"月"+myday+"日"+weekday);
				    }
//兼容IE FF 设为首页 加入收藏夹
function setHomePage(obj){
    var aUrls=document.URL.split("/");
    var vDomainName="http://"+aUrls[2]+"/";
    try{//IE
        obj.style.behavior="url(#default#homepage)";
        obj.setHomePage(vDomainName);
    }catch(e){//other
        if(window.netscape) {//ff
            try {
                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
            } 
            catch (e) { 
                    alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'"); 
            }
            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
            prefs.setCharPref('browser.startup.homepage',vDomainName);
         }
    }
    if(window.netscape)alert("ff");
}
function addFavorite(){
    var aUrls=document.URL.split("/");
    var vDomainName="http://"+aUrls[2]+"/";
    var description=document.title;
    try{//IE
        window.external.AddFavorite(vDomainName,description);
    }catch(e){//FF
        window.sidebar.addPanel(description,vDomainName,"");
    }
}
//首页滑动门效果
function mainmenu_home(){
$(".tab-pro dl dt").each(
	function(){
		$(this).click(function(){
			$(".tab-pro dl dt").removeClass("current");
			$(this).addClass("current");
			var idt = $(".tab-pro dl dt").index(this);
			$(".tab-pro dl dd").hide();
			$(".tab-pro dl dd:eq("+idt+")").show();
		})
	})
}
$(function(){
	mainmenu_home();
}); 
//国内外机构
function mainmenu1(){
$(".map dl dt").each(
	function(){
		$(this).click(function(){
			$(".map dl dt").removeClass("current");
			$(this).addClass("current");
			var idt = $(".map dl dt").index(this);
			$(".map dl dd").hide();
			$(".map dl dd:eq("+idt+")").show();
		})
	})
}
$(function(){
	mainmenu1();
});
//产品参数
function mainmenu(){
$(".pro_parameters dl dt").each(
	function(){
		$(this).click(function(){
			$(".pro_parameters dl dt").removeClass("current");
			$(this).addClass("current");
			var idt = $(".pro_parameters dl dt").index(this);
			$(".pro_parameters dl dd").hide();
			$(".pro_parameters dl dd:eq("+idt+")").show();
		})
	})
}
$(function(){
	mainmenu();
});
//导航下拉
$(function(){
$("#nav li:has(ul)").hover(
function(){$(this).children("ul").show(); 
},
function(){$(this).children("ul").hide(); 
})	
})
//语言版本下拉
$(function(){
$(".top_nav li.en:has(ul)").hover(
function(){$(this).children("ul").show(); 
},
function(){$(this).children("ul").hide(); 
})	
})
//等高
$(function(){
var l_height=$('.sidebar').height();
var r_height=$('.mainbar').height();
if (l_height>r_height){
	$('.mainbar').height(l_height)
}
else{
	$('.sidebar').height(r_height)
}
})
//斑马线
$(function(){
$(".people_list tr:odd").addClass("odd")		   
})
//招聘详细
$(function(){
$(".job_show td:even").addClass("odd")
})
//全国办事处
$(function(){
$("#Map area").click(function(){
$('#office_'+this.id).toggle().siblings('.office').hide();
})
})
//国外办事处
$(function(){
$("#Map2 area").click(function(){
$('#office1_'+this.id).toggle().siblings('.office1').hide();
})
})

//常见问题展开收缩图标
$(function(){
	var $ad=$(".issue_list .submenu")
	$(".issue_list h4").click(function(){
		$(".issue_list h4 span").css("background","url(Style/cut/service_faq_06.png) no-repeat");
		if($ad.is(":visible")){
			$(this).find('span').css("background","url(Style/cut/service_faq_03.png) no-repeat");
		}else{
			$(this).find('span').css("background","url(Style/cut/service_faq_06.png) no-repeat");
		}
	})
})
//侧栏展开收缩
$(function(){
	$(".sidebar li").click(function(){
	$(this).children('ul').show().end().find('strong').text('-').end().siblings('li').children('ul').hide().end().find('strong').text('+');
	})
})
$(function(){
	$(".sidebar li li:has(ul)").hover(function(){
			$(this).css({'border':'1px solid #ccc','cursor':'pointer','border-right':'none'}).children('a').css({'background':'url(style/cut/people_10.png) 0 no-repeat','color':'#DA2337'}).end().children('ul').show().find('li:first-child').css('border-left','none')								   
			},
			function(){$(this).css('border','1px solid #F7FBFE').children('a').css({'background':'url(style/cut/people_13.png) 0 no-repeat','color':'#6D8EB7'}).end().children('ul').hide()})
		   })
