﻿//fclr, fhclr, bg, bgh
//"#ffffff\",\"#ffffff\",\"#2F3540\",\"#999999\"


function AutoKeyHeight()
{
	return "22";
}

function AutoKeyWidth()
{
	return "92";
}

function MenuChild(menuobj)
{
	menuobj.hideOnMouseOut=true;
	menuobj.bgColor="#ABABAB";//'#555555';
	menuobj.menuBorder=0;
	menuobj.menuLiteBgColor='#FFFFFF';
	menuobj.menuBorderBgColor='#777777';
	menuobj.ChildBorderBgColor='#777777';
	
}

function Menu(label,pad, space, to, sx, sy, srel, opq, vert, idt, aw, ah,acw)  
{
	this.version = "020320 [Menu; mm_menu.js]";
	this.type = "Menu";
	this.menuWidth =155;// mw;
	this.menuChildWidth =acw;// mw;
	this.menuItemHeight =22 ;//mh;
	this.fontSize =12;// fs;
	this.fontWeight = "plain";
	this.fontFamily ="宋体";// fnt; 
	this.fontColor ="#313131";// fclr;
	this.fontColorHilite ="#313131";// fhclr;
	this.menuItemBgColor ="#D4CADC";// bg;
	this.menuHiliteBgColor ="#BAA4CC";// bgh;
	this.bgColor = "#F5E7FE"; //#555555;
	this.menuBorder = 1;
	this.menuBgOpaque=opq;
	this.menuItemBorder = 1;
	this.menuItemIndent = idt;
			
	this.menuItemVAlign = "middle";// valgn;
	this.menuItemHAlign = "left";//halgn;
	this.menuItemPadding = pad;
	this.menuItemSpacing = space;
	this.menuLiteBgColor = "#ffffff";
	this.menuBorderBgColor = "#777777";
		
	this.menuContainerBgColor = "#cccccc";
	this.childMenuIcon = "arrows.gif";
	this.submenuXOffset = sx;
	this.submenuYOffset = sy;
	this.submenuRelativeToItem = srel;
	this.vertical = vert;
	this.items = new Array();
	this.actions = new Array();
	this.childMenus = new Array();
	this.hideOnMouseOut = true;
	this.hideTimeout = to;
	this.addMenuItem = addMenuItem;
	this.writeMenus = writeMenus;
	this.MM_showMenu = MM_showMenu;
	this.onMenuItemOver = onMenuItemOver;
	this.onMenuItemAction = onMenuItemAction;
	this.hideMenu = hideMenu;
	this.hideChildMenu = hideChildMenu;
	if (!window.menus) window.menus = new Array();
	this.label = " " + label;
	window.menus[this.label] = this;
	window.menus[window.menus.length] = this;
	if (!window.activeMenus) window.activeMenus = new Array();
}

function RunJavascript()
{
	
	ShowToTop();
} 

function IE6()
{
	var ua = navigator.userAgent.toLowerCase();
  var ie = 0;
  
  if(is_ie)
  {
     ie = ua.match(/msie ([\d.]+)/)[1];
  } 
  
  if(ie==6)
  {
  	return true;
  }
  else 
  {
  	return false;
  }

}


function ChangeBG2(ddobj)
{
	var s_name=ddobj.getAttribute("bgfile");
	//ddobj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/template/images/nav"+s_name+".png')";
	if(IE6())
	{
		
		ddobj.style.backgroundImage ="url(/template/images/nav"+s_name+".gif)";
	}
	else
	{
		ddobj.style.backgroundImage ="url(/template/images/nav"+s_name+".png)";
	}		
	
}


function ChangeBG1(ddobj)
{
	var s_name=ddobj.getAttribute("bgfile");
	//ddobj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/template/images/nav"+s_name+"on.png')";
	//ddobj.style.backgroundImage ="url(/template/images/nav"+s_name+"on.gif)";
	
	if(IE6())
	{
		ddobj.style.backgroundImage ="url(/template/images/nav"+s_name+"on.gif)";
	}
	else
	{
		ddobj.style.backgroundImage ="url(/template/images/nav"+s_name+"on.png)";
	}		
	
	//status=Math.random();
}

function OpenUrl(s_url)
{
	location.href=s_url;
}


function ShowToTop()
{//显示是否返回页首的链接
	var sh = document.body.scrollHeight || document.documentElement.scrollHeight;
	
	if(sh>1000)
	{
		$('divtotop').style.display="";
	}
	else
	{
		$('divtotop').style.display="none";
	}
} 

function SelectInfoDiv(i_sel)
{
	for(i=1;i<4;i++)
	{
		$('divicon'+i).className="nodsp";
		$('lit'+i).className="";
		
	}
	$('divicon'+i_sel).className="";
	$('lit'+i_sel).className="current";
}



