/*  --------------------------------------------------------------------------------\
 *  Web Wite use to JQuery Javascript framework
 *  (c) 2005-2011 hinan.com.cn
 *  author:	chenzhuohong,QQ:366758899,Msn:hinan.com.cn@qq.com,E-Mail:hinan.com.cn@qq.com
 *  EditDatetime:	2011-04-20
 *  Remarks:		使用此文件对象|函数必须在同一个网页包含 jquery-1.4.1.js
 *----------------------------------------------------------------------------------*/

var Net089886 = {
    //** 预设长度为20的数组：对象/属性
    avObj: [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null],
    avIdName: [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null],
    avIsAuto: [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false],
    avKey: [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    // ** 当用户将鼠标指针移动到对象上时的事件处理调用
    fnSetObj: function (activeCssName, normalCssName, arrayNum) {
        Net089886.avObj[arrayNum] = $(Net089886.avIdName[arrayNum] + ">div:eq(0) a").each(function (i, n) {
            $(this).data(this.rel, $("#" + this.rel).html());
            $(this).mousemove(function () {
                //设置原先选中的菜单样式为：不选中样式
                $(this).parents("ul").find("[className='" + activeCssName + "']").attr("className", normalCssName);
                //设置当前对应的菜单样式：选中样式
                $(this).parent("li").attr("className", activeCssName);
                //显示对应的数据块
                $(Net089886.avIdName[arrayNum] + ">div:eq(1)").html($(this).data(this.rel)).animate({
                    opacity: 'show'
                }, 1000);
            });
        });
    },
    //** 当用户将鼠标指针 移动到对象内时触发/移出对象边界时触发
    fnFootSelector: function (arrayNum) {

        $(Net089886.avIdName[arrayNum]).mouseenter(function () { Net089886.avIsAuto[arrayNum] = false; })
                          .mouseleave(function () { Net089886.avIsAuto[arrayNum] = true; });
    },
    //** 随机调用显示
    fnRandom: function (arrayNum) {
        $("a[rel=" + Net089886.avObj[arrayNum].get(parseInt(Net089886.avObj[arrayNum].length * Math.random())).rel + "]").mousemove();
    },
    //** 指定选卡调用显示
    fnDefaultCardShow: function (arrayNum, num) {
        if (num > -1) $("a[rel=" + Net089886.avObj[arrayNum].get(num).rel + "]").mousemove();
    },
    //** 滚动下条记录 
    fnRollNext: function (arrayNum) {
        if (Net089886.avIsAuto[arrayNum]) {
            if (Net089886.avKey[arrayNum] == null || Net089886.avKey[arrayNum] == 'undefined') Net089886.avKey[arrayNum] = -1;
            Net089886.avKey[arrayNum] += 1;
            if (Net089886.avKey[arrayNum] == -1 || Net089886.avKey[arrayNum] > Net089886.avObj[arrayNum].length - 1) Net089886.avKey[arrayNum] = 0;
            $("a[rel=" + Net089886.avObj[arrayNum].get(Net089886.avKey[arrayNum]).rel + "]").mousemove();
        }
    },
    //** 一次调用完成调用（idName=#ID|.class对象定位, int必须为不相等的值,  false|true设置自动滚动,  int毫秒, defaultCardShow=int默认展示N选卡, false|true随机展示选卡, 'on活动css', 'nl隐藏css'）
    fnOneRun: function (idName, arrayNum, isAuto, interval, defaultCardShow, isRandom, activeCssName, normalCssName) {
        if (idName == null || idName == "" || idName == 'undefined') return false;
        if (arrayNum == null || arrayNum == "" || arrayNum == 'undefined' || typeof arrayNum != 'number') arrayNum = 0;
        if (isAuto == null || isAuto == "" || isAuto == 'undefined' || typeof isAuto != 'boolean') isAuto = false;
        if (interval == null || interval == "" || interval == 'undefined' || typeof interval != 'number') interval = 4000;
        if (defaultCardShow == null || defaultCardShow == "" || defaultCardShow == 'undefined' || typeof defaultCardShow != 'number') defaultCardShow = 0;
        if (isRandom == null || isRandom == "" || isRandom == 'undefined' || typeof isRandom != 'boolean') isRandom = false;
        if (activeCssName == null || activeCssName == "" || activeCssName == 'undefined') activeCssName = "on";
        if (normalCssName == null || normalCssName == "" || normalCssName == 'undefined') normalCssName = "nl";

        Net089886.avIdName[arrayNum] = idName;
        Net089886.avIsAuto[arrayNum] = isAuto;
        Net089886.fnSetObj(activeCssName, normalCssName, arrayNum);
        Net089886.fnDefaultCardShow(arrayNum, defaultCardShow);

        if (isRandom) { Net089886.fnRandom(arrayNum); }
        if (isAuto) {
            Net089886.fnFootSelector(arrayNum);
            setInterval("Net089886.fnRollNext(" + arrayNum + ")", interval);
        }
    }
};
Net089886.Fn = {
    fnGetFullPath: function (obj) {
        if (obj) {
            var image = new Image();
            // ie  
            if (window.navigator.userAgent.indexOf("MSIE") >= 1) {
                obj.select();
                image.src = document.selection.createRange().text;
                return document.selection.createRange().text;
            }
            // firefox  
            else if (window.navigator.userAgent.indexOf("Firefox") >= 1) {
                if (obj.files) {
                    image.src = obj.files.item(0).getAsDataURL();
                    return obj.files.item(0).getAsDataURL();
                }
                return obj.value;
            }
            return obj.value;
        }
    },
    fnCheckIsNumeralValue: function (curName, alertStr) {
        var rValue = true;
        var curID = $('#' + curName);
        var curIDValue = curID.val();
        if (curIDValue == null || curIDValue == "0" || curIDValue == "0.00" || curIDValue == "" || $.trim(curIDValue) == "" || curIDValue == "undefined") {
            alert(alertStr);
            //curID.val('0')
            curID.focus();
            rValue = false;
        }
        return rValue;
    },
    fnCheckIsEmptyValue: function (curName, alertStr) {
        var rValue = true;
        var curID = $('#' + curName);
        var curIDValue = curID.val();
        if (curIDValue == null || curIDValue == "" || $.trim(curIDValue) == "" || curIDValue == "undefined") {
            alert(alertStr);
            curID.val('')
            curID.focus();
            rValue = false;
        }
        return rValue;
    },
    fnCheckImgFileType: function (hName, curName) {
        var rValue = true;
        var hfID = $('#' + hName);
        var curID = $('#' + curName);
        var curIDValue = curID.val();
        /*
        if (curIDValue == "" && hfID.val() == "") {
        alert("请选择图片文件上传 .jpg | .gif | .png | .bmp");
        curID.focus();
        rValue = false;
        }*/
        if (curIDValue != "" && curIDValue != "undefined") {
            var pos = curIDValue.lastIndexOf(".");
            var lastname = curIDValue.substring(pos, curIDValue.length).toLowerCase();
            if (lastname == ".jpg" || lastname == ".gif" || lastname == ".png" || lastname == ".bmp") return true;
            alert("您上传的文件类型为" + lastname + "，图片必须为.jpg | .gif | .png | .bmp类型");
            curID.focus();
            rValue = false;
        }
        return rValue;
    },
    fnCheckFileType: function (uMode, hName, curName) {
        var rValue = true;
        var hfIDValue = $('#' + hName).val();
        var curID = $('#' + curName);
        var curIDValue = curID.val();
        var lastname = '';

        if (curIDValue != "" && curIDValue != "undefined") {
            var pos = curIDValue.lastIndexOf(".");
            lastname = curIDValue.substring(pos, curIDValue.length).toLowerCase();
        }
        switch (uMode * 1) {
            case 0:         //// 图片
                if (lastname == ".jpg" || lastname == ".gif" || lastname == ".png" || lastname == ".bmp") {
                    rValue = true;
                } else {
                    if (hfIDValue == "") {
                        rValue = false;
                        alert("您上传的文件类型为" + lastname + "，请上传文件类型必须为 .jpg | .gif | .png | .bmp（后缀）类型");
                    }
                }
                break;
            case 1:         //// 文字
                rValue = true;
                break;
            case 2:         //// .swf 动画
                if (lastname == ".swf") {
                    rValue = true;
                } else {
                    if (hfIDValue == "") {
                        rValue = false;
                        alert("您上传的文件类型为" + lastname + "，请上传文件类型必须为 .swf（后缀）类型");
                    }
                }
                break;
            case 3:         //// .flv 视频
                if (lastname == ".flv") {
                    rValue = true;
                } else {
                    if (hfIDValue == "") {
                        rValue = false;
                        alert("您上传的文件类型为" + lastname + "，请上传文件类型必须为 .flv（后缀）类型");
                    }
                }
                break;
            case 4:         //// 专题(图片)
                if (lastname == ".jpg" || lastname == ".gif" || lastname == ".png" || lastname == ".bmp") {
                    rValue = true;
                } else {
                    if (hfIDValue == "") {
                        rValue = false;
                        alert("您上传的文件类型为" + lastname + "，请上传文件类型必须为 .jpg | .gif | .png | .bmp（后缀）类型");
                    }
                }
                break;
            default:
                if (hfIDValue == "") {
                    alert("您上传的文件类型为" + lastname + "，请上传文件类型必须为 .swf | .flv | .jpg | .gif | .png | .bmp（后缀）类型");
                    rValue = false;
                }
                break;
        }
        return rValue;
    },
    fnMmMo: function (obj, attrStr, mmValue, moValue) {//设置指定对象的mousemove/mouseout事件属性：    fnMmMo(对象, 属性, mm属性值, mo属性值)
        $(obj).mousemove(function () {
            $(this).attr(attrStr, mmValue);
        }).mouseout(function () {
            $(this).attr(attrStr, moValue);
        });
    },
    fnGetModeOption: function (mode) {
        var rValue = "";
        switch (mode) {
            case -1:
                rValue = "";
                break;
            case 0:
                rValue = "<option value='' selected='selected'></option>";
                break;
            case 1:
                rValue = "<option value='' selected='selected'>不限</option>";
                break;
            case 2:
                rValue = "<option value='' selected='selected'>请选择</option>";
                break;
            default:
                rValue = "<option value='' selected='selected'></option>";
                break;
        }
        return rValue;
    },
    fnCla: function (mode, relativePathMark, obj1, obj2, obj3, obj4, obj5, obj6) {//DropDownList.ClientID(1,2,3,4,5,null)
        //// 类别[1级]
        if (obj1 != null) obj1.change(function () {
            var urlstr = relativePathMark + "WebService/Class2.asmx/SelectByClasses";
            $.ajax({
                type: "POST",   //访问WebService使用Post方式请求
                contentType: "application/json", //WebService 会返回Json类型
                url: urlstr, //调用WebService的地址和方法名称组合---WsURL/方法名
                data: "{class1:'" + obj1.val() + "'}",
                dataType: 'json',
                success: function (result) {     //回调函数，result，返回值
                    //// 清除之前的选项值
                    obj2.empty();
                    var _appendValue = Net089886.Fn.fnGetModeOption(mode);
                    if (_appendValue != "" && _appendValue != null) obj2.append(_appendValue);
                    $(result.d).each(function () {
                        //// 新增更新后的选项值
                        obj2.append("<option value='" + this["Class2"] + "'>" + this["Class2"] + "</option>");
                    });

                    //// 清除选项值
                    if (obj3 != null) obj3.empty();
                    if (obj4 != null) obj4.empty();
                    if (obj5 != null) obj5.empty();
                    if (obj6 != null) obj6.empty();
                }
            });
        });
        //// 类别[2级]
        if (obj2 != null) obj2.change(function () {
            var urlstr = relativePathMark + "WebService/Class3.asmx/SelectByClasses";
            $.ajax({
                type: "POST",   //访问WebService使用Post方式请求
                contentType: "application/json", //WebService 会返回Json类型
                url: urlstr, //调用WebService的地址和方法名称组合---WsURL/方法名
                data: "{class1:'" + obj1.val() + "', class2:'" + obj2.val() + "'}",
                dataType: 'json',
                success: function (result) {     //回调函数，result，返回值
                    //// 清除之前的选项值
                    obj3.empty();
                    var _appendValue = Net089886.Fn.fnGetModeOption(mode);
                    if (_appendValue != "" && _appendValue != null) obj3.append(_appendValue);
                    $(result.d).each(function () {
                        //// 新增更新后的选项值
                        obj3.append("<option value='" + this["Class3"] + "'>" + this["Class3"] + "</option>");
                    });
                    //// 清除选项值
                    if (obj4 != null) obj4.empty();
                    if (obj5 != null) obj5.empty();
                    if (obj6 != null) obj6.empty();
                }
            });
        });
        //// 类别[3级]
        if (obj3 != null) obj3.change(function () {
            var urlstr = relativePathMark + "WebService/Class4.asmx/SelectByClasses";
            $.ajax({
                type: "POST",   //访问WebService使用Post方式请求
                contentType: "application/json", //WebService 会返回Json类型
                url: urlstr, //调用WebService的地址和方法名称组合---WsURL/方法名
                data: "{class1:'" + obj1.val() + "', class2:'" + obj2.val() + "', class3:'" + obj3.val() + "'}",
                dataType: 'json',
                success: function (result) {     //回调函数，result，返回值
                    //// 清除之前的选项值
                    obj4.empty();
                    var _appendValue = Net089886.Fn.fnGetModeOption(mode);
                    if (_appendValue != "" && _appendValue != null) obj4.append(_appendValue);
                    $(result.d).each(function () {
                        //// 新增更新后的选项值
                        obj4.append("<option value='" + this["Class4"] + "'>" + this["Class4"] + "</option>");
                    });
                    //// 清除选项值
                    if (obj5 != null) obj5.empty();
                    if (obj6 != null) obj6.empty();
                }
            });
        });
        //// 类别[4级]
        if (obj4 != null) obj4.change(function () {
            var urlstr = relativePathMark + "WebService/Class5.asmx/SelectByClasses";
            $.ajax({
                type: "POST",   //访问WebService使用Post方式请求
                contentType: "application/json", //WebService 会返回Json类型
                url: urlstr, //调用WebService的地址和方法名称组合---WsURL/方法名
                data: "{class1:'" + obj1.val() + "', class2:'" + obj2.val() + "', class3:'" + obj3.val() + "', class4:'" + obj4.val() + "'}",
                dataType: 'json',
                success: function (result) {     //回调函数，result，返回值
                    //// 清除之前的选项值
                    obj5.empty();
                    var _appendValue = Net089886.Fn.fnGetModeOption(mode);
                    if (_appendValue != "" && _appendValue != null) obj5.append(_appendValue);
                    $(result.d).each(function () {
                        //// 新增更新后的选项值
                        obj5.append("<option value='" + this["Class5"] + "'>" + this["Class5"] + "</option>");
                    });
                    //// 清除选项值
                    if (obj6 != null) obj6.empty();
                }
            });
        });
        //// 类别[5级]
        if (obj5 != null) obj5.change(function () {
            var urlstr = relativePathMark + "WebService/Class6.asmx/SelectByClasses";
            $.ajax({
                type: "POST",   //访问WebService使用Post方式请求
                contentType: "application/json", //WebService 会返回Json类型
                url: urlstr, //调用WebService的地址和方法名称组合---WsURL/方法名
                data: "{class1:'" + obj1.val() + "', class2:'" + obj2.val() + "', class3:'" + obj3.val() + "', class4:'" + obj4.val() + "', class5:'" + obj5.val() + "'}",
                dataType: 'json',
                success: function (result) {     //回调函数，result，返回值
                    //// 清除之前的选项值
                    if (obj6 != null) {
                        obj6.empty();
                        var _appendValue = Net089886.Fn.fnGetModeOption(mode);
                        if (_appendValue != "" && _appendValue != null) obj6.append(_appendValue);
                        $(result.d).each(function () {
                            //// 新增更新后的选项值
                            obj6.append("<option value='" + this["Class6"] + "'>" + this["Class6"] + "</option>");
                        });
                    }
                }
            });
        });
    }
};
 
/*******************************************************************************************\
 * 数据对象Hinan: 网站共用对象
 * (c) 2005-2011 hinan.com.cn
 * author: 陈卓红(Heney)
 * 参数说明：无
 * EditDatetime:	2011-04-20
\-------------------------------------------------------------------------------------------*/
var Hinan = {
	getRange:function(){
	/* getRange():	得到当前文档窗体的top,left,height,width值 -------\
	 * 参数说明：
	 * (无)
	 \------------------------------------------------------------*/
		var _top     = document.documentElement.scrollTop;
		var _left    = document.documentElement.scrollLeft;
		var _height  = document.documentElement.clientHeight;
		var _width   = document.documentElement.clientWidth;
		if (_top==0 && _left==0 && _height==0 && _width==0) {
		_top     = document.body.scrollTop;
		_left    = document.body.scrollLeft;
		_height  = document.body.clientHeight;
		_width   = document.body.clientWidth;
		}
		return  { top:_top, left:_left, height:_height, width:_width };
	},
	hideSelect: function (oWindows,visibility){
		var obj = oWindows;
		var i;
		var selects;
		if(obj==null){
			selects = document.getElementsByTagName('select');	
		}else{
			selects = obj.document.getElementsByTagName('select');
		}
		for(i = 0,iLen=selects.length; i<iLen; i++) {
			selects[i].style.visibility = visibility;
		}
	},
	onbodyscroll:function(dID){
		var range=Hinan.getRange();
		dID.style.top=(range.top+dID.oy) +"px";
		dID.style.left=(range.left+dID.ox) +"px";
	},
	showBoxOfRel:function(aObj,dID,isShort,len){
		//typeof 返回值有六种可能： "number," "string," "boolean," "object," "function," 和 "undefined."
		//获取 原贴信息
		var lobj = null;
		if(typeof aObj == 'object'){
			lobj=aObj
		}else{
			lobj=$(aObj)[0];
		}
		if(lobj==""||lobj==null) {
			lobj = window.event.srcElement;
		}
		var rel=lobj.getAttribute("rel");
		var urn=lobj.getAttribute("urn");

		var relobj = $(rel)[0];
		if(relobj!=null){
			var rbody = relobj.innerHTML;
			rbody=rbody.replace(/<.*>/gi,"");
			//rbody=rbody.replace(/<[^>]*>/gi,"");
			if(isShort){
				if(rbody.length>len){
					rbody = rbody.substring(0,len) + "...";
				}
			}
			var urnobj = $(urn)[0];
			if(urnobj!=null)urnobj.innerHTML=rbody;
		}
		this.hideSelect(null,"hidden");

		var wfBox = $(dID)[0];
		wfBox.style.display="block";
	
		if(Prototype.Browser.Opera){//修正(2007-10-31,增加)：在Opera时，修改显示位置
				wfBox.oy = 135;
		}
		var range=Hinan.getRange();
		wfBox.style.top=(range.top+wfBox.oy) +"px";
		wfBox.style.left=(range.left+wfBox.ox) +"px";
	
		window.onscroll=function(wfBox){
			Hinan.onbodyscroll(dID);
		}
	},
	createLoadingDiv:function(dID,dStr){
		var divIDName = dID;
		if(divIDName==""||divIDName==null) {divIDName = 'dataloading';}

		var divShowStr, cuID = $(divIDName)[0];
		if(cuID==""||cuID==null){
			if(divShowStr==null||divShowStr==""){divShowStr='<img src="http://www.hinan.com.cn/common/images/loading_16x16.gif" border="0" /> 正在加载数据，请稍等...';}
			var bod = document.getElementsByTagName('body')[0];
			var overlay = document.createElement('div');
			overlay.id = divIDName;
			overlay.innerHTML = divShowStr;
			bod.appendChild(overlay);
		}
	},
	loadingWH:function(aID,w,h){
		if(w==null) w= 230;
		if(h==null) h= 80;
		var range=Hinan.getRange();
		this.hideSelect(null,'hidden');
		var b = $(aID)[0];
		b.style.display="block";
		b.ox=(range.width-w)/2;
		b.oy=(range.height-h)/2;
		b.style.top=(range.top+b.oy) +"px";
		b.style.left=(range.left+b.ox) +"px";
	},
	closeLoadingWH: function (aID){
		this.hideSelect(null,'visible');
		//Element.hide(aID);
		$(aID)[0].style.display = "none";
	},
	floatBox:function(dID,dragID,tID,iframeID,w,h,iframeStr,titleStr){
		if(w==null)w=400;
		if(h==null)h=300;
		var range=Hinan.getRange();
		var ifrID = $(iframeID)[0];
		ifrID.width = w;
		ifrID.height = h;
		ifrID.src = iframeStr;
		if(titleStr!=null&&titleStr!=""){
			var aTitle = $(tID)[0];
			aTitle.innerHTML = titleStr;
		}
		wfBox=$(dID)[0];
		wfBox.style.width = (w + 10) + 'px';
		wfBox.style.height = (h + 46) + 'px';
		wfBox.ox=(range.width-(w+10))/2;
		wfBox.oy=(range.height-(h+46))/2;
		Drag.init($(dragID)[0], wfBox);
		wfBox.onDragEnd=function(x,y){
			wfBox.ox=x-Hinan.getRange().left;
			wfBox.oy=y-Hinan.getRange().top;
		}
	},
	showBox:function(dID){
		this.hideSelect(null,"hidden");
		var wfBox = $(dID)[0];
		wfBox.style.display="block";
		if(Prototype.Browser.Opera){//修正(2007-10-31,增加)：在Opera时，修改显示位置
			wfBox.oy = 135;
		}
		var range=Hinan.getRange();
		wfBox.style.top=(range.top+wfBox.oy) +"px";
		wfBox.style.left=(range.left+wfBox.ox) +"px";
		window.onscroll=function(wfBox){
			Hinan.onbodyscroll(dID);
		}
	},
	initbox:function(isAll,dID,dragID,w,h,tID,titleStr,isShort,len){//注：未使用
		if(w==null)w=400;
		if(h==null)h=300;
		var range=Hinan.getRange();
		var aTitle = $(tID)[0];
		aTitle.innerHTML = titleStr;
		wfBox = $(dID)[0];
		wfBox.ox=(range.width-w)/2;
		wfBox.oy=(range.height-h)/2;

		Drag.init($(dragID)[0], wfBox);
	
		wfBox.onDragEnd=function(x,y){
			wfBox.ox=x-Hinan.getRange().left;
			wfBox.oy=y-Hinan.getRange().top;
		}
		
		if(isAll==null || isAll=="")isAll=false;
		//isAll=true,同一个页面多个地方使用Class=lbOn
		if(isAll){
			//var all=this.getAllElement();
			var all=$$();
			var l=all.length;
			for(var i=0;i<l;i++){
				var o=all[i];
				if(o.className=="lbOn"){
					o.attachEvent("onclick", new Function("this.showBoxOfRel('"+o.id+"','"+dID+"',"+isShort+","+len+");"));
				}
			}
		}
	}
};

/*******************************************************************************************\
 * 数据对象Hinan.Commons: 网站共用对象(JS函数)
 * (c) 2005-2008 hinan.com.cn
 * author: 陈卓红(Heney)
 * 参数说明：无
 * EditDatetime:	2008-04-16
\-------------------------------------------------------------------------------------------*/
Hinan.Commons = {
    obj: null,
    safeFilterString: function (isFilter, isFilter2) {
        var N_No = "'";
        if (isFilter) {//过滤特殊字符
            N_No += "|!|#|^|&|*|+|~|`|<|>|/|=|\\|\"|?"
        }
        if (isFilter2) {
            N_No += "| |　|:|,|(|)|[|]|{|}|;|%|$"
        }
        N_No += "|iframe|script";
        N_No += "|select |delete |update |insert ";
        N_No += "|0x223e3c2f7469746c653e3c7363726970";
        N_No += "|0x730079007300610064006d0069006e00";
        N_No += "|create |alter |drop |declare|master|truncate";
        N_No += "|exists|exec|table_name|sysobjects|syscolumns|cast(|char(|fetch |varchar(|constraint_";
        N_No += "|is_member|is_srvrolemember|ireposproperty|@@";
        N_No += "|grant|revoke|commit|rollback";
        return N_No.split("|");
    },
    getSelectPage: function (v, curpage, allpage, cpath, extname) {
        var url = '';
        var fpage = cpath + extname;
        if (v == 1) {
            url = fpage;
        } else if (v > allpage) {
            url = cpath + '_' + allpage + extname;
        } else {
            url = cpath + '_' + v + extname;
        }
        top.location.href = url;
        return false;
    },
    checkFilterString: function (objFilter, str) {
        for (var j = 0, jLen = objFilter.length; j < jLen; j++) {
            if (str.indexOf(objFilter[j]) > -1) {
                Hinan.Commons.sharingJs(0, true, "提示:为了网站系统的安全与稳定, 请不要输入包含有 “" + objFilter[j] + "” 的过滤字符串", false, "", false, -1, false, "", "", "");
                return false;
            }
        }
        return true;
    },
    fTrim: function (str) {
        return str.replace(/(^\s*)|(\s*$)/g, "");
    },
    sharingJs: function (wObj, isAlert, alertStr, isLocaton, locUrl, isHistory, goNum, isCloseWin, wFromOrId, fnameArray, fvalueArray) {
        var _commonFunction = {
            alert: function (str) {
                window.alert(str);
            },
            location: function (wobj, url) {
                window.location.href = url;
            },
            history: function (num) {
                window.history.go(num);
            },
            close: function () {
                window.close();
            }
        };
        var _wObject = new Array(window, window.opener, parent, parent.parent);
        if (!Object.isNumber(wObj)) {
            _commonFunction.alert('argument[0]必须为数字值！');
            _commonFunction.close();
            return;
        } else if (wObj >= _wObject.length || wObj < 0) {
            _commonFunction.alert('argument[0]数字长度值设置错误，请检查参数值！');
            _commonFunction.close();
            return;
        }
        var _wObj = _wObject[wObj];
        if (wFromOrId != null && wFromOrId != "") {//表单有返回值,当wFromOrId=Array()，表示返回多个表单值。
            var i;
            if (!typeof wFromOrId == 'boolean') {//是返回表单值
                if (!Object.isArray(fnameArray) || !Object.isArray(fvalueArray)) {
                    _commonFunction.alert('表单名|值必须为数值，请检查您的参数值！');
                    _commonFunction.close();
                    return;
                } else if (fnameArray.length != fvalueArray.length) {
                    _commonFunction.alert('表单名|值 数组参数值长底不相等，请检查您的参数值！');
                    _commonFunction.close();
                    return;
                }
                //--------------------------------------------------------------
                if (Object.isArray(wFromOrId)) {//N个表单值
                    for (i = 0, iLen = wFromOrId.length; i < iLen; i++) {
                        if (fnameArray[i].length != fvalueArray[i].length) {//检测数组长度是否相等[n][m]
                            _commonFunction.alert('表单名|值 数组参数值长底不相等，请检查您的参数值！');
                            _commonFunction.close();
                            return;
                        }
                        for (var j = 0, jLen = fnameArray[i].length; j < jLen; j++) {
                            _wObj.document.forms["" + wFromOrId[i] + ""].elements["" + fnameArray[i][j] + ""].value = fvalueArray[i][j];
                            //_commonFunction.alert(fnameArray[i][j]);
                        }
                    }
                } else {//单个表单值
                    for (i = 0, iLen = fnameArray.length; i < iLen; i++) {
                        _wObj.document.forms["" + wFromOrId + ""].elements["" + fnameArray[i] + ""].value = fvalueArray[i];
                    }
                }
            } else {//是返回对定ID值
                var _idObj;
                for (i = 0, iLen = fnameArray.length; i < iLen; i++) {
                    _idObj = _wObj.document.getElementById(fnameArray[i]);
                    if (_idObj != null && _idObj != "") _idObj.innerHTML = fvalueArray[i];
                }
            }
        }
        //typeof 返回值有六种可能： "number," "string," "boolean," "object," "function," 和 "undefined."
        if (!typeof isAlert == 'boolean') { _commonFunction.alert('isAlert必须为：false | true'); return; }
        if (!typeof isLocaton == 'boolean') { _commonFunction.alert('isLocaton必须为：false | true'); return; }
        if (!typeof isHistory == 'boolean') { _commonFunction.alert('isHistory必须为：false | true'); return; }
        if (!typeof isCloseWin == 'boolean') { _commonFunction.alert('isCloseWin必须为：false | true'); return; }
        if (isAlert) _commonFunction.alert(alertStr);
        if (isLocaton) _commonFunction.location(_wObj, locUrl);
        if (isHistory) _commonFunction.history(goNum);
        if (isCloseWin) _commonFunction.close();
    },
    openWindow: function () {
        /* openWindow():	打开新窗口 ---------------------------------------------------\
        * 参数说明(7个参数值):	
        * _pars[0]:	打开方式: _pars[0]=0新窗口打开; _pars[0]=1无菜单栏窗口打开.
        * _pars[1]:	打开的网址
        * _pars[2]:	窗口的宽
        * _pars[3]:	窗口的高
        * _pars[4]:	是否有滚动条: _pars[6]=0无滚动条显示; _pars[6]=1有滚动条显示
        * _pars[5]:	是否可改变大小: _pars[7]=0 不可以; _pars[7]=1 可以
        * _pars[6]:	对应于屏幕的top值
        * _pars[7]:	对应于屏幕的left值
        \--------------------------------------------------------------------------------*/
        var _pars = new Array(0, null, 300, 300, 0, 0, 200, 200);
        if (arguments.length < 2) {
            alert("错误提示: 最少必须为有>=2个参数值: Mode和URL值！\n\n请参考CommonJS.openWindow()参数说明调用。\n ");
            return false;
        }
        if (arguments.length > 7) {//检查参数最大长度<=6
            alert("错误提示: 最多只能传>=6个参数值！\n\n请参考CommonJS.openWindow()参数说明调用。\n ");
            return false;
        }
        for (var i = 0, iLen = arguments.length; i < iLen; i++) {
            switch (i) {
                //第1,3,4,5,6,7的参数必须为数字类型.  
                case 0:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                    if (Object.isNumber(arguments[i])) {//必须是数字值,默认=0.
                        _pars[i] = arguments[i];
                    } else {
                        alert("错误提示:第" + (i + 1) + "个参数值有误，必须为数字类型！\n\n请参考CommonJS.openWindow()参数说明调用。\n ");
                        return false;
                    }
                    break;
                case 1:
                    _pars[i] = arguments[i];
                    if (_pars[i] == null) {
                        alert("错误提示: 必须输入URL值！\n\n请参考CommonJS.openWindow()参数说明调用。\n ");
                        return false;
                    }
                    break;
                default:
                    break;
            }
        }
        //打开窗口方式
        if (_pars[0] == 0) {
            window.open(_pars[1]);
        } else {
            if (Prototype.Browser.IE) { //Prototype.Browser.IE,Opera,WebKit,Gecko,MobileSafari
            } else {
                _pars[2] = _pars[2] + 100;
                _pars[3] = _pars[3] + 50;
            }
            var _oPars = 'status=0,toolbar=0,titlebar=1,menubar=0,location=0,channelmode=0,directories=0'
            _oPars += ',width=' + _pars[2];
            _oPars += ',height=' + _pars[3];
            _oPars += ',scrollbars=' + _pars[4];
            _oPars += ',resizable=' + _pars[5];
            _oPars += ',top=' + _pars[6];
            _oPars += ',left=' + _pars[7];
            window.open(_pars[1], '_blank', _oPars, true);
        }
    },
    showSwf: function (fileURL, flashWidth, flashHeight) {
        /* showFlash(fileURL,flashWidth,flashHeight):	显示Flash的.swf文件 --------------\
        * 参数说明：
        * fileURL:	文件的路径URL
        * flashWidth：	显示的宽值
        * flashHeight:	显示的高值
        \--------------------------------------------------------------------------------*/
        var _returnValue = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + flashWidth + '" height="' + flashHeight + '">';
        _returnValue += '<param name="movie" value="' + fileURL + '" />';
        _returnValue += '<param name="quality" value="high" />';
        _returnValue += '<param name="wmode" value="transparent" />';
        _returnValue += '<embed src="' + fileURL + '" quality="high"  wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + flashWidth + '" height="' + flashHeight + '"></embed>';
        _returnValue += '</object>';
        document.writeln(_returnValue);
    },
    showFlvVideo: function (fileURL, flashWidth, flashHeight, isShowLogo) {
        /* showFlvVideo(fileURL,flashWidth,flashHeight):	显示Flash的.swf文件 -------------\
        * 参数说明：
        * fileURL:	文件的路径URL
        * flashWidth：	显示的宽值
        * flashHeight:	显示的高值
        * isShowLogo:	是否显示Logo: true|false; 
        \--------------------------------------------------------------------------------*/
        var _flashVarsParam = 'vcastr_file=' + fileURL + '&IsAutoPlay=1&DefaultVolume=35&IsShowBar=2&BarColor=0x009933&IsContinue=1';
        if (isShowLogo) { _flashVarsParam += '&LogoUrl=http://www.hinan.com.cn/common/images/logoflv.png'; }
        var _returnValue = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + flashWidth + '" height="' + flashHeight + '">';
        _returnValue += '<param name="movie" value="http://www.hinan.com.cn/common/vcastr22/vcastr22.swf" />';
        _returnValue += '<param name="quality" value="high" />';
        _returnValue += '<param name="menu" value="false" />';
        _returnValue += '<param name="allowFullScreen" value="true" />';
        _returnValue += '<param name="FlashVars" value="' + _flashVarsParam + '" />';
        _returnValue += '<embed src="http://www.hinan.com.cn/common/vcastr22/vcastr22.swf" allowFullScreen="true" FlashVars="' + _flashVarsParam + '" menu="false" quality="high" width="' + flashWidth + '" height="' + flashHeight + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
        _returnValue += '</object>';
        document.writeln(_returnValue);
    },
    showVideo: function (fileURL, flashWidth, flashHeight) {
        /* showVideo(fileURL,flashWidth,flashHeight):	显示视频文件: mp3,avi,wmv,wav,mp4,mid等-------------\
        * 参数说明：
        * fileURL:	文件的路径URL
        * flashWidth：	显示的宽值
        * flashHeight:	显示的高值
        \------------------------------------------------------------------------------------------------*/
        var _returnValue = '<object width="' + flashWidth + '" height="' + flashHeight + '" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" align="baseline" border="0" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">';
        _returnValue += '<param name="FileName" value="' + fileURL + '" />';
        _returnValue += '<param name="ShowControls" value="1" />';
        _returnValue += '<param name="ShowPositionControls" value="0" />';
        _returnValue += '<param name="ShowAudioControls" value="1" />';
        _returnValue += '<param name="ShowTracker" value="1" />';
        _returnValue += '<param name="ShowDisplay" value="0" />';
        _returnValue += '<param name="ShowStatusBar" value="1">';
        _returnValue += '<param name="AutoSize" value="0" />';
        _returnValue += '<param name="ShowGotoBar" value="0" />';
        _returnValue += '<param name="AutoStart" value="1" />';
        _returnValue += '<param name="PlayCount" value="0" />';
        _returnValue += '<param name="AnimationAtStart" value="0" />';
        _returnValue += '<param name="TransparentAtStart" value="0" />';
        _returnValue += '<param name="AllowScan" value="0" />';
        _returnValue += '<param name="EnableContextMenu" value="1" />';
        _returnValue += '<param name="ClickToPlay" value="0" />';
        _returnValue += '<param name="InvokeURLs" value="1" />';
        _returnValue += '<param name="DefaultFrame" value="datawindow" />';
        _returnValue += '<embed src="' + fileURL + '" align="baseline" border="0" width="' + flashWidth + '" height="' + flashHeight + '" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&amp;sbp=mediaplayer&amp;ar=media&amp;sba=plugin&amp;" name="MediaPlayer" showcontrols="1" showpositioncontrols="0" showaudiocontrols="1" showtracker="1" showdisplay="0" showstatusbar="1" autosize="0" showgotobar="0" showcaptioning="0" autostart="1" autorewind="0" animationatstart="0" transparentatstart="0" allowscan="1" enablecontextmenu="1" clicktoplay="0" invokeurls="1" defaultframe="datawindow"></embed>';
        _returnValue += '</object>';
        document.writeln(_returnValue);
    },
    showAutomate: function (sfile, sw, sh, isshowLogo, notpic) {//自动显示
        if (notpic == null || notpic == "") { notpic = '/common/images/notpic75X55.gif'; }
        if (sfile == "" || sfile == null) {
            document.write('<img src="' + notpic + '" width=' + sw + ' height=' + sh + ' border=0 />');
            return;
        }
        var _sfile = sfile.toLowerCase();
        _sfile = _sfile.substr(_sfile.lastIndexOf('.')); //得到文件后缀名
        if (_sfile == "" || _sfile == null) {
            document.write('<img src="' + notpic + '" width=' + sw + ' height=' + sh + ' border=0 />');
            return;
        } else {

            if (_sfile == ".gif" || _sfile == ".jpg" || _sfile == ".png" || _sfile == ".bmp") {//图片
                document.write('<img src="' + sfile + '" width=' + sw + ' height=' + sh + ' border=0 />');
                return;
            } else if (_sfile == ".swf") {//.swf
                this.showSwf(sfile, sw, sh);
                return;
            } else if (_sfile == ".flv") {//.flv
                this.showFlvVideo(sfile, sw, sh, isshowLogo);
                return;
            } else {
                document.write('<img src="' + notpic + '" width=' + sw + ' height=' + sh + ' border=0 />');
                return;
            }
        }

    },
    showPicRoll: function (flashWidth, flashHeigth, textHeight, flashBgColor, pics, links, texts) {
        /* showPicRoll(flashWidth,flashHeigth,textHeight,flashBgColor,pics,links,texts):	显示滚动.jpg图片的Flash------\
        * 参数说明：
        * flashWidth：	显示的宽值
        * flashHeight:	显示的高值
        * textHeight:	文本枢高度
        * flashBgColor:显示背景色
        * pics:		图片字符串文本： 	 pics=img1+"|"+img2+"|"+img3+"|"+img4+"|"+img5;
        * links：		超链接字符串文本： links=url1+"|"+url2+"|"+url3+"|"+url4+"|"+url5;
        * texts：		图片字符串文本： 	 texts=标题1+"|"+标题2+"|"+标题3+"|"+标题4+"|"+标题5;
        \-------------------------------------------------------------------------------------------------------------*/
        if (flashBgColor == "") flashBgColor = "#F0F0F0";
        if (textHeight == "") textHeight = 0;
        var linksStr = '';
        var linksArray = links.split("|");
        for (var i = 0, iLen = linksArray.length; i < iLen; i++) {
            linksStr = linksStr + escape(linksArray[i]) + '|';
        }
        linksStr = linksStr.substr(0, linksStr.length - 1);
        var _returnValue = '<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0 width=' + flashWidth + ' height=' + flashHeigth + '>';
        _returnValue += '<param name=allowscriptAccess value=sameDomain />';
        _returnValue += '<param name=movie value=http://www.hinan.com.cn/common/flashs/picScrollAds.swf />';
        _returnValue += '<param name=quality value=high />';
        _returnValue += '<param name=bgcolor value=' + flashBgColor + ' />';
        _returnValue += '<param name=menu value=false />';
        _returnValue += '<param name=wmode value=opaque />';
        _returnValue += '<param name=FlashVars value="pics=' + pics + '&links=' + linksStr + '&texts=' + texts + '&borderwidth=' + flashWidth + '&borderheight=' + flashHeigth + '&textheight=0" />';
        _returnValue += '<embed src=http://www.hinan.com.cn/common/flashs/picScrollAds.swf wmode=opaque FlashVars="pics=' + pics + '&links=' + linksStr + '&texts=' + texts + '&borderwidth=' + flashWidth + '&borderheight=' + flashHeigth + '&textheight=' + textHeight + '  menu=false bgcolor=' + flashBgColor + '" quality=high width=' + flashWidth + ' height=' + flashHeigth + ' allowscriptAccess=sameDomain type=application/x-shockwave-flash  pluginspage=http://www.macromedia.com/go/getflashplayer></embed>';
        _returnValue += '</object>';
        document.writeln(_returnValue);
    },
    _getCookieVal: function (offset) {
        /* _getCookieVal(offset):	内部function，读取客户端浏览器指定名字Name的cookie值-------\
        * 参数说明：
        * offset:	cookie名称
        \--------------------------------------------------------------------------------*/
        var endstr = document.cookie.indexOf(";", offset);
        if (endstr == -1)
            endstr = document.cookie.length;
        return unescape(document.cookie.substring(offset, endstr));
    },
    getCookie: function (name) {
        /* getCookie(name):	读取客户端浏览器指定名字Name的cookie值-----------------------------\
        * 参数说明：
        * name:	cookie名称
        \--------------------------------------------------------------------------------*/
        var arg = name + "=";
        var alen = arg.length;
        var clen = document.cookie.length;
        var i = 0;
        while (i < clen) {
            var j = i + alen;
            if (document.cookie.substring(i, j) == arg)
                return this._getCookieVal(j);
            i = document.cookie.indexOf(" ", i) + 1;
            if (i == 0)
                break;
        }
        return "";
    },
    setCookie: function (cookieName, cookieValue, nDays, domain) {
        /* setCookie(cookieName,cookieValue,nDays):	设置客户端浏览器的Cookie-----------------\
        * 参数说明：
        * cookieName:	cookie名称
        * cookieValue:	cookie值
        * nDays:		N天内cookie值有效
        * domain:		设置在那个域名内有效
        \--------------------------------------------------------------------------------*/
        var today = new Date();
        var expire = new Date();
        if (nDays == null || nDays == 0) nDays = 1;
        expire.setTime(today.getTime() + 3600000 * 24 * nDays);
        document.cookie = cookieName + "=" + escape(cookieValue) + ";path=/;domain=" + domain + ";expires=" + expire.toGMTString();
    },
    clearABlur: function () {
        try {
            var bod = document.getElementsByTagName('body')[0];
            var bodA = bod.getElementsByTagName('a');
            for (var j = 0, jLen = bodA.length; j < jLen; j++) {
                bodA[j].onfocus = function () {
                    //消除链接虚线框
                    this.blur();
                }
            }
        } catch (e) { }
    },
    resizeWdHt: function (obj, w, h) {
        /* resizeWdHt(object,w,h):	改变指定对象的宽和高，当指定的值大于对象宽和高时改变--------------\
        * 参数说明：
        * obj: Object | id
        * w:	宽值
        * h:	高值
        \--------------------------------------------------------------------------------*/

        var cobj = obj;
        if (typeof cobj != 'object') {
            cobj = $(obj)[0];
            if (typeof cobj != 'object') return;
        }

        if (w <= 0) w = 550;
        if (h <= 0) h = 550;

        var tempw, temph;
        if (cobj.width <= w && cobj.height <= h) {
            return;
        }

        if (cobj.width > w) {
            cobj.width = w;
            temph = parseInt(cobj.height * (w / cobj.width));
            if (temph > h) {
                cobj.height = h;
                cobj.width = parseInt(cobj.width * (h / cobj.width));
            } else {
                cobj.height = temph;
            }
        } else {
            cobj.height = h;
            tempw = parseInt(cobj.width * (h / cobj.height));
            if (tempw > w) {
                hispic.width = w;
                cobj.height = parseInt(cobj.height * (w / cobj.width));
            } else {
                cobj.width = tempw;
            }
        }
    },
    changeObject: function (mode, aObj, aValue) {
        var obj = aObj;
        if (typeof aObj == 'object') {
            obj = aObj
        } else if (typeof aObj == 'string') {
            obj = $(aObj)[0];
        }
        if (obj != null && obj != '' && obj != 'undefined') {
            switch (mode.toLowerCase()) {
                case 'src':
                    obj.src = aValue;
                    break;
                case 'href':
                    obj.href = aValue;
                    break;
                case 'alt':
                    obj.alt = aValue;
                    break;
                case 'target':
                    obj.target = aValue;
                    break;
                case 'cname':
                    obj.className = aValue;
                    break;
                default:
                    break;
            }
        }
    },
    preLoadImages: function () { //载入图片
        var d = document;
        if (d.images) {
            if (!d.MM_p) d.MM_p = new Array();
            var i, j = d.MM_p.length, a = arguments;
            for (i = 0, iLen = a.length; i < iLen; i++) {
                if (a[i].indexOf("#") != 0) {
                    d.MM_p[j] = new Image;
                    d.MM_p[j++].src = a[i];
                }
            }
        }
    },
    checkFileUpload: function (sFile, upOper) {
        var aArray;
        if (Object.isArray(upOper)) {
            aArray = upOper;
        } else {
            switch (upOper) {
                case "pic":
                    aArray = 0;
                    break;
                case "swf":
                    aArray = 1;
                    break;
                case "flv":
                    aArray = 2;
                    break;
                case "music":
                    aArray = 3;
                    break;
                case "doc":
                    aArray = 4;
                    break;
                default:
                    aArray = 'allFile';
                    break;
            }
        }
        var _cfs = this.checkFileSelect(aArray, sFile);
        if (!_cfs.isUpload) {
            alert(_cfs.errorMessages);
            return false;
        }
        return true;
    },
    checkFileSelect: function (NumOrArray_Value, sFile) {
        /*---检测本地选择的上传类型--------------------------------------------------\
        * var arrs = 1 | Array() | 'allFile';
        * var cfs = Hinan.Commons.checkFileSelect(arrs,'/images/test.gif'); 
        * if(!cfs.isUpload) alert(cfs.errorMessages);
        *
        \* ----------------------------------------------------------------------*/

        //用户能上传的文件类型
        var file_ext = new Array(
			new Array('.gif', '.jpg', '.jpeg', '.png', '.bmp'),
			new Array('.swf'),
			new Array('.flv'),
			new Array('.mp3', '.mp4', '.wma', '.wav', '.av'),
			new Array('.doc', '.docx', '.ppt', '.chm', '.txt', '.pdf', '.rar', '.zip', '.gz')
		);
        var i;
        var _fileExtList = '', _errorMessages = '', returnValue = false;
        if (sFile == null || sFile == '') {
            _errorMessages = '错误提示：\n\n您指定的文件后缀名.ext！';
            return { isUpload: false, errorMessages: _errorMessages };
        }
        sFile = sFile.toLowerCase();
        //sFile= sFile.substr((sFile.length-5));
        sFile = sFile.substr(sFile.lastIndexOf('.'));

        var isNum = false, isArr = false, isAllFiles = false, obj = NumOrArray_Value;
        if (Object.isNumber(obj)) {//单个指定数组
            if (obj > -1) isNum = true;
        } else if (Object.isArray(obj)) {//指定数组多个数组之一(必须是数据对象)
            isArr = true;
        } else {//全部之一
            isAllFiles = true;
        }
        if (isAllFiles) {//全部用户能上传的文件类型之一
            for (i = 0, iLen = file_ext.length; i < iLen; i++) {
                _fileExtList += '|' + file_ext[i].toString();
                for (var j = 0, jLen = file_ext[i].length; j < jLen; j++) {
                    if (sFile.indexOf(file_ext[i][j]) > -1) {
                        returnValue = true;
                        break;
                    }
                }
                if (returnValue == true) break;
            }
            _errorMessages = '错误提示：\n\n您当前选择的文件类型：' + sFile + '\n\n请正确选择文件类型：必须是如下(' + _fileExtList + ')的其中之一。';
        }

        if (isNum) {//单个指定数组之中的文件
            if (obj >= file_ext.length || obj < 0) {
                _errorMessages = '错误提示：\n\n您指定的数组值不存在或有误，请检查您的参数值！';
                return { isUpload: false, errorMessages: _errorMessages };
            }
            for (var jj = 0, jjLen = file_ext[obj].length; jj < jjLen; j++) {
                if (sFile.indexOf(file_ext[obj][jj]) > -1) {
                    returnValue = true;
                    break;
                }
            }
            _fileExtList = file_ext[obj].toString();
            _errorMessages = '错误提示：\n\n您当前选择的文件类型：' + sFile + '\n\n请正确选择文件类型：必须是如下(' + _fileExtList + ')的其中之一。';
        }

        if (isArr) {//指定数组（多个数组）之一
            //obj 外部对比的数组值,如:0,1,4;或3,4等, 要注意过滤数组
            if (obj.length > file_ext.length) {
                _errorMessages = '错误提示：\n\n您设置的数组参数有误，请检查您的数组参数值！';
                return { isUpload: false, errorMessages: _errorMessages };
            }
            for (i = 0, iLen = obj.length; i < iLen; i++) {
                if (!isFinite(obj[i])) { //数据值不为数字提示错误信息
                    _errorMessages = '错误提示：\n\n您提交的数组参数有误，请检查您的数组参数值！';
                    return { isUpload: false, errorMessages: _errorMessages };
                }
                _fileExtList += '|' + file_ext[obj[i]].toString() + '\n\n';
                if (file_ext[obj[i]].toString().indexOf(sFile) > -1) {
                    returnValue = true;
                    break;
                }
            }


            _errorMessages = '错误提示：\n\n您当前选择的文件类型：' + sFile + '\n\n请正确选择文件类型必须是如下：(\n\n' + _fileExtList + '的其中之一。';
        }
        return { isUpload: returnValue, errorMessages: _errorMessages };
    },
    _clipboardDataShow: function (msg, idShowName, clas) {
        var cla = (clas) ? clas : "error";
        //disp.className = cla;
        $(idShowName)[0].innerHTML = "<span class=" + cla + ">" + msg + " <a href=javascript:void(0) onclick=$('" + idShowName + "')[0].innerHTML='';><img src=/common/images/closesm.gif border=0 alt=关闭 /></span>";
    },
    setClipboardData: function (URL, Title, showID, clas) {// 复制当前URL，通过雅虎通/MSN/QQ等通讯软件发送给好友
        var curURL = document.location.href;
        URL = (URL) ? URL : curURL;
        var idShowName = (showID) ? showID : "msgID";
        var cla = (clas) ? clas : "cRed";
        if (window.clipboardData) {
            //clipboardData.setData("Text",URL+"\r\n\n我给你推荐http://www.hinan.com.cn海南之家\r\n信息标题："+Title+"。你有空的话看看，还很不错的！^_^");
            clipboardData.setData("Text", Title + "\n" + URL + "\n\n我给你推荐的，你有空的话看看，还很不错的！^_^\n");
        } else if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
            } catch (e) {
                cla = 'cRed';
                this._clipboardDataShow('复制失败，请选择地址信息，并右键鼠标选择复制', idShowName, cla);
                return;
            }
            var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
            if (!clip) {
                cla = 'cRed';
                this._clipboardDataShow('复制失败，请选择地址信息，并右键鼠标选择复制', idShowName, cla);
                return;
            }
            var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
            if (!trans) {
                cla = 'cRed';
                this._clipboardDataShow('复制失败，请选择地址信息，并右键鼠标选择复制', idShowName, cla);
                return;
            }
            trans.addDataFlavor('text/unicode');
            //var str = new Object();
            var len = new Object();
            var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
            var copytext = URL;
            str.data = copytext;
            trans.setTransferData("text/unicode", str, copytext.length * 2);
            var clipid = Components.interfaces.nsIClipboard;
            if (!clip) return false;
            clip.setData(trans, null, clipid.kGlobalClipboard);
        }
        this._clipboardDataShow('地址已经复制成功，您可以通过雅虎通/MSN/QQ等通讯软件发送给好友', idShowName, cla);
        return;
    }
};

