﻿/*
Version:	VDCS Common & Instantiation Library 1.1.0.0705
*/

var VDCS=new Object();
var dcs=new Object();

dcs.version=new Object();
dcs.version.bulid="1.1.0";


function put(s) { document.write(s); }
function isNull(s) { return (s==null) ? true : false; }
function isEmpty(s) { return (s==null || s=="") ? true : false; }
function isArray(o) { var re=false; if (iso(o)) { try { if (o.length>-1) re=true; } catch(e) { } } return re; }
function isObject(s) { return (typeof(s)=="object" && s) ? true : false; }
function iso(s) { return (typeof(s)=="object" && s) ? true : false; }
function getType(s) { return typeof(s).toString(); }

String.prototype.trim=function() { return this.replace(/(^\s*)|(\s*$)/g,""); }	///^\s+/	/\s+$/
function toTrim(s) { return typeof(s)=="string"?s.trim():s; }
function toLength(s) { return s.replace(/[^\x00-\xff]/g,"aa").length; }
function toReplace(s,s1,s2) { return s.replace(s1,s2); }
function toDisp(s,s1,s2) { return s.replace("{$"+s1+"}",s2); }

function isInte(s) { return /^[0-9]*[1-9][0-9]*$/.exec(s)?true:false; }		//判断是否是正整数
function isInt(s) { return (parseInt(s)==s); }
function isNum(s) { return (parseFloat(s)==s); }

function toInt(s) { return isInt(s)?parseInt(s):0; }
function toNum(s) { return isNum(s,1)?parseFloat(s):0; }

function inStr(s) { return s.indexOf(s); }
function inPart(s,sVar,sSymbol) { if (isEmpty(sSymbol)) sSymbol=","; return (sSymbol+s.toString()+sSymbol).indexOf(sSymbol+sVar.toString()+sSymbol)+1; }

function $(s) { return dcs.browser.getElementById(s); }

Array.prototype.del=function(n) { if(n<0) return this; return this.slice(0,n).concat(this.slice(n+1,this.length)); }


dcs.config=new Object();
dcs.config._data=new Array();
dcs.config._data=new Array();
dcs.config._data["dir"]				= "/";
dcs.config._data["url"]				= "/";
dcs.config._data["dir.common"]			= "common/";
dcs.config._data["dir.common.smiley"]		= "images/smiley/";
dcs.config._data["dir.common.script"]		= "common/script/";
dcs.config._data["dir.common.editor"]		= "common/script/editor/";
dcs.config._data["dir.account"]			= "account/";
dcs.config._data["dir.passport"]		= "passport/";
dcs.config._data["dir.images"]			= "images/";
dcs.config._data["dir.upload"]			= "upload/";
dcs.config._data["dir.xml"]			= "xml/";
dcs.config._data["dir.acout"]			= "acout/";
dcs.config._data["dir.support"]			= "support/";
dcs.config._data["dir.skin.base"]		= "skin/";
dcs.config._data["dir.skin"]			= "skin/default/";

dcs.config.getValue=function(k) { return this._data[k]; }
dcs.config.setValue=function(k,v) { this._data[k]=v; }

dcs.config.setPath=function(sDir,sURL,sSkin)
{
	if (!isEmpty(sDir)) this._data["dir"]=sDir;
	if (!isEmpty(sURL)) this._data["url"]=sURL;
	if (!isEmpty(sSkin)) this._data["dir.skin"]=(sSkin=="_base") ? this._data["dir.skin.base"] : sSkin;
}
dcs.config.setDir=function(k,v) { this._data["dir."+k]=v; }
dcs.config.getDir=function(k) { return this._data["dir."+k]; }
dcs.config.setFile=function(k,v) { this._data["url.file."+k]=v; }
dcs.config.getURL=function(k,sFile)
{
	var re="";
	var tmpBase=this._data["url"];
	if (isEmpty(k)) { re=tmpBase; } else { re=this._data["dir."+k]; if (re.substring(0,1)!="/" && re.indexOf("://")==-1) re=tmpBase+re; }
	if (!isEmpty(sFile)) re+=this._data["url.file."+sFile];
	return re;
}




//########################################
//########################################
dcs.browser=new Object();
dcs.browser.userAgent		= navigator.userAgent.toLowerCase();
dcs.browser.appVersion		= navigator.appVersion;

dcs.browser.doInit=function()
{
	this.isIE=(this.userAgent.indexOf("msie")!=-1); this.isIE5=false; this.isGecko=false; this.isFirefox=false; this.isOpera=false;
	if (this.isIE)
	{
		this.MajorVer=this.appVersion.match(/MSIE (.)/)[1]; this.MinorVer=this.appVersion.match(/MSIE .\.(.)/)[1];
		this.isIE5=(this.MajorVer>5 || this.MinorVer>=5); this.type=(this.isIE5)?"ie5":"ie"; this.typeName="ie";
	}
	else
	{
		this.isGecko=true; this.type="gecko"; this.typeName="gecko";
		this.MajorVer=0; this.MinorVer=0;
		this.isFirefox=(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);
		this.isOpera=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
	}
}
dcs.browser.doInit();

dcs.browser.getType=function() { return this.type; }
dcs.browser.getTypeName=function() { return this.typeName; }

dcs.browser.getObject=function(s) { return this.getElementById(s); }
dcs.browser.getElementById=function(s) { return (this.isIE5 || this.isFirefox) ? document.getElementById(s) : document.all(s); }
dcs.browser.getElementsByName=function(s) { return (this.isIE5 || this.isFirefox) ? document.getElementsByName(s) : document.all(s); }

dcs.browser.doRefresh=function() { return window.document.location.reload(); }
dcs.browser.goBack=function() { return history.back(); }

dcs.browser.getDomain=function() { return window.document.domain; }
dcs.browser.getURLs=function() { return window.document.URL; }
dcs.browser.getTitle=function() { return window.document.title; }
dcs.browser.getReferer=function() { return window.document.referrer; }

dcs.browser.xmlHttp=null;
dcs.browser.getXMLHttpObject=function()
{
	if (this.xmlHttp==null)
	{
		if (window.ActiveXObject)						// IE
		{
			var tmpAry=new Array("Microsoft.XMLHTTP","Msxml2.XMLHTTP","Msxml.XMLHTTP");
			for (var i=0;i<tmpAry.length;i++) { try { this.xmlHttp=new ActiveXObject(tmpAry[i]); } catch(e) { this.xmlHttp=null; } if (this.xmlHttp!=null) break; }
		}
		else if(window.XMLHttpRequest) { this.xmlHttp=new XMLHttpRequest(); }	// Firefox, Opera, Safari, ...
	}
	return this.xmlHttp;
}




//########################################
//########################################
dcs.init=new Object();
dcs.init._Queues=new Array();

dcs.init.isRes=function(s) { return isEmpty(this._Queues[s]); }

dcs.init.loadResource=function(sName,s,sData,sFunc,t)
{
	if (!isEmpty(sName) && !isInt(t) && t<1)
	{
		if (!isEmpty(this._Queues[sName])) { if (!isEmpty(sFunc)) eval(sFunc+(sFunc.indexOf(")")>0?"":"()")); return true; }
		this._Queues[sName]=new Date().getTime();
	}
	var _xmlHttp=dcs.browser.getXMLHttpObject();
	if (!isEmpty(sFunc))
	{
		_xmlHttp.open((isEmpty(sData)?"GET":"POST"),s,!dcs.browser.isIE);
		_xmlHttp.onreadystatechange=function(){ dcs.init.loadResourceReadyFunc(_xmlHttp,sFunc,t); };
		_xmlHttp.send((isEmpty(sData)?null:sData));
	}
	else { try { _xmlHttp.open("GET",s,false); _xmlHttp.send(null); if(_xmlHttp.readyState==4 && (_xmlHttp.status==200 || _xmlHttp.status==0)) { eval(_xmlHttp.responseText); return true; } } catch(e) {  } }
}

