//防止错误出现
//function killErrors(){return true;}window.onerror=killErrors;

//找回用户密码隐藏显示
function display(ID){if (document.getElementById(ID).style.display == "none") {document.getElementById(ID).style.display = "";}else{document.getElementById(ID).style.display = "none";}}

//播放器同步歌词JS功能开始============================================================================================
var lrcO;
var lrcobj;

function lrcClass(tt)
{
  this.inr = [];

  this.oTime = 0;

  this.dts = -1;
  this.dte = -1;
  this.dlt = -1;
  this.ddh;
  this.fjh;

  lrcbc.style.width = 0;

  if(/\[offset\:(\-?\d+)\]/i.test(tt))
    this.oTime = RegExp.$1/1000;
 
  tt = tt.replace(/\[\:\][^$\n]*(\n|$)/g,"$1");
  tt = tt.replace(/\[[^\[\]\:]*\]/g,"");
  tt = tt.replace(/\[[^\[\]]*[^\[\]\d]+[^\[\]]*\:[^\[\]]*\]/g,"");
  tt = tt.replace(/\[[^\[\]]*\:[^\[\]]*[^\[\]\d\.]+[^\[\]]*\]/g,"");
  tt = tt.replace(/<[^<>]*[^<>\d]+[^<>]*\:[^<>]*>/g,"");
  tt = tt.replace(/<[^<>]*\:[^<>]*[^<>\d\.]+[^<>]*>/g,"");

  while(/\[[^\[\]]+\:[^\[\]]+\]/.test(tt))
  {
    tt = tt.replace(/((\[[^\[\]]+\:[^\[\]]+\])+[^\[\r\n]*)[^\[]*/,"\n");
    var zzzt = RegExp.$1;
    /^(.+\])([^\]]*)$/.exec(zzzt);
    var ltxt = RegExp.$2;
    var eft = RegExp.$1.slice(1,-1).split("][");
    for(var ii=0; ii<eft.length; ii++)
    {
      var sf = eft[ii].split(":");
      var tse = parseInt(sf[0],10) * 60 + parseFloat(sf[1]);
      var sso = { t:[] , w:[] , n:ltxt }
      sso.t[0] = tse-this.oTime;
      this.inr[this.inr.length] = sso;
    }
  }
  this.inr = this.inr.sort( function(a,b){return a.t[0]-b.t[0];} );

  for(var ii=0; ii<this.inr.length; ii++)
  {
    while(/<[^<>]+\:[^<>]+>/.test(this.inr[ii].n))
    {
      this.inr[ii].n = this.inr[ii].n.replace(/<(\d+)\:([\d\.]+)>/,"%=%");
      var tse = parseInt(RegExp.$1,10) * 60 + parseFloat(RegExp.$2);
      this.inr[ii].t[this.inr[ii].t.length] = tse-this.oTime;
    }
    lrcbc.innerHTML = "<font>"+ this.inr[ii].n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/%=%/g,"</font><font>") +"</font>";
    var fall = lrcbc.getElementsByTagName("font");
    for(var wi=0; wi<fall.length; wi++)
      this.inr[ii].w[this.inr[ii].w.length] = fall[wi].offsetWidth;
    this.inr[ii].n = lrcbc.innerText;
  }

  this.run = function(tme)
  {
    if(tme<this.dts || tme>=this.dte)
    {
      var ii;
      for(ii=this.inr.length-1; ii>=0 && this.inr[ii].t[0]>tme; ii--){}
      if(ii<0) return;
      this.ddh = this.inr[ii].t;
      this.fjh = this.inr[ii].w;
      this.dts = this.inr[ii].t[0];
      this.dte = (ii<this.inr.length-1)?this.inr[ii+1].t[0]:Hxplayer.currentMedia.duration;

      lrcwt1.innerText = this.retxt(ii-7);
      lrcwt2.innerText = this.retxt(ii-6);
      lrcwt3.innerText = this.retxt(ii-5);
      lrcwt4.innerText = this.retxt(ii-4);
      lrcwt5.innerText = this.retxt(ii-3);
      lrcwt6.innerText = this.retxt(ii-2);
      lrcwt7.innerText = this.retxt(ii-1);
      lrcfilter.innerText = this.retxt(ii-1);
      lrcwt8.innerText = this.retxt(ii+1);
      lrcwt9.innerText = this.retxt(ii+2);
      lrcwt10.innerText = this.retxt(ii+3);
      lrcwt11.innerText = this.retxt(ii+4);
      lrcwt12.innerText = this.retxt(ii+5);
      lrcwt13.innerText = this.retxt(ii+6);
      this.print(this.retxt(ii));
      if(this.dlt==ii-1)
      {
	clearTimeout(lrcO);
	golrcoll(0);
	golrcolor(0);
      }
      this.dlt = ii;
    }
    var bbw = 0;
    var ki;
    for(ki=0; ki<this.ddh.length && this.ddh[ki]<=tme; ki++)
      bbw += this.fjh[ki];
    var kt = ki-1;
    var sc = ((ki<this.ddh.length)?this.ddh[ki]:this.dte) - this.ddh[kt];
    var tc = tme - this.ddh[kt];
    bbw -= this.fjh[kt] - tc / sc * this.fjh[kt];
    if(bbw>lrcbox.offsetWidth)
      bbw = lrcbox.offsetWidth;
    lrcbc.style.width = Math.round(bbw);
  }

  this.retxt = function(i)
  {return (i<0 || i>=this.inr.length)?"":this.inr[i].n;}

  this.print = function(txt)
  {
    lrcbox.innerText = txt;
    lrcbc.innerText = txt;
  }

  this.print("");
  lrcwt1.innerText = "";
  lrcwt2.innerText = "";
  lrcwt3.innerText = "";
  lrcwt4.innerText = "";
  lrcwt5.innerText = "";
  lrcwt6.innerText = "";
  lrcwt7.innerText = "";
  lrcfilter.innerText = "";
  lrcwt8.innerText = "";
  lrcwt9.innerText = "";
  lrcwt10.innerText = "";
  lrcwt11.innerText = "";
  lrcwt12.innerText = "";
  lrcwt13.innerText = "";
}

