﻿var _i=Math.random();
if(document.compatMode == "BackCompat"){var dtd=false;}else{dtd=true;}
function clientWidth(){if(dtd){return document.documentElement.clientWidth;}else{return document.body.clientWidth;}}
function clientHeight(){if(dtd){return document.documentElement.clientHeight;}else{return document.body.clientHeight;}}
function scrollWidth(){if(dtd){return document.documentElement.scrollWidth;}else{return document.body.scrollWidth;}}
function scrollHeight(){if(dtd){return document.documentElement.scrollHeight;}else{return document.body.scrollHeight;}}
function scrollLeft(){if(dtd){return document.documentElement.scrollLeft;}else{return document.body.scrollLeft;}}
function scrollTop(){if(dtd){return document.documentElement.scrollTop;}else{return document.body.scrollTop;}}

function getId(id)
{
	return document.getElementById(id);
}

function getName(str)
{
	return document.getElementsByName(str);
}

function getTag(str)
{
	return document.getElementsByTagName(str);
}

function getFid(id)
{
	return parent.document.getElementById(id);
}


function switchdiv(namestr,n,a,b){
	for(var i=a;i<=b;i++){ getId(namestr+i).style.display = "none";}
	getId(namestr+n).style.display = "block";
}

function classCldOpt(obj,typeid)
{
	var CldOpt=ajax("../class/classajax.asp","classid="+obj.value+"&typeid="+typeid,"Cldclassid");
}

//创建Option
function addOpt(OptIndex,OptValue,OptText,OptId)
{
	var OptId=getId(OptId);
    OptId.options[OptIndex]=new Option(OptText,OptValue);
    OptId.appendChild(OptId.options[OptIndex]);
}

function OpenWindow(Url,Width,Height,WindowObj)
{
	var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'px;dialogHeight:'+Height+'px;status:no;help:no;scroll:no;status:0;help:0;scroll:0;');
	return ReturnStr;
}
function OpenThenSetValue(Url,Width,Height,WindowObj,SetObj)
{
	var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'px;dialogHeight:'+Height+'px;status:no;help:no;scroll:no;status:0;help:0;scroll:0;');
	if (ReturnStr!='') SetObj.value=ReturnStr;
	return ReturnStr;
}

function T(id,n){ getId(id).style.fontSize=n+"px";}

function ajax(url,urlcs,secid)
{
	_i=Math.random();
	_i++;
	if(urlcs==""){urlcs="bb=1";}
	var responseStr=$.ajax({ url:url+"?alz="+_i+"&"+urlcs, async: false}).responseText;
	if(getId(secid)){getId(secid).innerHTML=responseStr;}
	return responseStr;
}

function ajax2(url,urlcs)
{
	if(urlcs==""){urlcs="bb=1"}
	var img=new Image();
	img.src=url+"?"+urlcs+"&i_i="+Math.random();
}

//得到URL参数值
function getPra(paramName){
	var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
	var oMatch = oRegex.exec( location.search ) ;	
	if ( oMatch && oMatch.length > 1 )
		return decodeURIComponent( oMatch[1] ) ;
	else
		return "";
}

//类别级数展开与关闭
function showclass(ids)
{
	var idarr=ids.split(",")
	var obj1=getId("Class_"+idarr[0])		
	if (obj1.style.display == "none"){newdisplay=""}else{newdisplay="none"};
	for(i=0;i<idarr.length;i++)
	{
		var obj=getId("Class_"+idarr[i])
		if(obj){obj.style.display=newdisplay};
	}
}

//数字格式控制
function onlynum(obj){obj.value=obj.value.replace(/\D/g,'')}


//搜索
function Search_check(str1,str2)
{
	if (getId("keyword").value=="" || getId("keyword").value==str1)
	{
		alert(getId("keyword").value);
		getId("keyword").focus();
		return false;
	}
}

//背景色改变效果
function bgcc(obj)
{
	obj.style.backgroundColor="#efefef"
	obj.onmouseout=function(){obj.style.backgroundColor=""}
	
}

function buttonbgcc(obj)
{
	obj.className="mybuttonstyle2";
	obj.onmouseout=function(){obj.className="mybuttonstyle";}	
}

//关键字写入录入框
function ctag(obj,str,types)
{
	if(getId(str).value=="")
	{
		getId(str).value=obj.title;
	}
	else
	{
		getId(str).value=getId(str).value+ "," +obj.title
		if(types==1||obj.title==""){getId(str).value=obj.title;}
	}
}
//保存数据的时候，锁提交按纽
function lock_button(obj1,obj2,obj3,str)
{
	if(getId(obj1))
	{
	getId(obj1).style.display="none";
	}
	if(getId(obj2))
	{
	getId(obj2).style.display="none";
	}
	if(getId(obj3))
	{
	getId(obj3).innerHTML=str;
	}
}

