// JScript 文件
function trim(str)
{
  while(true)
   {
    if (str.substring(0,1)==" " || str.substring(0,1)=="　" || str.substring(t-1,t)=="   ")
     {
      str=str.substring(1,str.length);
     }else
     {
      break;
     }
   }

  while(true)
  {
     var t=str.length;
   if (str.substring(t-1,t)==" " || str.substring(t-1,t)=="　" || str.substring(t-1,t)=="   ")
    {
     str=str.substring(0,t-1);
    }else
    {
     break;
    }
  }
  return str;
}


function changeposition(me,obj)
{
	document.getElementById("navobj1").style.backgroundPosition="top";
//	document.getElementById("navobj2").style.backgroundPosition="top";
	document.getElementById("navobj2").style.backgroundPosition="top";
	document.getElementById("navobj3").style.backgroundPosition="top";
	document.getElementById("navobj4").style.backgroundPosition="top";
	document.getElementById("navobj5").style.backgroundPosition="top";
		
	me.style.backgroundPosition="bottom";
	
	if(obj!="1")
	{
   	    document.getElementById("snav").style.color="#1F376D";
   	}else
   	{
   	    document.getElementById("snav").style.color="#ffffff";
   	}
}

function changepositionback()
{
//	document.getElementById("navobj2").style.backgroundPosition="top";
	document.getElementById("navobj2").style.backgroundPosition="top";
	document.getElementById("navobj3").style.backgroundPosition="top";
	document.getElementById("navobj4").style.backgroundPosition="top";
	document.getElementById("navobj5").style.backgroundPosition="top";
   	document.getElementById("navobj1").style.backgroundPosition="bottom";
   	document.getElementById("snav").style.color="#ffffff";
}

function changeposition1(me)
{
	me.style.backgroundPosition="bottom";
    me.style.color="#ffffff";
}

function changepositionback1(me)
{
   	me.style.backgroundPosition="top";
   	me.style.color="#ffffff";
}


function addBookmark(title,url){
	if (window.sidebar)
 		window.sidebar.addPanel(title, url,"");
	else if( document.all )
		window.external.AddFavorite(url, title);
	else if( window.opera && window.print )
		return true;
}

//右侧面行业ＮＢＡ处焦点代码
function changefocuspic(obj)
{
    if(obj=="1")
    {
        document.getElementById("huwu1").style.backgroundImage ="url(images/index_rightfocus_a11.gif)";
        
        document.getElementById("huwu2").style.backgroundImage ="url(images/index_rightfocus_a2.gif)";
        document.getElementById("huwu2").style.fontWeight ="normal";
        
        document.getElementById("huwu3").style.backgroundImage ="url(images/index_rightfocus_a3.gif)";
        document.getElementById("huwu3").style.fontWeight ="normal";
        
        document.getElementById("hw1").style.zIndex="100";
        document.getElementById("hw2").style.zIndex="20";
        document.getElementById("hw3").style.zIndex="20";
         
    }
    if(obj=="2")
    {
        document.getElementById("huwu2").style.backgroundImage ="url(images/index_rightfocus_a22.gif)";
        
        document.getElementById("huwu1").style.backgroundImage ="url(images/index_rightfocus_a1.gif)";
        document.getElementById("huwu1").style.fontWeight ="normal";
        
        document.getElementById("huwu3").style.backgroundImage ="url(images/index_rightfocus_a3.gif)";
        document.getElementById("huwu3").style.fontWeight ="normal";
        
        document.getElementById("hw1").style.zIndex="20";
        document.getElementById("hw2").style.zIndex="100";
        document.getElementById("hw3").style.zIndex="20";                       
    }
    if(obj=="3")
    {
        document.getElementById("huwu3").style.backgroundImage ="url(images/index_rightfocus_a33.gif)";
        
        document.getElementById("huwu1").style.backgroundImage ="url(images/index_rightfocus_a1.gif)";
        document.getElementById("huwu1").style.fontWeight ="normal";
        
        document.getElementById("huwu2").style.backgroundImage ="url(images/index_rightfocus_a2.gif)";
        document.getElementById("huwu2").style.fontWeight ="normal";
        
        document.getElementById("hw1").style.zIndex="20";
        document.getElementById("hw2").style.zIndex="20";
        document.getElementById("hw3").style.zIndex="100";       
    }
}


function checkgosearch()
{
    if(trim(document.getElementById("pcode").value)=="")
    {
        alert("请填写要查询的内容！");
        return false;
    }
}

//////////////////////////////////////////////////////////////////////////////////////////////////


//function viewObj()
//{
//    document.getElementById("viewdo").style.verticalAlign="top";
//    document.getElementById("changeblock").innerHTML="<img src='images/up.gif' onclick='viewup()' style='cursor:hand;' alt='NEXT PAGE'>";
//    var govar;
//    govar=setTimeout("gomovedown()",50);
//}

//function goright()
//{
//    document.getElementById("newproduct").scrollTop=document.getElementById("newproduct").scrollTop+40;
//    govar=setTimeout("gomovedown()",50);
//    if(document.getElementById("newproduct").scrollTop==320)
//    {
//        clearTimeout(govar);
//    }
//}

window.onscroll = function MoveQQ()
{
    document.getElementById("divMenu").style.top=document.documentElement.scrollTop+140;
}

function set()
{
    document.getElementById("divMenu").style.left="-150px";
    document.getElementById("picobj").innerHTML="<div onclick=\"view()\"  style=\"cursor:hand;\"><img src=\"http://mall.cp1168.com/images/mright1.gif\" title=\"点击扩大\"/></div>";
}

function view()
{
    document.getElementById("divMenu").style.left=0;
    document.getElementById("picobj").innerHTML="<div onclick=\"set()\"  style=\"cursor:hand;\" ><img src=\"http://mall.cp1168.com/images/mright2.gif\"  title=\"点击右上角缩小\"/></div>";
}
    
//    
//            window.setTimeout(function(){document.getElementById("topimg").style.display="none";},8000);
//            
        var speed=300;
        function m()
        {
        document.getElementById("whattext").style.color="#0000ff";
        setTimeout("e()",speed)
        }
        function e()
        {
        document.getElementById("whattext").style.color="#ff0000";
        setTimeout("m()",speed)
        }