dcs.init.loadResourceReadyFunc=function(_xmlHttp,sFunc,t) { if(_xmlHttp.readyState==4 && (_xmlHttp.status==200 || _xmlHttp.status==0)) { if (t==1 || t==2 || t==3) { eval((sFunc.indexOf(")")>0?sFunc.substring(0,sFunc.length-2):sFunc)+"(t==3?_xmlHttp.responseXML:(t==2?_xmlHttp.responseXML.xml:_xmlHttp.responseText))"); } else { eval(_xmlHttp.responseText); eval(sFunc+(sFunc.indexOf(")")>0?"":"()")); } } }

dcs.init.loadRes=function(s,sFunc,t) { this.loadResource("loadRes:resource/VDCS.lib."+s+".js",dcs.config.getURL("common.script")+"resource/VDCS.res."+s+".js",null,sFunc,t); }
dcs.init.loadUtil=function(s,sFunc,t) { this.loadResource("loadUtil:resource/VDCS.util."+s+".js",dcs.config.getURL("common.script")+"resource/VDCS.util."+s+".js",null,sFunc,t); }
dcs.init.loadLib=function(s,sFunc,t) { this.loadResource("loadLib:resource/VDCS.lib."+s+".js",dcs.config.getURL("common.script")+"resource/VDCS.lib."+s+".js",null,sFunc,t); }

dcs.init.loadURL=function(s,sData,sFunc,t)
{
	var tmpURL=s;
	if (tmpURL.indexOf("://")>0) tmpURL=dcs.config.getURL("common","url.proxy")+"?url="+encodeURI(s)+"&contenttype="+((t==2 || t==3)?"xml":"js");
	this.loadResource("loadURL:"+s,tmpURL,sData,sFunc,t);
}

dcs.init.loadStyle=function() { if (dcs.browser.isIE) put("<link rel=\"stylesheet\" rev=\"stylesheet\" type=\"text/css\" href=\""+dcs.config.getURL("common.script")+"resource/browse.ie.css"+"\" charset=\"utf-8\" />"); }




//########################################
//########################################
dcs.common=new Object();
dcs.common.NEWLINE			= "";
dcs.common.VALUE_UNKNOWN		= "[unknown]";
dcs.common.VALUE_EMPTY_REPLACER		= "NaN";
dcs.common.VALUE_EMPTY_REPLACERS	= "<font class=\"gray\">NaN</font>";

dcs.common.toReplace=function(s,s1,s2) { return s.replace(s1,s2); }
dcs.common.toDisp=function(s,s1,s2) { return s.replace("{$"+s1+"}",s2); }

dcs.common.isNumber=function(s,t,v)
{
	var sSafe=(t==1)?"0123456789.":"0123456789";
	var tmpAry=new Array(1);
	if (v==null || v=="") { tmpAry[0]=false; tmpAry[1]=true; } else { tmpAry[0]=0; tmpAry[1]=s; }
	if (s==null || s=="") return tmpAry[0];
	for (var i=0;i<s.length;i++) { if (sSafe.indexOf(s.charAt(i))==-1) return tmpAry[0]; }
	return tmpAry[1];
}




//########################################
//########################################
dcs.list=new Object();
dcs.list.is=function(o) { return o && o.del; }
dcs.list.isKey=function(k) { return typeof(k)=="string"; }
dcs.list.getNew=function() { return new Array(); }

dcs.list.toString=function(o,p1,p2) { if (!p1) p1=";"; if (!p2) p2="="; var re=""; if (this.is(o)) { for (var k in o) { if (this.isKey(o[k])) re+=p1+k+p2+o[k]; } if (re) re=re.substring(p1.length); } return re; }
dcs.list.byString=function(s,p1,p2) { if (!p1) p1=";"; if (!p2) p2="="; var reAry=new Array(),tmpAry,tmpArys=s.split(p1); for (var i=0;i<tmpArys.length;i++) { tmpAry=tmpArys[i].split(p2); if (tmpAry.length==2 && toTrim(tmpAry[0])!="") reAry[toTrim(tmpAry[0])]=toTrim(tmpAry[1]); } return reAry; }

dcs.list.toAppend=function(o,oAppend)
{
	if (!this.is(o)) o=this.getNew();
	if (this.is(oAppend)) { for(var k in oAppend) { if (this.isKey(oAppend[k])) o[k]=oAppend[k]; } }
	return o;
}




//########################################
//########################################
dcs.form=new Object();

dcs.form.getObject=function(s,t)
{
	var o,reo=null;
	switch (t) {
		case "parent":		o=this.getElement(s); if (iso(o)) reo=dcs.browser.isIE ? o.parentElement : o.parentNode; break;
	}
	return reo;
}

dcs.form.getElement=function(s,t)
{
	if (t==1) { dcs.init.loadLib("form"); return dcs.form.getElements(s); }
	var reo=null;
	try {
		if (!isEmpty(s)) {
			var tmpTarget="";
			if (s.indexOf(":")!=-1) { tmpTarget=s.substring(0,s.indexOf(":")); s=s.substring(s.indexOf(":")+1); }
			var tmpForm;
			if (tmpTarget=="parent") { if (s.indexOf(".")==-1) { reo=window.parent.document.getElementById(s); } else { if (iso(tmpForm=window.parent.document.forms[s.substring(0,s.indexOf("."))])) reo=tmpForm.elements[s.substring(s.indexOf(".")+1)]; } }
			else if (tmpTarget!="") { }
			else { if (s.indexOf(".")==-1) { reo=document.getElementById(s); } else { if (iso(tmpForm=document.forms[s.substring(0,s.indexOf("."))])) reo=tmpForm.elements[s.substring(s.indexOf(".")+1)]; } }
		}
	} catch(e) {  }
	return reo;
}

dcs.form.getValue=function(o)
{
	var re="";
	if (!iso(o)) o=this.getElement(o);
	if (iso(o))
	{
		var tmpType=o.type; if (isEmpty(tmpType)) tmpType="";
		if (o.length || inPart("radio,checkbox",tmpType)>0) {
			if (o.length) {
				for(var i=0;i<o.length;i++) {
					if (isEmpty(tmpType)) tmpType=o[i].type;
					switch (tmpType){
						case "radio":		if (o[i].checked) { re=o[i].value; } break;
						case "checkbox":	if (o[i].checked) { re+=","+o[i].value; } break;
					}
				}
				if (tmpType=="checkbox" && !isEmpty(re)) re=re.substring(2);
			} else {
				switch (tmpType) {
					case "radio":		if (o.checked) { re=o.value; } break;
					case "checkbox":	if (o.checked) { re=o.value; } break;
				}
			}
		}
		else { re=o.value; }
	}
	return re;
}

dcs.form.setValue=function(o,v,sMode)
{
	if (!iso(o)) o=this.getElement(o);
	if (iso(o))
	{
		if (isEmpty(v)) v="";
		if (o.length) {
			var tmpType="";
			for(var i=0;i<o.length;i++) {
				if (isEmpty(tmpType)) tmpType=o[i].type;
				switch (tmpType) {
					case "radio":		if (inPart(v,o[i].value)>0 || sMode==("__no"+(i+1))) { o[i].checked=true; } break;
					case "checkbox":	if (inPart(v,o[i].value)>0 || sMode=="__all__") { o[i].checked=true; } break;
				}
			}
		}
		else { if (sMode=="append") o.value+=v; else o.value=v; }
	}
}