function bb()
{ffbb = ffbb - 0.5;}

function ff()
{ffbb = ffbb + 0.5;}


function golrcoll(s)
{ lrcoll.style.top = -2-(s++)*3;
  if(s<=6)
    lrcO = setTimeout("golrcoll("+s+")",100);}

function golrcolor(t)
{ lrcfilter.filters.alpha.opacity = 100-(t++)*10;
  if(t<=10)
    setTimeout("golrcolor("+t+")",60);}

function lrcrun(m)
{ lrcobj = new lrcClass(m);
  setInterval("try {lrcobj.run(Hxplayer.controls.currentPosition)} catch(hh){}",10);} 
//播放器同步歌词JS功能结束============================================================================================


//前台News_Show.html读取上传的图片缩小比例
<!--
var flag=false;
function NewShow(ImgD){
var image=new Image();
var iwidth = 500; 
var iheight = 400; 
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}
else{if(image.height>iheight){ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}}}
//-->


//前台Star.asp艺人专辑列表图片等比例缩小
<!--
var flag=false;
function StarWList(ImgD){
var image=new Image();
var iwidth = 100; 
var iheight = 70; 
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}
else{if(image.height>iheight){ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}}}
//-->


//前台Star.asp艺人专辑介绍图片等比例缩小
<!--
var flag=false;
function StarWShow(ImgD){
var image=new Image();
var iwidth = 150; 
var iheight = 105; 
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}
else{if(image.height>iheight){ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}}}
//-->



//前台Star.asp图片等比例缩小
<!--
var flag=false;
function StaList(ImgD){
var image=new Image();
var iwidth = 80; 
var iheight = 80; 
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}
else{if(image.height>iheight){ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}}}
//-->


//商务首页图片自动适用
<!--
var flag=false;
function CmShow(ImgD){
var image=new Image();
var iwidth = 145; 
var iheight = 145; 
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}
else{if(image.height>iheight){ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}}}
//-->



//主页Main商城部分列表图片等比例缩小
<!--
var flag=false;
function CulList(ImgD){
var image=new Image();
var iwidth = 90; 
var iheight = 80; 
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}
else{if(image.height>iheight){ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}}}
//-->


//Music.asp中间滑轮选项卡图片等比例缩小
<!--
var flag=false;
function MusList(ImgD){
var image=new Image();
var iwidth = 85; 
var iheight = 85; 
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}
else{if(image.height>iheight){ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}}}
//-->


//主页AD2品牌广告等比例缩小
<!--
var flag=false;
function MainAdTwo(ImgD){
var image=new Image();
var iwidth = 150; 
var iheight = 50; 
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}
else{if(image.height>iheight){ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}}}
//-->


//前台Links友情链接部分图片等比例缩小
<!--
var flag=false;
function LinksList(ImgD){
var image=new Image();
var iwidth = 88; 
var iheight = 33; 
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}
else{if(image.height>iheight){ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;}
else{ImgD.width=image.width;
ImgD.height=image.height;}}}}
//-->


