//显示和隐藏表格 - 模块
function Show_Temp(bgName,tbName,txName)
{
//alert(tbName);
	for(i=1; i<4; i++)
	{
		bg="sm_button_bg"+i+"";
		tb="comment"+i+"";
		tx="comment_text"+i+"";
		
		if(tb==tbName)
		{
			document.all(tb).style.display = "";
			document.all(tx).style.color = "yellow";
			document.all(bg).style.backgroundImage = "url(images/sm_button_bg_on.gif)" 
		}
		else
		{
	        document.all(tb).style.display="none";
		    document.all(tx).style.color="white";
			document.all(bg).style.backgroundImage = "url(images/sm_button_bg.gif)" 
		}
	
    }
	
}



//显示和隐藏表格 - 默认设置
function Show2_Temp(bgName,tbName,txName)
{
//alert(tbName);
	for(i > 3; i<5; i++)
	{
		bg="sm_button_bg"+i+"";
		tb="comment"+i+"";
		tx="comment_text"+i+"";
		
		if(tb==tbName)
		{
			document.all(tb).style.display = "";
			document.all(tx).style.color = "yellow";
			document.all(bg).style.backgroundImage = "url(images/sm_button_bg_on.gif)" 
		}
		else
		{
	        document.all(tb).style.display="none";
		    document.all(tx).style.color="white";
			document.all(bg).style.backgroundImage = "url(images/sm_button_bg.gif)" 
		}
	
    }
	
}




function PlanPost(){
theForm.content.value = HtmlEdit.document.body.innerHTML;
		//return true;
}

function Search_Send()
{
  if (document.Search.Search_Key.value == "")
 {
   alert("提示：请在搜索框中输入关键字！");
   document.Search.Search_Key.focus();}
else
{
Search.submit();
	}
}

function do_select(sName)
{
    var sRt = document.getElementById(sName).value;
    var sRts = document.getElementById("sParam");

    if(document.getElementById(sName).checked == true)
    {
        sRts.value += sRt+','; 
    }
    else
    {
        sRts.value = sRts.value.replace(sRt+",","");
    }
}


//检查登陆框的输入内容是否填写===================================================
function Check_Login(){
	  if (document.login.Username.value == "")
	{
	   alert("请输入“用户名”后再进行登陆！");
	   document.login.Username.focus();
	   return false;
	}
  
	  if (document.login.Password.value == "")
	{
	   alert("请输入“密码”后再进行登陆！");
	   document.login.Password.focus();
	   return false;
	}
	
	
	  if (document.login.validatecode.value == "")
	{
	   alert("请输入“验证码”后再进行登陆！");
	   document.login.validatecode.focus();
	   return false;
	}
 //login.submit(); 
}


<!-- 
function sethome(obj){
	linkName.click();
}

function htmlSetHome(obj)
{
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage('http://www.bizthor.com/');	
}

function addthis(){
window.external.AddFavorite('http://www.bizthor.com/', '碧堂网络') 
}





//检查注册----------->>>
function SearchCheck()
{

  if (document.myform.Search_Item.value == "product_number" && document.myform.Search_Key.value == "" )
  {
    alert("请输入要搜索的产品型号！");
    return false;
  }

 // if (document.myform.Search_Key.value == "")
// {
//   alert("请输入关键字！");
//   document.myform.Search_Key.focus();

 //  return false;
//  }

}






function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
    ok=(plugins && plugins[plgIn]);
  } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
  if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}




//添加至收藏夹=============>>>>>>
function addBookmark(title,url) {
	if (window.sidebar) { 
	window.sidebar.addPanel(title, url,""); 
	} else if( document.all ) {
	window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
	return true;
	}
}