//后台，消息浮动层显示，相对于固定高宽的满屏窗口
function showMsg(str1,str2,w,top)
{


	var Fid = getFid("showMsg_Id");
	var Cid = getFid("showMsg_content");
	var Tid = getFid("showMsg_title");	
	var bgs=getFid("bgs");
	var bgs_ifr=getFid("bgs_ifr");

	if (Fid.style.display == "none")
	{
		eval("Fid.style.display=\"\";");
		eval("Fid.style.left=\""+(screen.width-w)/2+"px\";");
		eval("Fid.style.width=\""+w+"px\";");
		eval("Fid.style.top=\""+top+"px\";");
		eval("bgs.style.left=\"0px\";");
		eval("bgs.style.width=\"100%\";");
		eval("bgs.style.height=\""+parent.document.body.clientHeight+"px\";");
		eval("bgs.style.display=\"\";");
		eval("bgs_ifr.style.display=\"\";");
		eval("Cid.style.width=\""+w+"px\";");
		eval("Tid.style.width=\""+w+"px\";");
		getFid("showMsg_title").innerHTML=str1;
		getFid("showMsg_content").innerHTML=str2;
	}
	else
	{
		eval("Fid.style.display=\"none\";");
		eval("bgs.style.display=\"none\";");
		eval("bgs_ifr.style.display=\"none\";");
		getFid("showMsg_title").innerHTML="";
		getFid("showMsg_content").innerHTML="";
	}

}

//前台消息浮动层显示，相对于本窗口eval("Fid.style.top=\""+(document.body.scrollTop+top)+"px\";");
function showMsg2(str1,str2,w,top)
{
			alert("a");
	var Fid = getFid("showMsg_Id");
	var Cid = getFid("showMsg_content");
	var Tid = getFid("showMsg_title");	
	var bgs=getFid("bgs");
	var bgs_ifr=getFid("bgs_ifr");
	if (Fid.style.display == "none")
	{
		eval("Fid.style.display=\"\";");
		eval("Fid.style.left=\""+(screen.width-w)/2+"px\";");
		eval("Fid.style.width=\""+w+"px\";");
		eval("Fid.style.top=\""+(document.body.scrollTop+top)+"px\";");
		eval("bgs.style.left=\"0px\";");
		eval("bgs.style.width=\"100%\";");
		eval("bgs.style.height=\""+parent.document.body.clientHeight+"px\";");
		eval("bgs.style.display=\"\";");
		eval("bgs_ifr.style.display=\"\";");
		eval("Cid.style.width=\""+w+"px\";");
		eval("Tid.style.width=\""+w+"px\";");
		getFid("showMsg_title").innerHTML=str1;
		getFid("showMsg_content").innerHTML=str2;
	}
	else
	{
		eval("Fid.style.display=\"none\";");
		eval("bgs.style.display=\"none\";");
		eval("bgs_ifr.style.display=\"none\";");
		getFid("showMsg_title").innerHTML="";
		getFid("showMsg_content").innerHTML="";
	}
}

function switchTab(n,a,b,str){
	for(var i=a;i<=b;i++){
		if(i!=n){
			getId("ContentBody"+n).style.display = "block";
			getId("ContentBody"+i).style.display = "none";
			getId("ListTitle"+i).className = str+"off";
			getId("ListTitle"+n).className = str+"on";
		}
	}
	if(getId("ShowAll")){getId("ShowAll").className = str+"off";}
}

//多产品图片时的切换
function chang_img(obj)
{
	src=obj.src;
	Arry_src=src.split("propic/");
	N_src="images/propic/big/"+Arry_src[1]
	getId("big_img").src=N_src;
}

//QQ自由移动层控制
var Obj=''
var index=10000;
function MDown(obj)
{
	if (Ym)clearTimeout(Ym);
	obj.setCapture();	
	obj.setCapture()
	px=obj.offsetLeft-event.x;
	py=obj.offsetTop-event.y;	
	obj.onmousemove=function()
	{
		if(obj)
		{
 			obj.style.left=event.x+px;
 			obj.style.top=event.y+py;			
 		}
	}
	obj.onmouseup=function()
	{
		if (obj)
		{
			var p;
			if (window.innerHeight)p = window.pageYOffset;
  			else if (document.documentElement && document.documentElement.scrollTop)p = document.documentElement.scrollTop;
  			else if (document.body)p = document.body.scrollTop;
			theTop=obj.offsetTop-p;
			theTop=theTop<0?0:theTop;
			obj.releaseCapture();obj=null;initFloatTips();			
		}
	}
}


//控制层移动MDown2(obj)
var Obj2=''
var index2=10000;
document.onmouseup=MUp2
document.onmousemove=MMove2
function MDown2(Object){
Obj2=Object.id
document.all(Obj2).setCapture()
pX=event.x-document.all(Obj2).style.pixelLeft;
pY=event.y-document.all(Obj2).style.pixelTop;
}
function MMove2(){
if(Obj2!=''){
 document.all(Obj2).style.left=event.x-pX;
 document.all(Obj2).style.top=event.y-pY;
 }
}
function MUp2(){
if(Obj2!=''){
 document.all(Obj2).releaseCapture();
 Obj2='';
 }
}

//选择操作（typeid: 1全选 2反选 3取消）
function sel(name,typeid)
{ 
	obj=getName(name)
	if(typeid==1)
	{
		for(i=0;i<obj.length;i++){obj[i].checked=true;}
		getId("ids").checked=true;
	}
	else if(typeid==3)
	{
		for(i=0;i<obj.length;i++){obj[i].checked=false;}	
		getId("ids").checked=false;
	}
	else
	{
		for(i=0;i<obj.length;i++)
		{
			if(obj[i].checked)
			{
				obj[i].checked=false;  
			}
			else
			{
				obj[i].checked=true;
			}
		}	
	}
}

//层显示与关闭
function showmenu(menuid)
{
	var obj=getId("menuid"+menuid)	
	if (obj.style.display == "none")
	{
		obj.style.display = "";
	}
	else
	{
		obj.style.display = "none";
	}
}