//后台左边友情链接部分图片等比例缩小
<!--
var flag=false;
function AdminLinkList(ImgD){
var image=new Image();
var iwidth = 88; 
var iheight = 33; 
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;}
else{ImgD.width=image.width;
ImgD.height=image.height;}
ImgD.alt=image.width+" × "+image.height;
}
else{if(image.height>iheight){ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;}
else{ImgD.width=image.width;
ImgD.height=image.height;}
ImgD.alt=image.width+" × "+image.height;
}}}
//-->



//前后台文本框显示输入和剩余字符多少
function textCounter(field, countfield, maxlimit)
{ 
if   (field.value.length   >   maxlimit)   
field.value   =   field.value.substring(0,maxlimit); 
else   
countfield.value   =   maxlimit   -   field.value.length; 
} 


	
//批量删除---检测
function CheckAll(form)
   {for (var i=0;i<form.elements.length;i++)
    {var e = form.elements[i];
    if (e.Name != "chkAll")
       e.checked = form.chkAll.checked;}}
function ConfirmDel()
   {if(confirm("确定要删除选中的信息吗？一旦删除将不能恢复！"))
     return true;
   else
     return false;}
function ConfirmUsed()
  {if(confirm("确定要启用该语言吗?启用后整站语言将为该语言版本!"))
     return true;
   else
     return false;}	 
function DelPicClass()
{
if(confirm("确定要删除该相册吗？删除相册的同时,将会删除该相册内的照片,并且不能恢复！"))
   return true;
else
   return false;	 
}



//鼠标经内容过切选项卡代码=============================================================================================
<!--
function SetTab(name,cursel,n)
{
 for(i=1;i<=n;i++)
 {
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"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";
}
} 
}



//主页头文件调用FLASH覆盖层============================================================================================
function Flash(Path,Width,Height)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="FlashH" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="'+Width+'" height="'+Height+'">');
	document.write('<param name="movie" value="'+Path+'"/>');
	document.write('<param name="quality" value="High"/>');
	document.write('<param name="scale" value="ExactFit"/>');
	document.write('<param name="wmode" value="transparent"/>');
	document.write('<embed wmode="transparent" src="'+Path+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="FlashH" width="'+Width+'" height="'+Height+'" scale="ExactFit"/>');
	document.write('</object>');
}

	
	
//后台留言回复分页代码============================================================================================
function showPageLink(sUrl,iPage,iCount){
	var i;
	i=Math.max(1,iPage-1);
	document.write("<a href=\"" + sUrl + "1\" title='第 1 页'><FONT face=Webdings>9</FONT></a> ");
	document.write("<a href=\"" + sUrl + i + "\" title='上一页(第 " + i + " 页)'><FONT face=Webdings>7</FONT></a> ");
	for(i=Math.max(1,iPage-5);i<iPage;i++){
		document.write("<a href=\""+sUrl + i + "\" title='第 " + i + " 页'><b>" + i + "</b></a> ");
	}
	document.write("<font color='#ff3333'><b>" + iPage + "</b></font> ");
	for(i=iPage+1;i<=Math.min(iCount,iPage+5);i++){
		document.write("<a href=\""+sUrl + i + "\" title='第 " + i + " 页'><b>" + i + "</b></a> ");
	}
	i=Math.min(iCount,iPage+1);
	if(iCount>iPage+5) document.write("<span style='font-size:8px'>···</span> ");
	document.write("<a href=\"" + sUrl + i + "\" title='下一页(第 " + i + " 页)'><FONT face=Webdings>8</FONT></a> ");
	document.write("<a href=\"" + sUrl + iCount + "\" title='最后一页(第 " + iCount + " 页)'><FONT face=Webdings>:</FONT></a> ");
}


//后台语言修改部分============================================================================================
function lang_url(url)
{
	window.location.href=url;
}
function lang_edit(id)        //修改语言
{
	var url = "SetConfig.asp?go=LangEdit&Action=Edit&id=" + id;
	lang_url(url);
}
function lang_used(id,checked)//启用语言
{
	if(!id || id == 0)
	{
		alert("操作非法！");
		return false;
	}
	lang_url("SetConfig.asp?go=LangUsed&id="+id+"&checked="+checked);
}
function lang_deft(id,ifsystem)//默认语言
{
	if(!id || id == 0)
	{
		alert("操作非法！");
		return false;
	}
	lang_url("SetConfig.asp?go=LangDeft&id="+id+"&ifsystem="+ifsystem);
}
function lang_del(url)       //删除语言
{
	question = confirm("确认删除该语言吗？如果语言正在使用中，请先停用！\n\n如果没有必要的话，请不要使用删除功能！停用语言即可！\n\n特别说明，删除后无法恢复！数据库内涉及该语言的部分请清理数据库");
	if (question != "0")
	{
		window.location.href=url;
	}
}