//检查种文件----------------
function check_torrent()
{

file=myform.file1.value;
Arr=file.split(".");

  var file=myform.file1.value;
    if  (file.length > 5)
    { picOK=false; i = file.length-1; ch = file.charAt(i);

      if ( ch == "r" || ch == "R" )
      { i = i-1; ch = file.charAt(i);
      if ( ch == "a" || ch == "A" )
      { i = i-1; ch = file.charAt(i);
      if ( ch == "r" || ch == "R" )
      { i = i-1; ch = file.charAt(i);

      if ( ch == ".")
      { picOK=true; }

    }  }  } 


    else
    {
    if ( ch == "p" || ch == "P" )
    { i = i-1; ch = file.charAt(i);
    if ( ch == "i" || ch == "I" )
    { i = i-1; ch = file.charAt(i);
    if ( ch == "z" || ch == "Z" )
    { i = i-1; ch = file.charAt(i);
    if ( ch == ".")
    { picOK=true; }

  } } }



	}

  }
  if (picOK==false)
  {
	  alert("提示：文件格式必须为[ RAR或ZIP ]，请重新选择！"); 
      return false;
  } 


}




//图片下传预览(1)========>>
function SelectPhoto(Flag,theForm)
{
if(Flag==1)
{
document.id1.src=theForm.file1.value;
}
if(Flag==2)
{
document.id1.src=theForm.file2.value;
}
if(Flag==3)
{
document.id1.src=theForm.file3.value;
}
if(Flag==4)
{
document.id1.src=theForm.file4.value;
}
if(Flag==5)
{
document.id1.src=theForm.file5.value;
}



}

//图片下传预览(2个以上)========>>
function SelectPhoto2(Flag,theForm)
{
if(Flag==1)
{
document.id1.src=theForm.file1.value;
}
if(Flag==2)
{
document.id2.src=theForm.file2.value;
}
if(Flag==3)
{
document.id3.src=theForm.file3.value;
}
if(Flag==4)
{
document.id4.src=theForm.file4.value;
}
if(Flag==5)
{
document.id5.src=theForm.file5.value;
}
if(Flag==6)
{
document.id6.src=theForm.file6.value;
}

}


//上传文件小窗口 ----------------------------------------------------->>
function UploadPic(InputName,id,MyClassName,FileNumber)
{
var up=window.open('upload.asp?FileNumber='+FileNumber+'&id='+id+'&MyClassName='+MyClassName+'&code='+document.all(InputName).value+'&InputName='+InputName, 'up', 'resizable=no,width=400,height=250');
up.focus();
}


//上传文件小窗口[个人头像] ----------------------------------------------------->>
function UploadSelfFace(InputName,id,MyClassName,FileNumber)
{
var up=window.open('upload_myinfo.asp?FileNumber='+FileNumber+'&id='+id+'&MyClassName='+MyClassName+'&code='+document.all(InputName).value+'&InputName='+InputName, 'up', 'resizable=no,width=400,height=250');
up.focus();
}


//打开小窗口------------------------------------------------------>>
function openWIN(URL, w, h)
{
	var news=window.open(URL, 'OpenName', 'width='+w+', height='+h+', resizable="no",scrollbars=yes');
	news.focus();
}
//End----------------------------------------------------------->>

//打开小窗口2------------------------------------------------------>>
function openWIN2(URL, w, h)
{
	var news=window.open(URL, 'OpenName', 'width='+w+', height='+h+', resizable=yes,scrollbars=yes');
	news.focus();
}
//End----------------------------------------------------------->>




//检查上传文件格式是否GIF或JPG，一齐检查5个上传文件------------------------------------------------------>>

function checkfile(theForm)
{
//------检查作者头像图文件格式是否JPG或者GIF------------------

file=myform.file1.value;
Arr=file.split(".");

  var file=theForm.file1.value;
    if  (file.length > 5)
    { picOK=false; i = file.length-1; ch = file.charAt(i);
      if ( ch == "g" || ch == "G" )
      { i = i-1; ch = file.charAt(i);
      if ( ch == "p" || ch == "P" )
      { i = i-1; ch = file.charAt(i);
      if ( ch == "j" || ch == "J" )
      { i = i-1; ch = file.charAt(i);
      if ( ch == ".")
      { picOK=true; }

    }  }  }
    else
    {
    if ( ch == "f" || ch == "F" )
    { i = i-1; ch = file.charAt(i);
    if ( ch == "i" || ch == "I" )
    { i = i-1; ch = file.charAt(i);
    if ( ch == "g" || ch == "G" )
    { i = i-1; ch = file.charAt(i);
    if ( ch == ".")
    { picOK=true; }

  } } }

  }
  if (picOK==false)
  { alert("对不起，文件格式必须为[ Jpg ]或[ Gif ]，请重新选择！"); return(false); } 
  
}

}