/*******************************************************************************************\
 * 对象srcMarquee(idDiv,Step,Width,Height,Timer,DelayTime,WaitTime,ScrollStep): 滚动暂停显示
 * (c) 2005-2008 hinan.com.cn
 * author: 陈卓红(Heney)
 *
 * 参数说明：
 * (无)
 * EditDatetime:	2008-04-16
\-------------------------------------------------------------------------------------------*/
function srcMarquee(){
	this.ID = document.getElementById(arguments[0]);
	if(!this.ID){this.ID = -1;return;}
	this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.Correct = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
	this.Step = 1;
	this.Timer = 30;
	this.DirectionArray = {"top":0 , "bottom":1 , "left":2 , "right":3};
	if(typeof arguments[1] == "number")this.Direction = arguments[1];
	if(typeof arguments[2] == "number")this.Step = arguments[2];
	if(typeof arguments[3] == "number")this.Width = arguments[3] + 'px';
	if(typeof arguments[4] == "number")this.Height = arguments[4]  + 'px';
	if(typeof arguments[5] == "number")this.Timer = arguments[5];
	if(typeof arguments[6] == "number")this.DelayTime = arguments[6];
	if(typeof arguments[7] == "number")this.WaitTime = arguments[7];
	if(typeof arguments[8] == "number")this.ScrollStep = arguments[8]
	this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
	this.ID.noWrap = true;
	this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
	if(arguments.length >= 7)this.Start();
}
srcMarquee.prototype.Start = function(){
	if(this.ID == -1)return;
	if(this.WaitTime < 800)this.WaitTime = 800;
	if(this.Timer < 20)this.Timer = 20;
	if(this.Width == 0)this.Width = parseInt(this.ID.style.width) + 'px';
	if(this.Height == 0)this.Height = parseInt(this.ID.style.height)  + 'px';
	if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];
	this.HalfWidth = Math.round(this.Width / 2);
	this.BakStep = this.Step;
	this.ID.style.width = this.Width;
	this.ID.style.height = this.Height;
	if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
	var msobj = this;
	var timer = this.Timer;
	var delaytime = this.DelayTime;
	var waittime = this.WaitTime;
	msobj.StartID = function(){msobj.Scroll()}
	msobj.Continue = function(){
		if(msobj.MouseOver == 1){
		setTimeout(msobj.Continue,delaytime);
     }
     else{ clearInterval(msobj.TimerID);
		msobj.CTL = msobj.Stop = 0;
		msobj.TimerID = setInterval(msobj.StartID,timer);
     }
    }
	msobj.Pause = function(){
		msobj.Stop = 1;
		clearInterval(msobj.TimerID);
		setTimeout(msobj.Continue,delaytime);
    }
	msobj.Begin = function(){
   msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth : msobj.ID.scrollHeight;
   if((msobj.Direction <= 1 && msobj.ClientScroll <msobj.Height) || (msobj.Direction > 1 && msobj.ClientScroll <msobj.Width))return;
   msobj.ID.innerHTML += msobj.ID.innerHTML;
   msobj.TimerID = setInterval(msobj.StartID,timer);
   if(msobj.ScrollStep < 0)return;
   msobj.ID.onmousemove = function(event){
       if(msobj.ScrollStep == 0 && msobj.Direction > 1){
			var eventobj = event || window.event;
			if(window.event){
				if(msobj.IsNotOpera){msobj.EventLeft = eventobj.srcElement.id == msobj.ID.id ? eventobj.offsetX - msobj.ID.scrollLeft : eventobj.srcElement.offsetLeft - msobj.ID.scrollLeft + eventobj.offsetX;}
				else {
				    msobj.ScrollStep = null; return;
                }
			}
else {
    msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;
            }
			msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
			msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
			msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth);
			}
		}
		msobj.ID.onmouseover = function(){
			if(msobj.ScrollStep == 0)return;
			msobj.MouseOver = 1;
			clearInterval(msobj.TimerID);
		}
		msobj.ID.onmouseout = function(){
		if(msobj.ScrollStep == 0){
			if(msobj.Step == 0)msobj.Step = 1;
			return;
		}
		msobj.MouseOver = 0;
		if(msobj.Stop == 0){
			clearInterval(msobj.TimerID);
			msobj.TimerID = setInterval(msobj.StartID,timer);
		}}}
		setTimeout(msobj.Begin,waittime);
}