dcs.form.doSubmit=function(o) { if (!iso(o)) o=$(o); if (!iso(o)) o=document.forms[o]; if (iso(o)) o.submit(); }
dcs.form.doSubmitOnce=function(o) { if (!iso(o)) o=$(o); if (!iso(o)) o=document.forms[o]; if (iso(o)) { if (o._smt) o._smt.disabled=true; if (o._sbt) o._sbt.disabled=true; if (o._rst) o._rst.disabled=true; } }
dcs.form.doSubmitQuick=function(o,oEvent) { if (!oEvent) oEvent=event; if ((oEvent.keyCode==13 && oEvent.ctrlKey) || (oEvent.keyCode==83 && oEvent.altKey)) { this.doSubmitOnce(o); this.doSubmit(o); } }

dcs.form.toConvertInput=function(s,sName)
{
	if (isEmpty(sName)) sName=this.SELECT_INPUT_NAME;
	var re="";
	var tmpAry=s.split(",");
	for (var i=0;i<tmpAry.length;i++) { re+="<input type=\"hidden\" name=\""+sName+"\" value=\""+tmpAry[i]+"\">"; }
	return re;
}




//########################################
//########################################
dcs.pages=new Object();

dcs.pages.go=function(s) { document.location.href=s; }

dcs.pages.isClickReturn=function(s,t)
{
	var re="";
	switch (t)
	{
		case 1:		re="您确定"+s+"吗？"; break;
		case 2:		re="您确定要"+s+"吗？\n\n执行该操作后将不可恢复！"; break;
		default :	re=s; break;
	}
	return window.confirm(re);
}

dcs.pages.isInputInt=function(s) { var kc=event.keyCode; return ((kc>=48 && kc<=57) || (s==1 && !re && kc==46)) ? true : false; }	//onKeyPress="event.returnValue=dcs.pages.isInputInt(0);"

dcs.pages.doBlockSwitch=function(o,sImg)
{
	var s=o; if (!iso(o)) o=$(o);
	if (o)
	{
		var tmpStatus=o.style.display; o.style.display=(tmpStatus=="none"?"":"none");
		if (isEmpty(sImg) && !iso(s)) sImg=s+"_icon";
		if (!isEmpty(sImg)) { var oImg=$(sImg); if (oImg) oImg.src=oImg.src.replace((tmpStatus=="none"?"open":"close"),(tmpStatus=="none"?"close":"open")); }
	}
	return false;
}




//########################################
//########################################
dcs.window=new Object();
dcs.window._QueuesOnLoad=new Array();

dcs.window.doTimeout=function(s,ss) { window.setTimeout(s,ss*1000); }
dcs.window.addTimeout=function(s,ss) { window.setTimeout(s,ss*1000); }

dcs.window.addOnLoad=function(s) { this._QueuesOnLoad[this._QueuesOnLoad.length]=s; }
dcs.window.doOnLoad=function() { for (var i=0;i<this._QueuesOnLoad.length;i++) { eval(this._QueuesOnLoad[i]); } }

dcs.window.getClipBoardData=function(t) { return (window.clipboardData) ? window.clipboardData.getData(isEmpty(t)?"text":t) : ""; }
dcs.window.setClipBoardData=function(s) { if (window.clipboardData) window.clipboardData.setData(s); }
dcs.window.doClipBoardClear=function() { if (window.clipboardData) window.clipboardData.clearData(); }

dcs.window.addFavorite=function(s,sURL) { if (dcs.browser.isIE) window.external.addFavorite(sURL,s); else alert("请按快捷键 \"Ctrl+D\" 添加收藏！"); }

dcs.window.doOpen=function(sURL,sName,sWidth,sHeight,sScroll,sContent) { var _Left=(screen.width)?(screen.width-sWidth)/2:0,_Top=(screen.height)?(screen.Height-sHeight)/2:0; var o=window.open(sURL,sName,"width="+sWidth+",height="+sHeight+",left="+_Left+",top="+_Top+",toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars="+sScroll+",resizable=no"); if (!isEmpty(sContent)) { o.document.write(sContent); /*o.document.close();*/ } return o; }

window.onload=function() { dcs.window.doOnLoad(); }
//window.onerror=function(a,b,c){ return true; }




//########################################
//########################################
dcs.q=new Object();

dcs.q.hide=function(o) { if (!iso(o)) o=$(o); if (o) o.style.display="none"; }
dcs.q.show=function(o,v) { if (!iso(o)) o=$(o); if (o) o.style.display=(v?v:""); }

dcs.q.html=function(o,v,t) { if (!iso(o)) o=$(o); if (o) { if (v==undefined) return o.innerHTML; else (t=="append") ? o.innerHTML+=v : o.innerHTML=v; } }

dcs.q.cssStyle=function(o,v,t) { if (!iso(o)) o=$(o); if (o) { if (v==undefined) return o.style.cssText; else { var oList=dcs.list.byString(o.style.cssText,";",":"); if (t=="reset") oList=dcs.list.getNew(); o.style.cssText=dcs.list.toString(dcs.list.toAppend(oList,dcs.list.byString(v,";",":")),";",":"); } } }
dcs.q.cssClass=function(o,v,t) { if (!iso(o)) o=$(o); if (o) { if (v==undefined) return o.className; else { if (t=="append") v=(o.className?o.className+" ":"")+v; o.className=v; } } }



/*
Version:	VDCS Compatible Library 1.0
*/


dcs.form.doOnceSubmit=function(o) { this.doSubmitOnce(o); }
dcs.form.doQuickSubmit=function(o,oEvent) { this.doSubmitQuick(o,oEvent); }


dcs.pages.doGo=function(s) { this.go(s); }

/*
this.isNS=false;
this.isNS=this.userAgent.indexOf("netscape")!=-1; if(this.isNS) this.type="ns";
dcs.browser.getElementById=function(s) { return (this.isNS) ? document.layers[s] : ((this.isIE5 || this.isFirefox) ? document.getElementById(s) : document.all(s)); }
dcs.browser.getElementsByName=function(s) { return (this.isNS) ? document.layers[s] : ((this.isIE5 || this.isFirefox) ? document.getElementsByName(s) : document.all(s)); }
*/






//########################################
//########################################
var dbg=new Object();

dbg.toString=function(o,l) { if (inPart("number,string,boolean",typeof(o))>0) return (l>0 && o.length>l) ? o.substr(0,l)+" ..." : o; else return "["+typeof(o)+"]"; }

dbg.obj=function(o,sMode,sRow)
{
	var _k,_v,_n=1,re="";
	if (isEmpty(sRow) || sRow==-1) sRow=20;
	try { for(_k in o) { if (_n>=sRow) { alert(re); re=""; _n=1; } if (sMode=="key") re+=_k+"\n"; else re+=_k+"="+(this.toString(o[_k],50))+"\n"; _n++; } if (re!="") { alert(re); re=""; } } catch(e) { dbg.e(e); }
}

dbg.objString=function(o,sMode,sRow)
{
	var _k,_v,_n=1,re="";
	if (isEmpty(sRow) || sRow==-1) sRow=20;
	try { for(_k in o) { if (sMode=="key") re+=_k+"\n"; else re+=_k+"="+(this.toString(o[_k],50))+"\n"; _n++; } } catch(e) { re=dbg.eString(e); }
	return re;
}

dbg.e=function(e) { alert(dbg.eString(e)); }

dbg.eString=function(e) { var re=""; for(var k in e) { re+=k+"="+e[k]+"\n"; } return re; }

function doTestObject(o,sMode,sRow) { dbg.obj(o,sMode,sRow); }


dbg.Tree=function(o) { if (isTree(o)) return toArrayString(o.getArray()); }
dbg.Table=function(o) { if (isTable(o)) return toArrayString(o.getArray()); }
dbg.List=function(o) { if (isArray(o)) return toArrayString(o); }
dbg.Array=function(o) { if (isArray(o)) return toArrayString(o); }