//后台风格修改部分============================================================================================
function skin_url(url)
{
	question = confirm("请确认该操作！");
	if (question != "0")
	{
		window.location.href=url;
	}
}

function skin_edit(id,modid)        //修改风格
{
	var url = "Skin_Admin.asp?go=Edit&Action=Edit&id="+id+"&Modid="+modid;
	skin_url(url);
}
function skin_used(id,checked,modid)//启用风格
{
	if(!id || id == 0)
	{
		alert("操作非法！");
		return false;
	}
	skin_url("Skin_Admin.asp?go=Check&id="+id+"&checked="+checked+"&Modid="+modid);
}
function skin_deft(id,isdefault,modid)//默认风格
{
	if(!id || id == 0)
	{
		alert("操作非法！");
		return false;
	}
	skin_url("Skin_Admin.asp?go=Deft&id="+id+"&isdefault="+isdefault+"&Modid="+modid);
}
function skin_del(url)       //删除语言
{
	question = confirm("确认删除该风格吗？\n\n如果没有必要的话，请不要使用删除功能！停用即可！\n\n特别说明，删除后无法恢复！");
	if (question != "0")
	{
		window.location.href=url;
	}
}


//前后台用户选择日期控件开始===============================================================================================
//调用方法如下：
//<input name="postdate" type="text" id="postdate" title="点击选择" onClick="javascript:ShowCalendar(this.id)" size="9">
//<input type="button" name="Submit" value="选 择" onClick="javascript:ShowCalendar('postdate')">
//版权来源：By Ziyue(http://www.web-v.com/)

var months = new Array("一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"); 
var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); 
var days = new Array("日","一", "二", "三", "四", "五", "六"); 
var today; 

document.writeln("<div id='Calendar' style='position:absolute; z-index:1; visibility: hidden; filter:\"progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#999999,strength=3)\"'></div>");

function getDays(month, year)
{ 
//下面的这段代码是判断当前是否是闰年的 
if (1 == month) 
return ((0 == year % 4) && (0 != (year % 100))) || (0 == year % 400) ? 29 : 28; 
else 
return daysInMonth[month]; 
} 

function getToday() 
{ 
//得到今天的年,月,日 
this.now = new Date(); 
this.year = this.now.getFullYear(); 
this.month = this.now.getMonth(); 
this.day = this.now.getDate(); 
}

function getStringDay(str) 
{ 
//得到输入框的年,月,日
var str=str.split("-")

this.now = new Date(parseFloat(str[0]),parseFloat(str[1])-1,parseFloat(str[2])); 
this.year = this.now.getFullYear(); 
this.month = this.now.getMonth(); 
this.day = this.now.getDate(); 
}

function newCalendar() { 
var parseYear = parseInt(document.all.Year.options[document.all.Year.selectedIndex].value); 
var newCal = new Date(parseYear, document.all.Month.selectedIndex, 1); 
var day = -1; 
var startDay = newCal.getDay(); 
var daily = 0; 

if ((today.year == newCal.getFullYear()) &&(today.month == newCal.getMonth())) 
day = today.day; 

var tableCal = document.all.calendar; 
var intDaysInMonth =getDays(newCal.getMonth(), newCal.getFullYear());

for (var intWeek = 1; intWeek < tableCal.rows.length;intWeek++) 
for (var intDay = 0;intDay < tableCal.rows[intWeek].cells.length;intDay++) 
{ 
var cell = tableCal.rows[intWeek].cells[intDay]; 
if ((intDay == startDay) && (0 == daily)) 
daily = 1; 

if(day==daily) //今天，调用今天的Class 
{
cell.style.background='#6699CC';
cell.style.color='#FFFFFF';
//cell.style.fontWeight='bold';
}
else if(intDay==6) //周六 
cell.style.color='green'; 
else if (intDay==0) //周日 
cell.style.color='red';

if ((daily > 0) && (daily <= intDaysInMonth)) 
{ 
cell.innerText = daily; 
daily++; 
} 
else 
cell.innerText = ""; 
} 
} 

function GetDate(InputBox)
{ 
var sDate; 
//这段代码处理鼠标点击的情况 
if (event.srcElement.tagName == "TD") 
if (event.srcElement.innerText != "") 
{ 
sDate = document.all.Year.value + "-" + document.all.Month.value + "-" + event.srcElement.innerText;
eval("document.all."+InputBox).value=sDate;
HiddenCalendar();
} 
} 

function HiddenCalendar()
{
//关闭选择窗口
document.all.Calendar.style.visibility='hidden';
}