//翻页跳转
function topage(obj){
	var jmpurl=obj.value;
	if(jmpurl!='')
	{
		location.href=jmpurl;
	}
	else
	{
		this.selectedindex=0;};
	}


//操作判断
function confirm_do(){
	if (confirm("您确定如此操作吗？")){
		return true;
	}
	return false;
}

//后台版面控制
forumpath="../"
function DvMenuCls(){
	var MenuHides = new Array();
	this.Show = function(obj,depth){
		var childNode = this.GetChildNode(obj);
		if (!childNode){return ;}
		if (typeof(MenuHides[depth])=="object"){
			this.closediv(MenuHides[depth]);
			MenuHides[depth] = '';
		};
		if (depth>0){
			if (childNode.parentNode.offsetWidth>0){
				childNode.style.left= childNode.parentNode.offsetWidth+'px';
				
			}else{
				childNode.style.left='100px';
			};
			
			childNode.style.top = '-2px';
		};
		childNode.style.display ='block';
		MenuHides[depth]=childNode;
	
	};
	this.closediv = function(obj){
		if (typeof(obj)=="object"){
			if (obj.style.display!='none'){
			obj.style.display='none';
			}
		}
	}
	this.Hide = function(depth){
		var i=0;
		if (depth>0){
			i = depth
		};
		while(MenuHides[i]!=null && MenuHides[i]!=''){
			this.closediv(MenuHides[i]);
			MenuHides[i]='';
			i++;
		};
	
	};
	this.Clear = function(){
		for(var i=0;i<MenuHides.length;i++){
			if (MenuHides[i]!=null && MenuHides[i]!=''){
				MenuHides[i].style.display='none';
				MenuHides[i]='';
			}
		}
	}
	this.GetChildNode = function(submenu){
		for(var i=0;i<submenu.childNodes.length;i++)
		{
			if(submenu.childNodes[i].nodeName.toLowerCase()=="div")
			{
				var obj=submenu.childNodes[i];
				break;
			}
		}
		return obj;
	}
}


function getvoteids()
{
	var ids="";
	var votelist=document.getElementsByName("voteids")
	for(i=0;i<votelist.length;i++)
	{
		if(votelist[i].checked)
		{
			ids+=votelist[i].value+',';	
		}
	}
	ids=ids.substring(0,ids.length-1)	
	if (ids==""){alert("请选择投票选项！"); return;}
	myvoteajax(ids);
	for(i=0;i<votelist.length;i++)
	{
		votelist[i].checked=false;
	}
}

function myvoteajax(id)
{
++_i;
var responseText=$.ajax({ url:"fun/vote/alz_vote_do.asp?id="+id+"&a="+_i, async: false }).responseText;
	if(responseText=="0")
	{
		alert('此投票已经过期，无效投票！');
	}	
	else if(responseText=="1")
	{	
		alert('此IP已经投过票，感谢您热情的参与！');
	}
	else if(responseText=="2")
	{
		alert('投票成功，感谢您的参与！');
	}	
	else
	{
	alert('投票时间间隔为'+responseText.substring(1,5)+'分钟');
	}
}

function getvoteids2()
{
	var ids="";
	var votelist=document.getElementsByName("voteids")
	for(i=0;i<votelist.length;i++)
	{
		if(votelist[i].checked)
		{
			ids+=votelist[i].value+',';	
		}
	}
	ids=ids.substring(0,ids.length-1)	
	if (ids==""){alert("请选择投票选项！"); return;}
	myvoteajax2(ids);
	for(i=0;i<votelist.length;i++)
	{
		votelist[i].checked=false;
	}
}

function myvoteajax2(id)
{
++_i;
var responseText=$.ajax({ url:"alz_vote_do.asp?id="+id+"&a="+_i, async: false }).responseText;
	if(responseText=="0")
	{
		alert('此投票已经过期，无效投票！');
	}	
	else if(responseText=="1")
	{	
		alert('此IP已经投过票，感谢您热情的参与！');
	}
	else if(responseText=="2")
	{
		alert('投票成功，感谢您的参与！');
	}	
	else
	{
	alert('投票时间间隔为'+responseText.substring(1,5)+'分钟');
	}
}

function AutoIframe(obj)
{
	var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];
	var FFextraHeight=getFFVersion>=0.1? 16 : 0;
	if (obj && !window.opera)
	{
		obj.style.display="block";
		if(obj.contentDocument && obj.contentDocument.body.offsetHeight)
		{
			obj.height = obj.contentDocument.body.offsetHeight+FFextraHeight; 
		}
		else if(obj.Document && obj.Document.body.scrollHeight)
		{
			obj.height = obj.Document.body.scrollHeight;
		}
	}
	
	var obj2=getId("Iframeload")	   
	if(obj2){obj2.style.display="none";}

}

