  // JavaScript Document
  <!--
  //纵向导航
  function mouseOver(obj){
	
  /**
  *图片初始
  */
  
  var imageOut=new Array('../templets/Nindeximg/1_04.jpg','../templets/Nindeximg/1_05.jpg','../templets/Nindeximg/1_06.jpg','../templets/Nindeximg/1_07.jpg'
					   ,'../templets/Nindeximg/1_08.jpg','../templets/Nindeximg/1_09.jpg');
  var imageOver=new Array('../templets/Nindeximg/menu1.jpg','../templets/Nindeximg/menu2.jpg','../templets/Nindeximg/menu3.jpg','../templets/Nindeximg/menu4.jpg','../templets/Nindeximg/menu5.jpg','../templets/Nindeximg/menu6.jpg');
  
	  for(var i=0;i<imageOver.length;i++){
			 if(obj.id==('img'+(i+1))){
				 obj.style.background='url('+imageOut[i]+')';
				 obj.style.color='#fff';
				 var objs=obj.getElementsByTagName('div');
				 //纵向菜单文字颜色
				 for(j=0;j<objs.length;j++){
					   objs[j].style.color='#fff';
					   }
				 
			 }else{
	 document.getElementById(('img'+(i+1))).style.background='url('+imageOver[i]+') left bottom no-repeat';	
				var objss= document.getElementById(('img'+(i+1))).getElementsByTagName('div');
				for(j=0;j<objss.length;j++){
					//韩文显示颜色
					if(objss[j].className=='ke'){
						objss[j].style.color='#a2cde4';
						}else{
							//汉字显示颜色
						  objss[j].style.color='#CEE4F0';
						 }
					   }
				 }
		  }
	}
	
	
	
	
  //横向导航
  function mOver(obj){
	
  var menuOut=new Array('../templets/Nindeximg/tm1.jpg','../templets/Nindeximg/tm2.jpg','../templets/Nindeximg/tm3.jpg','../templets/Nindeximg/tm4.jpg','../templets/Nindeximg/tm5.jpg','../templets/Nindeximg/tm6.jpg');
  var menuOver=new Array('../templets/Nindeximg/tm1on.jpg','../templets/Nindeximg/tm2on.jpg','../templets/Nindeximg/tm3on.jpg','../templets/Nindeximg/tm4on.jpg','../templets/Nindeximg/tm5on.jpg','../templets/Nindeximg/tm6on.jpg');
		 for(var i=0;i<menuOver.length;i++){
			 if(obj.id==('m'+(i+1))){
				document.getElementById(('m'+(i+1))).style.background='url('+menuOver[i]+')';			
			 }else{
				   document.getElementById(('m'+(i+1))).style.background='url('+menuOut[i]+') left center no-repeat';
				 }
		  }
	}
  function yeDails_(obj){
		var id=obj.id;
		var num=id.substr(2);
	   for(i=1;i<=3;i++){
		   if(num==i){
			 obj.style.background="url(images/jhh.jpg)";
			 obj.style.color='#000000';
			 document.getElementById(('ye_d_'+i)).style.display='block';
		   }else{
				document.getElementById(('ye'+i)).style.background="url(../images/jhh.jpg)";
				document.getElementById(('ye'+i)).style.color='#ffffff';
				document.getElementById(('ye_d_'+i)).style.display='none';
			   }
		 }       
	
	  }
	  //中间切换
	 function  yeTech(obj){
		   var defaultCss="hover";
		   var SelectCss="hover_1";
		   var m_arr=new Array();
		   m_arr[1]='m_zxmr_';
		   m_arr[2]='m_jgmr_';
		   var txt_arr=new Array();
		   txt_arr[1]='bodycenter6div1';
		   txt_arr[2]='bodycenter6div2';
			   for(i=1;i<=2;i++){
				 if(m_arr[i]==obj.id){
					   obj.className=defaultCss;
//					   obj.style.background="url(../images/vv4.jpg)";
//					   obj.style.color='#fff';
					   document.getElementById(txt_arr[i]).style.display='block';
					 }else{
						 	document.getElementById(m_arr[i]).className=SelectCss;
//							document.getElementById(m_arr[i]).style.background='url()';
//							document.getElementById(m_arr[i]).style.color='#666666';
							document.getElementById(txt_arr[i]).style.display='none';
						 }
			   }
		 }
		 //左边菜单鼠标经过效果
		 function ch_left_menu(obj){
			   var outImage=new Array();  //鼠标离开焦点时显示图片（原图）
			   var overImage=new Array(); //鼠标经过显示图片（改变的图片）
			  overImage[0]='http://www.ye120.com/templets/Nimgaes/1.jpg';
			 overImage[1]='http://www.ye120.com/templets/Nimgaes/2.jpg';
			 overImage[2]='http://www.ye120.com/templets/Nimgaes/3.jpg';
			 overImage[3]='http://www.ye120.com/templets/Nimgaes/4.jpg';
			 overImage[4]='http://www.ye120.com/templets/Nimgaes/5.jpg';
			 overImage[5]='http://www.ye120.com/templets/Nimgaes/6.jpg';
			 overImage[6]='http://www.ye120.com/templets/Nimgaes/7.jpg';
			 overImage[7]='http://www.ye120.com/templets/Nimgaes/8.jpg';
			 overImage[8]='http://www.ye120.com/templets/Nimgaes/9.jpg';
			 overImage[9]='http://www.ye120.com/templets/Nimgaes/10.jpg';
			 
			 outImage[0]='http://www.ye120.com/templets/Nimgaes/1-.jpg';
			 outImage[1]='http://www.ye120.com/templets/Nimgaes/2-.jpg';
			 outImage[2]='http://www.ye120.com/templets/Nimgaes/3-.jpg';
			 outImage[3]='http://www.ye120.com/templets/Nimgaes/4-.jpg';
			 outImage[4]='http://www.ye120.com/templets/Nimgaes/5-.jpg';
			 outImage[5]='http://www.ye120.com/templets/Nimgaes/6-.jpg';
			 outImage[6]='http://www.ye120.com/templets/Nimgaes/7-.jpg';
			 outImage[7]='http://www.ye120.com/templets/Nimgaes/8-.jpg';
			 outImage[8]='http://www.ye120.com/templets/Nimgaes/9-.jpg';
			 outImage[9]='http://www.ye120.com/templets/Nimgaes/10-.jpg';			
			   var parentN=document.getElementById('left_menu');
				var objs=parentN.getElementsByTagName('LI');				
				for(i=0;i<objs.length;i++){		
					  if(objs[i].id==obj.id){						 
						objs[i].style.background='url('+outImage[i]+') center center no-repeat';
						  var o=obj.getElementsByTagName('a');
							o[0].style.color='#1d4c9f';
						  }else{
								objs[i].style.background='url('+overImage[i]+')';
								var o=objs[i].getElementsByTagName('a');
								for(s=0;s<o.length;s++){
										o[s].style.color='#6E6F70';
										
									}
							  }
					}
			 }
  function yemiddleleft(obj){
		var i=obj.id.substr(2);	
		currtAuto=i;		
		for(j=1;j<=3;j++){	
			  if(j==i){
				 obj.style.background='url(../templets/Nindeximg/yebg_11.jpg) center center no-repeat';
				 obj.style.color='#fff';
				  document.getElementById(('yem_div_'+j)).style.display='block';
				  document.getElementById(('yem_div_'+j)).onmouseover=function(){clearInterval(leftAuto);};
				  document.getElementById(('yem_div_'+j)).onmouseout=function (){yemiddleleftAuto();};
				  }else{
					  document.getElementById(('yem_div_'+j)).style.display='none';
					   document.getElementById(('t_'+j)).style.background='url(../templets/Nindeximg/bgover_63.jpg)';	
					   document.getElementById(('t_'+j)).style.color='#0B337E';
					  }
			}
	}
  /*右侧自动切换*/
  var currtAuto=1;
  var  leftAuto;
  function beginAuto(){
	  var obj_tt1=document.getElementById("t_1");
	  var obj_tt2=document.getElementById("t_2");
	  var obj_tt3=document.getElementById("t_3");
	  if(currtAuto==1){yemiddleleft(obj_tt1);}if(currtAuto==2){yemiddleleft(obj_tt2);}
	  if(currtAuto==3){yemiddleleft(obj_tt3);}currtAuto++;if(currtAuto>=4){currtAuto=1;}
	 }
  function yemiddleleftAuto(){
	  var step=4000;
	  leftAuto= setInterval("beginAuto()",step);	
	}
	