srcMarquee.prototype.Scroll = function(){
	switch(this.Direction){
	case 0:
	this.CTL += this.Step;
	if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
		this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
		this.Pause();
		return;
	}
	else{
		if(this.ID.scrollTop >= this.ClientScroll){this.ID.scrollTop -= this.ClientScroll;}
		this.ID.scrollTop += this.Step;
	}
	break;

	case 1:
	this.CTL += this.Step;
	if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
		this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
		this.Pause();
		return;
	}
	else{
		if(this.ID.scrollTop <= 0){this.ID.scrollTop += this.ClientScroll;}
		this.ID.scrollTop -= this.Step;
	}
	break;

	case 2:
	this.CTL += this.Step;
	if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
		this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
		this.Pause();
		return;
	}
	else{
		if(this.ID.scrollLeft >= this.ClientScroll){this.ID.scrollLeft -= this.ClientScroll;}
		this.ID.scrollLeft += this.Step;
	}
	break;

	case 3:
	this.CTL += this.Step;
	if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
		this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
		this.Pause();
		return;
	}
	else{
		if(this.ID.scrollLeft <= 0){this.ID.scrollLeft += this.ClientScroll;}
	this.ID.scrollLeft -= this.Step;
	}
	break;
	}
}

/*******************************************************************************************\
 * 对象RollMarquee (mode,speed,obj1,obj2,obj3): 滚动无暂停显示
 * (c) 2005-2008 hinan.com.cn
 * author: 陈卓红(Heney)
 *
 * 参数说明：
 * mode = left|top|right|bottom
 * speed = 滚动时间设置,数字值越大,越慢
 * obj1,obj2,obj3 = Div层 (最外层0,内部层1,内部层2), 其中: 0是1-2的父层,1-2同级.
 * EditDatetime:	2008-04-16
\-------------------------------------------------------------------------------------------*/
function RollMarquee (mode,speed,obj1,obj2,obj3){
	this.mode = mode;
	this.speed = speed;
	this.dome = $(obj1)[0];
	this.dome1 = $(obj2)[0];
	this.dome2 = $(obj3)[0];
	//this.StartID = null;
	this.StartID = new Function();
	this.start();
}
RollMarquee.prototype.start = function(){
	var msobj = this;
	var speed = this.speed;
	//this.StartID主要用于 setInterval(function(),times);
	this.StartID = function(){msobj.marquee()}
	this.dome2.innerHTML = this.dome1.innerHTML;  //克隆obj1为obj2
	if(this.mode=='bottom')this.dome.scrollTop = this.dome.scrollHeight;
	var MyMar=setInterval(msobj.StartID,speed); 
	//var MyMar= new PeriodicalExecuter(msobj.StartID, speed);
	this.dome.observe('mouseover', function(event){// onmouseover
		clearInterval(MyMar); //鼠标移上时清除定时器达到滚动停止的目的 
	});
	// dome.onmouseover=function() {clearInterval(MyMar)}; 
	this.dome.observe('mouseout', function(event){// onmouseout
		MyMar= setInterval(msobj.StartID,speed); //鼠标移开时重设定时器
	});
	// dome.onmouseout=function() {MyMar=setInterval(msobj.StartID,speed)}; 
}
RollMarquee.prototype.marquee = function(){
	switch(this.mode){
		case 'top':
			if( this.dome2.offsetTop - this.dome.scrollTop<=0 )//当滚动至obj1与obj2交界时 
				this.dome.scrollTop -= this.dome1.offsetHeight;  //obj跳到最顶端 
			else{ 
				this.dome.scrollTop++;
			} 
			break;
		case 'right':
			if( this.dome.scrollLeft<=0 ) 
				this.dome.scrollLeft += this.dome2.offsetWidth;
			else{ 
				this.dome.scrollLeft--;
			}
			break;
		case 'bottom':
			if( this.dome1.offsetTop - this.dome.scrollTop>=0 )//当滚动至obj1与obj2交界时 
				this.dome.scrollTop += this.dome2.offsetHeight;  //obj跳到最顶端 
			else{ 
				this.dome.scrollTop--;
			} 
			break;
		case 'left':
			if( this.dome2.offsetWidth - this.dome.scrollLeft<=0 ) 
				this.dome.scrollLeft -= this.dome1.offsetWidth;
			else{ 
				this.dome.scrollLeft++; 
			}
			break;
		default:
			break;
	}
}