function toArrayString(strAry,strTitle)
{
	var re="";
	re="<table border=\"1\">";
	if (typeof(strAry[0])=="object")
	{
		var tmpCol=strAry[0].length,tmpRow=strAry.length,tmpAry,_r;
		if (!isEmpty(strTitle)) re+="<tr><td colspan=\""+(tmpCol+1)+"\">"+strTitle+"</td></tr>";
		re+="<tr><td colspan=\""+(tmpCol+1)+"\">Col="+tmpCol+", Row="+tmpRow+"</td></tr>";
		for (var _a=0;_a<strAry.length;_a++) { tmpAry=strAry[_a]; re+="<tr>"; re+="<td>"+(_a+1)+".</td>"; for (_r=0;_r<tmpAry.length;_r++) { re+="<td>"+tmpAry[_r]+"</td>"; } re+="</tr>"; }
	}
	else
	{
		if (!isEmpty(strTitle)) re+="<tr><td colspan=\"2\">"+strTitle+"</td></tr>";
		if (dcs.list.is(strAry))
		{
			var c=0;
			re+="<tr><td colspan=\"2\">Lnegth={$count}</td></tr>";
			for (var k in strAry) { if (typeof(strAry[k])=="string") { re+="<tr><td>"+k+".</td><td>"+strAry[k]+"</td></tr>"; c++; } }
			re=toDisp(re,"count",c);
		}
		else
		{
			re+="<tr><td colspan=\"2\">Lnegth="+strAry.length+"</td></tr>";
			for (var _a=0;_a<strAry.length;_a++) { re+="<tr><td>"+(_a+1)+".</td><td>"+strAry[_a]+"</td></tr>"; }
		}
	}
	re+="</table>";
	return re;
}



dcs.init._Queues["loadRes:resource/VDCS.lib.multibar.js"]="init load already.";
/* ************************************* */

VDCS.libMultiBar=function()
{
	this._config=new Array();
	this._queue=new Array();
	this._config["activate"]=null;
}

VDCS.libMultiBar.prototype.addItem=function(strKey,strBarID,strContentID,strClass,strClassOver)
{
	var n=this._queue.length;
	this._queue[n]=new Array();
	this._queue[n]["key"]=strKey;
	this._queue[n]["bar.id"]=strBarID;
	this._queue[n]["content.id"]=strContentID;
	this._queue[n]["bar.class"]=strClass;
	this._queue[n]["bar.class.over"]=strClassOver;
}

VDCS.libMultiBar.prototype.setActivate=function(strKey) { this._config["activate"]=strKey; }

VDCS.libMultiBar.prototype.doLoad=function()
{
	this.doClick(this._config["activate"]);
}

VDCS.libMultiBar.prototype.doClick=function(strKey)
{
	if (strKey!=null && this._config["activated"]==strKey) return false;
	var tmpAry,tmpKey,tmpObjectBar,tmpObjectContent;
	for (var q=0;q<this._queue.length;q++)
	{
		tmpAry=this._queue[q];
		tmpKey=tmpAry["key"];
		tmpObjectBar=$(tmpAry["bar.id"]);
		tmpObjectContent=$(tmpAry["content.id"]);
		if (tmpObjectBar && tmpObjectContent)
		{
			if ((isEmpty(strKey) && q==0) || strKey==tmpKey)
			{
				this._config["activated"]==tmpKey;
				if (tmpObjectBar.className!=tmpAry["bar.class.over"]) tmpObjectBar.className=tmpAry["bar.class.over"];
				if (tmpObjectContent.style.display!="") tmpObjectContent.style.display="";
			}
			else
			{
				if (tmpObjectBar.className!=tmpAry["bar.class"]) tmpObjectBar.className=tmpAry["bar.class"];
				if (tmpObjectContent.style.display!="none") tmpObjectContent.style.display="none";
			}
		}
	}
}




dcs.init._Queues["loadRes:resource/VDCS.lib.player.js"]="init load already.";
/* ************************************* */

VDCS.libPlayer=function()
{
	this._id="";
	this._url="";
	this._name="";
	this._type=""; 
	this._width=-1; 
	this._height=-1;
	this._html=""; 
	this._ScreenType=0;
	this._params=new Object();
}


VDCS.libPlayer.prototype.setID=function(strer) { this._id=strer; }
VDCS.libPlayer.prototype.setURL=function(strer) { this._url=strer; }
VDCS.libPlayer.prototype.setName=function(strer) { this._name=strer; }
VDCS.libPlayer.prototype.setType=function(strer) { if (strer=="rm") strer="real"; this._type=strer; }
VDCS.libPlayer.prototype.setSize=function(strWidth,strHeight) { this._width=strWidth; this._height=strHeight; }
VDCS.libPlayer.prototype.setScreenType=function(strer) { if (strer==1){ this._ScreenType=true; }else{ this._ScreenType=false; } }

VDCS.libPlayer.prototype.addParams=function(strKey,strValue) { this._params[strKey]=strValue; }

VDCS.libPlayer.prototype.getHTML=function() { return this._html; }

VDCS.libPlayer.prototype.doParse=function()
{
	switch (this._type)
	{
		case "wmp":
			this._html=this.toWMP();
			break; 
		case "real":
			this._html=this.toReal();
			break;
		case "flash":
			this._html=this.toFlash();
			break; 
	}
}

VDCS.libPlayer.prototype.toWMP=function()
{
	var re="";
	re+="<object id=\""+this._id+"\" name=\""+this._id+"\" width="+this._width+" height="+this._height+" classid=\"CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6\" type=\"application/x-oleobject\" standby=\"正在载入 Windows Media Player 播放流 ...\">";
	re+="<param name=\"URL\" value=\""+this._url+"\">";
	re+="<param name=\"Album\" value=\"\"/>";
	re+="<param name=\"rate\" value=\"1\">";
	re+="<param name=\"balance\" value=\"0\">";
	re+="<param name=\"currentPosition\" value=\"0\">";
	re+="<param name=\"defaultFrame\" value=\"\">";
	re+="<param name=\"playCount\" value=\"100\">";
	re+="<param name=\"autoStart\" value=\"-1\">";
	re+="<param name=\"currentMarker\" value=\"0\">";
	re+="<param name=\"invokeURLs\" value=\"-1\">";
	re+="<param name=\"baseURL\" value=\"\">";
	re+="<param name=\"volume\" value=\"100\">";
	re+="<param name=\"mute\" value=\"0\">";
	re+="<param name=\"uiMode\" value=\"full\">";
	re+="<param name=\"stretchToFit\" value=\"0\">";
	re+="<param name=\"windowlessVideo\" value=\"0\">";
	re+="<param name=\"enabled\" value=\"-1\">";
	re+="<param name=\"enableContextMenu\" value=\"0\">";
	re+="<param name=\"fullScreen\" value=\"0\">";
	re+="<param name=\"SAMIStyle\" value=\"\">";
	re+="<param name=\"SAMILang\" value=\"\">";
	re+="<param name=\"SAMIFilename\" value=\"\">";
	re+="<param name=\"captioningID\" value=\"\">";
	re+="</object>";
	return re;
}