//拖动对象
var move_obj={o:null,z:0,x:0,y:0}
function move_(e)
{ 
    e=window.event||e;
    var oDragHandle = e.target || event.srcElement; 
    var topElement = "HTML"; 
    while (oDragHandle.tagName != topElement && oDragHandle.className != "alt_")
    { 
        oDragHandle =oDragHandle.parentNode||oDragHandle.parentElement; 
    } 
    if (oDragHandle.className=="alt_")
    { 
        isdrag = true; 
        move_obj.o = oDragHandle;
        move_obj.z=move_obj.o.style.zIndex;
        move_obj.o.style.zIndex=999;
        y = e.clientY-parseInt(move_obj.o.style.top+0); 
        x = e.clientX-parseInt(move_obj.o.style.left+0); 
        document.onmousemove=function moveMouse(e)
        {
            e=window.event||e;
            if (move_obj.o)with(move_obj.o.style)
            {
                var yy=e.clientY-y;if (yy<0)yy=0;else if (yy+move_obj.o.offsetHeight>document.body.clientHeight)yy=document.body.clientHeight-move_obj.o.offsetHeight;
                var xx=e.clientX-x;if (xx<0)xx=0;else if (xx+move_obj.o.offsetWidth>=document.body.clientWidth)xx=document.body.clientWidth-move_obj.o.offsetWidth;
                top=yy+"px";left=xx+"px";return false;
            }
        } 
        move_obj.o.onmouseup=function(){if(move_obj.o){document.onmousemove=null;move_obj.o.style.zIndex=move_obj.z;}move_obj.o=null;}
        return false; 
    } 
}

function showtime() {
  var d = new Date();
  var iYear = d.getYear()
  var iMonth = d.getMonth()
  var iDay = d.getDate()
  var sWeek = d.getDay()
  var sHour  = d.getHours()
  var sMinute = d.getMinutes()
  var sSecond = d.getSeconds()
  if(sWeek == 0) sWeek = "<font color=#ff0000 title=周末愉快>星期日</font>";
  if(sWeek == 1) sWeek = "星期一";
  if(sWeek == 2) sWeek = "星期二";
  if(sWeek == 3) sWeek = "星期三";
  if(sWeek == 4) sWeek = "星期四";
  if(sWeek == 5) sWeek = "星期五";
  if(sWeek == 6) sWeek = "<font color=#ff0000 title=周末愉快>星期六</font>";
  if(sHour <= 9) sHour = "0" + sHour;
  if(sMinute <= 9) sMinute = "0" + sMinute;
  if(sSecond <= 9) sSecond = "0" + sSecond;
  sClock = iYear + "年" + (iMonth + 1) + "月" + iDay + "日 " 
    + " " + sHour + ":" + sMinute + ":" + sSecond + "&nbsp;"+sWeek;
getId("clock").innerHTML = sClock;
setTimeout("showtime()", 1000);
}

function eshowtime() {
  var d = new Date();
  var iYear = d.getYear()
  var iMonth = d.getMonth()
  var iDay = d.getDate()
  var sWeek = d.getDay()
  var sHour  = d.getHours()
  var sMinute = d.getMinutes()
  var sSecond = d.getSeconds()
  if(sWeek == 0) sWeek = "<font color=#ff0000 title='Happy weekend'>sunday</font>";
  if(sWeek == 1) sWeek = "monday";
  if(sWeek == 2) sWeek = "tuesday";
  if(sWeek == 3) sWeek = "wednesday";
  if(sWeek == 4) sWeek = "thursday";
  if(sWeek == 5) sWeek = "friday";
  if(sWeek == 6) sWeek = "<font color=#ff0000 title='Happy weekend'>saturday</font>";
  if(sHour <= 9) sHour = "0" + sHour;
  if(sMinute <= 9) sMinute = "0" + sMinute;
  if(sSecond <= 9) sSecond = "0" + sSecond;
  sClock = (iMonth + 1) + "/" + iDay + "/" + iYear 
    + " " + sHour + ":" + sMinute + ":" + sSecond + "&nbsp;"+sWeek;
getId("eclock").innerHTML = sClock;
setTimeout("eshowtime()", 1000);
}

