var showad = true;
var Toppx = 100;			//上端位置
var AdDivW = 97;		//宽度
var AdDivH = 223;		//高度
var MinScreenW=700;
var PageWidth=765;
var ClosebuttonHtml = '<div align="right" style="position: absolute;top:0px;right:0px;margin:2px;padding:2px;z-index:2000;"><a href="javascript:;" onclick="hidead()" style="color:red;text-decoration:none;font-size:12px;">关闭</a></div>'
var AdContentHtml = '<div align="center" style="color:green;font-size:23pt;font-family:黑体;"><a href="http://www.ndkj.com/" target="_blank"><img src="002.gif" border="0" alt="长沙南大科技开发有限公司" width="100%"></a></div>';
document.write ('<div id="Javascript.LeftDiv" style="position: absolute;border: 1px solid #ffffff;background-color:#ffffff;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:-1000px;word-break:break-all;display:none;">'+ClosebuttonHtml+'<div>'+AdContentHtml+'</div></div>');
document.write ('<div id="Javascript.RightDiv" style="position: absolute;border: 1px solid #ffffff;background-color:#ffffff;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:-1000px;word-break:break-all;display:none;">'+ClosebuttonHtml+'<div>'+AdContentHtml+'</div></div>');
function scall(){
	if(!showad){return;}
	if (window.screen.width<MinScreenW){
		alert("临时提示：\n\n显示器分辨率宽度小于"+MinScreenW+",不显示广告");
		showad = false;
		document.getElementById("Javascript.LeftDiv").style.display="none";
		document.getElementById("Javascript.RightDiv").style.display="none";
		return;
	}
	var Borderpx = ((window.screen.width-PageWidth)/2-AdDivW)/2;

	document.getElementById("Javascript.LeftDiv").style.display="";
	document.getElementById("Javascript.LeftDiv").style.top=document.body.scrollTop+Toppx;
	document.getElementById("Javascript.LeftDiv").style.left=document.body.scrollLeft+Borderpx;
	document.getElementById("Javascript.RightDiv").style.display="";
	document.getElementById("Javascript.RightDiv").style.top=document.body.scrollTop+Toppx;
	document.getElementById("Javascript.RightDiv").style.left=document.body.scrollLeft+document.body.clientWidth-document.getElementById("Javascript.RightDiv").offsetWidth-Borderpx;
}

function hidead()
{
	showad = false;
	document.getElementById("Javascript.LeftDiv").style.display="none";
	document.getElementById("Javascript.RightDiv").style.display="none";
}
window.onscroll=scall;
window.onresize=scall;
window.onload=scall;

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//--商情订购-->
function FormCheck() 
{
if (document.Formn.emailn.value=="" ||  document.Formn.emailn.value=="您的接收邮箱")
{
    alert("请输入你常用的邮箱!");
	document.Formn.emailn.focus();
	document.Formn.emailn.select();
	return false;
}
var str1 = document.Formn.emailn.value
if(str1.indexOf("@") == -1 || str1.indexOf(".") == -1){ 
alert("E-mail格式不正确,请重新填写！"); 
document.Formn.emailn.focus();
document.Formn.emailn.select();
return false; 
} 
return true;
document.Formn.submit()
}

//--商情订购-->
function FormCheck() 
{
if (document.Formn.emailn.value=="" ||  document.Formn.emailn.value=="您的接收邮箱")
{
    alert("请输入你常用的邮箱!");
	document.Formn.emailn.focus();
	document.Formn.emailn.select();
	return false;
}
var str1 = document.Formn.emailn.value
if(str1.indexOf("@") == -1 || str1.indexOf(".") == -1){ 
alert("E-mail格式不正确,请重新填写！"); 
document.Formn.emailn.focus();
document.Formn.emailn.select();
return false; 
} 
return true;
document.Formn.submit()
}
var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false); 
var isNS4 = (document.layers ? true : false); 
var isNS = navigator.appName == "Netscape"; 

function getRef(id) { 
if (isDOM) return document.getElementById(id); 
if (isIE4) return document.all[id]; 
if (isNS4) return document.layers[id]; 
} 

function moveRightEdge() { 
var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck; 

if (isDOM) { 
yMenuFrom = parseInt (divMenu.style.top, 0); 
yMenuTo = (isNS ? window.pageYOffset : document.body.scrollTop+20); 

yMenuFrom1 = parseInt (divMenu1.style.top, 0); 
yMenuTo1 = (isNS ? window.pageYOffset : document.body.scrollTop+20); 
} 
timeoutNextCheck = 0; 

if (yMenuFrom != yMenuTo) { 
	yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 10); 
	if (yMenuTo < yMenuFrom) 
		yOffset = -yOffset; 
	if (isNS4) 
		divMenu.top += yOffset; 
	else if (isDOM) 
		divMenu.style.top = parseInt (divMenu.style.top, 0) + yOffset; 
		timeoutNextCheck = 10; 
} 

if (yMenuFrom1 != yMenuTo1) { 
	yOffset1 = Math.ceil(Math.abs(yMenuTo1 - yMenuFrom1) / 10); 
	if (yMenuTo1 < yMenuFrom1) 
		yOffset1 = -yOffset1; 
	if (isNS4) 
		divMenu1.top += yOffset1; 
	else if (isDOM) 
		divMenu1.style.top = parseInt (divMenu1.style.top, 0) + yOffset1; 
		timeoutNextCheck = 10; 
} 
setTimeout ('moveRightEdge()', timeoutNextCheck); 
} 
