﻿// JScript 文件
//导航栏样式加载

function menu_load()
{
    var str_url=window.location.href;  //获取url
    var str_class1=/class=hm/;           //获取参数
    str_class1.exec(str_url);
    var str_class=RegExp.rightContext;
    str_class=str_class.substring(0,1);
    if(parseInt(str_class)>= 0 && parseInt(str_class)<=9)
    {
        document.getElementById("td_menu"+str_class).style.background="url(/images/style/menu_over.gif) no-repeat center top";
        document.write("<style type='text/css'>#td_menu"+str_class+" a{color:#e67817; padding-top:13px; height:22px;}</style>");
    }
    else
    {
        document.getElementById("td_menu1").style.background="url(/images/style/menu_over.gif) no-repeat center top";
        document.write("<style type='text/css'>#td_menu1 a{color:#e67817; padding-top:13px; height:22px;}</style>");
    }
}

//
function change_display(str_list_id)
{
    if(document.getElementById(str_list_id).style.display == "")
    {
        document.getElementById(str_list_id).style.display = "none";
    }
    else
    {
        document.getElementById(str_list_id).style.display = "";
    }
}

//产品显示页面鼠标经过小图片时改变样式且改变大图src
function image_change(str_di_id)
{
  try
  {
  document.getElementById("div_pd_1").className="div_pd_img1";
  }
  catch(err){}
  try
  {
document.getElementById("div_pd_2").className="div_pd_img1";
  }
  catch(err){}
  try
  {
document.getElementById("div_pd_3").className="div_pd_img1";
  }
  catch(err){}
document.getElementById(str_di_id).className="div_pd_img2";
var str_im_id;
str_im_id=str_di_id.replace("div","img");
document.getElementById("img_pd_b").src = document.getElementById(str_im_id).src;
}

function show_big_pdimg()
{
document.getElementById("div_pd_bb").style.display="";
document.getElementById("img_pd_bb").src = document.getElementById("img_pd_b").src;
}

function menu_list_display() 
{ //v9.0
    var i,p,v,obj,args=menu_list_display.arguments;
    for (i=0; i<(args.length-2); i+=3) 
    with (document)
    if (getElementById && ((obj=getElementById(args[i]))!=null))
    {
    v=args[i+2];
    if (obj.style)
    { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v;
    }
}

function div_locat()
{
    for(var ii = 2; ii <= 9; ii++ )
    {
        try
        {
            var obj_ls = document.getElementById("div_td_menu" + ii);
            var iwidth = parseInt(obj_ls.style.width.replace("px",""));
            var ileft = obj_ls.offsetLeft;
            var str_page_trim = (document.body.clientWidth - 968) / 2;
            if((iwidth + ileft) > (str_page_trim + 968))
            {
                obj_ls.style.right = str_page_trim + 1 + "px";
            }
        }
        catch(err){}
    }
}

//
function leftmenu_list_show(str_id)
{
    
    for(var i=0;i<=9;i++)
    {
        try
        {
            document.getElementById("div_td_leftmenu_" + i).style.visibility="hidden";
            document.getElementById("td_leftmenu_" + i).style.background="url(/images/style/left_menu_out.gif)";
        }
        catch(err)
        {}
    }
    document.getElementById("div_" + str_id).style.visibility="visible";
    document.getElementById(str_id).style.background = "url(/images/style/left_menu_over.gif)";
}

//
function qiehuan(num){
	for(var id = 0;id<=9;id++)
	{
		if(id==num)
		{
			document.getElementById("qh_con"+id).style.display="block";
			document.getElementById("mynav"+id).className="nav_on";
		}
		else
		{
    		try
    		{
			    document.getElementById("qh_con"+id).style.display="none";
			    document.getElementById("mynav"+id).className="";
		    }
		    catch(err){}
		}
	}
}

//search text box on click to clear text
function srh_text_click(str_id)
{
    try
    {
        var obj = document.getElementById(str_id);
        if(obj.value == "站内搜索")
        {
            obj.value = "";
            obj.style.color = "#444444";
        }
        else if(obj.value == "")
        {
            obj.value = "站内搜索";
            obj.style.color = "#aaaaaa";
        }
    }
    catch(Error){}
}