/*  function Clear(){
   var inputs=document.getElementsByTagName('input');
   for(k=0;k<inputs.length;k++){
	 if(inputs[k].type=='text'){
		 inputs[k].value='';
	 }
   }
  }*/
  
	/*		   var n=0;
			   var showImg = document.getElementById("bigImg");
			   var showNum = document.getElementById("thumbImg");
			   var ie = document.all?true:false;
				function Mea(value){
					n=value;
					setBg(value);
					plays(value);
				}
				function setBg(value){
				  for(var i=0;i<4;i++)
				   if(value==i){showNum.getElementsByTagName("div")[i].className='cur';} 
					else{showNum.getElementsByTagName("div")[i].className='normal';}  
				  } 
				function plays(value){
					if(ie){with (bigImg){
						filters[0].Apply();
						for(i=0;i<4;i++)i==value?showImg.getElementsByTagName("div")[i].className='dis':showImg.getElementsByTagName("div")[i].className='undis'; 
						filters[0].play();   
					}
  }else{
						for(i=0;i<4;i++)i==value?showImg.getElementsByTagName("div")[i].className='dis':showImg.getElementsByTagName("div")[i].className='undis'; 
  }                }             
				function clearAuto(){clearInterval(autoStart)}
				function setAutos(){autoStart=setInterval("auto(n)", 3000)}
				function auto(){
					n++;
					if(n>3)n=0;
					Mea(n);
				}*/
				
