function trim(str){
	return str.replace(/(^\s*)|(\s*$)/g, "");
}
function getutf8len(str)
{
	var iArr = str.match(/[^\x00-\xff]/ig);
	return parseInt(str.length + (iArr == null ? 0 : iArr.length));
}

var marked_row = new Array;

function $(Obj)
{
	return document.getElementById(Obj);
}

function getBrowser()
{
        var browser = '';
        var agentInfo = navigator.userAgent.toLowerCase();
        if (agentInfo.indexOf("msie") > -1) {
                var re = new RegExp("msie\\s?([\\d\\.]+)","ig");
                var arr = re.exec(agentInfo);
                if (parseInt(RegExp.$1) >= 5.5) {
                        browser = 'IE';
                }
        } else if (agentInfo.indexOf("firefox") > -1) {
                browser = 'FF';
        } else if (agentInfo.indexOf("netscape") > -1) {
                var temp1 = agentInfo.split(' ');
                var temp2 = temp1[temp1.length-1].split('/');
                if (parseInt(temp2[1]) >= 7) {
                        browser = 'NS';
                }
        } else if (agentInfo.indexOf("gecko") > -1) {
                browser = 'ML';
        } else if (agentInfo.indexOf("opera") > -1) {
                var temp1 = agentInfo.split(' ');
                var temp2 = temp1[0].split('/');
                if (parseInt(temp2[1]) >= 9) {
                        browser = 'OPERA';
                }
        }
        return browser;
}