//检查上传文件格式是否GIF或JPG，一齐检查5个上传文件------------------------------------------------------>>

var img=null; 
function checkPic(theForm){ 

	//检查第1个文件
	var location=theForm.pic.value; 
	if(location==""){ 
	alert("提示：请选择产品预览图"); 
	return false; 
	} 
	var point = location.lastIndexOf("."); 
	var type = location.substr(point); 
	if(type==".jpg"||type==".gif"||type==".JPG"||type==".GIF"||type==".PNG"||type==".png"){ 
	img=document.createElement("img"); 
	img.src=location; 
	if(img.fileSize>204800){ 
	alert("提示：产品预览图请不要大于200KB"); 
	return false; 
	}else 
	return true; 
	} 
	else{ 
	alert("提示：产品预览图格式只能为 jpg或者gif格式"); 
	return false; 
	} 
	return true; 

} 


var img=null; 
function checkPic2(theForm){ 

	//检查第1个文件
	var location=theForm.pic2.value; 
	if(location==""){ 
	alert("提示：请选择产品展示图"); 
	return false; 
	} 
	var point = location.lastIndexOf("."); 
	var type = location.substr(point); 
	if(type==".jpg"||type==".gif"||type==".JPG"||type==".GIF"||type==".PNG"||type==".png"||type==".SWF"||type==".swf"){ 
	img=document.createElement("img"); 
	img.src=location; 
	if(img.fileSize>512000){ 
	alert("提示：产品展示图请不要大于500KB"); 
	return false; 
	}else 
	return true; 
	} 
	else{ 
	alert("提示：产品展示图格式只能为 jpg / gif / swf 格式"); 
	return false; 
	} 
	return true; 
	
} 












//提示确认框----------->>>
function AreYouOK(ms)
 {
  return confirm(ms)
 }



//图片变淡效果
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta)
{
	if (!document.all)
		return
  if (object != "[object]")
	{  
		setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
		return;
	}
	clearTimeout(nereidFadeTimers[object.sourceIndex]);
	diff = destOp-object.filters.alpha.opacity;
	direction = 1;
	if (object.filters.alpha.opacity > destOp)
	{
		direction = -1;
	}
	delta=Math.min(direction*diff,delta);
	object.filters.alpha.opacity+=direction*delta;
	if (object.filters.alpha.opacity != destOp)
	{
		nereidFadeObjects[object.sourceIndex]=object;
		nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
  }
}

//Mouse控制上下移动
function movstar(a,time){
	movx=setInterval("mov("+a+")",10)
	}
function movover(){
	clearInterval(movx)
	}
function mov(a){
	scrollx=new_date.document.body.scrollleft
	scrolly=new_date.document.body.scrollTop
	scrolly=scrolly+a
	new_date.window.scroll(scrollx,scrolly)
	}
function o_down(theobject){
object=theobject
	while(object.filters.alpha.opacity>60){
		object.filters.alpha.opacity+=-10}
		}
function o_up(theobject){
object=theobject
	while(object.filters.alpha.opacity<100){
		object.filters.alpha.opacity+=10}
		}
function wback(){
	if(new_date.history.length==0){window.history.back()}
	else{new_date.history.back()}
	}

//检查输入的是否数字
function CheckNum()
{
  var k = window.event.keyCode;
  if (k < 48 || k > 57){
     alert("提示：只能输入数字！");
     window.event.keyCode = 0 ;}
}
