/**
 * 制作:  叶风
 * 版权:  2.0
 * 主页:  www.25-25.cn
 * Email: ye.fn@163.com 
 * 
 */
var $_obj = function(obj)
{	return typeof(obj)=="object"?obj:document.getElementById(obj)
}
var moveDIV = function (id){
	$_obj(id).onmousedown=function(e){
		with(this){
			if (document.all)
				style.position = "absolute";
			else
				style.position = "fixed";
			if(!e)e =event ; //FOR IE
			var l =offsetLeft;
			var t =offsetTop;
			var x =e.clientX;
			var y =e.clientY;
			var drag = true;
			document.onmousemove=function(e){
				if(!drag)return false;
				with(this){
					if(!e)e =event;  //FOR IE
					style.left = l+e.clientX-x+"px";
					style.top = t+e.clientY-y+"px";
				}
			}
		}
		document.onmouseup=function(){drag =false;};
	}
}
var option = function(id, opt, index_value )
{	
	var j=1;
	var select_obj = document.getElementById(id);
	select_obj.length=j;
	if(opt) 
		for(i=0;i<opt.length;)
		  {
			value = opt[i++];
			name = opt[i++];
			select_obj[j++] = new Option(name, value);
			if(index_value==value)
				index_value = j-1;
		  }
	select_obj.selectedIndex = index_value;
}
var del_Element = function(id)
{
	obj = $_obj(id);
	obj.parentNode.removeChild(obj);
}
var open_w = function(url, name, face)
{	if(face==null)
		face =  'width=500px,resizable=yes,location=yes,scrollbars=yes';
	return window.open(url, name, face);
}
var open_MD = function(url, face)
{	if(face==null)
		face =  'dialogWidth=500px;';
	window.showModalDialog(url, window, face);
}
var set_iframe = function(id)
{	var obj_iframe = $_obj(id);
	obj_iframe.height = obj_iframe.contentWindow.document.documentElement.scrollHeight;
	obj_iframe.width = obj_iframe.contentWindow.document.documentElement.scrollWidth;
}

// for IE
var hover_style = function(c, subitme, subc)
{  var childs, subchilds;
	if(document.all && (childs = document.getElementsByClassName(c)) )
	  {	for(var i = 0 ; i < childs.length ; i++)
			for(var ii=0 ; (subchilds = childs[i].getElementsByTagName(subitme)) && (ii < subchilds.length) ; ii++)
			  {	subchilds[ii].onmouseover= function() {this.className = subc;}
				subchilds[ii].onmouseout = function() {this.className = this.className.replace(subc, '' );}
			  }
	  }
}

/*// 浏览器判断
var GetBrowser = function()
{
	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;
}
//  加载完页面执行
if (document.all)
  { window.attachEvent('onload', new Function("hover_style('ta_h', 'tr', 'js_hover')") );
  }
else{
 	//window.addEventListener('load',hover_style('ta_h', 'tr', 'js_hover'),false);
  }  */
/**********************/
function BrowserPic(obj)
{	pic_obj = $_obj(obj);
	win_obj = open_w('?u=cfile_manager-fbrowser');
}
function UpPic(obj)
{	pic_obj = $_obj(obj);
	edit_file(pic_obj.value, 1);
}

var pic_obj;
var win_obj;