VDCS.libPlayer.prototype.toReal=function()
{
	var _control_height=60;
	var re="";
	re+="<object id=\""+this._id+"\" name=\""+this._id+"\" width=\""+this._width+"\" height=\""+this._height+"\" classid=\"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa\">";
	re+="<param name=\"src\" value=\""+this._url+"\">";
	re+="<param name=\"console\" value=\""+this._id+"_clip1\">";
	re+="<param name=\"controls\" value=\"imagewindow\">";
	re+="<param name=\"autostart\" value=\"true\">";
	re+="<embed type=\"audio/x-pn-realaudio-plugin\" console=\""+this._id+"_clip\" controls=\"ImageWindow\" width=470 height=350></embed>";
	re+="</object>";
	re+="<object id=\""+this._id+"_control\" name=\""+this._id+"_control\" width=\""+this._width+"\" height=\""+_control_height+"\" classid=\"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa\">";
	re+="<param name=\"src\" value=\""+this._url+"\">";
	re+="<param name=\"console\" value=\""+this._id+"_clip1\">";
	re+="<param name=\"controls\" value=\"ControlPanel,StatusBar\">";
	re+="<param name=\"autostart\" value=\"-1\">";
	re+="<param name=\"shuffle\" value=\"0\">";
	re+="<param name=\"prefetch\" value=\"0\">";
	re+="<param name=\"nolabels\" value=\"0\">";
	re+="<param name=\"loop\" value=\"0\">";
	re+="<param name=\"numloop\" value=\"0\">";
	re+="<param name=\"center\" value=\"0\">";
	re+="<param name=\"maintainaspect\" value=\"0\"> ";
	re+="<embed type=\"audio/x-pn-realaudio-plugin\" console=\""+this._id+"_clip\" controls=\"ControlPanel,StatusBar\" width=470 height=60></embed>";
	re+="</object>"; 
	return re;
}

VDCS.libPlayer.prototype.toFlash=function()
{
	var re="";
	if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length)	// netscape plugin architecture
	{
		re = "<embed type=\"application/x-shockwave-flash\" id=\""+this._id+"\" name=\""+this._id+"\" width=\""+this._width+"\" height=\""+this._height+"\" src=\""+this._url+"\"";
		for(var key in this._params) { re += [key] +"=\""+ this._params[key] +"\" "; }
		re += "/>";
	}
	else	// PC IE
	{ 
		re = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=\""+this._id+"\" name=\""+this._id+"\" width=\""+this._width+"\" height=\""+this._height+"\">";
		re += "<param name=\"movie\" value=\""+this._url+"\" />";
		for(var key in this._params) { re += "<param name=\""+ key +"\" value=\""+ this._params[key] +"\">"; }
		re += "</object>";
	}
	return re;
}


VDCS.libPlayer.prototype.getTimes=function(strer)
{
	var tmpObject=$((isEmpty(strer) ? this._id : strer));
	var re=-1;
	switch (this._type)
	{
		case "wmp":
			re=parseInt(tmpObject.Duration*1000);
			break; 
		case "real":
			re=parseInt(tmpObject.GetLength());
			break;
	}
	return re;
}

VDCS.libPlayer.prototype.getTimeCurrent=function(strer)
{
	var tmpObject=$((isEmpty(strer) ? this._id : strer));
	var re=-1;
	switch (this._type)
	{
		case "wmp":
			re=parseInt(tmpObject.CurrentPosition*1000);
			break; 
		case "real":
			re=parseInt(tmpObject.GetLength());
			break;
	}
	return re;
}

VDCS.libPlayer.prototype.getTimeAry=function(strer)
{
	var re=new Array();
	re[1]=0; re[2]=0; re[3]=0; re[4]=0;
	var tmpTimes=this.getTimes(strer);
	var tmpSeconds=parseInt(tmpTimes/1000);
	re[4]=tmpTimes-tmpSeconds*1000;
	var tmpNum=tmpSeconds;
	re[3]=tmpNum;
	if (tmpNum>60)
	{
		tmpNum=parseInt(tmpNum/60);
		re[2]=tmpNum;
		re[3]=tmpSeconds-tmpNum*60;
	}
	if (tmpNum>60)
	{
		tmpNum=parseInt(tmpNum/60);
		re[1]=tmpNum;
		re[2]=re[2]-tmpNum*60;
	}
	return re;
}


/*
dcs.play=new Object();

dcs.play.doFullScreen=function(strer)
{
	var g_Browser = navigator.appName;
	var wmp_state="1";
	if (g_Browser == "Netscape")
	{ wmp_state = document.strer.GetPlayState(); }
	else
	{ wmp_state = document.strer.PlayState; }
	if(wmp_state!="3")
	{ alert("影片还未开始播放或已结束，无法切换为全屏模式！\n\n请在影片播放时使用 “全屏播放” 功能。") }
	else
	{ document.strer.fullScreen=1; }
}
*/







dcs.init._Queues["loadRes:resource/VDCS.res.box.js"]="init load already.";
/* ************************************* */

dcs.box=new Object();

dcs.box.doDelayShow=function(strObject,strSpace) { dcs.window.addTimeout("dcs.box.doDelayShowProcess('"+strObject+"')",strSpace); }
dcs.box.doDelayShowProcess=function(strObject)
{
	var tmpObject=$(strObject);
	if (tmpObject) tmpObject.style.display="";
}



dcs.xbox=new Object();
dcs.xbox.doCreate=function(strDivID,strTitle,strBody,strImgURL)
{
	var tmpClass="xBox";
	if (strDivID.indexOf(":")>0)
	{
		tmpClass=strDivID.substring(strDivID.indexOf(":")+1);
		strDivID=strDivID.substring(0,strDivID.indexOf(":"));
	}
	var tmpObject=$(strDivID);
	if (tmpObject)
	{
		tmpObject.style.display=(tmpObject.style.display=="none") ? "" : "none";
		return false;
	}
	var tmpDiv=document.createElement("div"); tmpDiv.id=strDivID; tmpDiv.className=tmpClass;
	var tmpDivTitle=document.createElement("div"); tmpDivTitle.id=strDivID+"__title"; tmpDivTitle.className="self__title";
	tmpDiv.appendChild(tmpDivTitle);
	this.doDrag(tmpDivTitle);
	var tmpSpan=document.createElement("span"); tmpSpan.className="self__windowtitle";
	tmpDivTitle.appendChild(tmpSpan);
	var tmpText=document.createTextNode(strTitle);
	tmpSpan.appendChild(tmpText);
	var tmpImg=document.createElement("img"); tmpImg.src=strImgURL; tmpImg.className="self__closeimg hand"; tmpImg.alt=tmpImg.title="点击关闭"; tmpImg.onclick=function() { doLayerHide(strDivID); };
	tmpDivTitle.appendChild(tmpImg);
	var tmpDivBody=document.createElement("div");
	tmpDivBody.id=strDivID+"__body"; tmpDivBody.className="self__body";
	if (strBody) tmpDivBody.innerHTML=(strBody.substring(0,4)=="div:") ? $(strBody.substring(4)).innerHTML : strBody;
	tmpDiv.appendChild(tmpDivBody);
	document.body.appendChild(tmpDiv);
}

dcs.xbox.doDrag=function(o)
{
	o.onmousedown=function(a)
	{
		var op=o.parentNode;
		var d=document;
		if(!a) a=window.event;
		var x=a.layerX ? a.layerX : a.offsetX,y=a.layerY ? a.layerY : a.offsetY;
		if(op.setCapture) op.setCapture();
		else if(window.captureEvents) window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);
		d.onmousemove=function(a)
		{
			if(!a)a=window.event;
			if(!a.pageX)a.pageX=a.clientX;
			if(!a.pageY)a.pageY=a.clientY;
			var tx=a.pageX-x,ty=a.pageY-y;
			op.style.left=tx;
			op.style.top=ty;
		};
		d.onmouseup=function()
		{
			if(op.releaseCapture) op.releaseCapture();
			else if(window.captureEvents) window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);
			d.onmousemove=null;
			d.onmouseup=null;
		};
	};
}