function ShowCalendar(InputBox)
{
var x,y,intLoop,intWeeks,intDays;
var DivContent;
var year,month,day;
var o=eval("document.all."+InputBox);
var thisyear; //真正的今年年份

thisyear=new getToday();
thisyear=thisyear.year;

today = o.value;
if(isDate(today))
today = new getStringDay(today);
else
today = new getToday(); 

//显示的位置
x=o.offsetLeft;
y=o.offsetTop;
while(o=o.offsetParent)
{
x+=o.offsetLeft;
y+=o.offsetTop;
}
document.all.Calendar.style.left=x+2;
document.all.Calendar.style.top=y+20;
document.all.Calendar.style.visibility="visible";

//下面开始输出日历表格(border-color:#9DBAF7)
DivContent="<table border='0' cellspacing='0' style='border:1px solid #0066FF; background-color:#EDF2FC'>";
DivContent+="<tr>";
DivContent+="<td style='border-bottom:1px solid #0066FF; background-color:#C7D8FA'>";

//年
DivContent+="<select name='Year' id='Year' onChange='newCalendar()' style='font-family:Verdana; font-size:12px'>";
for (intLoop = thisyear - 100; intLoop < (thisyear + 5); intLoop++) //修改在当年时间的前N年和后N年日期
DivContent+="<option value= " + intLoop + " " + (today.year == intLoop ? "Selected" : "") + ">" + intLoop + "</option>"; 
DivContent+="</select>";

//月
DivContent+="<select name='Month' id='Month' onChange='newCalendar()' style='font-family:Verdana; font-size:12px'>";
for (intLoop = 0; intLoop < months.length; intLoop++) 
DivContent+="<option value= " + (intLoop + 1) + " " + (today.month == intLoop ? "Selected" : "") + ">" + months[intLoop] + "</option>"; 
DivContent+="</select>";

DivContent+="</td>";

DivContent+="<td style='border-bottom:1px solid #0066FF; background-color:#C7D8FA; font-weight:bold; font-family:Wingdings 2,Wingdings,Webdings; font-size:16px; padding-top:2px; color:#4477FF; cursor:hand' align='center' title='关闭' onClick='javascript:HiddenCalendar()'>S</td>";
DivContent+="</tr>";

DivContent+="<tr><td align='center' colspan='2'>";
DivContent+="<table id='calendar' border='0' width='100%'>";

//星期
DivContent+="<tr>";
for (intLoop = 0; intLoop < days.length; intLoop++) 
DivContent+="<td align='center' style='font-size:12px'>" + days[intLoop] + "</td>"; 
DivContent+="</tr>";

//天
for (intWeeks = 0; intWeeks < 6; intWeeks++)
{ 
DivContent+="<tr>"; 
for (intDays = 0; intDays < days.length; intDays++) 
DivContent+="<td onClick='GetDate(\"" + InputBox + "\")' style='cursor:hand; border-right:1px solid #BBBBBB; border-bottom:1px solid #BBBBBB; color:#215DC6; font-family:Verdana; font-size:12px' align='center'></td>"; 
DivContent+="</tr>"; 
} 
DivContent+="</table></td></tr></table>";

document.all.Calendar.innerHTML=DivContent;
newCalendar();
}

function isDate(dateStr)
{ 
var datePat = /^(\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/;
var matchArray = dateStr.match(datePat);
if (matchArray == null) return false; 
var month = matchArray[3];
var day = matchArray[5]; 
var year = matchArray[1]; 
if (month < 1 || month > 12) return false; 
if (day < 1 || day > 31) return false; 
if ((month==4 || month==6 || month==9 || month==11) && day==31) return false; 
if (month == 2)
{
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); 
if (day > 29 || (day==29 && !isleap)) return false; 
} 
return true;
}
//前后台用户选择日期控件结束===============================================================================================



//用户管理中心删除文件提示=================================================================================================
function Del_File(temp){
	 var msg=window.confirm ("您真的确定要删除该文件吗?");
	  if(msg==true){
		  window.location=temp;
	  }
	}


//兼容多种浏览器的常用设置代码===============================================================================================
function  addFav() {   //加入收藏夹;用法：<a href="javascript:;" onclick="addFav()">加入收藏</a>  
             if  (document.all) {   
                window.external.addFavorite('http://www.idunhua.com', '敦华娱乐');   
            }   
             else   if  (window.sidebar) {   
            window.sidebar.addPanel('敦华娱乐', 'http://www.idunhua.com',  "" );   
            }   
        }   
