﻿function menuchange(obj)
    {
     
      if($("#menu"+obj).is(":hidden"))
       {
        $(".aaa").hide();
        $("#menu"+obj).show();
        document.getElementById("mt"+obj).src="../images/qh_68.jpg";
       }
       else
       {
       $("#menu"+obj).hide();
        document.getElementById("mt"+obj).src="../images/index_67.jpg";
       }
      
    }
    
    
    
    function mmRestore()
{
 
 
 $("#timg1").removeClass("cc1");
 $("#timg2").removeClass("cc2");
 $("#timg3").removeClass("cc3");
 $("#timg4").removeClass("cc4");
 $("#timg5").removeClass("cc5");
 $("#timg6").removeClass("cc6");
 $("#timg7").removeClass("cc7");

 
 
}


function mmChang(obj)
{
 mmRestore();
 $("#timg"+obj).addClass("cc"+obj);
}

window.onload=function(){
if(location.href.indexOf("?")==-1)

{


var topA=new Array();
topA=document.getElementById("topmenu").getElementsByTagName("a");
strUrl=location.href.substring(location.href.lastIndexOf("/")+1);
for(var i=0; i<topA.length;i++)
{ 
  strHref=topA[i].getAttribute("href").substring(topA[i].getAttribute("href").lastIndexOf('/')+1);	
  if(strHref==strUrl)
  { 

    topA[i].className="cc"+(i+1);
//    alert(topA[i].className);
  }		
}

}

if(location.href.indexOf("?")!=-1)
{
var url= location.href.substring(location.href.lastIndexOf("/")+1,location.href.indexOf("?"));
if(url="pro_detail.aspx")
{
 strLast = location.href.substring(location.href.indexOf("?")+1);	
		strParentID=strLast.substring(0,strLast.indexOf("&"));
		strSelfID=strLast.substring(strLast.indexOf("&")+1);	
		parentID=strParentID.substring(strParentID.indexOf("=")+1);//获得第一个参数，这是一级菜单的id
		selfID=strSelfID.substring(strSelfID.indexOf("=")+1);//获得第二个参数，这是二级菜单的id   
		tt(parentID);
}
 }


}


function tt(obj)
{
  $(".aaa").hide();
  $("#menu"+obj).show();
//  document.getElementById("mt"+obj).src="../images/qh_68.jpg";
}