function setPointerli(theli, theliNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theli.style) == 'undefined') {
        return false;
    }

    // 1.1 Sets the mouse pointer to pointer on mouseover and back to normal otherwise.
    if (theAction == "over" || theAction == "click") {
        theli.style.cursor='pointer';
    } else {
        theli.style.cursor='';//normal';
    }

    // 3. Gets the current color...
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    if (typeof(window.opera) == 'undefined') {
        currentColor = theli.style.background;
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theli.style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
    if (currentColor.indexOf("rgb") >= 0)
    {
        var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1,
                                     currentColor.indexOf(')'));
        var rgbValues = rgbStr.split(",");
        currentColor = "#";
        var hexChars = "0123456789ABCDEF";
        for (var i = 0; i < 3; i++)
        {
            var v = rgbValues[i].valueOf();
            currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
        }
    }

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theliNum] = true;
            // Garvin: deactivated onclick marking of the checkbox because it's also executed
            // when an action (like edit/delete) on a single item is performed. Then the checkbox
            // would get deactived, even though we need it activated. Maybe there is a way
            // to detect if the row was clicked, and not an item therein...
            // document.getElementById('id_rows_to_delete' + theliNum).checked = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theliNum]) == 'undefined' || !marked_row[theliNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theliNum] = true;
            // document.getElementById('id_rows_to_delete' + theliNum).checked = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theliNum] = (typeof(marked_row[theliNum]) == 'undefined' || !marked_row[theliNum])
                                  ? true
                                  : null;
            // document.getElementById('id_rows_to_delete' + theliNum).checked = false;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            theli.style.background = newColor;
        }
        // 5.2 ... with other browsers
        else {
            theli.style.backgroundColor = newColor;
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function

function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 1.1 Sets the mouse pointer to pointer on mouseover and back to normal otherwise.
    if (theAction == "over" || theAction == "click") {
        theRow.style.cursor='pointer';
    } else {
        theRow.style.cursor='';//normal';
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
    if (currentColor.indexOf("rgb") >= 0)
    {
        var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1,
                                     currentColor.indexOf(')'));
        var rgbValues = rgbStr.split(",");
        currentColor = "#";
        var hexChars = "0123456789ABCDEF";
        for (var i = 0; i < 3; i++)
        {
            var v = rgbValues[i].valueOf();
            currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
        }
    }

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
            // Garvin: deactivated onclick marking of the checkbox because it's also executed
            // when an action (like edit/delete) on a single item is performed. Then the checkbox
            // would get deactived, even though we need it activated. Maybe there is a way
            // to detect if the row was clicked, and not an item therein...
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = false;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointerli()' function

//action get function
function getUrl(url,target)
{
	var form = document.createElement("FORM");
	form.method = "POST";
	form.action = url;
	if(target)
		form.target = target;
	else
		form.target = "_self";
	document.body.appendChild(form);
	form.submit();
}

function goback()
{
	window.history.go(-1);
}




/**
* 提示窗口
* add by xiaoyi
*/
KContainer = "wallpaper";
cssDir = "/js/popupDialog/";

// Images Directory
imageDir = "/js/popupDialog/";

// Include Style Sheet
document.write('<link rel="stylesheet" type="text/css" href="'+cssDir+'popupStyle.css">\n');

function popupDialog ( pWidth , pHeight ) {

	// define variables
	pTop = 0;
	this.width = pWidth ? pWidth : "300";
	this.height = pHeight ? pHeight : "180";
	this.defaultIcon = "<img id='icon' src='"+imageDir+"alert.gif' align=\"center\" valign=\"absmiddle\">";

	var fullBg = '<div id="fullPageBg" style="position:absolute;top:0px;left:0px;width:100%;height:100%;background:url('+imageDir+'blank.gif);"></div>';

	if ( $("popupDialogTable") == null ) {
		var el = document.getElementById(KContainer);
		//			var el = document.body;
		this.oDiv = document.createElement("span");
		this.oDiv.id = "dialogContainer";
		this.oDiv.innerHTML = fullBg;
		el.appendChild(this.oDiv);
		$("fullPageBg").style.height = document.body.scrollHeight;

		this.oShadow = document.createElement("div");
		this.oShadow.id = "dialogShadow";
		this.oShadow.style.display = "none";
		el.appendChild(this.oShadow);

		this.oTable = document.createElement("table");
		this.oTable.id = "popupDialogTable";
		this.oTable.style.width = this.width + "px";
		this.oTable.style.height = this.height + "px";
		//this.oTable.style.border = "1px solid #000000";
		this.oTable.style.backgroundColor = "#FFFFFF";
		this.oTable.cellSpacing = 0;
		this.oTable.cellPadding = 0;
		this.oTable.border = 0;

		// determine the windows position when first open
		var pClientWidth = parent ? parent.document.body.clientWidth : document.body.clientWidth;
		//var pClientHeight = parent ? parent.document.body.clientHeight : document.body.clientHeight;
		//var pScrollTop = parent ? parent.document.body.scrollTop : document.body.scrollTop;
		//var pTop = -40 + (pClientHeight / 2 + pScrollTop) - (this.height / 2);
		this.oTable.style.position = "absolute";
		left = (document.body.clientWidth / 2) - 0 - (this.width / 2);
		this.oTable.style.left = left + "px";
		if(document.documentElement.clientHeight)
		pTop = document.documentElement.clientHeight/2 - (this.height / 2) + document.documentElement.scrollTop;
		this.oTable.style.top = pTop + "px";
		// append to current document'body
		el.appendChild(this.oTable);

		// add a row for the titlebar
		this.oTrTitle = this.oTable.insertRow(0);
		this.oTrTitle.className = "popupTitle";

		// Title: add the title to the titlebar
		this.oTdTitle = this.oTrTitle.insertCell(0);
		this.oTdTitle.id = "titleContainer";
		//this.oTdTitle.onmousedown = onMouseDown;
		this.oTdTitle.style.backgroundImage = "url(" + imageDir + "titleBg.gif)";
		this.oTdTitle.height = "22";
		this.oTdTitle.width = "95%";

		// add the close image to the titlebar
		this.oTdClose = this.oTrTitle.insertCell(1);
		this.oTdClose.innerHTML = "<img style='margin-right:-1px !important;margin-right: 2px;' src='" + imageDir + "close.gif' onmouseover='this.src=\""+imageDir+"onClose.gif\";' onmouseout='this.src=\""+imageDir+"close.gif\";' onClick='new popupDialog().reset();'>";
		this.oTdClose.style.backgroundImage = "url(" + imageDir + "rightTitle.gif)";
		this.oTdClose.style.paddingLeft = "1px";
		this.oTdClose.style.cursor = "hand";
		this.oTdClose.width = "12px";

		this.oTrBody = this.oTable.insertRow(1);
		this.oTdBody = this.oTrBody.insertCell(0);
		this.oTdBody.id = "popupBody";
		this.oTdBody.colSpan = 2;
		this.oTdBody.className = "popupBody";
		this.oTdBody.style.backgroundImage = "url(" + imageDir + "bodyBg.gif)";

		this.oDivContent = document.createElement("div");
		this.oDivContent.id = "contentContainer";
		this.oDivContent.className = "popupContent";
		this.oTdBody.appendChild(this.oDivContent);

		this.oDivButton = document.createElement("div");
		this.oDivButton.id = "buttonContainer";
		this.oDivButton.className = "popupButton";
		this.oTdBody.appendChild(this.oDivButton);

		this.oDivForm = document.createElement("form");
		this.oDivForm.id = "contentForm";
		this.oDivContent.appendChild(this.oDivForm);

		this.oTableContent = document.createElement("table");
		this.oTableContent.style.width = "100%";
		this.oTableContent.style.height = "80%";
		this.oDivForm.appendChild(this.oTableContent);

		this.oTrContent = this.oTableContent.insertRow(0);

		this.oTdIcon = this.oTrContent.insertCell(0);
		this.oTdIcon.id = "iconContainer";
		this.oTdIcon.className = "popupIcon";
		this.oTdIcon.innerHTML = this.defaultIcon;
		this.oTdMsg = this.oTrContent.insertCell(1);
		this.oTdMsg.id = "msgContainer";
		this.oTdMsg.className = "popupMsg";

		dialogOver("popupDialogTable");
	}

	this.shadow = function () {
		var oDialog = $("popupDialogTable");
		var oShadow = $("dialogShadow");
	
		oShadow['style']['position'] = "absolute";
		oShadow['style']['background']	= "#fb91c0";
		oShadow['style']['display']	= "";
		oShadow['style']['opacity']	= "0.2";
		oShadow['style']['filter'] = "alpha(opacity=40)";
		oShadow['style']['top'] = oDialog.offsetTop + 5;
		oShadow['style']['left'] = oDialog.offsetLeft + 5;
		oShadow['style']['width'] = oDialog.offsetWidth;
		oShadow['style']['height'] = oDialog.offsetHeight;
	}

	this.setValue = function ( pObject , pValue ) {
		if ( pValue != "" ){
			switch (  pObject) {
				case "title" :
				$("titleContainer").innerHTML = pValue;
				break;
				case "content" :
				$("msgContainer").innerHTML = pValue;
				break;
				case "icon" :
				$("icon") ? $("icon").src =  imageDir + pValue + '.gif' : function(){};
				break;
			}
		}
	}

	this.reset = function () {
		$('dialogContainer') ? $('dialogContainer').parentNode.removeChild($('dialogContainer')) : function(){};
		$('dialogShadow') ? $('dialogShadow').parentNode.removeChild($('dialogShadow')) : function(){};
		$('popupDialogTable') ? $('popupDialogTable').parentNode.removeChild($('popupDialogTable')) : function(){};
		dialogOut();
	}

	this.event = function ( pOkFunc , pCancelFunc ) {

		if ( pCancelFunc && pCancelFunc != "" ) {
			this.oDivButton.innerHTML = '<input id="buttonOk" type="button" class="buttonOkStyle" onClick="new popupDialog().reset();"/> <input id="buttonCancel" type="button" class="buttonCancelStyle" onClick="new popupDialog().reset();"/>';
			this.buttonFunc('buttonOk',pOkFunc);
			//this.buttonFunc('buttonCancel',pCancelFunc);
		} else {
			this.oDivButton.innerHTML = '<input id="buttonOk" type="button" class="buttonOkStyle" onClick="new popupDialog().reset();"/>';
			this.buttonFunc('buttonOk',pOkFunc);
		}
	}

	this.buttonFunc = function ( pbuttonObj, pFunction ) {
		if ( $(pbuttonObj) ) {
			$(pbuttonObj).style.display = '';
			if ( $(pbuttonObj).addEventListener ) {
				if ( $(pbuttonObj).act ) {
					$(pbuttonObj).removeEventListener('click', function(){eval($(pbuttonObj).act)}, false);
				}
				$(pbuttonObj).act = pFunction;
				$(pbuttonObj).addEventListener('click', function(){eval(pFunction)}, false);
			} else {
				if( $(pbuttonObj).act ) {
					$(pbuttonObj).detachEvent('onclick', function(){eval($(pbuttonObj).act)});
				}
				$(pbuttonObj).act = pFunction;
				$(pbuttonObj).attachEvent('onclick', function(){eval(pFunction)});
			}
			$(pbuttonObj).focus();
		}
	}
}

function onMouseDown ( event ) {
	var oObj = $("popupDialogTable");
	oObj.onmousemove = mousemove;
	oObj.onmouseup = mouseup;
	oObj.setCapture ? oObj.setCapture() : function(){};
	oEvent = window.event ? window.event : event;
	var dragData = {x : oEvent.clientX, y : oEvent.clientY};
	var backData = {x : parseInt(oObj.style.top), y : parseInt(oObj.style.left)};

	function mousemove(e){
		var oEvent = window.event ? window.event : e;
		var iLeft = oEvent.clientX - dragData["x"] + parseInt(oObj.style.left);
		var iTop = oEvent.clientY - dragData["y"] + parseInt(oObj.style.top);
		oObj.style.left = iLeft + "px";
		oObj.style.top = iTop + "px";
		$("dialogShadow").style.left = iLeft + 5  + "px";
		$("dialogShadow").style.top = iTop + 5  + "px";
		dragData = {x: oEvent.clientX, y: oEvent.clientY};
		dialogOver("popupDialogTable");
	}

	function mouseup (e) {
		if(window.pageYOffset)
		clientHeight = window.pageYOffset;
		else
		clientHeight = document.body.clientHeight
		var oEvent = window.event ? window.event : e;
		oObj.onmousemove = null;
		oObj.onmouseup = null;
		if(oEvent.clientX < 1 || oEvent.clientY < 1 || oEvent.clientX > document.body.clientWidth || oEvent.clientY > clientHeight){
			oObj.style.left = backData.y  + "px";
			oObj.style.top = backData.x  + "px";
			$("dialogShadow").style.left = backData.y + 5;
			$("dialogShadow").style.top = backData.x + 5;
		}
		oObj.releaseCapture ? oObj.releaseCapture() : function(){};
	}
}

function  dialogOver ( objID ) {
	var sels = document.getElementsByTagName('select');
	for ( var i = 0; i < sels.length; i++ ) {
		if ( ObjAOverObjB($(objID) , sels[i]) ){
			sels[i].style.visibility = 'hidden';
		} else {
			dialogOut();
		}
	}
}

function  dialogOut () {
	var sels = document.getElementsByTagName('select');
	for ( var i = 0; i < sels.length; i++ ) {
		sels[i].style.visibility = 'visible';
	}
}

function ObjAOverObjB ( objA , objB ) {
	var pos1 = getPosition(objA)
	var pos2 = getPosition(objB)
	var result = true;
	//		document.documentElement.clientHeight
	//		document.documentElement.scrollTop

	var obj1Left = pos1.left - document.documentElement.scrollLeft + 100;
	var obj1Top = pos1.top - document.documentElement.scrollTop - 20;
	var obj1Right = obj1Left + objA.offsetWidth + 50;
	var obj1Bottom = obj1Top + objA.offsetHeight + 50;
	var obj2Left = pos2.left - document.documentElement.scrollLeft;
	var obj2Top = pos2.top - document.documentElement.scrollTop;
	var obj2Right = obj2Left + objB.offsetWidth;
	var obj2Bottom = obj2Top + objB.offsetHeight;

	if ( obj1Right <= obj2Left || obj1Bottom <= obj2Top || obj1Left >= obj2Right || obj1Top >= obj2Bottom )
	result = false;

	return result;
}

// 获取对象的坐标
function getPosition ( Obj ) {
	var sumTop=0;
	var sumLeft=0;
	var el = document.getElementById(KContainer);
	try{
	while(Obj.nodeName!="BODY")
	{
		sumTop+=Obj.offsetTop;
		sumLeft+=Obj.offsetLeft;
		if(window.navigator.userAgent.indexOf("MSIE")>=1)
			Obj = Obj.parentElement;
		else
			Obj = Obj.offsetParent;
	}
	}catch(e)
	{}
	return {left:sumLeft,top:sumTop}
}

/**
* 调用方法：
*/
var Dialog;
function showInfor ( pContent , pIcon , pFunc , pTitle ) {
	var Title = pTitle ? pTitle : "&nbsp;&nbsp; 提示信息 ";
	var Icon = pIcon ? pIcon : "";

	Dialog = new popupDialog();
	Dialog.shadow();
	Dialog.setValue("title",Title);
	Dialog.setValue("content",pContent);
	Dialog.setValue("icon",Icon);
	Dialog.event(pFunc);
}

function confirmInfor ( pContent , pIcon , pOkFunc , pCancelFunc , pTitle ) {
	var Title = pTitle ? pTitle : "&nbsp;&nbsp; 提示信息 ";
	var Icon = pIcon ? pIcon : "confirm";

	Dialog = new popupDialog();
	Dialog.shadow();
	Dialog.setValue("title",Title);
	Dialog.setValue("content",pContent);
	Dialog.setValue("icon",Icon);
	Dialog.event(pOkFunc,pCancelFunc);
}
/**
* 提示窗口
* add by xiaoyi
*/


/**
* 一组checkbox的多选及传值处理
* add by xiaoyi
* 说明：将以下3行放在页面末尾
* var ochkForm	= document.getElementById('form1');			//form名称
* var ochkBoxes	= ochkForm['ids[]'];					//checkbox名称
* var ochkAllBox	= document.getElementsByName('chkAll');	//全选的checkbox名称
*/
//var ochkForm	= document.getElementById('form2');
//var ochkBoxes	= ochkForm['thread_ids[]'];
//var ochkAllBox	= document.getElementsByName('chkAll');

//判断选中数量
function checkChkBoxCount()
{
	var count = 0 ;
	if (ochkBoxes.length)
	{
		for (var i=0;i<ochkBoxes.length;i++)
		{
			if(ochkBoxes[i].checked)
			{
				count++ ;
			}
		}
	}
	else
	{
		if(ochkBoxes.checked)
		{
			count = 1 ;
		}
	}
	return count;
}

// 多选的全选与取消
function checkAllChkBox(boolvalue)
{
	try {
		if(ochkBoxes.length>1)
		{
			for(var i=0;i<ochkBoxes.length;i++)
			{
				ochkBoxes[i].checked = boolvalue;
			}
		}
		else
		ochkBoxes.checked = boolvalue;
	}
	catch (e) {}
	ochkAllBox[0].checked = boolvalue;
	ochkAllBox[1].checked = boolvalue;
}

// 只有全部选中时“全选”选中
function SingleCheckChkBox(ch)
{
	var flag1=false;
	var flag2=false;

	if (ochkBoxes.length)
	{
		for (var i=0;i<ochkBoxes.length;i++)
		{
			if(ochkBoxes[i].checked)
			flag1 = true;
			else
			flag2 = true;
		}
	}
	else
	{
		if(ochkBoxes.checked)
		flag1 = true;
		else
		flag2 = true;
	}

	if(flag1==true&&flag2==false)
	{
		ochkAllBox[0].checked = true;
		ochkAllBox[1].checked = true;
	}
	else
	{
		ochkAllBox[0].checked = false;
		ochkAllBox[1].checked = false;
	}
}
	/**
	 * 一组checkbox的多选及传值处理
	 * add by xiaoyi
	*/

//js加载器
Loader = {
    onLoad : function(){},
    onReady : function(){},
    init : function(container) {
    },
    handlerError : function(e) {
        alert(e);
    },
    on : function(evt, handler) {
        switch ( evt.toLowerCase() ) {
            case 'load' :
                this.onLoad = handler;
            break;
            case 'ready' :
                this.onReady = handler;
            break;
            default :
            break;
        }
        return true;
     },
    _load : function(path,type,callback) {
        try {
        	if(type=="css")
        	{
        		var css = document.createElement('link');
        		css.href = path;
        		css.type = "text/css";
        		css.rel = "stylesheet";
                document.getElementsByTagName("head")[0].appendChild(css);
                callback();
        	}
        	else
        	{
	            var script = document.createElement('script');
	            script.src = path;
	            script.type = "text/javascript";
	            document.getElementsByTagName("head")[0].appendChild(script);
	            if( script.addEventListener ) {
	                script.addEventListener("load", callback, false);
	            } else if(script.attachEvent) {
	                script.attachEvent("onreadystatechange", function(){
	                        if(script.readyState == 4
	                            || script.readyState == 'complete'
	                            || script.readyState == 'loaded') {
	                            callback();
	                        }
	                });
	            }
        	}
        } catch(e) {
            this.handlerError(e);
        }
    },
    load : function(scripts, indicator) {
        var total = scripts.length;
        var _self  = this;
        if ( indicator >= total ) {
            _self.onReady();
            return true;
        }
        indicator = indicator || 0;
        var callee = arguments.callee;
        var script = scripts[indicator][0];
        this._load(script,scripts[indicator][1], function() {
            callee.apply(_self, [scripts, ++indicator]);
            _self.onLoad(script);
        });
        return true;
    }
};

//编辑器图片上传的回调函数
function callBackUpload(img_id)
{
	var img_url='http://resource.ifensi.com/photo/info/'+img_id+'/?type=large';
	var element = document.createElement("img");
	element.src = img_url;
	element.alt = "";
	element.border = 0;

	CKEDITOR.instances.editor1.insertHtml("<a href='http://resource.ifensi.com/photo/info/"+img_id+"' target='_blank'><img src='"+img_url+"' border='0' alt='查看原图' title='查看原图'></a><br /><br />");
}