/*
dcs.xbox.doDrags=()
{
	obj : null,
	
	init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
	{
		o.onmousedown	= Drag.start;
		var op=o.parentNode;
		
		o.hmode	= bSwapHorzRef ? false : true ;
		o.vmode	= bSwapVertRef ? false : true ;
		
		o.root=oRoot && oRoot != null ? oRoot : op ;
		
		if (o.hmode  && isNaN(parseInt(o.root.style.left  ))) o.root.style.left  =window.screen.width/2 - 100+"px";
		if (o.vmode  && isNaN(parseInt(o.root.style.top   ))) o.root.style.top   =(document.body.scrollHeight-31)/2 - 100+"px";
		if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right ="0px";
		if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom="0px";
		
		o.minX	= typeof minX != 'undefined' ? minX : null;
		o.minY	= typeof minY != 'undefined' ? minY : null;
		o.maxX	= typeof maxX != 'undefined' ? maxX : null;
		o.maxY	= typeof maxY != 'undefined' ? maxY : null;
		
		o.xMapper=fXMapper ? fXMapper : null;
		o.yMapper=fYMapper ? fYMapper : null;
		
		o.root.onDragStart	= new Function();
		o.root.onDragEnd	= new Function();
		o.root.onDrag		= new Function();
	},
	
	start : function(e)
	{
		var o=Drag.obj=this;
		e=Drag.fixE(e);
		var y=parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
		var x=parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		o.root.onDragStart(x, y);
		
		o.lastMouseX	= e.clientX;
		o.lastMouseY	= e.clientY;
		
		if (op.hmode)
		{
			if (o.minX != null)	o.minMouseX	= e.clientX - x + o.minX;
			if (o.maxX != null)	o.maxMouseX	= o.minMouseX + o.maxX - o.minX;
		}
		else
		{
			if (o.minX != null) o.maxMouseX=-o.minX + e.clientX + x;
			if (o.maxX != null) o.minMouseX=-o.maxX + e.clientX + x;
		}
		
		if (o.vmode)
		{
			if (o.minY != null)	o.minMouseY	= e.clientY - y + o.minY;
			if (o.maxY != null)	o.maxMouseY	= o.minMouseY + o.maxY - o.minY;
		}
		else
		{
			if (o.minY != null) o.maxMouseY=-o.minY + e.clientY + y;
			if (o.maxY != null) o.minMouseY=-o.maxY + e.clientY + y;
		}
		
		document.onmousemove	= Drag.drag;
		document.onmouseup	= Drag.end;
		
		return false;
	},
	
	drag : function(e)
	{
		e=Drag.fixE(e);
		
		var o=Drag.obj;
		
		var ey	= e.clientY;
		var ex	= e.clientX;
		var y=parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
		var x=parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		var nx, ny;
		
		if (o.minX != null) ex=o.hmode ? Math.max(ex, op.minMouseX) : Math.min(ex, o.maxMouseX);
		if (o.maxX != null) ex=o.hmode ? Math.min(ex, op.maxMouseX) : Math.max(ex, o.minMouseX);
		if (o.minY != null) ey=o.vmode ? Math.max(ey, op.minMouseY) : Math.min(ey, o.maxMouseY);
		if (o.maxY != null) ey=o.vmode ? Math.min(ey, op.maxMouseY) : Math.max(ey, o.minMouseY);
		
		nx=x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
		ny=y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));
		
		if (o.xMapper)		nx=o.xMapper(y)
		else if (o.yMapper)	ny=o.yMapper(x)
		
		Drag.obj.root.style[o.hmode ? "left" : "right"]=nx + "px";
		Drag.obj.root.style[o.vmode ? "top" : "bottom"]=ny + "px";
		Drag.obj.lastMouseX	= ex;
		Drag.obj.lastMouseY	= ey;
		
		Drag.obj.root.onDrag(nx, ny);
		return false;
	},
	
	end : function()
	{
		document.onmousemove=null;
		document.onmouseup  =null;
		Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
		Drag.obj=null;
	},
	
	fixE : function(e)
	{
		if (typeof e == 'undefined') e=window.event;
		if (typeof e.layerX == 'undefined') e.layerX=e.offsetX;
		if (typeof e.layerY == 'undefined') e.layerY=e.offsetY;
		return e;
	}
};
*/


VDCS.libXBox=function()
{
}

VDCS.libXBox.prototype.doCreateWindow=function(strDivID,strDivTitleID,bdivid,imgsrc,text)
{
}




dcs.init._Queues["loadRes:resource/VDCS.res.browser.js"]="init load already.";
/* ************************************* */

dcs.browser.toAgent=function(strer,strHtml)
{
	var re,tmpstr,tmp1,tmp2;
	var tmpAry=strer.split(";");
	if (tmpAry.length<3) { re="unknown browser info."; }
	else
	{
		re=strHtml;
		if (isEmpty(re)) re="OS: {$os}, Browser: {$browser}";
		tmpstr=tmpAry[2];
		tmp1=tmpstr.length-1;
		tmp2=tmpstr.substr(tmp1,1);
		if (tmp2==")") { tmpstr=tmpstr.substr(1,tmp1-1); }
		var tmpOS=tmpstr;
		var tmpBrowser=tmpAry[1];
		tmpOS=tmpOS.replace("NT 5.0","2000");
		tmpOS=tmpOS.replace("NT 5.1","XP");
		tmpOS=tmpOS.replace("NT 5.2","2003");
		tmpBrowser=tmpBrowser.replace("MSIE","Internet Explorer");
		re=toDisp(re,"os",tmpOS);
		re=toDisp(re,"browser",tmpBrowser);
	}
	return re;
}




dcs.init._Queues["loadRes:resource/VDCS.res.codes.js"]="init load already.";
/* ************************************* */

//########################################
//########################################
dcs.codes=new Object();
dcs.code=dcs.codes;

dcs.codes.toCuted=function(strer,strlen,strsymbol) { return dcs.code.toCuted(strer,strlen,strsymbol); }
dcs.codes.toCuted=function(strer,strlen,strsymbol)
{
	var re="";
	if (strsymbol==null) strsymbol="..";
	var tc=0,cc=0,c_mod=2,tt;
	for (ci=1;ci<=strer.length;ci++)
	{
		//if (strlen<0) { re+=strsymbol; break; }
		tt=strer.charCodeAt(ci-1);
		if (tt>696 || tt<0)
		{
			strlen-=1;
			if (strlen<0) { re+=strsymbol; break; }
			re+=strer.substring(ci-1,ci);
		}
		else
		{
			cc+=1;
			if (cc>c_mod && c_mod>0) { tc+=1; cc=0; }
			tc+=1;
			if (tc>1)
			{
				tc=0;
				strlen-=1;
				if (strlen<0) { re+=strsymbol; break; }
			}
			re+=strer.substring(ci-1,ci);
		}
	}
	return re;
}

dcs.codes.toHTML=function(strer,strtype)
{
	var re=strer;
	//re=replace(re," ","&nbsp;")
	//re=replace(re,"&","&amp;")
	re=toReplace(strer,"<","&lt;");
	re=toReplace(strer,">","&gt;");
	//re=toReplace(re,chr(10),"<br>");					'换行
	//re=toReplace(re,chr(12),"");						'回车
	/*
	switch (strtype)
	{
		case 1:
			re=toReplace(re,CHR(9)," ")				'制表符
			re=toReplace(re,CHR(10),"")				'换行
			re=toReplace(re,CHR(13),"")				'回车
		case 2:
			re=toReplace(re,CHR(9),"&nbsp; &nbsp; &nbsp; &nbsp; ")
			re=toReplace(re,CHR(10),"<br>"&vbcrlf)			'换行
			re=toReplace(re,CHR(13),"")				'回车
	}
	*/
	return re;
}

dcs.codes.toTemplate=function(strer,strTemplate,strKey)
{
	if (isEmpty(strKey)) strKey='tpl';
	if (isEmpty(strTemplate)) strTemplate='{$'+strKey+'}';
	return toDisp(strTemplate,strKey,strer);
}

