﻿function over(obj)
{
	obj.style.color = '';
	obj.style.backgroundColor = '';
}
function out(obj)
{
	obj.style.color = '';
	obj.style.backgroundColor = '';
}
function collapse(objid)
{
	var obj = document.getElementById(objid);
	collapseAll();
	obj.style.display = ''; 
}
function collapseAll()
{
	for (var i=1; i<=12; i++)
	{
		var obj = document.getElementById('g_' + i.toString());
		if (obj) obj.style.display = 'none';
	}
}
function expandAll()
{
	for (var i=1; i<=10; i++)
	{
		var obj = document.getElementById('g_' + i.toString());
		if (obj) obj.style.display = '';
	}
}
function check1()
{
if(document.getElementById("ctl00_Main_txtname").value=="")
 {
 alert('请输入您的姓名');
 document.getElementById("ctl00_Main_txtname").focus();
 document.getElementById("ctl00_Main_txtname").select();
return false;
 }
if(document.getElementById("ctl00_Main_txttel").value=="")
 {
 alert('请输入您的联系电话');
 document.getElementById("ctl00_Main_txttel").focus();
 document.getElementById("ctl00_Main_txttel").select();
return false;
 }
 if(document.getElementById("ctl00_Main_txtemail").value=="")
 {
 alert('请输入您的Email');
 document.getElementById("ctl00_Main_txtemail").focus();
 document.getElementById("ctl00_Main_txtemail").select();
return false;
 }

  if(document.getElementById("ctl00_Main_txttitle").value=="")
 {

  document.getElementById("ctl00_Main_txttitle").select();
 document.getElementById("ctl00_Main_txttitle").focus();
  alert('请输入主题');

return false;

 }
 if(document.getElementById("ctl00_Main_txtcontent").value=="" ||  document.getElementById("ctl00_Main_txtcontent").value.length<6 )
 {

 document.getElementById("ctl00_Main_txtcontent").focus();

  alert('请输入留言内容，并且字符长度不能少于6个字');
return false;

 }

}
function checkemail()
{
var email = document.getElementById("ctl00_Main_txtemail").value;//得到输入的邮箱
	var reg = /^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]*[0-9a-zA-Z])*\.)+[a-zA-Z]{2,9})$/;//定义验证邮件的正则表达式
	if(!email.match(reg))//验证失败，显示错误信息，返回
	{ alert('请输入正确的Email地址');
 document.getElementById("ctl00_Main_txtemail").focus();

		return false;
	}

}
function check()
{
check1();

}
function nTab1s(thisObj,Num){
if(thisObj.className == "active")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=0; i <tabList.length; i++)
{
if (i == Num)
{
thisObj.className = "active";
document.getElementById(tabObj+"_Content"+i).style.display = "block";
}else{
tabList[i].className = "normal";
document.getElementById(tabObj+"_Content"+i).style.display = "none";
}
}
}
function nTabs(thisObj,Num){
if(thisObj.className == "active")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=0; i <tabList.length; i++)
{
if (i == Num)
{
thisObj.className = "active";
document.getElementById(tabObj+"_Content"+i).style.display = "block";
}else{
tabList[i].className = "normal";
document.getElementById(tabObj+"_Content"+i).style.display = "none";
}
}
}
function selCat(name,obj,n)
{
for(i=1;i<=n;i++)
{
eval("document.getElementById('"+name+i+"').className=''");
//隐藏变换选项卡内容
if(name == 'n' || name == 's'){}
else{
eval("document.getElementById('display_"+name+'_'+i+"').style.display='none'");
}
}
//排行模块
if(name == 'mt' || name == 'dt'){
eval("document.getElementById('"+name+obj+"').className='topButtonOver'");
}
//所有中间选项卡模块
else{
eval("document.getElementById('"+name+obj+"').className='columnBarOver'");
}
//显示变换选项卡内容
if(name == 'n' || name == 's'){}
else{
eval("document.getElementById('display_"+name+'_'+obj+"').style.display=''");
}
}
function DLLRegistered(strID)
{
var o = null;
try {
o = new ActiveXObject(strID);
}catch(e){
return false;
}
if(o != null){
o = null;
return true;
}else
return false;
}

var flag=false;
function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 230/170){
if(image.width>230){ 
ImgD.width=230;
ImgD.height=(image.height*230)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
else{
if(image.height>170){ 
ImgD.height=170;
ImgD.width=(image.width*170)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
}
} 
function DrawImage1(ImgD){//首页
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 180/140){
if(image.width>180){ 
ImgD.width=180;
ImgD.height=(image.height*180)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
else{
if(image.height>140){ 
ImgD.height=140;
ImgD.width=(image.width*140)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
}
} 
function DrawImage2(ImgD){//产品页
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 110/100){
if(image.width>110){ 
ImgD.width=110;
ImgD.height=(image.height*110)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
else{
if(image.height>100){ 
ImgD.height=100;
ImgD.width=(image.width*100)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
}
} 
function DrawImage3(ImgD){//具体产品页
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 300/270){
if(image.width>300){ 
ImgD.width=300;
ImgD.height=(image.height*300)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
else{
if(image.height>270){ 
ImgD.height=270;
ImgD.width=(image.width*270)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
}
} 

function DrawImages(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 135/110){
if(image.width>135){ 
ImgD.width=135;
ImgD.height=(image.height*135)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
else{
if(image.height>110){ 
ImgD.height=110;
ImgD.width=(image.width*110)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
}
} 



function DrawImagec(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 334/256){
if(image.width>334){ 
ImgD.width=334;
ImgD.height=(image.height*334)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
else{
if(image.height>256){ 
ImgD.height=256;
ImgD.width=(image.width*256)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
}
} 
