
//下面的代码是－双击滚屏
var currentpos,timer; 

function initialize() 
{ 
timer=setInterval("scrollwindow()",2);
} 
function sc(){
clearInterval(timer);	
}
function scrollwindow() 
{ 
currentpos=document.body.scrollTop; 
window.scroll(0,++currentpos); 
if (currentpos != document.body.scrollTop) 
sc();
} 
document.onmousedown=sc
document.ondblclick=initialize

<!--确认执行代码-->

function GP_popupConfirmMsg(msg) { //v1.0
document.MM_returnValue = confirm(msg);
}

// 修改编辑栏高度
function admin_Size(num,objname)
{
	var obj=document.getElementById(objname)
	if (parseInt(obj.rows)+num>=3) {
		obj.rows = parseInt(obj.rows) + num;	
	}
	if (num>0)
	{
		obj.width="90%";
	}
}//end 

//查看图片
function lookimg(imgurl) {
if (imgurl==""){
//alert(imgurl);
alert("没有查看的内容");
}
if (imgurl!=""){
disp = window.open("","pop");
content = '<HTML>';
content += '<TITLE>查看图片</TITLE>';
content += '</HEAD>';
content += '<BODY style="margin:0px">'; 
content += '<table width="100%"  height="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="center"><img src="../' + imgurl + '""></td></tr></table>';
content += '</BODY></HTML>';
disp.document.write(content);
disp.document.close();
}
}//end

//产品左边菜单
function hideAll() {
for(i=0;i<odiv.length;i++) {
odiv[i].style.display="none";
jt[i].style.backgroundImage='url(images/leftMbgOut.jpg)';
jt[i].style.color='#666666';
}
} 
function showObj(num) {
	num = num-1
//alert("num="+num)
	if (odiv[num].style.display=="none") {
		hideAll();
		odiv[num].style.display="inline";
		jt[num].style.backgroundImage='url(images/leftMbg.jpg)';
		jt[num].style.color='#8C24AD';
	
	}else {
		odiv[num].style.display="none";
		//alert("ddd")
		jt[num].style.backgroundImage='url(images/leftMbgOut.jpg)';
		jt[num].style.color='#666666';
	}
}
//end

//左边收缩
function turnit(ss)
{
 if (ss.style.display=="") 
  ss.style.display="none";
 else
  ss.style.display=""; 
}
var newWindow = null
//end

/*/右边菜单
function hideAll() {
for(i=0;i<odiv.length;i++) {
odiv[i].style.display="none";
jt[i].style.backgroundImage='url(images/z1.jpg)';
}
} 

function showObj(num) {

if (odiv[num].style.display=="none") {
hideAll();
odiv[num].style.display="inline";
jt[num].style.backgroundImage='url(images/z2.jpg)';
}
else {
odiv[num].style.display="none";
jt[num].style.backgroundImage='url(images/z1.jpg)';
}
}
//alert(window.navigator.appName)
//var text1="hello,world!";
//alert("字符串的长度为："+text1.length);
/*/


//下拉菜单
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_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; }
}
//end

function openad(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//结束


<!--全选,反选-->

function CheckOthers(form)
{
    for (var i=0;i<form.elements.length;i++)
    {
        var e = form.elements[i];
            if (e.checked==false)
            {
                e.checked = true;
            }
            else
            {
                e.checked = false;
            }
    }
}
//上面是全选,可有可无
function CheckAll(form)
{
    for (var i=0;i<form.elements.length;i++)
    {
        var e = form.elements[i];
            e.checked = true;
    }
}

//--------------------------------------------------------------------全选,全不选

function all_check(the_fields, do_check)
{
var elts = document.forms['form3'].elements[the_fields];
var elts_cnt = (typeof(elts.length) != 'undefined')
? elts.length
: 0;
if (elts_cnt) {
for (var i = 0; i < elts_cnt; i++) {
elts[i].checked = do_check;
}
} else {
elts.checked = do_check;
}

return true;
}


//结束



//预先载入图片
<!--
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_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_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];}
}
//-->