dcs.codes.toFormatNumber=function(srcStr,nAfterDot)
{
	var re="";
	var srcStr=""+srcStr+"";
	var strLen=srcStr.length;
	var dotPos=srcStr.indexOf(".",0);
	if (dotPos==-1)
	{
		re=srcStr+".";
		for (i=0;i<nAfterDot;i++) { re=re+"0"; }
	}
	else
	{
		if ((strLen-dotPos-1)>=nAfterDot)
		{
			nAfter=dotPos+nAfterDot+1;
			var tmpTen=1;
			for(j=0;j<nAfterDot;j++) { tmpTen=tmpTen*10; }
			re=Math.round(parseFloat(srcStr)*tmpTen)/tmpTen;
		}
		else
		{
			re=srcStr;
			for (i=0;i<(nAfterDot-strLen+dotPos+1);i++) { re=re+"0"; }
		}
	}
	return re;
}

dcs.codes.toPrice=function(strPrice) { return this.toFormatNumber((isNum(strPrice) ? strPrice : ""),2); }

dcs.codes.getRandNum=function(strnum)
{
	var dd=new Date();
	var ms=dd.getMilliseconds();
	if (ms<1) ms=1;
	for(i=1;i<3;i++)
	{
		if (ms<=strnum) break;
		ms=Math.floor(ms/2);
		i-=1;
	}
	return(ms);
}




dcs.init._Queues["loadRes:resource/VDCS.res.cookies.js"]="init load already.";
/* ************************************* */

dcs.cookies=new Object();

dcs.cookies.setValue=function(strName,strValue,strExpire)
{
	var tmpDays=0;
	switch (strExpire)
	{
		case "day":	tmpDays=1;
		case "week":	tmpDays=7;
		case "month":	tmpDays=30;
		case "year":	tmpDays=365;
		case "yes":	tmpDays=3650;
	}
	if (tmpDays>0)
	{
		var tmpDate=new Date();
		tmpDate.setTime(tmpDate.getTime()+(tmpDays*24*60*60*1000));
		var tmpExpires="; expires="+tmpDate.toGMTString();
		document.cookie=strName+"="+strValue+tmpExpires+"; path=/";
	}
}

dcs.cookies.getValue=function(strName)
{
	var re="";
	var rRE=new RegExp(escape(strName)+"=([^;]+)");
	if (rRE.test(document.cookie+";"))
	{
		rRE.exec(document.cookie+";");
		re=unescape(RegExp.$1);
	}
	return re;
}

dcs.cookies.getValueGipId=function(name)
{
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1)
	{
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	}
	else
	{
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1) end = dc.length;
	return unescape(dc.substring(begin + prefix.length, end));
}




dcs.init._Queues["loadRes:resource/VDCS.res.form.select.js"]="init load already.";
/* ************************************* */

dcs.form.SELECT_FORM_NAME="frm_list";
dcs.form.SELECT_INPUT_NAME="_select_id";
dcs.form.SELECT_HANDLE_FORM_NAME="frm_select_handle";

dcs.form.doSelectForm=function()
{
	var _objForm=eval("document."+this.SELECT_FORM_NAME);
	var _nvalue=_objForm._select_data.checked;
	var _ncheckbox;
	for(var i=0;i<_objForm.elements.length;i++)
	{
		var _ncheckbox=_objForm.elements[i];
		if(_ncheckbox.name==this.SELECT_INPUT_NAME) { _ncheckbox.checked=_nvalue; }
	}
}

dcs.form.getSelectID=function()
{
	var re="";
	var _objForm=eval("document."+this.SELECT_FORM_NAME);
	var _ncheckbox;
	for(var i=0;i<_objForm.elements.length;i++)
	{
		var _ncheckbox=_objForm.elements[i];
		if(_ncheckbox.name==this.SELECT_INPUT_NAME && _ncheckbox.checked) re+=","+_ncheckbox.value;
	}
	if (re!="") re=re.substring(1);
	return re;
}

dcs.form.doSelectCheck=function()
{
	var _objForm=eval("document."+this.SELECT_FORM_NAME);
	var _isselect=false;
	var re=false;
	for(var i=0;i<_objForm.elements.length;i++)
	{
		var _ncheckbox=_objForm.elements[i];
		if(_ncheckbox.name==this.SELECT_INPUT_NAME && (_ncheckbox.checked || _ncheckbox.value!="")) { _isselect=true; break; }
	}
	if (_isselect)
	{
		if (confirm("执行此操作后可能无法恢复！你确定吗？")) { return true; }
		else { return false; }
	}
	else { alert("请至少选择一条记录"); return false; }
}

dcs.form.doSelectClick=function()
{
	if (this.doSelectCheck())
	{
		var _objForm=eval("document."+this.SELECT_FORM_NAME);
		if (_objForm._select_handle.value=="")
		{
			var _objFormHandle=eval("document."+this.SELECT_HANDLE_FORM_NAME);
			if (_objFormHandle)
			{
				var tmpValue=_objFormHandle._select_handle.options[_objFormHandle._select_handle.selectedIndex].value;
				_objForm._select_handle.value=tmpValue;
			}
		}
		_objForm.submit();
	}
}

dcs.form.doSelectParse=function()
{
	var _objForm=eval("document."+this.SELECT_FORM_NAME);
	for(var i=0;i<_objForm.elements.length;i++)
	{
		var _ncheckbox=_objForm.elements[i];
		//alert(_ncheckbox.name+"="+_ncheckbox.value);
		if(_ncheckbox.value=="" || _ncheckbox.value=="0") { _ncheckbox.disabled=true; }
	}
}

dcs.form.doOptionSelectAll=function(strForm,strPrefix)
{
	if (isEmpty(strPrefix)) strPrefix="__is__";
	if (strForm)
	{
		var _objForm=strForm;
		var _objCheck=_objForm.__option_select_all;
		var tmpCheckecd=(_objCheck && _objCheck.checked) ? true : false;
		for(var i=0;i<_objForm.elements.length;i++)
		{
			var _ncheckbox=_objForm.elements[i];
			if(_ncheckbox.name.substring(0,strPrefix.length)==strPrefix) { _ncheckbox.checked=tmpCheckecd; }
		}
		if (_objCheck) _objCheck.checked=tmpCheckecd;
	}
}




dcs.init._Queues["loadRes:resource/VDCS.res.images.js"]="init load already.";
/* ************************************* */
dcs.images=new Object();

dcs.images.doZoom=function(strObject)
{
	var re=true;
	if(event.altKey || event.ctrlKey)
	{
		var zoomSize=parseInt(strObject.style.zoom,10)||100;
		zoomSize+=event.wheelDelta/12;
		if (zoomSize>0) strObject.style.zoom=zoomSize+'%';
		re=false;
	}
	return re;
}

dcs.images.doResize=function(strObject,strWidth,strHeight,strTitle)
{
	var tmpWidth=strWidth;
	var tmpHeight=strHeight;
	if (isEmpty(tmpHeight)) tmpHeight=null;
	var tmpisInit=false;
	if (tmpWidth==null) { tmpWidth=0.7; }
	else if (tmpWidth==0)
	{
		if (strObject.parentNode)
		{
			var tmpObjectParent=strObject
			while (inPart("div,td",tmpObjectParent.parentNode.tagName.toLowerCase())<1)
			{
				tmpObjectParent=tmpObjectParent.parentNode;
			}
			tmpWidth=tmpObjectParent.parentNode.offsetWidth;
		}
	}
	else if (tmpWidth<0.1) { tmpWidth=0.7; }
	if (tmpWidth<1) tmpWidth=screen.width*tmpWidth;
	if (tmpHeight!=null)
	{
		if (tmpHeight==0)
		{
			if (strObject.parentNode) tmpHeight=strObject.parentNode.offsetHeight;
		}
		else if (tmpHeight<0.1) { tmpHeight=0.7; }
		if (tmpHeight<1) tmpHeight=screen.Height*tmpHeight;
	}
	if ((tmpWidth>0 || tmpHeight>0) && strObject.style.display=="none") { strObject.style.display=""; tmpisInit=true; }
	if(strObject.width>tmpWidth || (tmpHeight!=null && strObject.height>tmpHeight))
	{
		strObject.resized=true;
		if (strObject.width>tmpWidth) strObject.width=tmpWidth;
		if (tmpHeight!=null && strObject.height>tmpHeight) strObject.height=tmpHeight;
		if (strTitle!=null)
		{
			if (isEmpty(strTitle)) strTitle="点击图片在新窗口中打开.\nCTRL键/ALT键+鼠标滚轮可以放大或缩小图片大小.";
			strObject.alt=strTitle;
		}
	}
	return false;
}