//首页头部焦点图轮换				
var $ = function (id) {
	return "string" == typeof id ? document.getElementById(id) : id;
};

var Class = {
  create: function() {
	return function() {
	  this.initialize.apply(this, arguments);
	}
  }
}

Object.extend = function(destination, source) {
	for (var property in source) {
		destination[property] = source[property];
	}
	return destination;
}

var TransformView = Class.create();
TransformView.prototype = {
  //容器对象,滑动对象,切换参数,切换数量
  initialize: function(container, slider, parameter, count, options) {
	if(parameter <= 0 || count <= 0) return;
	var oContainer = $(container), oSlider = $(slider), oThis = this;

	this.Index = 0;//当前索引
	
	this._timer = null;//定时器
	this._slider = oSlider;//滑动对象
	this._parameter = parameter;//切换参数
	this._count = count || 0;//切换数量
	this._target = 0;//目标参数
	
	this.SetOptions(options);
	
	this.Up = !!this.options.Up;
	this.Step = Math.abs(this.options.Step);
	this.Time = Math.abs(this.options.Time);
	this.Auto = !!this.options.Auto;
	this.Pause = Math.abs(this.options.Pause);
	this.onStart = this.options.onStart;
	this.onFinish = this.options.onFinish;
	try{
	oContainer.style.overflow = "hidden";
	oContainer.style.position = "relative";
	
	oSlider.style.position = "absolute";
	oSlider.style.top = oSlider.style.left = 0;}catch(err){}
  },
  //设置默认属性
  SetOptions: function(options) {
	this.options = {//默认值
		Up:			true,//是否向上(否则向左)
		Step:		5,//滑动变化率
		Time:		10,//滑动延时
		Auto:		true,//是否自动转换
		Pause:		4000,//停顿时间(Auto为true时有效)
		onStart:	function(){},//开始转换时执行
		onFinish:	function(){}//完成转换时执行
	};
	Object.extend(this.options, options || {});
  },
  //开始切换设置
  Start: function() {
	if(this.Index < 0){
		this.Index = this._count - 1;
	} else if (this.Index >= this._count){ this.Index = 0; }
	
	this._target = -1 * this._parameter * this.Index;
	this.onStart();
	this.Move();
  },
  //移动
  Move: function() {
	  try{
	clearTimeout(this._timer);
	var oThis = this, style = this.Up ? "top" : "left", iNow = parseInt(this._slider.style[style]) || 0, iStep = this.GetStep(this._target, iNow);
	
	if (iStep != 0) {
		this._slider.style[style] = (iNow + iStep) + "px";
		this._timer = setTimeout(function(){ oThis.Move(); }, this.Time);
	} else {
		this._slider.style[style] = this._target + "px";
		this.onFinish();
		if (this.Auto) { this._timer = setTimeout(function(){ oThis.Index++; oThis.Start(); }, this.Pause); }
	}}catch(err){}
  },
  //获取步长
  GetStep: function(iTarget, iNow) {
	var iStep = (iTarget - iNow) / this.Step;
	if (iStep == 0) return 0;
	if (Math.abs(iStep) < 1) return (iStep > 0 ? 1 : -1);
	return iStep;
  },
  //停止
  Stop: function(iTarget, iNow) {
	clearTimeout(this._timer);
	this._slider.style[this.Up ? "top" : "left"] = this._target + "px";
  }
};



