﻿function myFun(sId) {
var onav = document.getElementById("nav").getElementsByTagName('a');
for (var i = 0; i < onav.length; i++) {
  if (i == sId) {
  onav[i].style.backgroundImage= "url(images/nav"+(i+1)+"c.gif)";
  } else {
  onav[i].style.backgroundImage= "url(images/nav"+(i+1)+".gif)";
  }
}
$("#nav a").each(function(i){
	if(sId!=i){
		$("#nav a").eq(i).hover(function(){
	$(this).css({ background:"url(images/nav"+(i+1)+"c.gif)" });
	}, 
	function(){
		$(this).css({ background:"url(images/nav"+(i+1)+".gif)" });
		});
		}
 });
}

function leftFun(navid,pid) {
var onav = document.getElementById("leftnav").getElementsByTagName('a');
for (var i = 0; i < onav.length; i++) {
  if (i == navid) {
  onav[i].style.backgroundImage= "url(images/left"+pid+"_"+(i+1)+"c.jpg)";
  } else {
  onav[i].style.backgroundImage= "url(images/left"+pid+"_"+(i+1)+".jpg)";
  }
}
$("#leftnav a").each(function(i){
	if(navid!=i){
		$("#leftnav a").eq(i).hover(function(){
	$(this).css({ background:"url(images/left"+pid+"_"+(i+1)+"c.jpg)" });
	}, 
	function(){
		$(this).css({ background:"url(images/left"+pid+"_"+(i+1)+".jpg)" });
		});
		}
 });
}

function togb(sId) {
for (var i = 0; i < 3; i++) {
	document.getElementById("togt"+i).style.backgroundImage= "";
	$("#togc"+i).hide();
}
document.getElementById("togt"+sId).style.backgroundImage= "url(images/bt0"+(sId+1)+".jpg)";
$("#togc"+sId).show();
}

function togbt(sId) {
		$("#probt .bta1").each(function(i){
			$("#probt .bta1").eq(i).css({ background:"url(images/probt"+(i+1)+"c.jpg)" });
			if(sId.indexOf(i+1)==(-1)){
//	$(".intxt_txtb_r_pro2_2 .bta1").eq(i).hover(function(){
//	$(this).css({ background:"url(images/probt"+(i+1)+"c.jpg)" });
//	}, 
//	function(){
//		$(this).css({ background:"url(images/probt"+(i+1)+".jpg)" });
//		});
		
		$("#probt .bta1").eq(i).css({ background:"url(images/probt"+(i+1)+".jpg)" });
}
 });
}

function togbtt(sId) {
		$("#probt .bta1").each(function(i){
			$("#probt .bta1").eq(i).css({ background:"url(images/probtt"+(i+1)+"c.jpg)" });
			if(sId.indexOf(i+1)==(-1)){
//	$(".intxt_txtb_r_pro2_2 .bta1").eq(i).hover(function(){
//	$(this).css({ background:"url(images/probt"+(i+1)+"c.jpg)" });
//	}, 
//	function(){
//		$(this).css({ background:"url(images/probt"+(i+1)+".jpg)" });
//		});
		
		$("#probt .bta1").eq(i).css({ background:"url(images/probtt"+(i+1)+".jpg)" });
}
 });
}

//加入收藏夹  格式 <a href="javascript:addFav()" class="navf2">添加收藏</a> 
function  addFav() {   
             if  (document.all) {   
                window.external.addFavorite(document.location.href, document.title);   
            }   
             else   if  (window.sidebar) {   
            window.sidebar.addPanel(document.title, document.location.href,  "" );   
            }   
        }   