/***(未完成)****************************************************************************************\
 * 对象RollPic: 变换图片显示
 * (c) 2005-2008 hinan.com.cn
 * author: 陈卓红(Heney)
 *
 * 参数说明：
 * 
 * EditDatetime:	2008-04-20
\-------------------------------------------------------------------------------------------*/
function RollPic( speed, a_id,aurlArray, img_id,imgArray, title_id,titleArray, info_id,infoArray, numPic_id,fPicName){
	if(arguments.length>11) { alert('参数长度有误,最多11个参数!');return;}
	if(!Object.isNumber(arguments[0])) {alert('参数[1]: 必须为数字类型!');return;}
	if ($(arguments[1])[0] == null) { alert('参数[2]: 对象ID不存在,请重设置ID值!'); return; }
	if(!Object.isArray(arguments[2])) {alert('参数[3]: 必须为数组类型!');return;}
	if ($(arguments[3])[0] == null) { alert('参数[4]: 对象ID不存在,请重设置ID值!'); return; }
	if(!Object.isArray(arguments[4])) {alert('参数[5]: 必须为数组类型!');return;}
	if ($(arguments[5])[0] == null) { alert('参数[6]: 对象ID不存在,请重设置ID值!'); return; }
	if(!Object.isArray(arguments[6])) {alert('参数[7]: 必须为数组类型!');return;}
	if ($(arguments[7])[0] == null) { alert('参数[8]: 对象ID不存在,请重设置ID值!'); return; }
	if(!Object.isArray(arguments[8])) {alert('参数[9]: 必须为数组类型!');return;}
	if ($(arguments[9])[0] == null) { alert('参数[10]: 对象ID不存在,请重设置ID值!'); return; }
	if(fPicName==null||fPicName=='') fPicName = '/common/images/numPic/menu0';
	//初始化
	this.obj = this.a_id = this.img_id = this.title_id = this.info_id = this.npicShow_id = this.numPic_id = null;
	this.aurlArray = this.imgArray = this.titleArray = this.infoArray = this._a_npicArray = this._npicArray = this._numPicArray = this._numPicArray_On = new Array();
	this.rotateID = new Function();
	
	this.speed = speed;
	this._length = aurlArray.length;
	this._n = 0;
	
	//设置值
	this.a_id = a_id;
	this.img_id = img_id;
	this.title_id = title_id;
	this.info_id = info_id;
	this.numPic_id = numPic_id;
	
	this.aurlArray = aurlArray;
	this.imgArray = imgArray;
	this.infoArray = infoArray;
	
	var _titleArray = new Array();
	var _a_npicArray = new Array();
	var _npicArray = new Array();
	var _numPicArray = new Array();
	var _numPicArray_On = new Array();
	var _npicName = '_' + Math.round(Math.random() * 1000000) + '_';
	var _numpicShow = '';
	for(var j=0,jLen=this._length; j<jLen; j++){
		_titleArray[j] = '<a href="' + aurlArray[j] + '" target="_blank"><b>' + titleArray[j] + '</b></a>';
		_a_npicArray[j] = 'a_num_' + _npicName + '_img_' + j;
		_npicArray[j] = 'num_' + _npicName + '_img_' + j;
		_numPicArray[j] = fPicName + (j+1) + '.gif';
		_numPicArray_On[j] = fPicName + (j+1) + '_on.gif';
		_numpicShow += '<a href="javascript:void(0)" id="'+_a_npicArray[j]+'"><img id="' + _npicArray[j] + '" src="' + _numPicArray[j] + '" border=0 /></a>';
	}
	this.titleArray = _titleArray;
	this._a_npicArray = _a_npicArray;
	this._npicArray = _npicArray;
	this._numPicArray = _numPicArray;
	this._numPicArray_On = _numPicArray_On;
	this.obj = this;
	//显示N,图片
	this.start(this.numPic_id,_numpicShow);
}
RollPic.prototype.start = function(obj,oHtml){
    $(obj)[0].innerHTML = oHtml;
	var _obj = this.obj;
	_obj.rotateID = function(){_obj.rotate()}
	for(var i=0,j=_obj._a_npicArray.length; i<j; i++){
	    $(_obj._a_npicArray[i])[0].observe('mouseover', function (event) {
			var elt = Event.element(event);
			//当前操作 _on [i]值
			var _on = 0, _length = _obj._npicArray.length;
			var aobj = $(elt)[0];
			
			for( var i=0,iLen=_length; i<iLen; i++ ){
				if( aobj.id == _obj._npicArray[i] ){
					_on = i;
					break;
				}
			}
			//初始化还原numpic.src显示
            for (var n = 0, nLen = _length; n < nLen; i++) {
				Hinan.Commons.changeObject( 'src', _obj._npicArray[n], _obj._numPicArray[n] ); 
			}
			//改变对象[_on]值
			Hinan.Commons.changeObject( 'src', _obj._npicArray[_on], _obj._numPicArray_On[_on] ); 
			//改变对象值 a_id_id.href 的值
			Hinan.Commons.changeObject( 'href', _obj.a_id, _obj.aurlArray[_on] );
			//改变对象值 img_id.src 的值
			Hinan.Commons.changeObject( 'src', _obj.img_id, _obj.imgArray[_on] );
			//改变对象值 info_id.innerHTML 的值
			$(_obj.info_id)[0].innerHTML = _obj.infoArray[_on];
			//改变对象值 title_id.innerHTML 的值
			$(_obj.title_id)[0].innerHTML = _obj.titleArray[_on];
			_obj._n = _on + 1;
		});
		$(_obj._a_npicArray[i])[0].observe('click',function(event){
			var elt = Event.element(event);
			//当前操作 _on [i]值
			var _on = 0, _length = _obj._npicArray.length;
			var aobj = $(elt)[0];
			
			for( var i=0,iLen=_length; i<iLen; i++ ){
				if( aobj.id == _obj._npicArray[i] ){
					_on = i;
					break;
				}
			}
			_obj._n = _on + 1;
			Hinan.Commons.openWindow(0,_obj.aurlArray[_on]);
		});
	}
	_obj.rotate();
	setInterval(_obj.rotateID,_obj.speed); 
}