function tendygg()
{
var iii=2;
var speed=30;
tendydemo0=getId("tendy_gg");
tendydemo1=getId("tendy_gg1");
tendydemo2=getId("tendy_gg2");

tendydemo2.innerHTML=tendydemo1.innerHTML;
function Marquee()
{
	if(tendydemo2.offsetWidth-tendydemo0.scrollLeft<=0)
	tendydemo0.scrollLeft-=tendydemo1.offsetWidth;
else
{
	tendydemo0.scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
tendydemo0.onmouseover=function() {clearInterval(MyMar)}
tendydemo0.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
}

function initMarquee() {
 var str=marqueeContent[0];
 document.write('<div id=marqueeBox style="overflow:hidden;height:'+marqueeHeight+'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'startMarquee()\',marqueeDelay)"><div>'+str+'</div></div>');
 marqueeId++;
 marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
 }
 
function startMarquee() {
 var str=marqueeContent[marqueeId];
  marqueeId++;
 if(marqueeId>=marqueeContent.length) marqueeId=0;
 if(marqueeBox.childNodes.length==1) {
  var nextLine=document.createElement('DIV');
  nextLine.innerHTML=str;
  marqueeBox.appendChild(nextLine);
  }
 else {
  marqueeBox.childNodes[0].innerHTML=str;
  marqueeBox.appendChild(marqueeBox.childNodes[0]);
  marqueeBox.scrollTop=0;
  }
 clearInterval(marqueeInterval[1]);
 marqueeInterval[1]=setInterval("scrollMarquee()",10);
 }
 
function scrollMarquee() {
	marqueeBox.scrollTop++;
	if(marqueeBox.scrollTop%marqueeHeight==marqueeHeight){
	clearInterval(marqueeInterval[1]);
	}
}

function showall(a,b)
{	
	for(i=a;i<=b;i++)
	{
		getId("ContentBody"+i).style.display="";
		getId("ListTitle"+i).className="ConfigSetOff";		
	}
	getId("ShowAll").className="ConfigSetOn";
}

function re_weather()
{
	getId("weather_str").innerHTML="&lt;iframe src=&quot;http://m.weather.com.cn/m/p6/weather1.htm?id=101280601T&quot; width=&quot;160&quot; height=&quot;20&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; hspace=&quot;0&quot; vspace=&quot;0&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; allowTransparency=&quot;true&quot;&gt;&lt;/iframe&gt;";
}

function showclassmenu(id)
{
	if(getId("class"+id).style.display=="")
	{
		getId("class"+id).style.display="none"
		if(getId("class_"+id)){getId("class_"+id).innerHTML="<img src=skins/images/list5.gif />"}
	}
	else
	{
		getId("class"+id).style.display=""
		if(getId("class_"+id)){getId("class_"+id).innerHTML="<img src=skins/images/list4.gif />"}
	}			
			
	for(i=1;i<500;i++)
	{
		if(getId("class"+i)&&i!=id)	{getId("class"+i).style.display="none"}
		if(getId("class_"+i)&&i!=id){getId("class_"+i).innerHTML="<img src=skins/images/list5.gif />"}
	}
}

function rollleft(speed,idname)
{
	var demo=getId(idname)
	var demo1=getId(idname+"1")
	var demo2=getId(idname+"2")
	demo2.innerHTML=demo1.innerHTML;
	function Marquee()
	{
		if(demo2.offsetWidth-demo.scrollLeft<=0)
		{
			demo.scrollLeft-=demo1.offsetWidth;
		}
		else
		{
			demo.scrollLeft++;
		}
	}
	var MyMar=setInterval(Marquee,speed)
	demo.onmouseover=function(){clearInterval(MyMar)}
	demo.onmouseout=function(){MyMar=setInterval(Marquee,speed)}	
}

function rollup(speed,idname)
{
	var demo=getId(idname); 
	var demo1=getId(idname+"1"); 
	var demo2=getId(idname+"2"); 
	demo2.innerHTML=demo1.innerHTML;
	function Marquee()
	{ 
		if(demo2.offsetTop-demo.scrollTop<=0)
		{ 
			demo.scrollTop-=demo1.offsetHeight;
		}
		else
		{ 
			demo.scrollTop++;
		} 
	}
	var MyMar=setInterval(Marquee,speed) 
	demo.onmouseover=function(){clearInterval(MyMar)} 
	demo.onmouseout=function(){MyMar=setInterval(Marquee,speed)}
}

function CloseMsg(url,urlcs)
{
	if(urlcs==""){urlcs="i_="+Math.random();}
	parent.window.open(url+"?"+urlcs+"&i_="+Math.random(),"frmright")
	parent.window.getId("bgs").style.display="none";
	parent.window.getId("showMsg_Id").style.display="none";	
}

//图片预览
function picview(thiss,url,path)
{
	var sTop=scrollTop();
	var sheight=scrollHeight();
	var cheight=clientHeight();
	sTop=sTop+1;
	var thetop=parseInt(event.y+sTop);	
	thetop+=150*(cheight-event.y)/cheight-100;
	var obj=getId("viewpic");
	obj.src=path+"skins/images/loading2.gif";
	var imagev=new Image(); 
	imagev.onload=function(){setimg(obj,150,500,url);}
	imagev.src=url;
	obj.style.display = "inline";
	obj.style.left = event.x+20+"px";
	obj.style.top = thetop+"px";
	thiss.onmouseout=function(){obj.style.display = "none";}
}
	
//图片按比例缩放
function setimg(ImgD,w,h,url)
{
	var image=new Image(); 
	var iwidth = w;
	var iheight = h;
	image.onload=function()
	{
		ImgD.onload=null;
		ImgD.src=url;	
		if(image.width>0 && image.height>0)
		{		
			if(image.width/image.height>= iwidth/iheight)
			{ 
				if(image.width>iwidth)
				{   
					ImgD.width=iwidth;
				}
				else
				{ 
					ImgD.width=image.width
				}
				//ImgD.alt=image.width+"×"+image.height; 
				} 
			else
			{ 
				if(image.height>iheight)
				{
					ImgD.height=iheight; 
				}
				else
				{ 
					ImgD.width=image.width;
				}
			//ImgD.alt=image.width+"×"+image.height; 
			}
		}
	}	
	image.src=url;
}

//自动生成缩略图切换
function ismallpic(obj)
{	
	var objsamll=getId("smallpic");
	if(obj.checked){objsamll.style.display="none"}else{objsamll.style.display="inline"}
	
}

//页内分页函数
function onepagelist(pagenums,lan)
{
if(pagenums>0)
{
	var group_pernum=10;	 //每组显示多少页
	for(i=1;i<=pagenums;i++)
	{
		var obj=getId("pagepart"+i);
		if(obj){obj.style.display="none";}
	}
	var pageon=getPra("inpage")
	if(pageon==""){pageon=1;}
	pageon=parseInt(pageon);
	obj=getId("pagepart"+pageon);
	if(obj){obj.style.display="";}
	var text1,text2,text3,text4;
	if(lan)
	{
		text1="上一页";	
		text2="下一页";	
		text3="转到第 ";	
		text4=" 页";
		text5="上一组";
		text6="下一组";
	}
	else
	{
		text1="BACK";	
		text2="NEXT";	
		text3="GO TO PAGE  ";	
		text4="";
		text5="BACK GROUP";
		text6="NEXT GROUP";
	}
	var theurl=location.href;
	if(pageon==""){pageon=1;}
	pageon=parseInt(pageon);
	theurl=theurl.replace("&inpage="+pageon,"")
	theurl=theurl.replace("?inpage="+pageon,"")
	theurl=theurl.replace("#","")
	if(theurl.indexOf("?")>0){pagestr="&";}else{pagestr="?";}	
	
	theurl=theurl+pagestr+"inpage="
	
	var gounps=Math.ceil(pagenums/group_pernum) //一共分多少组
	var gounpon=Math.ceil(pageon/group_pernum) //当前页码位于多少组	
	prepage=pageon-1;
	nextpage=pageon+1;
	pregroup=pageon-group_pernum;
	nextgroup=pageon+group_pernum;
	if(prepage<1){prepage=1;}
	if(nextpage>pagenums){nextpage=pagenums;}
	if(pregroup<1){pregroup=1;}
	if(nextgroup>pagenums){nextgroup=pagenums;}
	document.write("<div class='onepage'>")
	if(pageon==1)
	{
		document.write("<a class='onepage_no'>"+text1+"</a>");
	}
	else
	{
		document.write("<a href='"+theurl+prepage+"'>"+text1+"</a>");
	}
	
	if(gounpon>1){document.write("<a href='"+theurl+pregroup+"' title='"+text5+"'>&lt;&lt;</a>");} //当前组大于一时，显示上一组
	
	for(var i=(gounpon-1)*group_pernum+1;i<=gounpon*group_pernum;i++) //显示位于当前组的页码
	{
		if(i>pagenums){break;}
		document.write("<a href='"+theurl+i+"'")
		if(pageon==i){document.write(" class='onepage_on'");}
		document.write(" title='"+text3+i+text4+"'>"+i+"</a>");
	}
	
	if(gounpon<gounps){	document.write("<a href='"+theurl+nextgroup+"' title='"+text6+"'>&gt;&gt;</a>");} //当前组小于总组数时，显示下一组
	
	if(pageon==pagenums)
	{
		document.write("<a class='onepage_no'>"+text2+"</a>");
	}
	else
	{
		document.write("<a href='"+theurl+nextpage+"'>"+text2+"</a>");
	}
	
	document.write("</div>")
}
}


//页面分页函数
function pagelist(pagenums,lan,urlstr)
{
	if(getCookie('newsmodel')=="2"){getId("newslist").className="newslist2";}
	
if(pagenums>0)
{
	var group_pernum=10;	 //每组显示多少页
	var text1,text2,text3,text4,text5,text6,text7,text8,text9,text10,url;
	if(lan)
	{
		text1="上一页";	
		text2="下一页";	
		text3="转到第 ";	
		text4=" 页";
		text5="上一组";
		text6="下一组";
		text7="共";
		text8="页";
		text9="第";
		text10="页";
	}
	else
	{
		text1="BACK";	
		text2="NEXT";	
		text3="GO TO PAGE  ";	
		text4="";
		text5="BACK GROUP";
		text6="NEXT GROUP";
		text7="ALL";
		text8="PAGES";
		text9="PAGE";
		text10="";
	}
	var theurl=location.href;	
	var urlRE=new RegExp(urlstr+"_(.*)\.html");		
	var pageREarr=theurl.match(urlRE);	
	if(pageREarr){pageon=pageREarr[1];}else{pageon=1;}
	pageon=parseInt(pageon);
	var gounps=Math.ceil(pagenums/group_pernum) //一共分多少组
	var gounpon=Math.ceil(pageon/group_pernum) //当前页码位于多少组	
	prepage=pageon-1;
	nextpage=pageon+1;
	pregroup=pageon-group_pernum;
	nextgroup=pageon+group_pernum;
	if(prepage<1){prepage=1;}
	if(nextpage>pagenums){nextpage=pagenums;}
	if(pregroup<1){pregroup=1;}
	if(nextgroup>pagenums){nextgroup=pagenums;}	
	document.write("<div id='mypage'>")
	document.write("<a>"+text7+" "+pagenums+" "+text8+" / "+text9+" "+pageon+" "+text10+"</a>");
	if(pageon==1)
	{
		document.write("<a class='page_no'>"+text1+"</a>");
	}
	else
	{
		url=urlstr+"_"+prepage+".html"
		url=url.replace("index_1.html","index.html")
		document.write("<a href='"+url+"'>"+text1+"</a>");
	}
	
	if(gounpon>1){document.write("<a href='"+urlstr+"_"+pregroup+".html' title='"+text5+"'>&lt;&lt;</a>");} //当前组大于一时，显示上一组
	
	for(var i=(gounpon-1)*group_pernum+1;i<=gounpon*group_pernum;i++) //显示位于当前组的页码
	{
		
		url=urlstr+"_"+i+".html"
		url=url.replace("index_1.html","index.html")
		if(i>pagenums){break;}
		document.write("<a href='"+url+"'")
		if(pageon==i){document.write(" class='page_on'");}
		document.write(" title='"+text3+i+text4+"'>"+i+"</a>");
	}
	
	if(gounpon<gounps){	document.write("<a href='"+urlstr+"_"+nextgroup+".html' title='"+text6+"'>&gt;&gt;</a>");} //当前组小于总组数时，显示下一组
	
	if(pageon==pagenums)
	{
		document.write("<a class='page_no'>"+text2+"</a>");
	}
	else
	{
		url=urlstr+"_"+nextpage+".html"
		url=url.replace("index_1.html","index.html")
		document.write("<a href='"+url+"'>"+text2+"</a>");
	}
	
	document.write("</div>")
}
}

//图片——链接类型 1为无 2为大图片 3为自定义
function linktypes(typeid)
{
	if(typeid=="3")
	{getId("link").style.display="";}
	else
	{getId("link").style.display="none";}
}

function setCookie(name,value)
{
	var Days = 30;
	var exp = new Date();
	exp.setTime(exp.getTime() + Days*24*60*60*1000);
	document.cookie=name+"="+escape(value)+";expires="+exp.toGMTString()+";path=/";
}

function getCookie(name)
{
	var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
	if(arr=document.cookie.match(reg)) return unescape(arr[2]);
	else return null;
}

function delCookie(name)
{
	var exp = new Date();
	exp.setTime(exp.getTime() - 1);
	var cval=getCookie(name);
	if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}

function allCookie()
{
	var str = document.cookie;
	if(str == "")
	{
		str = "没有保存任何cookie";
	}
	return str;
}
   
function changemodel(types)
{
	if(types=="news")
	{
		var obj=getId("newslist");
		if(obj)
		{
			if(obj.className=="newslist")
			{
				obj.className="newslist2";
				setCookie("newsmodel","2");
			}
			else
			{
				obj.className="newslist";
				setCookie("newsmodel","1");
			}
		}
	}
}

function backtolist()
{
	var url=getCookie("news_list_url");
	if(url)
	{
		location.href=url;	
	}
	else
	{
		location.href="../../";
	}
}

function OK(url)
{
	if(url)
	{
		if(url.indexOf("?")>0)
		{
			url+="&t="+Math.random();
		}
		else
		{
			url+="?t="+Math.random();
		}
		parent.window.open(url,"frmright");
	}
	parent.window.getId("bgs").style.display="none";
	parent.window.getId("showMsg_Id").style.display="none";	
}

//进度条函数，结合sub loadingbar使用
function loadingbar(id,numson,numsall,w)
{
	var barwidth=numson/numsall*w;
	var percenter=parseInt(numson/numsall*100)+"%";	
	getId("loadingbar"+id).style.width=barwidth;
	getId("loadnum"+id).innerHTML=percenter;
}

//zmr8
function gotosearch(str)
{
	getId("keyword").value=str;
}
function gotocity(str)
{
	alert("成功切入追梦人吧"+str+"站！");
}

function searchform()
{
	var form=getId("searchform")	
	var keyword=getId("keyword")
	if(keyword&&keyword.value==""){alert("请输入搜索关键词！");keyword.focus();return false;}else{form.submit();}
}

function picclick(id,path)
{
	ajax2(path+"picclick.asp","id="+id+"&add=1");	
}
function videosjbg(webpath)
{
	var i=randomChar(1,"videobg");
	getId("videolook").style.background="url("+webpath+"images/videobg_"+i+".jpg)";	
}

function randomChar(m,types)
{
	var tmp="";
	var str="0123456789poiuytrewqasdfghjklmnbvcxzQWERTYUIOPLKJHGFDSAZXCVBNM";
	var str1="0123456789poiuytrewqasdfghjklmnbvcxzQWERTYUIOPLKJHGFDSAZXCVBNM";
	if(types=="num"){str="0123456789";str1="0123456789";}
	if(types=="Num"){str="0123456789";str1="123456789";}
	if(types=="videobg"){str="0123456789";str1="12345";}
	for(var i=0;i<m;i++)
	{
		if(i==0)
		{tmp += str1.charAt(Math.ceil(Math.random()*100000000)%str1.length);}
		else
		{tmp += str.charAt(Math.ceil(Math.random()*100000000)%str.length);}
	}
	return tmp;
}

function get_Code(path) {
	var Dv_CodeFile = path+"alz_admin/alz_GetCode.asp";
	if(document.getElementById("imgid"))
		document.getElementById("imgid").innerHTML = '<img src="'+Dv_CodeFile+'?t='+Math.random()+'" alt="点击刷新验证码" style="cursor:pointer;border:0;vertical-align:middle;" onclick="this.src=\''+Dv_CodeFile+'?t=\'+Math.random()" />'
}

function submitForm(formID)
{ 
	if(window.event.ctrlKey&&window.event.keyCode==13)
	{ 
		document.getElementById(formID).submit(); 
	} 
}

function copy(obj){
	obj.select();
	js=obj.createTextRange();
	js.execCommand("Copy");
}
function movediv(divId,moveobj)
{
	var posX;
	var posY;  
	movediv = document.getElementById(divId);
	moveobj.onmousedown=function(e)
	{
	  if(!e) e = window.event; //如果是IE
	  posX = e.clientX - parseInt(movediv.style.left);
	  posY = e.clientY - parseInt(movediv.style.top);
	  document.onmousemove = mousemove;  
	}
	document.onmouseup = function()
	{
	  document.onmousemove = null;
	}
	function mousemove(ev)
	{
	  if(ev==null) ev = window.event;//如果是IE
	  movediv.style.left = (ev.clientX - posX) + "px";
	  movediv.style.top = (ev.clientY - posY) + "px";
	}
}

window.onerror=function(){return true;}

//////////////////////////////////////////////////////////
/*
模拟windows模态对话框。
Author: HxyMan
Thanks: Laomi,Fssunwin
Update: 2008-1-20
*/
var DvWnd={
$:function(d){return document.getElementById(d)},
move:0,
eventStartX:0,
eventStartY:0,
wndStartX:0,
wndStartY:0,
d:{a:'dvwnd',b:'dvwndtitle',c:'dvwndchild',d:'dvwndstatus',e:'dvwndiframe',g:'dvwndcanvas',w:'DvWnd'},
e:null,
x:function(){return DvWnd.e.clientX;},
y:function(){return DvWnd.e.clientY;},
drag_start:function(e){
   DvWnd.e=e;
   DvWnd.move=1;
   DvWnd.eventStartX=DvWnd.x();
   DvWnd.eventStartY=DvWnd.y();
   DvWnd.wndStartX=DvWnd.$(DvWnd.d.a).offsetLeft;
   DvWnd.wndStartY=DvWnd.$(DvWnd.d.a).offsetTop;
},
drag_stop:function(e){
   DvWnd.e=e;
   DvWnd.move=0;
},
drag:function(e){
   DvWnd.e=e;
   if(DvWnd.move){
    DvWnd.$(this.d.a).style.left=DvWnd.wndStartX+(DvWnd.x()-DvWnd.eventStartX)+'px';
    DvWnd.$(this.d.a).style.top=DvWnd.wndStartY+(DvWnd.y()-DvWnd.eventStartY)+'px';
    try{document.selection.empty();}catch(er){}
   }
},
close:function(isreload){
   DvWnd.$(DvWnd.d.a).style.display='none';DvWnd.$(DvWnd.d.g).style.display='none';
   var a=document.body;a.removeChild(DvWnd.$(DvWnd.d.a));a.removeChild(DvWnd.$(DvWnd.d.g));
   if(isreload==1);// window.location.reload();
},
onfocus:function(){
   DvWnd.flash(2);
},
flash:function(n){
   DvWnd.$(DvWnd.d.b).className='dvwndfocus';
   setTimeout(function(){DvWnd.$(DvWnd.d.b).className='dvwndtitle';},50);
   if(n>1){setTimeout(function(){DvWnd.flash(n-1);},100);}
},
open:function(){
   var de=document.documentElement;
   var w=window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
   var ch=window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
   if (self.pageYOffset) {
    var st=self.pageYOffset;
   } else if (de&&de.scrollTop){ // Explorer 6 Strict
    var st=de.scrollTop;
   } else if (document.body) {// all other Explorers
    var st=document.body.scrollTop;
   }
   if (window.innerHeight && window.scrollMaxY) { 
    var sh=window.innerHeight + window.scrollMaxY;
   } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
    var sh=document.body.scrollHeight;
   } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
    var sh=document.body.offsetHeight;
   }
   var a=arguments;
   DvWnd.title=a[0]||'信息窗口';
   DvWnd.para=a[1];//网址或者要显示的内容
   DvWnd.width=a[2]||300;
   DvWnd.height=a[3]||200;
   DvWnd.type=null==a[4]?1:a[4];//1-框架,2-直接显示内容
   DvWnd.canvas=a[5]||{bg:'#fff',opa:0.1};
   DvWnd.left=a[6]||(w-DvWnd.width)/2+'px';
   DvWnd.top=a[7]||(ch-(DvWnd.height||200))/2+st+'px';
   var dc=document,s='';
   var o=dc.createElement("div");
   o.id=DvWnd.d.a;
   o.className='dvwnd';
   o.style.width=DvWnd.width+'px';
   o.style.height=DvWnd.height+'px';
   o.style.left=DvWnd.left;
   o.style.top=DvWnd.top;
   s+='<div id="'+DvWnd.d.b+'" class="dvwndtitle" onmousedown="'+DvWnd.d.w+'.drag_start(event)" onmouseup="'+DvWnd.d.w+'.drag_stop(event)" onmousemove="'+DvWnd.d.w+'.drag(event)">';
   s+='<span style="float:right"><a href="javascript:'+DvWnd.d.w+'.close('+ DvWnd.type +');" class="dvwndclose">×</a></span>'+DvWnd.title;
   s+='</div>';
   s+='<div id="'+DvWnd.d.c+'" class="dvwndchild">';
   s+=1==DvWnd.type?('<iframe id="'+DvWnd.d.e+'" name="'+DvWnd.d.e+'" src="about:blank" style="width:100%;height:'+(DvWnd.height-40)+'px;" frameborder="0" hspace="0"></iframe>'):('<div style="padding:10px;">'+DvWnd.para+'</div>');
   s+='</div>';
   o.innerHTML=s;
   dc.body.appendChild(o);
   o=dc.createElement("div");
   o.id=DvWnd.d.g;
   o.className='dvwndcanvas';
   o.style.height=(sh>ch?sh:ch)+'px';
   o.style.width=w+'px';
   s=DvWnd.canvas;
   o.style.backgroundColor=s.bgc;
   o.style.filter='alpha(opacity='+(s.opa*100)+')';
   o.style.display='block';
   o.onclick=function(){DvWnd.onfocus()};
   dc.body.appendChild(o);
   if(1==DvWnd.type){DvWnd.$(DvWnd.d.e).src=DvWnd.para;}
}
}