//设置首页；用法：<a href="javascript:void(0);" onclick="SetHome(this)">设为首页</a>
function SetHome(obj){   
    try{   
        obj.style.behavior='url(#default#homepage)';   
        obj.setHomePage('http://www.idunhua.com');   
    }catch(e){   
        if(window.netscape){   
            try{   
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");   
            }catch(e){   
                alert("抱歉，此操作被浏览器拒绝！\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");   
            };   
        }else{   
            alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您需要手动将'http://www.idunhua.com/'设置为首页。");   
        };   
    };   
};   



//隐藏下载地址方法java_s:download_client();==============================================================================================
function download_client() 
{

var _ver = "UC2009_beta";
var _path = "http://dl.uc.sina.com/uc/uc2009beta_setup.exe";
var _url = "http://beacon.sina.com.cn/e.gif?ucim||" + _ver + "||download||" + Math.random();

try {
var _head = document.getElementsByTagName("head")[0];
var snode = document.createElement("img");
snode.setAttribute("src", _url);
snode.onload = function() {
window.location.href = _path;
}
if(navigator.appName == "Microsoft Internet Explorer") {
snode.onreadystatechange = function() {
if(snode.readyState == "complete" || snode.readyState == "loaded") {
_head.removeChild(snode);
window.location.href = _path;
}
}
}
_head.appendChild(snode);
}catch(e){
window.location.href = _path;
}
} 











//设定多长时间运行【时钟】
function timeset(time,js)
{
	time = parseInt(time);
	if(time < 1)
	{
		eval(js);
	}
	else
	{
		if(time < 10)
		{
			time = time*1000;
		}
		window.setTimeout(js,time);
	}
}

/*************全选函数***********/
function select_all(id)
{
	if(id && id != "undefined")
	{
		var objs = $(id).getElementsByTagName("input");
	}
	else
	{
		var objs = window.document.getElementsByTagName("input");
	}
	for(var i=0; i<objs.length; i++)
	{
		if(objs[i].type.toLowerCase() == "checkbox" ) objs[i].checked = true;
	}
}
/***************全不选函数***********/
function select_none(id)
{
	if(id && id != "undefined")
	{
		var objs = $(id).getElementsByTagName("input");
	}
	else
	{
		var objs = window.document.getElementsByTagName("input");
	}
	for(var i=0; i<objs.length; i++)
	{
		if(objs[i].type.toLowerCase() == "checkbox" ) objs[i].checked = false;
	}
}
/*****************反选函数**************/
function select_anti(id)
{
	if(id && id != "undefined")
	{
		var objs = $(id).getElementsByTagName("input");
	}
	else
	{
		var objs = window.document.getElementsByTagName("input");
	}
	for(var i=0; i<objs.length; i++)
	{
		if(objs[i].type.toLowerCase() == "checkbox" )
		{
			if(objs[i].checked == true)
			{
				objs[i].checked = false;
			}
			else
			{
				objs[i].checked = true;
			}
		}
	}
}

/*取得复选框的值，并以,合并*/
function join_checkbox()
{
	var idarray = new Array();//定义一个数组
	var cv = document.getElementsByTagName("input");
	var m = 0;
	for(var i=0; i<cv.length; i++)
	{if(cv[i].type.toLowerCase() == "checkbox")
		{if(cv[i].checked)
			{idarray[m] = cv[i].value;
			 m++;}}}
	var id = idarray.join(",");
	return id;
}


/*Select 选框的处理*/
function selected_true(idname,optioned)
{
	var obj = $(idname);
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].value == optioned)
		{
			obj[i].selected = true;
		}
	}
}


/*判断选择个数*/
function count_checked_items() {
  var number_checked=0;
  var box_count=document.listform.id.length;
  if ( box_count==null ) {
  if ( document.listform.id.checked==true ) {
  number_checked=1;}else {
  number_checked=0;}}
  else {
  for ( var i=0; i < (box_count); i++ ) {
  if ( document.listform.id[i].checked==true ) {
  number_checked++;}}}return number_checked;
}
/*批量删除*/
function del_all() {
      if (count_checked_items()>0){ 
          if(confirm("您真的要删除这些产品吗?删除后无法恢复!")){ 
          document.listform.action.value="del_all";
          document.listform.submit();
          }
      }
      else
          alert('请您先选择要删除的产品!');
          return false;       
      }

/*批量审核*/
function check_all() {
      if (count_checked_items()>0){ 
          if(confirm("您真的要审核这些产品吗?")){ 
          document.listform.action.value="che_all";
          document.listform.submit();
          }
      }
      else
          alert('请您先选择要审核的产品!');
          return false;       
      }
/*批量取消审核*/
function nocheck_all() {
      if (count_checked_items()>0){ 
          if(confirm("您真的要取消审核这些产品吗?取消后前台不显示!")){ 
          document.listform.action.value="noche_all";
          document.listform.submit();
          }
      }
      else
          alert('请您先选择要取消审核的产品!');
          return false;       
      }