RollPic.prototype.rotate = function(){
	var _obj = this;
	var _on;
	_on = _obj._n = ( _obj._n >= _obj._length ) ? 0 : _obj._n;
	
	//初始化还原numpic.src显示
	for( var i=0,iLen=_obj._length; i<iLen; i++ ){
		Hinan.Commons.changeObject( 'src', _obj._npicArray[i], _obj._numPicArray[i] ); 
	}
	//改变对象[_on]值
	Hinan.Commons.changeObject( 'src', _obj._npicArray[_on], _obj._numPicArray_On[_on] ); 
	//改变对象值 a_id_id.href 的值
	Hinan.Commons.changeObject( 'href', _obj.a_id, _obj.aurlArray[_on] );
	//改变对象值 img_id.src 的值
	Hinan.Commons.changeObject( 'src', _obj.img_id, _obj.imgArray[_on] );
	//改变对象值 info_id.innerHTML 的值
	$(_obj.info_id)[0].innerHTML = _obj.infoArray[_on];
	//改变对象值 title_id.innerHTML 的值
	$(_obj.title_id)[0].innerHTML = _obj.titleArray[_on];
	
	_obj._n = _on + 1;
}
/*******************************************************************************************\
 * 对象Drag(a, aRoot): 层移动显示(源层,目标层)
 * (c) 2005-2008 hinan.com.cn
 * author: 陈卓红(Heney)
 *
 * 参数说明：
 * a, aRoot = 源层,目标层
 * EditDatetime:	2008-04-16
\-------------------------------------------------------------------------------------------*/
var Drag={
    obj:null,
	init:function(a, aRoot){
			a.onmousedown=Drag.start;
			a.root = aRoot;
			if(isNaN(parseInt(a.root.style.left)))a.root.style.left="0px";
			if(isNaN(parseInt(a.root.style.top)))a.root.style.top="0px";
			a.root.onDragStart=new Function();
			a.root.onDragEnd=new Function();
			a.root.onDrag=new Function();
		},
	start:function(a){	
			var b=Drag.obj=this;
			a=Drag.fixE(a);
			var c=parseInt(b.root.style.top);
			var d=parseInt(b.root.style.left);
			b.root.onDragStart(d,c,a.clientX,a.clientY);
			b.lastMouseX=a.clientX;
			b.lastMouseY=a.clientY;
			document.onmousemove=Drag.drag;
			document.onmouseup=Drag.end;
			return false;
		},	
	drag:function(a){
			a=Drag.fixE(a);
			var b=Drag.obj;
			var c=a.clientY;
			var d=a.clientX;
			var e=parseInt(b.root.style.top);
			var f=parseInt(b.root.style.left);
			var h,g;
			h=f+d-b.lastMouseX;
			g=e+c-b.lastMouseY;
			b.root.style.left=h+"px";
			b.root.style.top=g+"px";			
			b.lastMouseX=d;
			b.lastMouseY=c;
			b.root.onDrag(h,g,a.clientX,a.clientY);
			return false;
		},
	end:function(){			
			document.onmousemove=null;
			document.onmouseup=null;
			Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style.left),parseInt(Drag.obj.root.style.top));
			Drag.obj=null;
		},
	fixE:function(a){
			if(typeof a=="undefined")a=window.event;
			if(typeof a.layerX=="undefined")a.layerX=a.offsetX;
			if(typeof a.layerY=="undefined")a.layerY=a.offsetY;
			return a;
		}
};
