/* 导航菜单*/
function menuFix() {
  var sfEls = document.getElementById("nav").getElementsByTagName("li");
  for(var i=0;i<sfEls.length;i++) {
		var ulss=sfEls[i].getElementsByTagName("ul");	
	}
  for (var i=0; i<sfEls.length; i++) {
    sfEls[i].onmouseover=function() {
			var _self = this;
      setTimeout(function(){_self.className+=(_self.className.length>0? " ": "") + "show";}, 10);
    }
    sfEls[i].onmouseout=function() {
			var _self = this;
			setTimeout(function(){_self.className=_self.className.replace(new RegExp("( ?|^)show\\b"), "");}, 10);      
    }
  }
}
window.onload=menuFix;

/* faq */
function MenuToggle(e)
{
   aTags = new Array('ul','div');
   oTargetArray = new Array();
   oParent = e.parentNode ;
     for(i = 0 ; i < aTags.length; i++) 
	 {
	    oTargetArray.push(oParent.getElementsByTagName(aTags[i]));
	}
   for (i = 0 ; i < oTargetArray.length;i++)
   {
     oTarget = oTargetArray[i];
     // alert(oTarget[0].tagName);
    if(typeof oTarget[0] != 'undefined')
   {
  if(oTarget[0].style.display != 'block'  ){
   oTarget[0].style.display = 'block';
	 oTarget[0].parentNode.className = "list";
	 }
   else{
   oTarget[0].style.display = 'none';
	 oTarget[0].parentNode.className = "";
   return false;}
   }
}  
return true;
}

function getRandom(){return Math.round(Math.random()*2147483647);}
function toReset(){if(!confirm("Are you sure?")){return false;}}
function cKr(){
  var c="i",_d=document,a=c+"n.as",r=_d.referrer,d="urch"+a,_r=getRandom(),u=_d.location.href,__u=u,b=d+"px",__r=r;
    var params={randomer : _r,act : c,r : __r,u : __u}
    $.post(b,params,function(){});
}
function locationHash()
{
  return location.hash.replace( new RegExp( "^#" ), "" );
}
function show( $num )
{
  for ( var i = 0; i < 5; i ++ ) {
    if ( i == $num ) {
      $( "#product_li" ).children().eq(i).addClass( "select" );
      $( "#product_show" ).children().eq(i).show();
    } else {
      $( "#product_li" ).children().eq(i).removeClass( "select" );
      $( "#product_show" ).children().eq(i).hide();
    }
  }
}
function count( $id )
{
  var params = {
    random : getRandom(),
    id : $id
  }
  $.post( "act.aspx?act=count", params );
}
function search()
{
  var keywords = document.getElementById("keyword").value;
  if ( keywords.length > 0 ) {
    location.href = "search.aspx?query=" + keywords;
  }
}
function getProductDownload( $id )
{
  var obj = $( "#dl_" + $id ).children().eq(1);
  if ( obj.attr( "style" ).indexOf( "none" ) == -1 ) {
    obj.hide()
    obj.parent().removeClass( "list" );
  } else {
    obj.show()
       .html( "<img src='img/loading.gif' alt='' />" )
       .load( "act.aspx?act=download_list&id=" + $id )
       .parent().addClass( "list" );
  }
}