﻿document.writeln("<script src=\"http:\/\/cs.shanke.cn\/counter\/www.flashv.com.cn\/mystat.asp?style=no\"><\/script>")


/*
Version:	VDCS 1.0 for Stage
*/

dcs.config.setValue("url.file.user.view",		"user.jsp");
dcs.config.setValue("url.file.user.bookmark",		"bookmark.jsp");

dcs.config.setValue("url.file.preview",			"preview.jsp");

dcs.config.setValue("url.file.verifycode",		"verifycode.do");

dcs.config.setValue("url.file.url.proxy",		"url.proxy.jsp");

dcs.form.SELECT_INPUT_NAME="_select_id[]";



//########################################
//########################################
function doLoginCheck() { return appUser.isLoginCheck(); }
/*
function doBookmarkAdd(strChannel,strName,strURL) { app.doBookmarkAdd(); }
*/



//########################################
//########################################
var app=new Object();



//########################################
//########################################
var appCommon=new Object();


appCommon.doReport=function()
{
	
}

appCommon.doBookmarkAdd=function(strChannel,strName,strURL)
{
	var re=dcs.config.getURL("account","user.bookmark");
	var strAction="add";
	if (strName==null || strName=="") strName=dcs.browser.getTitle();
	if (strURL==null || strURL=="") strURL=dcs.browser.getURLs();
	if (strChannel) re=dcs.url.toAppend(re,"channel="+strChannel);
	if (strAction) re=dcs.url.toAppend(re,"action="+strAction);
	if (strName) re=dcs.url.toAppend(re,"name="+strName);
	if (strURL) re=dcs.url.toAppend(re,"url="+dcs.url.toEncode(strURL));
	window.open(re);
}

appCommon.toUploadPic=function(strer,strwidth,strheight,strm,strtype)
{
	var re="";
	if (strer==null || strer=="") strer="no_pic.gif";
	var tmpURL=dcs.url.isValid(strer) ? strer : dcs.config.getURL("upload")+strer;
	var tmpSize="";
	if (!isNull(strwidth) && !dcs.common.isNumber(strwidth)) strwidth=120;
	if (!isNull(strheight) && !dcs.common.isNumber(strheight)) strheight=90;
	if (!isNull(strwidth))
	{
		strwidth=strwidth*strm;
		tmpSize+=" width=\""+strwidth+"\"";
	}
	if (!isNull(strheight))
	{
		strheight=strheight*strm;
		tmpSize+=" height=\""+strheight+"\"";
	}
	switch (strtype)
	{
		case 0:
			re="<img class=\"pic\" src=\""+tmpURL+"\" "+tmpSize+" title=\"点击放大\">";
			break;
		case 1:
			re=re="<a href=\""+tmpURL+"\" target=\"_blank\"><img class=\"pic\" src=\""+tmpURL+"\" "+tmpSize+" title=\"点击放大\"></a>";
			break;
		default:
			re=tmpURL;
			break;
	}
	return re;
}

appCommon.getADS=function(strSort,strChannel,strType)
{
	var re="";
	var tmpURL=dcs.config.getURL("xml")+"misc.ad.asp";
	
	re="<script type=\"text/javascript\" language=\"Javascript\" src=\""+tmpURL+"\"></script>";
	return re;
}



//########################################
//########################################
var appUser=new Object();

appUser.isLoginCheck=function()
{
	dcs.init.loadUtil("error");
	var err=new VDCS.utilError();
	var tmpMessage="";
	if (document.frm_login.username.value=="")
	{
		err.addItem("请输入您的 用户名称 ！");
		document.frm_login.username.focus();
	}
	else if (document.frm_login.password.value=="")
	{
		err.addItem("请输入您的 登陆密码 ！");
		document.frm_login.password.focus();
	}
	err.doPop();
	return err.isCheck();
}

appUser.doMailCheck=function(strNum)
{
	if (strNum<1) return false;
	put("<bgsound src=\""+dcs.config.getURL("skin")+"images/account/newmail.mp3\">");
	$("user_mail_new").style.display="";
	$("user_mail_new_num").innerText=strNum;
}

appUser.toURL=function(strid,strname,strmodule)
{
	var re="";
	re=dcs.config.getURL("account","user.view");
	if (strid) re=dcs.url.toAppend(re,"userid="+strid);
	if (strname) re=dcs.url.toAppend(re,"username="+dcs.url.toEncode(strname));
	if (strmodule) re=dcs.url.toAppend(re,"module="+strmodule);
	return re;
}

appUser.toLinkURL=function(strid,strname,strmodule,strtarget,strtitle,strtext)
{
	var re="";
	var tmpURL;
	var tmpText=isEmpty(strtext) ? strname : strtext;
	if (strid>0)
	{
		tmpURL=this.toURL(strid,strname,strmodule);
		re=dcs.url.toHyperLink(tmpURL,tmpText,strtarget,strtitle);
	}
	else
	{
		if (strname.length>0)
		{
			var tmpAry=strname.split(",");
			for (var i=0;i<tmpAry.length;i++)
			{
				tmpURL=this.toURL(0,tmpAry[i],strmodule);
				tmpText=tmpAry[i];
				if (re.length>0) re+=" "+dcs.url.toHyperLink(tmpURL,tmpText,strtarget,strtitle);
				else re=dcs.url.toHyperLink(tmpURL,tmpText,strtarget,strtitle);
			}
		}
		else
		{
			re=(strmodule=="moderator") ? re="<font class=\"gray\">暂无</font>" : "<font class=\"gray\">------</font>";
		}
	}
	return re;
}

appUser.toGroupPower=function(strer)
{
	var re="";
	return re;
}

appUser.toFace=function(strer,strWidth,strHeight)
{
	var re="";
	var tmpURL=strer;
	switch (strer.substring(0,1))
	{
		case "#":
			tmpURL=dcs.config.getURL("upload")+"face/"+strer.substring(1);
			break;
		case "$":
			tmpURL=dcs.config.getURL("upload")+"user.face/"+strer.substring(1);
			break;
	}
	re=(isInt(strWidth) && isInt(strHeight)) ? "<img class=\"user-face\" src=\""+tmpURL+"\" width=\""+strWidth+"\" width=\""+strHeight+"\">" : tmpURL;
	return re;
}

