document.title = "美的中央空调";

document.write("<script language=\"javascript\" src=\"/js/swfobject.js\"></script>");

function GI(id){ return document.getElementById(id); }
function gN(name)	{return document.getElementsByName(name);}

function GN(name){ return document.getElementsByName(name); }

function Ion_getParentObject(targetObj, level)
{
	if(level>0)
	{
		var tempObj = targetObj.parentNode;
		return Ion_getParentObject(tempObj, level-1);
	}
	else
		return targetObj;
}

function changeTopMenuImg(o, flag)
{
	var s = o.src;
	if(flag==0)
		o.src = s.substring(0, s.lastIndexOf("_")+1) + "1.gif";
	else
		o.src = s.substring(0, s.lastIndexOf("_")+1) + "0.gif";
}

function changeTdColor_0(o, flag, fontColor, bgColor)
{
	var obj = Ion_getParentObject(o, 1);
	if(obj!=null)
	{
		if(flag==0)
		{
			var nodesList = obj.childNodes;
			for(var i=0; i<nodesList.length; i++)
			{
				nodesList[i].style.color = "#" + fontColor;
			}
			obj.style.backgroundColor = "#" + bgColor;
		}
		else if(flag==1)
		{
			var nodesList = obj.childNodes;
			for(var i=0; i<nodesList.length; i++)
			{
				nodesList[i].style.color = "";
			}
			obj.style.backgroundColor = "";
		}
	}
}

function centerair_style(id,total,index)
{
	try
	{
		for(i=1;i<=total;i++)
		{
			objDiv = GI("m_1_2_"+i)
			objDiv.style.cssText = "display:none";
		}
		
		objA = GI("centerair_img1");
		objB = GI("centerair_img2"); 

		objA.src = "images/index_M_1b.jpg";
		objB.src = "images/index_M_2b.jpg";

		objD = GI("centerair_img"+id);
		objDiv1 = GI("m_1_2_"+id);

		objD.src = "images/index_M_"+id+"a.jpg";
		objDiv1.style.cssText = "display:";
	}
	catch(e){}
}

function changeIndexNews(flag, type)
{
	for(var i=0; i<2; i++)
	{
		GI("index_news_title_" + i).src = "images/cn/index_title_"+ i +"_0.gif";
		GI("index_news_title_more_" + i).style.display = "none";
		GI("s_2_2_" + i).style.display = "none";
	}
	
	GI("index_news_title_" + flag).src = "images/cn/index_title_"+ flag +"_1.gif";
	GI("index_news_title_more_" + flag).style.display = "";
	GI("s_2_2_" + flag).style.display = "";
}

function SearchProduct()
{
	if(GN("product_0")[0].checked)
	{
		if(GI("pro_0_0").value==-1)
			window.open("/pages/series.jsp?catid=74|88");
		else
		{
			if(GI("pro_0_child").value==-1)
				window.open("/pages/groups.jsp?catid=74|88|" + GI("pro_0_0").value);
			else
				window.open("/pages/products.jsp?catid=74|88|" + GI("pro_0_0").value + "#" + GI("pro_0_child").value);
		}
	}
	else
	{
		if(GN("product_1")[0].checked)
		{
			//商用中央热水  
			if(GI("pro_1_0").value==-1)
				window.open("/heater/pages/groups.jsp?catid=75|144");
			else
				window.open("/heater/pages/showCategoryContent.jsp?catid=75|144|" + GI("pro_1_0").value);
		}
		else
		{
			if(GI("pro_1_1").value==-1)
				window.open("/heater/pages/series.jsp?catid=75|145");
			else
			{
				if(GI("pro_0_1_child").value==-1)	
					window.open("/heater/pages/groups.jsp?catid=75|145|"+ GI("pro_1_1").value);
				else
					window.open("/heater/pages/showCategoryContent.jsp?catid=75|145|"+ GI("pro_1_1").value +"|"+ GI("pro_0_1_child").value);
			}
		}
	}
}	

function getOs()
{
  var browser = navigator.appName;
  var b_version = navigator.appVersion;
  var version = b_version.split(";"); 
  var trim_Version = version[1].replace(/[   ]/g,"");   
  if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0") return 6;
  if(navigator.userAgent.indexOf("MSIE")>0) return 1;
  if(isFirefox=navigator.userAgent.indexOf("Firefox")>0)  return 2;
  if(isSafari=navigator.userAgent.indexOf("Safari")>0)  return 3;
  if(isCamino=navigator.userAgent.indexOf("Camino")>0)  return 4;
  if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0) return 5;
  return 7;
}

function disposeContent(oId, len)
{
	var t = GI(oId).innerText;
	if(t.length>len)
		t = t.substring(0, len) + "...";
	GI(oId).innerHTML = "<div style=\"line-height:18px;\">&nbsp;&nbsp;" + t + "<div>";
	GI(oId).style.display = "";
}


function skipPage(pageId,totalPages)
{
	if(pageId>totalPages)
		pageId = totalPages;
	if(pageId<1)
		pageId = 1;
	pageForm.pageId.value = pageId;
	
	pageForm.submit();
}
function skipPage_(pageId, totalPages)
{
	if(pageId>totalPages)
		pageId = totalPages;
	if(pageId<1)
		pageId = 1;
	pageForm.pageId.value = pageId;
	pageForm.submit();
}

function HAS(idstr)
{
	var obj = document.getElementById(idstr);
  if(obj.style.display=="none")
    obj.style.display = "";
  else
    obj.style.display = "none";
}

function checkSearch(form)
{
	if(form.keyword.value.length==0)	
	{
			alert("请输入查询关键字");
			form.keyword.focus();
			return false;
	}
	form.submit();
}

function FamilyTopMenu(overFlag, curFlag)
{
	for(var i=0; i<menuIds.length; i++)
	{
		if(menuIds[i]!=curFlag && curFlag!=-1)
		{
			GI("family_top_"+menuIds[i]).src = "/family/images/cn/family_topMenu_"+ menuIds[i] +"_0.gif";
		}
	}
	GI("family_top_"+overFlag).src = "/family/images/cn/family_topMenu_"+ overFlag +"_1.gif";
}