/*批量热门*/
function hot_all() {
      if (count_checked_items()>0){ 
           if(confirm("您真的要把这些产品设置为热门吗?")){ 
          document.listform.action.value="hot_all";
          document.listform.submit();
          }
      }
      else
          alert('请您先选择要设置热门的产品!');
          return false;       
      }
/*批量取消审核*/
function nohot_all() {
      if (count_checked_items()>0){ 
          if(confirm("您真的要把这些产品取消热门吗?")){ 
          document.listform.action.value="nohot_all";
          document.listform.submit();
          }
      }
      else
          alert('请您先选择要取消热门的产品!');
          return false;       
      }
/*批量推荐*/
function recom_all() {
      if (count_checked_items()>0){ 
           if(confirm("您真的要把这些产品设置为推荐吗?")){ 
          document.listform.action.value="recom_all";
          document.listform.submit();
          }
      }
      else
          alert('请您先选择要设置推荐的产品!');
          return false;       
      }
/*批量取消推荐*/
function norecom_all() {
      if (count_checked_items()>0){ 
          if(confirm("您真的要把这些产品取消推荐吗?")){ 
          document.listform.action.value="norecom_all";
          document.listform.submit();
          }
      }
      else
          alert('请您先选择要取消推荐的产品!');
          return false;       
      }
/*批量最新*/
function new_all() {
      if (count_checked_items()>0){ 
           if(confirm("您真的要把这些产品设置为最新吗?")){ 
          document.listform.action.value="new_all";
          document.listform.submit();
          }
      }
      else
          alert('请您先选择要设置最新的产品!');
          return false;       
      }
/*批量取消最新*/
function nonew_all() {
      if (count_checked_items()>0){ 
          if(confirm("您真的要把这些产品取消最新吗?")){ 
          document.listform.action.value="nonew_all";
          document.listform.submit();
          }
      }
      else
          alert('请您先选择要取消最新的产品!');
          return false;       
      }


/*创建ajax对象*/
function add_ajax()
{
	var xmlhttp=null;
	try
	{
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			xmlhttp=null;
		}
	}
	if(!xmlhttp && typeof XMLHttpRequest != "undefined")
	{
		xmlhttp=new XMLHttpRequest();
	}
    return xmlhttp;
}

/*根据url来处理ajax的信息*/
function get_ajax(url)
{
	var xmlhttp = add_ajax();
	var randname = "rand"+Math.floor(Math.random()*10000);
	var randnum = Math.floor(Math.random()*10000);
	if(url.indexOf("?") != -1)
	{
		url += "&"+randname+"="+randnum;
	}
	else
	{
		url += "?"+randname+"="+randnum;
	}
	xmlhttp.open("GET",url,false);
	xmlhttp.send(null);
	if(xmlhttp.readyState==3)
	{
		alert("数据加载中...");
	}
	else if(xmlhttp.readyState == 4)
	{
		var result = xmlhttp.responseText;
		if(result)
		{
			return result;
		}
		else
		{
			alert("网络原因，请刷新后重新提交");
		}
	}
}


//获取当前分类的参数列表[增加]
function get_catapara(id){
	cata_para.style.display = "none";
	if(id && id != "undefined")
	{
	var message = get_ajax("product_admin.asp?action=cata&cata_id="+id);
	}
	if(message)
		{
			document.getElementById("cata_para").innerHTML = message;
			document.getElementById("cata_para").style.display = "";
			return true;
		}
}
//获取当前分类的参数列表[修改]
function get_catapara_edit(id,cid,pid){
	cata_para.style.display = "none";
	if(id && id != "undefined")
	{
	var message = get_ajax("product_admin.asp?action=cata&cata_id="+id);
	var msg=window.confirm ("切换分类需要重新填写特殊参数，确认要更改分类吗？");
	var message1 = get_ajax("product_admin.asp?action=catalist&catalist_id="+cid+"&proid="+pid);
	var message2 = get_ajax("product_admin.asp?action=paralist&catalist_id="+cid+"&proid="+pid);
	}
	if (msg==true){
	if(message)
		{
			document.getElementById("cata_para").innerHTML = message;
			document.getElementById("cata_para").style.display = "";
			return true;
		}
	}
	else
	{
		if(message1 && message2)
		{
			document.getElementById("catalist_para").innerHTML = message1;
			document.getElementById("catalist_para").style.display = "";
			document.getElementById("cata_para").innerHTML = message2;
			document.getElementById("cata_para").style.display = "";
			return true;
		}
		}
}