function ShowClassBar(i_id)
{
	var evt = window.event || arguments.callee.caller.arguments[0]; // 获取event对象
  var srcElement = evt.srcElement || evt.target;  // 获取触发事件的源对象
  
		if($('ul'+i_id).className=="")
		{
			$('ul'+i_id).className="nodsp";
			srcElement.src=srcElement.src.replace("minus","plus");
		}
		else
		{
			$('ul'+i_id).className="";
			srcElement.src=srcElement.src.replace("plus","minus")	;
		}
}

function OpenService(i_sel)
{
	var s_source="";
	if(i_sel==1)
	{
		s_source=location.href;
		window.open('/user/chat/default.aspx?sel=1&rnd='+Math.random()+'&source='+s_source,'_blank','scrollbars=no,width=510,height=480,left='+(screen.width-510)/2+',top='+(screen.height-480)/2+',status=no,resizable=yes')
	}
	else
	{
		popup_open("/user/chat/default.aspx?rnd="+Math.random()+"&source="+s_source,"在线客服咨询中心",510,465);	
	}
	
	
}

function setNavBar(s_id)
{
	if($("ahr"+s_id)!=null)
		$("ahr"+s_id).className ="on";
		
}

function CheckEmail(s_in)
{
		
		if($('email').value.toLowerCase().search(s_in)>-1)
		{
			$('email').value="";
		}
}



	
var i_timeout=0;
	function ShowMenu(i_sel)
	{	
		
		
		ClearMenuTimeout();	
		HiddenMenuEnd();
		
		$('div'+i_sel).style.visibility="visible";
		
	}
	
	function HiddenMenu()
	{
		ClearMenuTimeout();
		i_timeout=setTimeout("HiddenMenuEnd()",1000);
	}
	function ClearMenuTimeout()
	{
		clearTimeout(i_timeout);
	}
	
	function HiddenMenuEnd()
	{
		for(var i=1;i<=8;i++)
		{
			if(i!=7){
				if($("div" + i)!=null){
					$("div"+i).style.visibility="hidden";
				}
				}
		}
		
	}


window.onload=function(){
		HiddenMenuEnd();
		
		ExecuteScript('/template/aspx/user/operate.aspx?sel=6&rnd='+Math.random());
		
}

function ReadUserEmail(s_email)
{
	
	
	if($('email')!=null)
	{
		if(s_email!="")
		{
			$('email').value=s_email;
		}	
	}
	else if($P('email')!=null)
	{
		if(s_email!="")
		{
			$P('email').value=s_email;
		}	
	}
		
}

function RssEmail()
{
	if(EmailCheckData())
	{
		$('frmemail').submit();
	}
	else
	{
		alert("请输入正确的电子邮件地址！");
	}	
}

function EmailCheckData()
{
	if(validEmail($('email').value)=="1")
	{
		return true;
	}
	else
	{
		return false;
	}
}



function ShowLeftBar(i_id,i_pid)
{
	if($('dl'+i_id)!=null)
		$('dl'+i_id).style.display="";
		
	if($('dl'+i_pid)!=null)
		$('dl'+i_pid).style.display="";
		
}


function AutoRightAd()
{
	window.setInterval("ChangeRightAd()",4000);
} 

var i_rightad=2;
var b_rightad=false;
function ChangeRightAd()
{
	if(b_rightad)
		return ;
	
	onrightmouse(i_rightad);
	i_rightad++;
	if(i_rightad>=4)
		i_rightad=1;
}
 
function onrightmouse(id)
      {
      	
        for(var i=1;i<4;i++)
        {
      
            $('right_img'+i).style.display="none";
            $('right_a'+i).className="";
        }
        $('right_img'+id).style.display="block";
         $('right_a'+id).className="no";
         
      }
    
       function onrightauto(id)
      {
        for(var i=1;i<4;i++)
        {
            if($('right_img'+i).style.display=="block")
            {
                if(id=="add"){
                    $('right_img'+i).style.display="none";
                    if(i==3){
                        $('right_img'+1).style.display="block";
                        return;
                    } 
                    $('right_img'+(i+1)).style.display="block";
                }else
                {
                      $('right_img'+i).style.display="none";
                    if(i==1){
                        $('right_img'+3).style.display="block";
                        return;
                    } 
                    $('right_img'+(i-1)).style.display="block";
                }
            }
          
        }
         
      }
      function c1()
	  {
	  this.parent.window.openwindow(2,'家盒子地图','/template/aspx/email/alertwindow.aspx?boxstate=2')
	  }
	  function c2()
	  {
	    this.parent.window.openwindow(1,'向我的好友推荐家盒子','/template/aspx/email/alertwindow.aspx?boxstate=4')
	  } 