//Main method 
/*############首页加载方法入口####################main*/
window.onload=function(){
	<!--//首页头部焦点图初始化开始
	function Each(list, fun){
		for (var i = 0, len = list.length; i < len; i++) { fun(list[i], i); }
	};
	
	var objs = $("idNum").getElementsByTagName("li");
	
	var tv = new TransformView("idTransformView", "idSlider", 479, 5, {
		onStart : function(){ Each(objs, function(o, i){ o.className = tv.Index == i ? "on" : ""; }) }//按钮样式
	});
	
	tv.Start();
	
	Each(objs, function(o, i){
		o.onmouseover = function(){
			o.className = "on";
			tv.Auto = false;
			tv.Index = i;
			tv.Start();
		}
		o.onmouseout = function(){
			o.className = "";
			tv.Auto = true;
			tv.Start();
		}
	})
	
	////////////////////////test2
	
	var objs2 = $("idNum2").getElementsByTagName("li");
	
	var tv2 = new TransformView("idTransformView2", "idSlider2", 399, 5, {
		onStart: function(){ Each(objs2, function(o, i){ o.className = tv2.Index == i ? "on" : ""; }) },//按钮样式
		Up: false
	});
	
	tv2.Start();
	
	Each(objs2, function(o, i){
		o.onmouseover = function(){
			o.className = "on";
			tv2.Auto = false;
			tv2.Index = i;
			tv2.Start();
		}
		o.onmouseout = function(){
			o.className = "";
			tv2.Auto = true;
			tv2.Start();
		}
	});
	try{
	$("idStop").onclick = function(){ tv2.Auto = false; tv2.Stop(); }
	$("idStart").onclick = function(){ tv2.Auto = true; tv2.Start(); }
	$("idNext").onclick = function(){ tv2.Index++; tv2.Start(); }
	$("idPre").onclick = function(){ tv2.Index--;tv2.Start(); }
	$("idFast").onclick = function(){ if(--tv2.Step <= 0){tv2.Step = 1;} }
	$("idSlow").onclick = function(){ if(++tv2.Step >= 10){tv2.Step = 10;} }
	$("idReduce").onclick = function(){ tv2.Pause-=1000; if(tv2.Pause <= 0){tv2.Pause = 0;} }
	$("idAdd").onclick = function(){ tv2.Pause+=1000; if(tv2.Pause >= 5000){tv2.Pause = 5000;} }
	
	$("idReset").onclick = function(){
		tv2.Step = Math.abs(tv2.options.Step);
		tv2.Time = Math.abs(tv2.options.Time);
		tv2.Auto = !!tv2.options.Auto;
		tv2.Pause = Math.abs(tv2.options.Pause);
	}}catch(err){}
	//--首页头部初始结束>
}
function ttk(id1,id2,id1_2,id2_2,moreJupid,v){
	$(id1).className='ye1';
	$(id2).className='ye1_2'	
	$(id1_2).style.display='';
	$(id2_2).style.display='none';
	$(moreJupid).href=$(v).value;
  }	
//添加收藏
function addfav(){
if (document.all)
  { window.external.addFavorite('http://www.ye120.com','广州艺星医学美容医院'); }

   else if (window.sidebar){window.sidebar.addPanel('广州艺星医学美容医院', "http://www.ye120.com", "广州艺星医学美容医院"); }

}
