﻿function each(arr, fun){ for(var i=0; i<arr.length; i++){fun(arr[i], i);} }
String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/ig, "");};
Array.prototype.each=function(f){each(this, f);};
function get$(el){if (typeof el == 'string') el = document.getElementById(el); return el;}
function get$$(el, tagName){return get$(el).getElementsByTagName(tagName);}
window.CEvent={         //自定义事件处理
	addListener:function(obj,target,act){
		if(obj.attachEvent) obj.attachEvent("on"+target,act);
		if(obj.addEventListener) obj.addEventListener(target,act,false);
	},
	removeListener:function(obj,target,act){
		if(obj.detachEvent) obj.detachEvent("on"+target,act);
		if(obj.removeEventListener) obj.removeEventListener(target,act,false);
	}
}

function checkSearch(){
	if(get$("keywords").value.trim().length==0 || get$("keywords").value=="请输入您感兴趣的产品"){
		alert("请输入搜索关键字！");
		get$("keywords").focus();
		return false;
	}
	return true;
}

function showcounter(){
	document.write('<span> <a href="http://www.miibeian.gov.cn/" target="_blank">ICP：鄂ICP备10017541号</a></span> <br /><br /><br /><script src="http://s60.cnzz.com/stat.php?id=1532670&web_id=1532670" language="JavaScript" charset="gb2312"></script><script type="text/javascript" src="http://js.tongji.linezing.com/721587/tongji.js"></script><noscript><a href="http://www.linezing.com"><img src="http://img.tongji.linezing.com/721587/tongji.gif"/></a></noscript>');
}

function showAd1(){showGGAd(9702490999, 728, 90);}
function showAd2(){showGGAd(1654604125, 336, 280);}
function showAd3(){showGGAd(8129908249, 160, 600);}
function showLinkAd(){showGGAd(6575766532, 600, 15);}
function showLinkAd1(){showGGAd(2023267608, 600, 15);}
function showLinkAd2(){showGGAd(6575766532, 468, 15);}
function showIndexAd(){showGGAd(9402450916, 300, 250);}

function showGGAd(slot, width, height){
	document.write('<script type="text/javascript"><!--\n');
	document.write('google_ad_client = "pub-5693190509980542";\n');
	document.write('google_ad_slot = "'+slot+'";\n');
	document.write('google_ad_width = '+width+';\n');
	document.write('google_ad_height = '+height+';\n');
	document.write('//-->\n');
	document.write('</script>\n');
	document.write('<script type="text/javascript"\n');
	document.write('  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\n');
	document.write('</script>');
}