function getSearchWork(){
	return document.getElementById("searchword2").value;
}
// play flash
// example: playSwf("134x49_torino.swf",134,49);
function playSwf(fPath,width,height) 
{	
	//alert(fPath,width,height);
	var str;
	str = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+width+"\" height=\""+height+"\">\n\r";
	str += "	<param name=\"movie\" value=\""+fPath+"\" />\n\r";
	str += "	<param name=\"quality\" value=\"high\" />\n\r";
	str += "	<param name=\"wmode\" value=\"transparent\" />\n\r";
	str += "	<embed wmode=\"transparent\" src=\""+fPath+"\" quality=\"high\"  width=\""+width+"\" height=\""+height+"\" type=\"application/x-shockwave-flash\"></embed>\n\r";
	str += "</object>\n\r";
	//alert(str);
	document.write(str);
}


// fundamental
id = function(o) { return document.getElementById(o); }

function pixelToNum(str) 
{
		if(str.slice(str.length - 2) == "px")
			{return parseInt(str.slice(0, (str.length - 2)));} 
		else
			{return str;}
}


// activity section: enlarge pics
function act_enlarge(idx)
{
	if (idx=="close")
	{
		var obj=id("act_picdetail");
		obj.style.display="none";
		return false;
	}
	
	var fullpath=idx;
	var obj=id("act_picdetail");
	obj.innerHTML="<img src=\""+ fullpath + "\" /><span onclick=\"act_enlarge('close')\">[关闭]</span>";
	obj.style.display="block";
	obj.style.top=document.body.scrollTop+document.documentElement.scrollTop+"px";
}


// city drop-down list
function getcity(){

	var city=[
	["北京","天津","上海","重庆"],
	["南京","苏州","南通","常州"],
	["福州","福安","龙岩","南平"],
	["广州","潮阳","潮州","澄海"],
	["兰州","白银","定西","敦煌"]
	];

	var sltProvince=id("ir_province");
	var sltCity=id("ir_city");
	  
	 //得到对应省份的城市数组
	var provinceCity=city[sltProvince.selectedIndex - 1];
	 //清空城市下拉框，仅留提示选项
	sltCity.length=1;
	//将城市数组中的值填充到城市下拉框中
	for(var i=0;i<provinceCity.length;i++)
	{
		sltCity[i+1]=new Option(provinceCity[i],provinceCity[i]);
	}
}


// footer drop list URL go
function go(idx)
{
	if (idx!="")
	{
		var win=window.open(idx);
	}
}


// switcher for products in 4th pages
function switchproduct(objsrc,idx,total)
{
	var obj;
	for (var i=1;i<=total ;i++ )
	{
		obj=id("product_series_tab"+i);
		obj.style.display="none";
	}
	obj=id("product_series_tab"+idx);
	obj.style.display="block";

	for (i=0;i<=total-1 ;i++ )
	{
		obj=id("product_4th_switcher");
		obj.getElementsByTagName("a")[i].className="unselected";
	}
	objsrc.className="selected";
}
