﻿var curPage=0;
var totolPage=0;
function displayLayer(fatherLayer, strSubLayer){
  var subStyle  = document.getElementById(strSubLayer).style;
  
  var fatherTop  = fatherLayer.offsetTop;
  var fatherHeight  = fatherLayer.clientHeight;
  var fatherLeft = fatherLayer.offsetLeft;
  
  while (fatherLayer = fatherLayer.offsetParent){
  	fatherTop += fatherLayer.offsetTop; 
  	fatherLeft += fatherLayer.offsetLeft;
  }
 
	  subStyle.top  = fatherTop + 12;
	  subStyle.left = fatherLeft ;
	  
  subStyle.visibility = 'visible';
}

function subDisplay(subLayer)
{
	subLayer.style.visibility = 'visible';
}

function hideLayer(strLayer){
    if(document.getElementById(strLayer) != null)
    {
	    document.getElementById(strLayer).style.visibility = 'hidden';
		}
}


function SearchPro(){	
 var search=document.getElementById("SearchName").value;
 window.location="Product.aspx?search="+escape(search);
}
function SearchNew(){	

 var search=document.getElementById("SearchName").value;
 window.location="News.aspx?search="+escape(search);
}
function pagePre()
{
 if(curPage>0)
{
  curPage--;
  divShow(curPage);
}
 
}
function pageNext()
{
  curPage++;
 divShow(curPage);
}
function divShow(id)
{
   var obj=document.getElementsByTagName("div");
    var j=0;
   for(var i=0;i<obj.length;i++)
	{   
            
          if(obj[i].id.substr(0,3)=="Pro")
           {
             obj[i].style.display='none';    
             if(j==id)
              {
                obj[i].style.display='';
              }
             j++;
             totolPage=j;
           }
        }
}

function ShowMoreDiv()
{
  
   var obj=document.getElementById("moreItem"); 
  
     x = event.clientX;
    
     y = event.clientY;
      x -= 10;
      y += 15;
      if(x<0) x=0;//防左移出
       moveTo(obj,x,y); 
       //obj.className=navigatorMargin;
       if(obj.style.visibility=='visible')           
        obj.style.visibility = 'hidden';
        else
         obj.style.visibility = 'visible';    
          
      


  
}
  function moveTo(obj,xL,yL) {
 
          obj.style.left = xL;
          obj.style.top = yL;
      }

function menuFix() {
if(document.getElementById("nav")!=null)
{ 
var sfEls = document.getElementById("nav").getElementsByTagName("li"); 
for (var i=0; i<sfEls.length; i++) { 
sfEls[i].onmouseover=function() { 
this.className+=(this.className.length>0? " ": "") + "sfhover"; 
} 
sfEls[i].onMouseDown=function() { 
this.className+=(this.className.length>0? " ": "") + "sfhover"; 
} 
sfEls[i].onMouseUp=function() { 
this.className+=(this.className.length>0? " ": "") + "sfhover"; 
} 
sfEls[i].onmouseout=function() { 
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), 
""); 
}
} 
} 
}

if (document.all){
window.attachEvent('onload',menuFix);
window.attachEvent('onload',GetUserLogin);
}
else{
window.addEventListener('load',menuFix,false);
window.addEventListener('load',GetUserLogin,false);
}



function ShowExample()
{
     return;
	JSDN.LightBoxPane.On();	
	var oPaneLayer = document.createElement("DIV");
	
	oPaneLayer.style.position = "absolute";
	oPaneLayer.style.zIndex = JSDN.LightBoxPane.zIndex + 1;
    
    var iStateWidth, iStateHeight, iStateLeft, iStateTop;
    var sWidth = 400;
    var sHeight = 400;
    
    iStateWidth = sWidth;
    iStateHeight = sHeight;
    
    iStateLeft = (JSDN.ClientArea.Width() - iStateWidth - 20) / 2;
    iStateTop = (JSDN.ClientArea.Height() - iStateHeight - 20) / 2;
    
    oPaneLayer.style.left = iStateLeft + "px";
    oPaneLayer.style.top = iStateTop + "px";
    oPaneLayer.style.width = iStateWidth + "px";
    oPaneLayer.style.height = iStateHeight + "px";
    
    oPaneLayer.style.backgroundColor = "#ffffff";
    oPaneLayer.style.border = "1px solid #cccccc";
	oPaneLayer.style.display="block";
	var text="<p align=\"center\"><font size=\"4\" color=\"#FF0000\">还未登录，请先登录后！</font></p><p></p><p></p>";
	text=text+"<table cellspacing=\"0\"><tr><td>用户名：</td><td><input type=\"text\" class=\"text\" id=\"UserName2\" /></td>";
    text=text+"</tr><tr><td>密&nbsp;&nbsp;&nbsp;码：</td><td><input type=\"password\" class=\"pass\" id=\"UserPSW2\" /></td>";
     text=text+"</tr><tr><td colspan=\"2\" align=\"center\"><img onclick=\"PostLogin2();\"  src=\"images/z_4.gif\" width=\"39\" height=\"19\" border=\"0\" /> </td></tr></table>";
	// alert(text);
	oPaneLayer.innerHTML = "<div style=\"text-align:center;width:100%;height:100%;vertical-align:middle;font-size:26px;font-weight:bold;font-family:Arial;\">"+text+"</div>"
	
	JSDN.$Attach(oPaneLayer);
	
	
}

//add by 罗标新 2008-9-6
function Pagechange(name,classid,fid)
{
  var selec=document.getElementById("select");
  var url=name + "?ClassID="+classid+"&curPage="+eval(selec.selectedIndex+1)+"&FID="+fid;
  window.location=url;
}

   

    

    