//菜单展开
if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
if(el.style.display != "block"){ //DynamicDrive.com change
for (var i=0; i<ar.length; i++){
if (ar[i].className=="submenu") //DynamicDrive.com change
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}//菜单展开结束


function checkBig()
{
  if (document.form1.BigClassName.value=="")
  {
    alert("大类名称不能为空！");
    document.form1.BigClassName.focus();
    return false;
  }
}





//----------------------------
function checkBig()
{
  if (document.form1.BigClassName.value=="")
  {
    alert("大类名称不能为空！");
    document.form1.BigClassName.focus();
    return false;
  }
}
function checkSmall()
{
  if (document.form2.BigClassName.value=="")
  {
    alert("请先添加大类名称！");
	document.form1.BigClassName.focus();
	return false;
  }

  if (document.form2.SmallClassName.value=="")
  {
    alert("小类名称不能为空！");
	document.form2.SmallClassName.focus();
	return false;
  }
}
function ConfirmDelBig()
{
   if(confirm("确定要删除该品牌吗？所有该品牌的产品会全部删除,不可恢复！"))
     return true;
   else
     return false;
	 
}

function ConfirmDelSmall()
{
   if(confirm("确定要删除该二级栏目吗？删除此栏目同时将删除所包含的小栏目，及该栏目下所有文章将会一起删除,删除后不能恢复！"))
     return true;
   else
     return false;
}
function delthree()
{
   if(confirm("确定删除该栏目吗？如果删除,该栏目下所有文章将会一起删除,删除后不能恢复！"))
     return true;
   else
     return false;
	 
}
function deldate()
{
   if(confirm("确定删除吗？删除后不能恢复！"))
     return true;
   else
     return false;
	 
}
//end

//翻转图像
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];}
}
//

//提示信息效果---------------------------------------------------------------------------------------------------
//if (window.navigator.appName<>"Netscape"){
//document.write(window.navigator.appName);
	