//获取支付方式列表
function get_pay(){
	propay.style.display = "none";
	var message = get_ajax("product_admin.asp?action=payadd&paction=propay");
	if(message)
		{
			document.getElementById("propay").innerHTML = message;
			document.getElementById("propay").style.display = "";
			return true;
		}
}
//获取运输方式列表
function get_ex(){
	proex.style.display = "none";
	var message = get_ajax("product_admin.asp?action=exadd&paction=proex");
	if(message)
		{
			document.getElementById("proex").innerHTML = message;
			document.getElementById("proex").style.display = "";
			return true;
		}
}


/*Cookie管理*/
function get_cookie(name)
{
	var cookieValue = "";
	var search = name + "=";
	if(document.cookie.length > 0)
	{
		offset = document.cookie.indexOf(search);
		if (offset != -1)
		{
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1)
			{
				end = document.cookie.length;
			}
			cookieValue = unescape(document.cookie.substring(offset, end));
		}
	}
	return cookieValue;
}

function set_cookie(cookieName,cookieValue,DayValue)
{
	var expire = "";
	var day_value=1;
	if(DayValue!=null)
	{
		day_value=DayValue;
	}
    expire = new Date((new Date()).getTime() + day_value * 86400000);
    expire = "; expires=" + expire.toGMTString();
	document.cookie = cookieName + "=" + escape(cookieValue) +";path=/"+ expire;
}

function del_cookie(cookieName)
{
	var expire = "";
    expire = new Date((new Date()).getTime() - 1 );
    expire = "; expires=" + expire.toGMTString();
	document.cookie = cookieName + "=" + escape("") +";path=/"+ expire;
}

//插入文件到当前光标处
function insert_txt(c,v)
{
	var obj=$(c);
	if(document.selection)
	{
		obj.focus();
		document.selection.createRange().text = v;
	}
	else
	{
		obj.value = obj.value.slice(0,Obj.selectionStart) + v + obj.value.slice(obj.selectionEnd,obj.value.length);
	}
}

//删除分类提示
function del_cata(temp){
	  var msg=window.confirm ("你真的要删除该分类吗?");
	  if(msg==true){
		  document.cata_del.id.value=temp;     
		  document.cata_del.submit();  
	  }
}

//删除模块提示
function del_mod(temp){
	  var msg=window.confirm ("你真的要删除该模块吗?");
	  if(msg==true){
		  document.mod_del.id.value=temp;     
		  document.mod_del.submit();  
	  }
}
//删除产品提示
function del_pro(temp){
	 var msg=window.confirm ("你真的要删除该产品吗?");
	  if(msg==true){
		  window.location=temp;
	  }
	}
//审核产品
function check_pro(temp){
		  window.location=temp;
	}
//显示分页
function viewPage(page){
        document.listform.me_page.value=page;   
		document.listform.submit();
     }
//设定上传产品图片数量(增加)
 function setid()
	  {
	  str='';
	  if(!window.addform.upcount.value)
	   window.addform.upcount.value=1;
 	  for(i=1;i<=window.addform.upcount.value;i++)
	     str+='图片'+i+':<input type="file" name="file'+i+'" style="width:400" class="tx1"><br>';
	  window.upid.innerHTML=str+'';
	  }
//设定上传产品图片数量（修改）
 function setid_edit(pcount)
	  {
	  str='';
	  if(!window.editform.upcount.value)
	   window.editform.upcount.value=pcount;
 	  for(i=pcount;i<=window.editform.upcount.value;i++)
	     str+='图片'+i+':<input type="file" name="file'+i+'" style="width:400" class="tx1"><br>';
	  window.upid.innerHTML=str+'';
	  }
//删除参数提示
function del_para(temp){
	 var msg=window.confirm ("你真的要删除该参数吗?");
	  if(msg==true){
		  window.location=temp;
	  }
	}
//删除支付方式
function del_pay(temp){
	 var msg=window.confirm ("你真的要删除该支付方式吗?");
	  if(msg==true){
		  window.location=temp;
	  }
	}
//删除运输方式
function del_ex(temp){
	 var msg=window.confirm ("你真的要删除该运输方式吗?");
	  if(msg==true){
		  window.location=temp;
	  }
	}
//隐藏层
function yinc(temp)
{   
var t=document.getElementById("payinfo").style.display;
if(t=="none"){
	document.getElementById(temp).style.display="block";
	document.getElementById("spayinfo").value="隐藏支付信息";
	}
	else
	{
		document.getElementById("spayinfo").value="显示支付信息";
		document.getElementById(temp).style.display="none";
		}
}

//验证
function checkform(){
	return true;
	}
