
function changecat1(image,ele){
	var obj = document.getElementsByName(ele);
	obj[0].src = "/statics/images/zh-cn/"+image+".gif";
	if(news_pre_ele && news_pre_ele != ele)
	{
		var obj1 = document.getElementsByName(news_pre_ele);
		obj1[0].src = "/statics/images/zh-cn/"+news_pre_ele+".gif";
	}
	news_pre_ele = ele;
	$(".news-content-ul").css("display","none");
	$("#"+ele).css("display","block");
}
$(document).ready(function(){
	//首页导航菜单鼠标滑动效果
	$(".header-banner-ul li").mouseover(function(){
		$(".header-banner-ul li").each(function(){
			$(this).removeClass("header-banner-ul-active");
		});
		$(this).addClass("header-banner-ul-active");
	});
	$(".index-news-header ul li").mouseover(function(){
		$(".index-news-header ul li").each(function(){
			$(this).removeClass("header-banner-ul-active");
		});
		$(this).addClass("header-banner-ul-active");
		$(".news-content-ul").css("display","none");
		$("#"+$(this).attr("id")+"ct").css("display","block");
	});
	//产品中心显示页面
	$(".category-nav ul li").mouseover(function(){
		$(".category-nav ul li").each(function(){
			$(this).removeClass("header-banner-ul-active");
		});
		$(this).addClass("header-banner-ul-active");
	});

	$(".cpzx-content-main ul li").mouseover(function(){
		$(".cpzx-content-main ul li").each(function(){
			$(this).removeClass("header-banner-ul-active");
		});

		$(".cpzx-content-main-body").css("display","none");
		$(this).addClass("header-banner-ul-active");
		$("#"+$(this).attr("id")+"bd").css("display","block");
	});
	
	//跳转到产品中心页对应标签
	var link = window.location.href;
	var r = link.split("#");
	if(r[1]!=null && r[1]!="" && $("#"+r[1])[0])
	{
		$(".cpzx-content-main ul li").each(function(){
			$(this).removeClass("header-banner-ul-active");
		});

		$(".cpzx-content-main-body").css("display","none");
		$("#"+r[1]).addClass("header-banner-ul-active");
		$("#"+r[1]+"bd").css("display","block");
	}

	//产品中心颜色隔行变化
	$(".cpzx-content-main-body table tr:even").css("background-color", "#d2eaf1"); //为表格所有奇数行设置背景颜色：#EEEEEE 
	$(".cpzx-content-main-body table tr:first").css("background-color", "#4bacc6");
	$(".cpzx-content-main-body table tr td").css("height", "25px");
	
	//产品中心显示页面图片预览
	$(".cpzx-content-header-small-image img").mouseover(function(){
		$("#bigthumb").attr("src",$(this).attr("src"));
		$(this).css("cursor","pointer");
	});
	//服务政策
	$(".khfw-wxfw-header").mouseover(function(){
		$(".khfw-wxfw-header").removeClass("active");
		$(this).addClass("active");
		$(".khfw-wxfw-content").css("display","none");
		$("#"+$(this).attr("id")+"ct").css("display","block");
	});
	//文件下载颜色改变
	
	$(".khfw-down-file ul li").mouseover(function(){
		$(this).css("background-color","#fff9df");
		$(this).css("border","1px double #fdbb80");
		$(this).css("color","#ee3300");
	});
	$(".khfw-down-file ul li").mouseout(function(){
		$(this).css("background-color","#EEEEEE");
		$(this).css("border","1px double #DDDDDD");
		$(this).css("color","#000066");
	});

	//积分商城
	$(".jfsclp ul li p").mouseover(function(){
		$(this).css("background-color","#fff9df");
		$(this).css("color","#ee3300");
	});
	$(".jfsclp ul li p").mouseout(function(){
		$(this).css("background-color","#EEEEEE");
		$(this).css("color","#000066");
	});
});
function changevideo(index)
{
	var videourl = $("#videourl").val();
	var varr	 = videourl.split(";");
	var url		 = "/statics/images/flvplayer.swf?vcastr_file="+varr[index]+"&IsAutoPlay=1";
	$("#move").val(url);
	alert($("#move").val());
}

function downlogin()
{
	alert("请先登录，再下载文件！");
	location.href="/index.php?m=member&c=index&a=register";
}

function shop_exchange(point,shopid,kcsy)
{
	var url = "/index.php?m=content&c=index&a=shop_exchange";
	var param = "kcsy="+kcsy+"&point="+point+"&shopid="+shopid;

	$.post(url,param,function(response){
		if(response=="no_login")
		{
			alert("请先登录!");
			location.href="/index.php?m=member&c=index&a=register";
		}
		else if(response=="kcsy_0")
		{
			alert("抱歉,库存数量不足!");
			return;
		}
		else if(response=="point_less")
		{
			alert("积分不足，请查看积分规则!");
			location.href="/index.php?m=content&c=index&a=lists&catid=124";
		}
		else if(response=="success")
		{
			alert("兑换成功!");
		}
		else if(response=="fail")
		{
			alert("兑换失败!");
		}
	});
}

function shop_collect(shopid)
{
	var url = "/index.php?m=content&c=index&a=shop_collect";
	var param = "shopid="+shopid;

	$.post(url,param,function(response){
		if(response=="no_login")
		{
			alert("请先登录!");
			location.href="/index.php?m=member&c=index&a=register";
		}
		else if(response=="have_collect")
		{
			alert("已经收藏过该商品!");
		}
		else if(response=="success")
		{
			alert("收藏成功!");
		}
		else if(response=="fail")
		{
			alert("收藏失败!");
		}
	});
}
function AddFavorite(sURL, sTitle)
{
    try
    {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}
function setHomepage(){   
    if (document.all){   
    document.body.style.behavior='url(#default#homepage)';   
    document.body.setHomePage(document.URL);   
  }else if (window.sidebar){   
        if(window.netscape){   
       try{    
          netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");    
       }catch (e){    
                    alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" );    
       }   
        }    
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);   
    prefs.setCharPref('browser.startup.homepage',document.URL);   
    }   
}