if (window.navigator.appName!="Netscape"){//如果为Netscape浏览器刚不运行该脚本,因为Netscape不支持某些属性
	
//******************************默认设置定义******************************
tPopWait=10;		//停留tWait豪秒后显示提示
tPopShow=1000;		//显示tShow豪秒后关闭提示，1000为1秒
showPopStep=20;
popOpacity=90;		//提示框的透明度,百分比，数字越小越透明
fontcolor="#fff";
bgcolor="#F6CA00";
bordercolor="#F6CA00";

//******************************内部变量定义******************************
sPop=null;curShow=null;tFadeOut=null;tFadeIn=null;tFadeWaiting=null;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText {  background-color: " + bgcolor + ";color:" + fontcolor + "; border: 1px " + bordercolor + " solid;font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");

function showPopupText()
{
  var o=event.srcElement;MouseX=event.x;MouseY=event.y;
  if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
    if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
  if(o.dypop!=sPop)
  {
    sPop=o.dypop;clearTimeout(curShow);clearTimeout(tFadeOut);clearTimeout(tFadeIn);clearTimeout(tFadeWaiting);  
    if(sPop==null || sPop=="")
    {
      dypopLayer.innerHTML="";dypopLayer.style.filter="Alpha()";dypopLayer.filters.Alpha.opacity=0;  
    }
    else
    {
      if(o.dyclass!=null) popStyle=o.dyclass 
      else popStyle="cPopText";
        curShow=setTimeout("showIt()",tPopWait);
    }
  }
}

function showIt()
{
  dypopLayer.className=popStyle;dypopLayer.innerHTML=sPop;
  popWidth=dypopLayer.clientWidth;popHeight=dypopLayer.clientHeight;
  if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
  else popLeftAdjust=0;
  if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
  else popTopAdjust=0;
  dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
  dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
  dypopLayer.style.filter="Alpha(Opacity=0)";fadeOut();
}

function fadeOut()
{
  if(dypopLayer.filters.Alpha.opacity<popOpacity)
  { dypopLayer.filters.Alpha.opacity+=showPopStep;tFadeOut=setTimeout("fadeOut()",1); }
  else
  { dypopLayer.filters.Alpha.opacity=popOpacity;tFadeWaiting=setTimeout("fadeIn()",tPopShow); }
}

function fadeIn()
{
  if(dypopLayer.filters.Alpha.opacity>0)
  { dypopLayer.filters.Alpha.opacity-=1;tFadeIn=setTimeout("fadeIn()",1); }
}
document.onmouseover=showPopupText;

}
//结束-----------------------------------------------------------------------------------------------------------------
//滚动到顶部
var goto_top_type = -1;
var goto_top_itv = 0;
 
function goto_top_timer()
{
var y = goto_top_type == 1 ? document.documentElement.scrollTop : document.body.scrollTop;
var moveby = 15;
 
y -= Math.ceil(y * moveby / 100);
if (y < 0) {
y = 0;
}
 
if (goto_top_type == 1) {
document.documentElement.scrollTop = y;
}
else {
document.body.scrollTop = y;
}
 
if (y == 0) {
clearInterval(goto_top_itv);
goto_top_itv = 0;
}
}
 
function goto_top()
{
if (goto_top_itv == 0) {
if (document.documentElement && document.documentElement.scrollTop) {
goto_top_type = 1;
}
else if (document.body && document.body.scrollTop) {
goto_top_type = 2;
}
else {
goto_top_type = 0;
}
 
if (goto_top_type > 0) {
goto_top_itv = setInterval('goto_top_timer()', 20);
}
}
}
//]]>






function CheckForm(){

  if (editor.EditMode.checked==true)
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
  else
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML; 

  if (document.myform.Title.value=="")
  {
    alert("文章标题不能为空！");
	document.myform.Title.focus();
	return false;
  }

  if (document.myform.Content.value=="")
  {
    alert("文章内容不能为空！");
	editor.HtmlEdit.focus();
	return false;
  }
  return true;  
}
function loadForm()
{
  editor.HtmlEdit.document.body.innerHTML=document.myform.Content.value;
  return true
}

function MyImage(Img,strwidth,strheight)//图片等比缩放
{
var image=new Image();
image.src=Img.src;
width=strwidth;
height=strheight;
if(image.width>width||image.height>height)
{
   w=image.width/width;
   h=image.height/height;
   if(w>h){
   Img.width=width;
   Img.height=image.height/w;
   }
   else
   {
    Img.height=height;
    Img.width=image.width/h;
   } 
} 
}
/*
function showPic(sUrl){ //鼠标放上去显示大图，页面上要放个图层：bigpic
var x,y; 
x = document.body.scrollTop + event.clientY + 10 + "px";
y = document.body.scrollLeft + event.clientX + 10 + "px";
document.getElementById("bigpic").style.left = x; 
document.getElementById("bigpic").style.top = y; 
document.getElementById("bigpic").innerHTML = "<img src=\"" + sUrl + "\">"; 
document.getElementById("bigpic").style.display = "block"; 
} 
function hiddenPic(){ 
document.getElementById("bigpic").innerHTML = ""; 
document.getElementById("bigpic").style.display = "none"; 
} 
*/
function showPic(sUrl){ //鼠标放上去显示大图，页面上要放个图层：bigpic
	  var ei = document.getElementById("bigpic");
	  //event = event || window.event;
	  ei.style.display = "block";
	  ei.innerHTML = '<img src="' + sUrl + '" />';
	  ei.style.top  = document.body.scrollTop + event.clientY + 10 + "px";
	  ei.style.left = document.body.scrollLeft + event.clientX + 10 + "px";
	}
function hiddenPic(){ 
 	var ei = document.getElementById("bigpic");
	ei.innerHTML = "";
	ei.style.display = "none";
}