dcs.images.doOpen=function(strObject,strType)
{
	var tmpURL;
	switch(strType)
	{
		case 1:
			tmpURL=(strObject.parentNode && strObject.parentNode.nodeName=="A") ? strObject.parentNode.href : strObject.src;
			break;
		default:
			tmpURL=strObject.src;
			break;
	}
	if (!isEmpty(tmpURL)) window.open(tmpURL);
	return false;
}



dcs.init._Queues["loadRes:resource/VDCS.res.paging.js"]="init load already.";
/* ************************************* */


//########################################
//########################################
dcs.paging=new Object();

dcs.paging.goTop=function() { document.body.scrollTop="0px"; }

dcs.paging.doGO=function(strtxt,strnum,strpage)
{
	if (isEmpty(strtxt)) strtxt="paging_url";
	if (isEmpty(strnum)) strnum="paging_num";
	if (isEmpty(strpage)) strpage="{$page}";
	var tmpurl=dcs.form.getValue(strtxt);
	var tmppage=dcs.form.getValue(strnum);
	tmpurl=dcs.common.toReplace(tmpurl,strpage,tmppage);
	document.location.href=tmpurl;
}

dcs.paging.getQuickLinks=function(strURL,strCounter,strPageNum,strTpl)
{
	var re="";
	if (!dcs.common.isNumber(strPageNum)) strPageNum=10;
	var tmpPageTotal=strCounter/strPageNum;
	tmpPageTotal=Math.round(tmpPageTotal);
	if ((tmpPageTotal*strPageNum)<strCounter) tmpPageTotal++;
	var tmpURL;
	if (isEmpty(strTpl))
	{
		if (tmpPageTotal>1)
		{
			re="<img class=\"icon\" src=\""+dcs.config.getURL("skin")+"images/common/ico_paging_quick.gif\" title=\"Quick Paging\">"
			for (var i=2;i<4;i++)
			{
				if (i>tmpPageTotal) break;
				tmpURL=dcs.common.toDisp(strURL,"page",i);
				re+=" <a href=\""+tmpURL+"\" alt=\"Page "+i+"\">"+i+"</a>";
			}
			if (tmpPageTotal>3)
			{
				if (tmpPageTotal>4) re+=" ..";
				i=tmpPageTotal;
				tmpURL=dcs.common.toDisp(strURL,"page",i);
				re+=" <a href=\""+tmpURL+"\" alt=\"Page "+i+"\">"+i+"</a>";
			}
		}
	}
	else
	{
		tmpURL=dcs.common.toDisp(strURL,"page",tmpPageTotal);
		re=dcs.common.toDisp(strTpl,"url",tmpURL);
	}
	return re;
}




dcs.init._Queues["loadRes:resource/VDCS.res.request.js"]="init load already.";
/* ************************************* */

//########################################
//########################################
dcs.request=new Object();

dcs.request.getQuery=function(strer)
{
	var re="";
	var tmpQuerys=document.location.search;
	if (tmpQuerys.indexOf("?")==0) tmpQuerys=tmpQuerys.substr(1);
	if (tmpQuerys.indexOf("&")>=0)
	{
		var tmpAryQuery=tmpQuerys.split("&");
		var tmpQuery;
		for (var i=0;i<tmpAryQuery.length;i++)
		{
			tmpQuery=tmpAryQuery[i];
			if (tmpQuery.indexOf("=")>=0 && tmpQuery.substring(0,tmpQuery.indexOf("="))==strer) { re=tmpQuery.substr(tmpQuery.indexOf("=")+1); break; }
		}
	}
	else { if (tmpQuerys.indexOf("=")>=0 && tmpQuerys.substring(0,tmpQuerys.indexOf("="))==strer) re=tmpQuerys.substr(tmpQuerys.indexOf("=")+1); }
	return re;
}




dcs.init._Queues["loadRes:resource/VDCS.res.time.js"]="init load already.";
/* ************************************* */

//########################################
//########################################
dcs.time=new Object();
dcs.time._Data=new Array();

dcs.time.getToday=function()
{
	if (isEmpty(this._Data["today"]))
	{
		var tmpDate=new Date();
		this._Data["today"]=tmpDate.getFullYear()+"-"+(tmpDate.getMonth()+1)+"-"+tmpDate.getDate();
	}
	return this._Data["today"];
}
dcs.time.getNow=function()
{
	if (isEmpty(this._Data["now"]))
	{
		var tmpDate=new Date();
		this._Data["now"]=tmpDate.getFullYear()+"-"+(tmpDate.getMonth()+1)+"-"+tmpDate.getDate()+" "+tmpDate.getHours()+":"+tmpDate.getMinutes()+":"+tmpDate.getSeconds();
	}
	return this._Data["now"];
}

dcs.time.toConvert=function(strer,strtype)
{
	var re="";
	re=dcs.common.toReplace(strer," ","<br>");
	if (strtype=="s") re="<font class=\"times\">"+re+"</font>";
	return re;
}

dcs.time.toDateDiff=function(strType,strDate1,strDate2)
{
	var tmpDate1=Date.parse(strDate1.replace(/-/gi,"/"));
	var tmpDate2=Date.parse(strDate2.replace(/-/gi,"/"));
	var re=tmpDate2-tmpDate1;
	switch (strType)
	{
		case "h":
			re=re/360000;
			break;
		case "m":
			re=re/60000;
			break;
		case "s":
			re=re/1000;
			break;
	}
	return ta;
}

dcs.time.toNumber=function(strDate)
{
	var re=Date.parse(strDate.replace(/-/gi,"/"))/1000;
	if (re<1) re=0;
	return re;
}




dcs.init._Queues["loadRes:resource/VDCS.res.url.js"]="init load already.";
/* ************************************* */

dcs.url=new Object();

function isExternalUrlSafeForNavigation(urlStr)
{
    var regEx = new RegExp("^(http(s?)|ftp|file)://", "i");
    return regEx.exec(urlStr);
}

dcs.url.isValid=function(strer) { return (strer.indexOf("://")!=-1 || strer.substring(0,1)=="/") ? true : false; }

dcs.url.toAppend=function(strBaseURL,strAppend)
{
	var re=strBaseURL;
	if (strAppend)
	{
		if (re.indexOf("?")==-1) { re+="?"; }
		else if (re.substring(re.indexOf("?")).length>0) re+="&";
		re+=strAppend;
	}
	return re;
}

dcs.url.toHyperLink=function(strURL,strTitle,strTarget,strStyle,strTitleNo)
{
	var re="";
	if (strURL=="" || strURL=="http://") { re=strTitleNo; }
	else
	{
		re="<a href=\""+strURL+"\"";
		if (strTarget) re+=" target=\"_blank\"";
		if (strStyle) re+=" "+strStyle;
		re+=">"+strTitle+"</a>";
	}
	return re;
}

dcs.url.toAppendRefresh=function(strURL,strKey)
{
	if (isEmpty(strKey)) strKey="_r";
	var re=strURL;
	if (re.indexOf("?")<0) re+="?"+strKey+"="+Math.random();
	else
	{
		if (re.indexOf(strKey+"=")>0) re=re.split(strKey+"=")[0];
		if (re.indexOf(re.length)!="&") re+="&";
		re+=strKey+"="+Math.random();
	}
	return re;
}

dcs.url.toEncode=function(strer) { return encodeURI(strer); }
dcs.url.toDecode=function(strer) { return decodeURI(strer); }

