﻿function showetwproinfo(setLanguage)
{
	var temp_page_num
	var temp_title=top.location.href
	var temp_page_num_l=temp_title.indexOf("?pageNum=")
	if(temp_page_num_l<0)
	{
		temp_page_num=0
		}
	else
	{
		temp_page_num_l=temp_page_num_l+9
		temp_page_num=temp_title.substr(temp_page_num_l)
		}
	//换页后，获取页面的页数
	var getitem=document.getElementsByTagName("item")
	var info=""
	if(window.ActiveXObject)
	{
		j=0+temp_page_num*8
		
		page_all_num=j+8
		allProductNum=getitem.length
		}
		else
		{
			j=1+temp_page_num*8
			page_all_num=j+8
			allProductNum=getitem.length
			}
			
		if(page_all_num>allProductNum)
			{
				page_all_num=allProductNum
			}
		//在IE下，第一杀不能正常显示，则先建一个空ID，以便IE能正常显示第一条（其实是第二条）,然后通过判断是IE还是火狐，如果是火狐，则从第二条显示，因为IE本身不能显示第一条，则J设为0
		
		//每页仅显示8条数据

for(i=j;i<page_all_num;i++)
	{
		if(getitem[i].getAttribute("languages")==setLanguage || setLanguage=="" || setLanguage==null)
		{
		var img="<a href='eachinfo.html?"+getitem[i].getAttribute("id")+"'>"+"<img src='"+getitem[i].getAttribute("pic")+"' width='120' height='80' border='0' />"+"</a>"
		var gettitle="<a href='eachinfo.html?"+getitem[i].getAttribute("id")+"'>"+getitem[i].getAttribute("pro-title")+"</a>"
		var temp_info="<div class='etw_each_pro'>"+img+gettitle+"</div>"
		info=info+temp_info
		}
	}

	document.write("<div id='etw_product_2009'>"+info+"<div id='etw_pro_turnpage'></div></div>")
	
	//每页仅显示8条数据，如果多于8条，则将翻译页插入etw_pro_turnpage中
	if(allProductNum>8)
		{
			var etw_pro_page_num=parseInt(allProductNum/8)
			var pageinfo=""
			for(pageNum=1;pageNum<etw_pro_page_num+2;pageNum++)
			{
				var linkinfo="<a href='new_product.html?pageNum="+(pageNum-1)+"'>"+pageNum+"</a>&nbsp;"
				pageinfo=pageinfo+linkinfo
				}
			var etw_pro_turnpage=document.getElementById("etw_pro_turnpage")
			etw_pro_turnpage.innerHTML=pageinfo
			}
}
function checkinfo()
{
	var getquery=top.location.href
	var getquery_place=getquery.indexOf("eachinfo.html?")+14
	var getquery_str=getquery.substr(getquery_place)
	var getid=document.getElementById(getquery_str)
	var h2=document.getElementById("eachinfo_title")						  
	h2.innerHTML=getid.getAttribute("pro-title")
	var eachinfo_pic=document.getElementById("eachinfo_pic")
	eachinfo_pic.setAttribute("src",getid.getAttribute("pic"))
	var eachinfo_description=document.getElementById("eachinfo_description")
	eachinfo_description.innerHTML=getid.getAttribute("description")
	}