// JavaScript Document
function g(e) {return document.getElementById(e);}
function chgmenu(e){
	switch(e){
	case "home":
	g("menu_home").src="/skin/bestsonny/menu_home1.gif"
	break;
	case "about":
	g("menu_about").src="/skin/bestsonny/menu_about1.gif"
	break;
	case "mobile":
	g("menu_mobile").src="/skin/bestsonny/menu_mobile1.gif"
	break;
	case "bbs":
	g("menu_bbs").src="/skin/bestsonny/menu_bbs1.gif"
	break;
	case "news":
	g("menu_news").src="/skin/bestsonny/menu_news1.gif"
	break;
	case "ask":
	g("menu_ask").src="/skin/bestsonny/menu_ask1.gif"
	break;
	case "space":
	g("menu_space").src="/skin/bestsonny/menu_space1.gif"
	break;
	case "service":
	g("menu_service").src="/skin/bestsonny/menu_service1.gif"
	break;
	case "fun":
	g("menu_fun").src="/skin/bestsonny/menu_fun1.gif"
	break;
	case "quality":
	g("menu_quality").src="/skin/bestsonny/menu_quality1.gif"
	break;
	case "brand":
	g("menu_brand").src="/skin/bestsonny/menu_brand1.gif"
	break;
	case "diy":
	g("menu_diy").src="/skin/bestsonny/menu_diy1.gif"
	break;
	}
}
function setmenu(e){
	switch(e){
	case "home":
	g("menu_home").src="/skin/bestsonny/menu_home0.gif"
	break;
	case "about":
	g("menu_about").src="/skin/bestsonny/menu_about0.gif"
	break;
	case "mobile":
	g("menu_mobile").src="/skin/bestsonny/menu_mobile0.gif"
	break;
	case "bbs":
	g("menu_bbs").src="/skin/bestsonny/menu_bbs0.gif"
	break;
	case "news":
	g("menu_news").src="/skin/bestsonny/menu_news0.gif"
	break;
	case "ask":
	g("menu_ask").src="/skin/bestsonny/menu_ask0.gif"
	break;
	case "space":
	g("menu_space").src="/skin/bestsonny/menu_space0.gif"
	break;
	case "service":
	g("menu_service").src="/skin/bestsonny/menu_service0.gif"
	break;
	case "fun":
	g("menu_fun").src="/skin/bestsonny/menu_fun0.gif"
	break;
	case "brand":
	g("menu_brand").src="/skin/bestsonny/menu_brand0.gif"
	break;
	case "quality":
	g("menu_quality").src="/skin/bestsonny/menu_quality0.gif"
	break;
	case "diy":
	g("menu_diy").src="/skin/bestsonny/menu_diy0.gif"
	break;
	}
}
function check_close(count){
                if (count == 1) {
				document.getElementById("Dpop").style.display= "none";
				document.getElementById("Dquote").style.display= "block";
				scall()
				}
				if (count == 2) {
				document.getElementById("Dpop").style.display= "block";
				document.getElementById("Dquote").style.display= "none";
				scall()
				window.frames["kefu"].location.reload();
				}
				if (count == 3) {
				document.getElementById("Dpop").style.display= "none";
				document.getElementById("Dquote").style.display= "none";
				scall()
				}
 } 

function scpop(){
 if(document.getElementById("Dquote").style.display=="block")
    {
        document.getElementById("Javascript.Div3").style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementById("Javascript.Div3").offsetHeight)-"16"+"px";
        document.getElementById("Javascript.Div3").style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById("Javascript.Div3").offsetWidth)+"px";
    }
 if(document.getElementById("Dpop").style.display=="block")
	{
		document.getElementById("Javascript.Div3").style.top=(document.documentElement.scrollTop)+"px";
　　	document.getElementById("Javascript.Div3").style.left=(document.documentElement.scrollLeft)+"px";
	}
}
var prox;
var proy;
var proxc;
var proyc;
function show(url,w,h){/*--打开--*/
var str = '<iframe src='+url+' frameborder="0" width='+(w-10)+' height='+(h-20)+' name="sframe" id="sframe"></iframe>';
str = str + "<div>[<span onclick='closeed()'>关闭</span>]</div>";
clearInterval(prox);
clearInterval(proy);
clearInterval(proxc);
clearInterval(proyc);
var o = document.getElementById("box");
o.style.display = "block";
o.style.width = w;
o.style.height = h; 
o.innerHTML = str;
sframe.location.reload();
prox = setInterval(function(){openx(o,500)},10);
}
function openx(o,x){/*--打开x--*/
var cx = parseInt(o.style.width);
if(cx < x)
{
o.style.width = (cx + Math.ceil((x-cx)/5)) +"px";
}
else
{
clearInterval(prox);
proy = setInterval(function(){openy(o,200)},10);
}
}
function openy(o,y){/*--打开y--*/
var cy = parseInt(o.style.height);
if(cy < y)
{
o.style.height = (cy + Math.ceil((y-cy)/5)) +"px";
}
else
{
clearInterval(proy);
}
}
function closeed(){/*--关闭--*/
clearInterval(prox);
clearInterval(proy);
clearInterval(proxc);
clearInterval(proyc);
var o = document.getElementById("box");
if(o.style.display == "block")
{
proyc = setInterval(function(){closey(o)},10);
}
}
function closey(o){/*--打开y--*/
var cy = parseInt(o.style.height);
if(cy > 0)
{
o.style.height = (cy - Math.ceil(cy/5)) +"px";
}
else
{
clearInterval(proyc);
proxc = setInterval(function(){closex(o)},10);
}
}
function closex(o){/*--打开x--*/
var cx = parseInt(o.style.width);
if(cx > 0)
{
o.style.width = (cx - Math.ceil(cx/5)) +"px";
}
else
{
clearInterval(proxc);
o.style.display = "none";
}
}