﻿var WebSiteRootPath="";

function ChangeMenu(prefix,showindex)
{
   var normalclassName="tabItem",selclassName="tabItemover";
   var menuId=prefix+"nav",contentId=prefix+"content";
   var controlMenuId=menuId+showindex; 
   var menuItems=document.getElementById(menuId).getElementsByTagName("li");
   
   currentDesignSide=showindex;
   
   for(var i=0;i<menuItems.length;i++)
   {
	  if(menuItems[i].className.indexOf(normalclassName)>=0)
	   {
		   if(menuItems[i].id==controlMenuId)
		   {
			   menuItems[i].className=selclassName;
			   document.getElementById(menuItems[i].id+"content").style.display='block';
		   }
		   else
		   {
			   menuItems[i].className=normalclassName;
			   document.getElementById(menuItems[i].id+"content").style.display='none';
		   }
	   }
   }
}


function ChkEmailValid(value)
{
  if(value=="")
    return false;
  
  var Reg=/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/ig;
  
  return Reg.test(value);
}

function SearchProduct()
{
  location.href=WebSiteRootPath+"SearchProduct.aspx?page=1&fname="+document.getElementById("bottomSearchInput").value
}


function OverNMenu(obj)
{
   obj.className="lihover";
}

function OutNMenu(obj)
{
   obj.className="lin";
}

function t2s()
{
 Word_Type=1;
 StranBody();
}

function s2t()
{
 Word_Type=0;
 StranBody();
}

function DrawImage(ImgD,param){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= 1){ 
   if(image.width>param){
    ImgD.width=param; 
    ImgD.height=(image.height*param)/image.width; 
   }
   else
   { 
    ImgD.height=param; 
    ImgD.width=(image.width*param)/image.height; 
   } 
  } 
  else{ 
   if(image.height>param){
    ImgD.height=param; 
    ImgD.width=(image.width*param)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
 }
}


document.onselectstart=DocSelectContent;

function DocSelectContent(){
return false;
}


function UserindexHelpMenu(menuIndex)
{
	var MenuContainer="userIndexHelpSubject"
	
	var contentContainer="indexc"
	
	var MenuImgPrefix="indext";
	
	var subMenus=document.getElementById(MenuContainer).getElementsByTagName("div");

 //   if(subMenus.length<menuIndex+1)
//	 menuIndex=0;

	for(var i=0;i<subMenus.length;i++)
	{
		if(subMenus[i].id==MenuImgPrefix+menuIndex)
		 {
			 subMenus[i].className="topRowhover";
			 document.getElementById(contentContainer+menuIndex).style.display='block';
		 }
		else
		 {
		 	 subMenus[i].className="topRow";
			 document.getElementById(contentContainer+(i+1)).style.display='none';
		 }
	}
}

