/*
 This releas built by Javascript Releaser at Brocade. 
 visited the site of brocade : http://Brocade.sourceforge.net.
 Author : PubTlk@hotmail.com.
 At Thu Nov 30 22:03:41 CST 2006.
*/
bc = {}; bc.w = {}; bc.a = {}; bc.u = {}; Brocade = { 	Version: '0.1.12-m1', 	hashCode:function(s){ 	var h = 0; 	 var len = s.length; 	 for (var i = 0; i < len; i++) { 	 h = 31*h + s.charCodeAt(i); 	 }  return h; 	}, 	toString: function(){ 	return 'bc-' + this.Version; 	} }; function getExpDate(days, hours, minutes) {  var expDate = new Date();  if (typeof days == "number" && typeof hours == "number" && typeof hours == "number") {  expDate.setDate(expDate.getDate() + parseInt(days));  expDate.setHours(expDate.getHours() + parseInt(hours));  expDate.setMinutes(expDate.getMinutes() + parseInt(minutes));  return expDate.toGMTString();  } } function getCookieVal(offset) {  var endstr = document.cookie.indexOf (";", offset);  if (endstr == -1) {  endstr = document.cookie.length;  }  return unescape(document.cookie.substring(offset, endstr)); } function getCookie(name) {  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 getCookieVal(j);  }  i = document.cookie.indexOf(" ", i) + 1;  if (i == 0) break;  }  return null; } function setCookie(name, value, expires, path, domain, secure) {  document.cookie = name + "=" + escape (value) +  ((expires) ? "; expires=" + expires : "") +  ((path) ? "; path=" + path : "") +  ((domain) ? "; domain=" + domain : "") +  ((secure) ? "; secure" : ""); } function deleteCookie(name,path,domain) {  if (getCookie(name)) {  document.cookie = name + "=" +  ((path) ? "; path=" + path : "") +  ((domain) ? "; domain=" + domain : "") +  "; expires=Thu, 01-Jan-70 00:00:01 GMT";  } } function isArray(a) {  return isObject(a) && a.constructor == Array; } function isBoolean(a) {  return typeof a == 'boolean'; } function isEmpty(a) {  var i, j;  if (isObject(a)) {  for (i in a) {  j = a[i];  if (isUndef(j) && isFunc(j)) {  return false;  }  }  }  return true; } function isFunc(a) {  return typeof a == 'function'; } function isNull(a) {  return typeof a == 'object' && !a; } function isNumber(a) {  return typeof a == 'number' && isFinite(a); } function isObject(a) {  return (a && typeof a == 'object') || isFunc(a); } function isString(a) {  return typeof a == 'string'; } function isUndef(a) {  return typeof a == 'undefined'; } function extractQueryString(url) {  var ret = (url.indexOf('?') >= 0 && url.indexOf('?') < (url.length-1))  ? url.substr(url.indexOf('?')+1)  : '';  return ret; } function trimQueryString(url) {  var ret = url.indexOf('?') >= 0  ? url.substring(0, url.indexOf('?'))  : url;  return ret; } Object.extend(Form,{ 		submit:function(form){ 	if(typeof form != 'object') 	 	form=$(form)||document.getElementsByName(form)[0];	 	for(i=0;i<form.length;i++){ 	 	if(form.elements[i].type=="submit"){ 	 	form.elements[i].click(); 	 	return; 	 	} 	 	}  	var smt = document.createElement("input"); 	smt.type="submit"; 	smt.value=null; 	Element.hide(smt); 	form.appendChild(smt); 	smt.click(); 	} }); Scroll = { 		position:function(){ 	var l=0,t=0; 	l = window.pageXOffset  || document.documentElement.scrollLeft  || document.body.scrollLeft  || 0; 	t = window.pageYOffset  || document.documentElement.scrollTop  || document.body.scrollTop  || 0; 	return [l,t]; 	}, 		view:function(){ 	var w=0,h=0; 	w = window.innerWidth 	||document.documentElement.clientWidth 	||document.body.clientWidth 	||0; 	h = window.innerHeight 	||document.documentElement.clientHeight 	||document.body.clientHeight 	||0; 	if(window.innerWidth){ 	if (document.height > window.innerHeight) w -=16; 	if ((document.body.scrollWidth || document.documentElement.scrollWidth) > window.innerWidth) h -=16; 	} 	return [w,h]; 	}, 		size:function(){ 	var w=0,h=0; 	w = window.scrollWidth 	||document.documentElement.scrollWidth 	||document.body.scrollWidth 	||0; 	h = window.scrollHeight 	||document.documentElement.scrollHeight 	||document.body.scrollHeight 	||0; 	return [w,h]; 	} }; bc.u.c={}; 
bc.u.c.Base=function(){}; bc.u.c.Base.prototype={ 	setOptions: function(o) { 	this.options=Object.extend({},o); 	}, 	out:function(e){ 	this.isHover=false; 	if(this.selectedElement && e==this.selectedElement) 	return; 	if(e.getAttribute('disabled')) return; 	if(this.options.hoveredClass){ 	Element.removeClassName(e,this.options.hoveredClass); 	}else{ 	e.style.backgroundColor=this.cacheStyle; 	} 	}, 	hover:function(e){ 	this.isHover=true; 	if(e.getAttribute('disabled')) return; 	if(this.selectedElement && e==this.selectedElement) 	return; 	if(this.options.hoveredClass){ 	Element.addClassName(e,this.options.hoveredClass); 	}else{ 	this.cacheStyle=e.style.backgroundColor; 	e.style.backgroundColor="#CCCCFF"; 	} 	if(null != this.options.cursor) 	if(window.back) 	e.style.cursor="pointer"; 	else e.style.cursor="hand"; 	} } 
bc.u.c.Ul4Menu=Class.create(); bc.u.c.Ul4Menu.prototype =Object.extend({ 	initialize:function(t,o){ 	this.hoverListener = this.onHover.bindAsEventListener(this); 	Event.observe(t, "mouseover", this.hoverListener); 	if(o.defaultClass || o.disabledClass){ 	var li = t.getElementsByTagName("li"); 	for(var j=0;j<li.length;j++){ 	if(o.disabledClass && li[j].getAttribute('disabled')){ 	Element.addClassName(li[j],o.disabledClass); 	}else if(o.defaultClass) 	Element.addClassName(li[j],o.defaultClass); 	} 	} 	this.setOptions(o); 	}, 	onHover:function(evt){ 	var e=Event.findElement(evt, 'LI'); 	if(e.type==null)return; 	Event.observe(e, "mouseout", function(evt){ 	this.out(e); 		}.bindAsEventListener(this)); 	this.hover(e); 		} },bc.u.c.Base.prototype); 
bc.u.c.Ul=Class.create(); bc.u.c.Ul.prototype =Object.extend({ 	initialize:function(t,o){ 	var me = this; 	$A([].concat(t)).each(function(e){ 	Event.observe(e, "click", me.onClick.bindAsEventListener(me)); 	Event.observe(e, "mouseover", me.onHover.bindAsEventListener(me)); 	if(o.defaultClass || o.disabledClass){ 	var li = e.getElementsByTagName("li"); 	for(var j=0;j<li.length;j++){ 	if(o.disabledClass && li[j].getAttribute('disabled')){ 	Element.addClassName(li[j],o.disabledClass); 	}else if(o.defaultClass) 	Element.addClassName(li[j],o.defaultClass); 	} 	} 	}.bind(this)); 	this.setOptions(o); 	}, 	onClick:function(evt){ 	var vs; 	var e = Event.findElement(evt, 'LI'); 	if(e.type==null)return; 	if(e.getAttribute('disabled')) return; 	vs = this.collect(e); 	if(null!=vs && this.options.callback)this.options.callback.call(this,vs);else return false; 	}, 	onHover:function(evt){ 	var e=Event.findElement(evt, 'LI'); 	if(e.type==null)return; 	Event.observe(e, "mouseout", function(evt){ 	this.out(e); 	Event.stop(evt); 	}.bindAsEventListener(this)); 	this.hover(e); 	Event.stop(evt); 	}, 	collect:function(element){ 	if(element!=this.selectedElement){ 	if(this.options.selectedClass){ 	Element.removeClassName(element,this.options.hoveredClass); 	Element.addClassName(element,this.options.selectedClass); 	if(this.selectedElement){ 	Element.removeClassName(this.selectedElement,this.options.selectedClass); 	} 	}else{ 	if(this.selectedElement)this.selectedElement.style.backgroundColor=this.cacheStyle; 	this.cacheStyle=element.style.backgroundColor="#FFCCFF"; 	} 	this.selectedElement=element; 	} 	var vs = new Array(); 	vs[0]=element.id||"#id"; 	vs[1]=element.getAttribute("text")||element.innerHTML; 	return vs; 	} },bc.u.c.Base.prototype); 
bc.u.c.Table=Class.create(); bc.u.c.Table.prototype =Object.extend({ 	initialize:function(t,o){ 	$A([].concat(t)).each(function(e){ 	Event.observe(e, "click", this.onClick.bindAsEventListener(this)); 		var t=e.getElementsByTagName("TR"); 	for(var i=0;i<t.length;i++){ 	if(o.disabledClass && t[i].getAttribute('disabled')){ 	Element.addClassName(t[i],o.disabledClass); 	}else if(o.defaultClass) 	Element.addClassName(t[i],o.defaultClass); 	Event.observe(t[i], "mouseover", this.onHover.bindAsEventListener(this)); 	} 	}.bind(this)); 	this.setOptions(o); 	}, 	onClick:function(evt){ 	var vs; 	var e = Event.findElement(evt, 'TR'); 	if(e.getAttribute('disabled')) return; 	vs = this.collect(e); 	if(null!=vs && this.options.callback)this.options.callback(vs);else return false; 	}, 	onHover:function(evt){ 	var e=Event.findElement(evt, 'TR'); 	if(this.options.isHeader && e.rowIndex==0)return; 	Event.observe(e, "mouseout", function(evt){ 	this.out(e); 	Event.stop(evt); 	}.bindAsEventListener(this)); 	this.hover(e); 	Event.stop(evt); 	}, 		collect:function(e){ 	if(e!=this.selectedElement){ 	if(this.options.selectedClass){ 	Element.removeClassName(e,this.options.hoveredClass); 	Element.addClassName(e,this.options.selectedClass); 	if(this.selectedElement){ 	Element.removeClassName(this.selectedElement,this.options.selectedClass); 	} 	}else{ 	if(this.selectedElement)this.selectedElement.style.backgroundColor=this.cacheStyle; 	this.cacheStyle=e.style.backgroundColor="#FFCCFF"; 	} 	this.selectedElement=e; 	} 	var tds = e.getElementsByTagName('TD'); 	var vs = new Array(); 	for(var i=0;i<tds.length;i++){ 		vs[i]=tds[i].getAttribute('value')||tds[i].innerHTML; 	} 	return vs; 	} },bc.u.c.Base.prototype); 
bc.a.Base = function(){}; bc.a.Base.prototype = { 		setOptions: function(options) { 	var requestHeaders = []; 	this.isFailure=false; 	 return this.options = Object.extend({ 	 	asynchronous:true,   	evalScripts:true, 	 	onComplete: this.onResponse.bind(this), 	 		 	onException:function(t,e){if(this.isFailure)return;this.isFailure=true;this.error(-1,(e.message||e.toString()));}.bind(this) 	 		 },options || {});  	},  	collect: function() {  	 		 	var t = new Array('checkbox','radio','text','textarea','password','hidden','select-one','select-multiple'); 	 	var body = (this.url.indexOf('?') >= 0 && this.url.indexOf('?') < (this.url.length-1))? this.url.substr(this.url.indexOf('?')+1): null; 	 	 	this.url = this.url.indexOf('?') >= 0? this.url.substring(0, this.url.indexOf('?')):this.url;  	if(body != null){  	 	return encodeURI(body);  	}  	 	if(null != this.options.fields){ 	 	var a = this.options.fields.split(','); 	 	body=""; 	 	for(var i=0;i<a.length;i++){ 	 	var v = null; 	 	if(t.indexOf($(a[i]).type,0) >= 0){ 	 	v = $F(a[i]); 	 	}else{ 	 	v = $(a[i]).innerHTML; 	 	} 	 	if(null==v) 	 	v=""; 	 	body += a[i]+"="+encodeURI(v)+"&"; 	 	} 	 		 	return body.substring(0,body.length-1);  	}  	 	var f;  	if(null != (f = $(this.options.form)||document.getElementsByName(this.options.form)[0])){  	body="";  	body=Form.serialize(f);  	 	return body;  	}  	 	return null;  	},  	sendRequest: function() { 	this.reqType = 'XML'; 	this.options.postBody = this.collect(); 	this.ri(true); 		 return new Ajax.Request(this.url,this.options); 	}, 	sendUpdateRequest: function(target) { 	this.reqType = 'text'; 	this.options.postBody = this.collect(); 		this.ri(true); 		 return new Ajax.Updater(target,this.url,this.options); 	}, 	sendPeriodicalUpdateRequest: function(target) { 	this.reqType = 'text'; 	this.options.postBody = this.collect(); 	this.ri(true); 		 return new Ajax.PeriodicalUpdater(target, this.url,this.options); 	}, 	 	onResponse: function(request) {	 if (null != request && ((request.status >= 200 && request.status < 300) || request.status == 0)) { 	 var isXML = (this.options.type||this.reqType).toUpperCase() == 'XML'; 	 if(isXML) { 	 	var xmlDoc = request.responseXML; 	 	if ((et = this.isError(xmlDoc)) > 0 && !isUndef(this.error)){	 	var ei = ""; 	 	if(et == 1){ 	 	ei = "<p>Request type is XML,but parse the response XML failured. Case:"+ 	"<br>- "+xmlDoc.documentElement.firstChild.nodeValue +"</p>"+ 	"<p>Response XML: <br>"+request.responseText.escapeHTML()+"</p>"; 		 	} else { 	 	ei = xmlDoc.documentElement.getElementsByTagName("error")[0].firstChild.nodeValue; 	 		 	} 	 	this.error(request.status,ei); 	 	} else if (this.isEmpty(xmlDoc) && !isUndef(this.empty)){	 		this.empty(); 	 	} else { 	 		 	this.handler(request);	 	} 	 } else {	 	var text = request.responseText; 	 	if(text.length ==0 && !isUndef(this.empty)){ 	 		 	this.empty(); 	 	} else { 	 		 	this.handler(request); 	 	} 	 } 	 }else if(null != request){ 	 	this.error(request.status,request.responseText); 	 }  	},  	handler:function(r){  	if(this.options.postFunction)  	this.options.postFunction(r);  	this.ri(false);  	},  	empty:function () {  	this.ri(false);  	},  	error:function(n,e) {  	this.ri(false);  	},  	 	isEmpty: function(xml) {  	if( xml == null)  	return true; 	 var root = xml.documentElement; 	 if (root.getElementsByTagName("elements").length == 0 	 || root.getElementsByTagName("elements")[0].getElementsByTagName("element").length == 0) { 	 return true; 	 } 	 return false; 	}, 		isError: function(xml) { 	 var root = xml.documentElement; 	 if (root.nodeName == "parsererror") { 	 return 1; 	 } 	 if(root.getElementsByTagName("error").length == 1){ 	 	return 2; 	 } 	 return 0; 	}, 		ri:function(b){ 	if(this.indicator) 	this.indicator(b); 	else 	this._indicator(b); 	}, 		_indicator:function (b){ 	var i = $("bc.indicator"); 	if(null == i){ 	new Insertion.Top(document.getElementsByTagName("body")[0], 	 	"<div id=\"bc.indicator\" style=\"padding:2px;" +  	 	"background-color:#FF3300;border:0px;position:fixed;right:1px;top:1px;"+ 	 	"z-index:10000;filter:Alpha(opacity=90);-moz-opacity:0.9;opacity:0.9;"+ 	 	"padding-left:15px;visibility:hidden\"><b>Loading......</b></div>"); 	 		 	i = $("bc.indicator"); 	} 	this._indicatorWidth=i.offsetWidth; 	if(b){ 	i.style.visibility = ''; 	if(navigator.appVersion.indexOf('MSIE')>0){ 	i.style.position="absolute"; 	this.idtp(null); 	Event.observe(window,"scroll",this.idtp.bindAsEventListener(this)); 	Event.observe(window,"resize",this.idtp.bindAsEventListener(this)); 	} 	}else{ 	i.style.visibility = 'hidden'; 	if(navigator.appVersion.indexOf('MSIE')>0){ 	Event.stopObserving(window,"scroll",this.idtp.bindAsEventListener(this)); 	Event.stopObserving(window,"resize",this.idtp.bindAsEventListener(this)); 	} 	} 	}, 	idtp:function(e){ 	var t= Scroll.position(); 	var v=$("bc.indicator"); 	v.style.top=t[1]+"px"; 	v.innerHTML=v.innerHTML; 	}, 		_catchEvent: function(l) { 	var isCatch = false; 	if (this.options.sourceClass) { 	 eo = document.getElementsByClassName(this.options.sourceClass); 	 for (var i=0; i<eo.length; i++) { 	 	Event.observe(eo[i], this.options.eventType, l.bindAsEventListener(this)); 	 } 	 isCatch = true; 	 } else if(this.options.source) { 	 Event.observe(this.options.source, this.options.eventType,l.bindAsEventListener(this)); 	 isCatch = true; 	 } 	 return isCatch; 	} }; 
bc.a.Ajax = Class.create(); bc.a.Ajax.prototype = Object.extend(new bc.a.Base(),{ 	initialize: function(url,options) { 	this.url=url; 	this.setOptions(options); 	} }); 
bc.a.ForSync = function (){}; bc.a.ForSync = Object.extend(new bc.a.Base(),{ 	initialize: function(url,options) { 	this.url = url; 	this.setOptions(options); 	this.options.type="text"; 	this.options.asynchronous=false; 	this.options.evalScripts=false; 		}, 	request: function() { 	if(this.options.preFunction) 	if(!this.options.preFunction())	return ; 	var r=this.sendRequest(); 		this.handler(r.transport); 	if(this._trans) 	return this._trans(r.transport.responseText); 	else 	return this.errorMessage||r.transport.responseText; 	},  	handler:function(request) {  	if(this.options.postFunction){  	this.options.postFunction(request);  	}  	this.ri(false);  	},  	error:function(n,e){  	this.isError=true;  	this.errorMessage=e;  	this.ri(false);  	},  	isError:function(){  	return this.isError;  	},  	indicator:function(b){  	if(this.options.indicator) 	this.options.indicator(b,$(this.options.target)); 	} }); 
bc.a.ForString = Class.create(); bc.a.ForString.prototype = Object.extend(bc.a.ForSync,{}); 
bc.a.ForArray = Class.create(); bc.a.ForArray.prototype = Object.extend({ 	_trans: function(t) { 	try{ 	return this.errorMessage||t.split(","); 	}catch(e){ 	throw e; 	} 	} },bc.a.ForSync); 
bc.a.ForHash = Class.create(); bc.a.ForHash.prototype = Object.extend({ 	_trans: function(t) { 	try{ 	var a ; 	t=t.replace(/\\/g,''); 	eval("a={"+t.replace(/=+/g,': ')+"}"); 	return this.errorMessage||$H(a); 	}catch(e){ 	throw e; 	} 	} },bc.a.ForSync); 
bc.a.Html = Class.create(); bc.a.Html.prototype = Object.extend(new bc.a.Base(),{ 	initialize: function(url,options) { 	this.url = url; 	this.setOptions(options); 	this.options.eventType = options.eventType ? options.eventType : "click"; 		if(!this._catchEvent(this.el)) 	this.el(null); 		}, 	el: function(e) { 	if(this.options.preFunction) 	if(!this.options.preFunction())	return ; 	this.sendUpdateRequest(this.options.target); 		},  	handler:function(request) {  	if(this.options.postFunction){  	this.options.postFunction(request);  	}  	this.ri(false);  	},  	error:function(n,e){  	var obj=this;  	setTimeout(obj.ff(e),300);  	this.ri(false);  	},  	ff:function(e){  	$(this.options.target).innerHTML="";  	$(this.options.target).innerHTML='<iframe src="javascript:void(0);" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" name="'+this.options.target+'#ep" id="'+this.options.target+'#ep"></iframe>';  	Position.clone(this.options.target,this.options.target+"#ep");  	var ep=frames[this.options.target+"#ep"];  	ep.document.clear();  	ep.document.write(e);  	ep.document.close();  	}, 	indicator:function(b){  	if(this.options.indicator)  	this.options.indicator(b,$(this.options.target));  	else  	this._indicator(b);  	} });  
bc.w.Component = function(){}; bc.w.Component.prototype = { 		version: "0.1.011", 		type: "bc.w.Component", 		setProperties: function(options) {  this._p = this.properties = Object.extend({},options || {}); 	}, 		paint: function(id, options) { 	this.id=id;  	this._e= $(id);  	this.setProperties(options);  	 	 	if(this.properties.parent && $(this.properties.parent)){  	this.parent = $(this.properties.parent);  	}  	if(!this._e){  	if(this.parent){  	new Insertion.Bottom(this.parent,"<div id='"+id+"'></div>");  	}else{  	this._e = document.createElement("div");  	this._e.id = id;  	document.body.appendChild(this._e);  	}  	 	this._e= this._e || $(id);  	}  	this.element=this._e;  	this.style=this._e.style; 
 	this.setStyle=function(t){Element.setStyle(this._e,t)}.bind(this); 
 	this.getStyle=function(t){return Element.getStyle(this._e,t);}.bind(this); 
 	this.hasClassName=function(c){return Element.hasClassName(this._e,c);}; 
 	this.addClassName=function(c){Element.addClassName(this._e,c);}; 
 	this.removeClassName=function(c){Element.removeClassName(this._e,c);}; 
 	this.scrollTo=function(){Element.scrollTo(this._e);}; 
 	this.toggle=function(){Element.toggle(this._e)}; 
 	this.getDimensions=function(){return Element.getDimensions(this._e)};  	if(this.properties.className)  	this.addClassName(this.properties.className);  	this.scrollListener=this.obscr.bindAsEventListener(this); 	this.resizeListener=this.rs2mx.bindAsEventListener(this);  		var ua = navigator.userAgent;  	if(parseFloat(ua.substring(ua.indexOf("MSIE ") + 5, ua.indexOf(";", ua.indexOf("MSIE ")))) <=6){  	this.isFixIE=true;  	} 	}, 		setWidth:function(w){ 	var d=this._getBdr(this._e); 	var e=this._getPdg(this._e); 	this.setStyle({width:parseInt(w)-d[0]+"px"}); 	}, 		setHeight:function(h){ 	var d=this._getBdr(this._e); 	var e=this._getPdg(this._e); 	this.setStyle({height:parseInt(h)-d[1]-e[1]+"px"}); 	}, 		show : function(){ 	if(this.mask) 	Element.show(this.mask); 	Element.show(this._e); 	if(this.onShow) 	this.onShow(); 	}, 		hide:function(){ 	Element.hide(this._e); 	if(this.mask) 	Element.hide(this.mask); 	}, 		isShow : function(){ 	if(Element.visible(this._e)) 	return true; 	else 	return false; 	}, 		fixIE:function(){ 	if(!this.isFixIE) 	return; 	if(null==this.mask){ 	new Insertion.After(this._e,  	 '<iframe id="'+this.type+':'+this.id+'_mask" '+ 	 'style="position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);background:none;" ' +	 'src="javascript:void(0)" frameborder="0" scrolling="no"></iframe>'); 	 	this.mask = $(this.type+':'+this.id+'_mask'); 	} 	 Element.show(this.mask); 	Position.clone(this._e,this.mask); 		}, 	center:function(){ 	}, 		max:function(){ 	if(this.parent && !this.parent.size){ 	this.parent.size = Element.getDimensions(this.parent); 	this.parent.real = Position.cumulativeOffset(this.parent); 	} 	if(!this.isMax){ 	if(!this.parent){ 	window.scroll(0,0); 	Event.observe(window,"scroll",this.scrollListener); 	Event.observe(window,"resize",this.resizeListener); 	} 	if(this.properties.dragable){ 	this.real=[parseInt(this._e.style.left),parseInt(this._e.style.top)]; 	this.size = this.getDimensions(); 	}else 	this.real=Position.realOffset(this._e); 	Position.absolutize(this._e); 	this._cacheM=this.getStyle("margin"); 	this.setStyle({margin:'0px'}); 	var a=this._getBdr(this._e); 	var b=this._getPdg(this._e); 	var fixw=b[0]; 	var fixh=b[1]; 	if(this.parent){ 	var c=this._getPdg(this.parent); 	var d=this._getBdr(this.parent); 	fixw += c[0]+d[0]; 	fixh += c[1]+d[1]; 	} 	if(!this.isFixIE){ 	fixw += a[0]; 	fixh += a[1]; 	} 	if(this.parent){ 	this.setStyle({ 	top:this.parent.real[1]+d[0]/2+"px", 	left:this.parent.real[0]+d[1]/2+"px", 	width:this.parent.size.width-fixw+"px", 	height:this.parent.size.height-fixh+"px" 	}); 	}else{ 	var sz=Scroll.view(); 	this.setStyle({ 	top:'0px', 	left:'0px', 	width:sz[0]-fixw+"px", 	height:sz[1]-fixh+"px" 	}); 	} 	this.setStyle({zIndex:99999}); 		this.fixIE(); 	 if(this.onResize) 	this.onResize(); 	this.isMax=true; 	}else{ 	if(!this.properties.dragable) 	Position.relativize(this._e); 	if(null != this._cacheM) 	this.setStyle({margin:this._cacheM}); 	if(!this.parent){ 	Event.stopObserving(window,"scroll",this.scrollListener); 	Event.stopObserving(window,"resize",this.resizeListener); 	} 	t=new Scroll.position(); 	if(this.parent && !this.properties.dragable){ 	this.style.top="0px";	this.style.left=this.real[0]+"px"; 	}else{ 	this.style.top=this.real[1]+"px"; 	this.style.left=this.real[0]+"px"; 	if(this.properties.dragable) 	this.setStyle({width:this.size.width,height:this.size.height}); 	} 		this.style.zIndex=1; 	if(this.mask){ 	this.mask.style.zIndex = 0; 	Position.clone(this._e,this.mask); 	} 	if(this.onResize) 	this.onResize(); 	this.isMax = false; 	} 		}, 	min:function(){ 	}, 		rs2mx:function(){ 	var sz=Scroll.view(); 	var d=this._getBdr(this._e); 	var e=this._getPdg(this._e); 	this.setStyle({width:sz[0]-d[0]-e[0]+"px"}); 	this.setStyle({height:sz[1]-d[1]-e[1]+"px"}); 	}, 		obscr:function(evt){ 	var t=new Scroll.position(); 	var w=new Scroll.view(); 	this.style.top=t[1]+"px"; 	this.style.left=t[0]+"px"; 	}, 		getElement : function () { 	return this._e; 	}, 		setContent: function(c){ 		this._e.innerHTML = c; 	}, 		addChild : function (c) { 	this._e.appendChild(c instanceof bc.w.Component?c._e:$(c)); 	return c; 	}, 		removeChild : function (c) { 	this._e.remove(c instanceof bc.w.Component?c._e:$(c)); 	}, 		addEventListener:function(eventType,f){  	Event.observe(this._e,eventType,f);  	},  	 	removeEventListener:function(eventType,f){  	Event.stopObserving(this._e,eventType,f);  	},  	_getBdr:function(_e){ 	return [ 	parseInt(_e.style.borderRightWidth||'0')+parseInt(_e.style.borderLeftWidth||'0'), 	parseInt(_e.style.borderTopWidth||'0')+parseInt(_e.style.borderBottomWidth||'0'), 	]; 	}, 	_getPdg:function(_e){ 	return [ 	parseInt(_e.style.paddingLeft||'0')+parseInt(_e.style.paddingRight||'0'), 	parseInt(_e.style.paddingTop||'0')+parseInt(_e.style.paddingBottom||'0'), 	]; 	}, 	_getMgn:function(_e){ 	return [ 	parseInt(_e.style.marginLeft||'0')+parseInt(_e.style.marginRight||'0'), 	parseInt(_e.style.marginTop||'0')+parseInt(_e.style.marginBottom||'0'), 	]; 	}, 		_getWsp:function(e){ 	var b,p,m,v,h; 	b=this._getBdr(e); 	p=this._getPdg(e); 	m=this._getMgn(e); 	h=b[0]+p[0]+m[0]; 	v=b[1]+p[1]+m[1]; 	return [v,h]; 	}, 		equals:function(t){ 	if(!t.type || !t.toString) 	return false; 	if(t.type!=this.type) 	return false; 	if(t.id!=this.id) 	return false; 	return true; 	}, 	hashCode:function(s){ 	var h = 0; 	 var len = s.length; 	 for (var i = 0; i < len; i++) { 	 h = 31*h + s.charCodeAt(i); 	 }  return h; 	}, 		remove:function(){ 	Element.remove(this._e); 	if(this.mask) 	Element.remove(this.mask); 	}, 		toString: function(){ 	return this.type + ':' + this.id; 	} }; 
bc.w.Container = Class.create(); bc.w.Container.prototype = Object.extend(new bc.w.Component(),{ 	version: "0.1.000", 	type: "bc.w.Container", 	initialize: function(id,options) { 	this.paint(id,options); 	} });  
bc.w.Panel = Class.create(); 
bc.w.Panel.Base = function(){}; bc.w.Panel.Base.prototype=Object.extend(new bc.w.Component(),{ 		version: '0.1.000', 		type:"bc.w.Panel", 	initialize: function(id,options) { 	this.paint(id,options); 	this._cc(); 	this.dragListener = this.drag.bindAsEventListener(this); 	this.dropListener = this.drop.bindAsEventListener(this); 	this.moveListener = this.move.bindAsEventListener(this); 	this.dragMaskListener = this.dragMask.bindAsEventListener(this); 	if(options.dragable){ 	Position.absolutize(this._e); 	this._e.setAttribute('tabindex','-1'); 	this.fixIE(); 	if(this.mask)this._e.style.zIndex = this.mask.style.zIndex + 1; 	Event.observe(this._e,"focus",function(e){ 	this._cacheZIdx = this._e.style.zIndex; 	this._e.style.zIndex = 99999; 	if(this.mask)this.mask.style.zIndex = 99997; 	}.bindAsEventListener(this)); 	Event.observe(this._e,"blur",function(e){ 	this._e.style.zIndex=this._cacheZIdx; 	if(this.mask)this.mask.style.zIndex=this._cacheZIdx-1;	}.bindAsEventListener(this)); 	Event.observe(this._titleBar._e,"mousedown",this.dragListener); 	} 	}, 		_cc:function(){ 	 	if(null!=this._e){  	var _cacheCnt=new Array();  	for(var i=0,length=this._e.childNodes.length;i < length;i++){  	var _fe=this._e.childNodes[i];  	if(_fe.nodeName=='#text') continue;  	_cacheCnt.push(_fe);  	}  	Element.cleanWhitespace(this._e);  	}  	 	this._titleBar = new bc.w.Container("pltbc:"+this.id,{parent:this._e});  	 	this.content = new bc.w.Container("plcnt:"+this.id,{parent:this._e});  	 	if(null!=_cacheCnt){  	for(var i=0,length=_cacheCnt.length;i<length;i++){  	this.content.addChild(_cacheCnt[i]);  	}  	} 	}, 	drag:function(evt){ 	Event.observe(document,"selectstart",this.dragMaskListener); 	evt = evt||event||window.event; 	this._dragObj = evt.target?evt.target : evt.srcElement; 	var bt = ":btx"; 	if(this._dragObj.id.lastIndexOf(bt)!=-1 || this._dragObj.parentNode.id.lastIndexOf(bt)!=-1) return; 	this._dragObj.style.cursor="move"; 	this.drag = true; 	if(this._e.focus) 	this._e.focus(); 	this.offsetX = Event.pointerX(evt) - parseInt(this.getStyle("left")||"0"); 	this.offsetY = Event.pointerY(evt) - parseInt(this.getStyle("top")||"0"); 	Event.observe(document,"mouseup",this.dropListener); 	Event.observe(document,"mousemove",this.moveListener); 	Event.stop(evt); 	}, 	dragMask:function(evt){ 	return false; 	}, 	drop:function(evt){ 	evt = evt||event||window.event; 	this._dragObj.style.cursor=""; 	this.drag = false; 	Event.stopObserving(document,"mouseup",this.dropListener); 	Event.stopObserving(document,"mousemove",this.moveListener); 	Event.stopObserving(document,"selectstart",this.dragMaskListener); 	if(this.onDrop) 	this.onDrop(evt); 	}, 	move:function(evt){ 	evt = evt||event||window.event; 	if(!this.drag) return; 	var l = Event.pointerX(evt) - this.offsetX; 	var t = Event.pointerY(evt) - this.offsetY; 		if(this.parent){ 	var ps = Element.getDimensions(this.parent); 	var real = Position.cumulativeOffset(this.parent); 	this.size = this.getDimensions(); 	if(l <= real[0]) 	l = real[0]; 	if(l >= real[0]+(ps.width-this.size.width)) 	l = real[0]+(ps.width-this.size.width); 	if(t <= real[1]) 	t = real[1]; 	if(t >= (real[1] + ps.height - this.size.height)) 	t = real[1] + ps.height - this.size.height; 	} 	this.setStyle({left:l+"px",top:t+"px"}); 		if(this.mask)Position.clone(this._e,this.mask); 		}, 	setContent:function(c){ 	this.content.setContent(c); 	}, 		addChild : function (child) { 	this.content.addChild(child); 	return child; 	}, 		setTitleBar : function (tbr) { 	if(typeof tbr == "object"){ 	if(tbr instanceof bc.w.TitleBar){ 	tbr.pContainer = this; 	this.titleBar = tbr; 	} 	 	this._titleBar.addChild(tbr); 	 	this.onResize(); 	}else{ 	this.setTitle(tbr); 	} 	}, 		setTitle: function(title){ 	if(this.titleBar) 	this.titleBar.setTitle(title); 	else 	this._titleBar.setContent(title); 	}, 	min:function(){ 	if(this.content.isShow()){ 	this.oldh=this.style.height; 	this.content.hide(); 	this.style.height=""; 	}else{ 	this.content.show(); 	} 		if(this.mask)Position.clone(this._e,this.mask); 	}, 	onResize:function(e){ 	if(!this.isMax){ 	this._csize=Element.getDimensions(this.content._e); 	}else{ 	this.content.setStyle({ 	height:this._csize['height']+"px" 	}); 	} 	var a=this._getBdr(this._e); 	var b=this._getPdg(this._e); 	var c=this._getWsp(this.content._e); 	var d=this._getWsp(this.titleBar._e); 	var s=this.getDimensions(this._e); 	var h=Element.getHeight(this.titleBar._e); 	var fixw=b[0]+b[0]+c[0]; 	var fixh=b[1]+c[1]+h+d[1]; 	if(!this.isFixIE){ 	fixw += a[0]; 	fixh += a[1]; 	} 	this.content.setStyle({ 	top:'0px', 	left:'0px', 	height:s["height"]-fixh +"px" 	}); 		if(this.mask)Position.clone(this._e,this.mask); 	} }); bc.w.Panel.prototype = Object.extend(bc.w.Panel.Base.prototype,{}); 
bc.w.TitleBar = Class.create(); bc.w.TitleBar.prototype=Object.extend(new bc.w.Component(),{ 		version: '0.1.000', 		type:"bc.w.TitleBar", 	initialize: function(t,o) { 	this.paint(this.type+":"+this.hashCode(t),o); 		var buttonBox = document.createElement("div"); 	buttonBox.id = this.id+":btx"; 	Element.setStyle(buttonBox,{cssFloat:'right',styleFloat:'right',padding:'0px 5px 0px 0px'}); 	this.addChild(buttonBox); 		var titleBox = document.createElement("div"); 	Element.setStyle(titleBox,{clear:'left',fontWeight:'bold',padding:'0px 5px 0px 5px'}); 	this.addChild(titleBox); 		if(o.icon){ 	var icon = document.createElement("img"); 	icon.src = o.icon; 	titleBox.appendChild(icon); 	} 		this.title = document.createElement("label"); 	this.title.style.marginLeft = '5px'; 	this.title.innerHTML = t; 	titleBox.appendChild(this.title); 	var btstyle = {marginLeft:'2px',cursor:'pointer'}; 	if(this.isFixIE) btstyle.cursor = "hand"; 		if(o.minIcon){ 	var minBt = document.createElement("img"); 	minBt.src = o.minIcon; 	Element.setStyle(minBt,btstyle); 	minBt.title = o.minTitle || 'minimize'; 	buttonBox.appendChild(minBt); 	Event.observe(minBt,"click",function(e){ 	if(this._mx)return; 	if(this._mi){	this._mi=false; 	minBt.title=o.minTitle || 'minimize'; 	minBt.src=o.minIcon; 	}else{ 	this._mi=true; 	minBt.title= o.restoreTitle || "restore"; 	if(o.restoreIcon) 	minBt.src=o.restoreIcon; 	} 	this.pContainer.min(); 	}.bindAsEventListener(this)); 	} 		if(o.maxIcon){ 	var maxBt = document.createElement("img"); 	maxBt.src = o.maxIcon; 	Element.setStyle(maxBt,btstyle); 	maxBt.title = o.maxTitle || "maximize"; 	buttonBox.appendChild(maxBt); 	Event.observe(maxBt,"click",function(e){ 	if(this._mi) return; 	if(this._mx){	this._mx=false; 	maxBt.title= o.maxTitle || "maximize"; 	maxBt.src=o.maxIcon; 	}else{ 	this._mx=true; 	maxBt.title = o.restoreTitle || "restore"; 	if(o.restoreIcon) 	maxBt.src=o.restoreIcon; 	} 	this.pContainer.max(); 	}.bindAsEventListener(this)); 	} 		if(o.closeIcon){ 	var closeBt = document.createElement("img"); 	closeBt.src = o.closeIcon; 	Element.setStyle(closeBt,btstyle); 	closeBt.title = o.closeTitle || "Close ..."; 	buttonBox.appendChild(closeBt); 	Event.observe(closeBt,"click",function(event){ 	if(this.pContainer.onClose)	if(!this.pContainer.onClose())return;	if(this.pContainer.stopAutoRefresh)this.pContainer.stopAutoRefresh(); 	this.pContainer.remove(); 	}.bindAsEventListener(this)); 	} 	
 	this.addBtxClass=function(c){Element.addClassName(this.buttonBox,c);}; 
 	this.addTitleClass=function(c){Element.addClassName(this.title,c);}; 	}, 		setTitle:function(t){ 	this.title.innerHTML=t; 	} }); 
bc.a.Panel = Class.create(); bc.a.Panel.prototype = Object.extend(Object.extend(new bc.w.Panel.Base(),bc.a.Base.prototype),{ 		version: '0.1.000', 		type:"bc.a.Panel", 	initialize: function(id,o) { 	this.paint(id,o); 	this._cc(); 	this.setOptions(o) 	}, 			catchFormSubmit:function(f){ 	if(f){ 	Event.observe($(f),"submit",this.onSubmit.bindAsEventListener(this),false); 	return; 	}  	var fs = (this.content._e).getElementsByTagName("FORM");  	if(null == fs)return;  	for(var i=0;i<fs.length;i++){  	Event.observe(fs[i],"submit",this.onSubmit.bindAsEventListener(this),false);  	}  	},  	decatchFormSubmit:function(f){  	if(f){ 	Event.stopObserving($(f),"submit",this.onSubmit.bindAsEventListener(this),false); 	return; 	}  	var fs = (this.content._e).getElementsByTagName("FORM");  	if(null == fs)return;  	for(var i=0;i<fs.length;i++){  	Event.stopObserving(fs[i],"submit",this.onSubmit.bindAsEventListener(this),false);  	}  	},  	 	onSubmit:function(evt){  	this.elem = evt.target?evt.target : evt.srcElement;  	this.url=this.elem.action;  	 	if(this._vl){  	for(var i=0;i < this._vl.length;i++){  	if(!this._vl[i](this.elem)){  	Event.stop(evt);  	return false;  	}  	}  	}  	if(null != this.elem){  	 	if(this.options.preFunction) 	if(!this.options.preFunction())	return ; 	this.reqType = 'text'; 	this.options.form = this.elem; 	this.sendUpdateRequest(this.elem.target||this.content._e);  	}  	Event.stop(evt);  	return false;  	},  	handler:function(r){  	if(this.options.postFunction)  	this.options.postFunction(r);  	this.catchFormSubmit();  	this.ri(false);  	},  	error:function(n,e) {  	this.content.setContent("<b>Error: </b>"+n+"<br>"+e);  	this.ri(false);  	},  	 	addValidator:function(v){  	if(!this._vl)this._vl = [];  	this._vl.push(v);  	},  	 	removeValidator:function(){  	this._vl.clear();  	},  	load:function(url,o){  	this.url = url; 	Object.extend(this.options,o); 	this.sendUpdateRequest(this.content._e); 	 	},  	indicator:function(b){ 	if(b && this.elem && typeof this.elem.target=="object"){ 	alert("All of the fields in the form do'nt named \"target\",the indicate failured."); 	return true; 	} 	if(this.options.indicator){ 	this.options.indicator(b,((this.elem!=null?this.elem.target:null)||this.content._e)); 	}else 	if(b){ 	((this.elem!=null?this.elem.target:null)||this.content._e).innerHTML=" Lodding..."; 	} 	} }); 
bc.w.TabBase = function(){}; bc.w.TabBase.prototype = Object.extend(new bc.w.Component(),{ 	version: '0.1.000', 	type:"bc.w.Tab", 	create:function(id,o){ 	this.paint(id,o); 	if(!o.barPosition) 	o.barPosition = "top"; 	if(o.barPosition && o.barPosition =="bottom"){ 	this.view = new bc.w.Container(this.type + ":view:"+id,{parent:this._e}); 	this.bar = new bc.w.Container(this.type + ":bar:"+id,{parent:this._e}); 	}else{	this.bar = new bc.w.Container(this.type + ":bar:"+id,{parent:this._e}); 	this.view = new bc.w.Container(this.type + ":view:"+id,{parent:this._e}); 	} 	if(o.barPosition && (o.barPosition == "top" || o.barPosition =="bottom")){ 	this.bar.setStyle({width:'100%',bottom:0,paddingTop:'5px'}); 	this.view.setStyle({width:'100%',height:'100%'}); 	}else{ 	this.bar.setStyle({height:'100%'}); 	this.view.setStyle({height:'100%',width:'100%'}); 	} 	this.bar.setStyle({position:'relative',zIndex:1}); 	this.view.setStyle({position:'relative',border:'#C0D9FB solid 2px',overflow:'auto',zIndex:0}); 	this.items = []; 	this.curItem = null; 	}, 		addItem:function(i){ 	if(!i instanceof bc.w.TabItem) 	return; 
	i.onClick = function(e){ 	if(this.curItem.equals(i)) 	return false; 	this.setCurTab(e); 	}.bind(this); 		i._sts(0); 	this.items.push(i); 	i.fPanel.tabIndex = this.items.length; 	this.bar.addChild(i._btp); 	this.view.addChild(i.content); 	this.setCurTab(0); 	}, 		getCurTab:function(){ 	return this.curItem; 	}, 	getTabCount:function(){ 	return this.items.length; 	}, 	setCurTab:function(i){ 	if(null != this.curItem) 	this.curItem.inactive(); 	this.curItem = typeof i== "object"?this.items[this.items.indexOf(i)]:this.items[i]; 	this.curItem.active(); 	}, 	refresh:function(){ 	this.curItem.refresh(); 	} }); 
bc.w.TabItem = Class.create(); bc.w.TabItem.prototype = { 	version: '0.1.000', 	type:"bc.w.TabItem", 	initialize: function(n,o,uri) { 	this._o = o; 	this._t = n; 	if(uri) this.uri = uri; 	this.id=this.type + ":"+Brocade.hashCode(n); 		this.buttonPanel = this._btp = document.createElement("span");	Element.setStyle(this._btp,{ 	position:'relative', 	padding:0, 	marging:0 	}); 		this.lPanel = document.createElement("span"); 	Element.setStyle(this.lPanel,{ 	width:(this._o.lCorner||5)+'px' 	}); 	this._btp.appendChild(this.lPanel); 		this.cPanel = document.createElement("span"); 	Element.setStyle(this.cPanel,{ 	width:'0px' 	}); 	this._btp.appendChild(this.cPanel); 		this.rPanel = document.createElement("span"); 	Element.setStyle(this.rPanel,{ 	width:(this._o.rCorner||5)+'px' 	}); 	this._btp.appendChild(this.rPanel); 		this.fPanel = document.createElement("a"); 	Element.setStyle(this.fPanel,{ 	textDecoration:"none" 	}); 	this.fPanel.href="javascript:void(0)"; 	var c=document.createElement("nobr"); 	c.appendChild(this.fPanel); 	this.cPanel.appendChild(c); 	this.button = document.createElement("nobr"); 	Element.setStyle(this.button,{ 		}); 	this.setText(n); 		if(o.icon){ 	this.icon = document.createElement("img"); 	this.icon.src = o.icon; 	this.icon.style.border="0px"; 	this.fPanel.appendChild(this.icon); 	}this.button.src=o.icon; 	this.fPanel.appendChild(this.button); 		this.content = new bc.a.Panel(this.type + ":c:"+Brocade.hashCode(n),Object.extend({ 	indicator:function(b,t){ 	if(b){ 	this.icon.src = this._o.loadingIcon; 	Element.update(t,'<p style="margin-left:15px;background:url('+ 	this._o.loadingIcon+') no-repeat top left;'+ 	'color:#777;padding:0 0 0 32;">Loading ...</p>'); 	}else{ 	this.icon.src = this._o.icon; 	} 	}.bind(this)},o)); 	this.content.hide(); 	this.content.setStyle({overflow:'auto'}); 	Event.observe(this._btp,"mouseover",this.hot.bindAsEventListener(this)); 	Event.observe(this._btp,"mouseout",this.unHot.bindAsEventListener(this)); 	Event.observe(this._btp,"click",this.click.bindAsEventListener(this)); 	Event.observe(this._btp,"keypress",this.key.bindAsEventListener(this)); 	}, 	setAccessKey:function(k){ 	this._akey = k; 	this.button.accessKey=k; 	Element.update(this.button,this._t + " (<u>"+k+"</u>)"); 	}, 	setText:function(t){ 	Element.update(this.button,t); 	}, 		_sts:function(i){ 	switch(i){ 	case 1:	if(window.innerWidth) 	Element.setStyle(this._btp,{ 	top:-2 	}); 	else 	Element.setStyle(this._btp,{ 	bottom:-4 	}); 	Element.setStyle(this.lPanel,{ 	padding:'4 0 8 5', 	background:"url("+this._o.curImg+") no-repeat left top" 	}); 	Element.setStyle(this.cPanel,{ 	padding:'4 2 8', 	background:"url("+this._o.curImg+") repeat-x center top" 	}); 	Element.setStyle(this.rPanel,{ 	padding:'4 5 8 0', 	background:"url("+this._o.curImg+") no-repeat right top" 	}); 	break; 	case 2:	Element.setStyle(this.lPanel,{ 	background:"url("+this._o.hotImg+") no-repeat left top" 	}); 	Element.setStyle(this.cPanel,{ 	background:"url("+this._o.hotImg+") repeat-x center top" 	}); 	Element.setStyle(this.rPanel,{ 	background:"url("+this._o.hotImg+") no-repeat right top" 	}); 	break; 	default:	if(window.innerWidth) 	Element.setStyle(this._btp,{top:0}); 	else 	Element.setStyle(this._btp,{bottom:0}); 	Element.setStyle(this.lPanel,{ 	padding:'4 0 0 5', 	background:"url("+this._o.defImg+") no-repeat left top" 	}); 	Element.setStyle(this.cPanel,{ 	padding:'4 2 0 2', 	background:"url("+this._o.defImg+") repeat-x center top" 	}); 	Element.setStyle(this.rPanel,{ 	padding:'4 5 0 0', 	background:"url("+this._o.defImg+") no-repeat right top" 	}); 	break; 	} 	}, 	setUri:function(u){ 	this.uri = u; 	}, 	load:function(){ 	if(this.uri) 	this.content.load(this.uri); 	}, 	add:function(c){ 	this.content.addChild(c); 	}, 	key:function(k){ 	if(k.keyCode == Event.KEY_RETURN) 	this.onClick(this); 	}, 	click:function(evt){ 	this.onClick(this); 	}, 	hot:function(evt){ 	if(this.isCur)return false; 	this._sts(2); 	}, 	unHot:function(evt){ 	if(this.isCur)return false; 	this._sts(0); 	}, 	isCurTab:function(){ 	return this.isCur; 	}, 	active:function(){ 	this.isCur = true; 	this._sts(1); 	this.content.show(); 	if(!this._o.noLoad || !this._fLoad){ 	this._fLoad = true; 	this.load(); 	} 	}, 	inactive:function(){ 	this.isCur = false; 	this._sts(0); 	this.content.hide(); 	}, 	refresh:function(){ 	this.load(); 	}, 	equals:function(t){ 	if(!t.type) 	return false; 	if(t.type!=this.type) 	return false; 	if(t.id!=this.id) 	return false; 	return true; 	} } 
bc.w.Tab = Class.create(); bc.w.Tab.prototype = Object.extend(new bc.w.TabBase(),{ 	initialize: function(id,o) { 	this.create(id,o); 	} });  
bc.w.PopupPanel = function(){}; bc.w.PopupPanel.prototype = Object.extend(new bc.w.Component(),{ 		version: "0.1.000", 		type: "bc.w.PopupPanel", 		create: function(id,o) { 	this.paint(id,o); 	this._e.style.position="absolute"; 	this.hide(); 		this.hideListener = this.hide.bindAsEventListener(this); 	this.mouseListener = this.ood.bindAsEventListener(this); 	}, 	_shadow:function(){ 	if(this.shadow)return; 	new Insertion.After(this._e,  	 '<div id="'+this.type+':sdw:'+this.id+ 	 '" style="background-color:#A5BFDA;position:absolute;' + 	 '-moz-opacity:0.6;opacity:0.6;'+ 	 'filter:progid:DXImageTransform.Microsoft.Alpha(opacity=60);" ' + 	 '</div>'); 	this.shadow = $(this.type+':sdw:'+this.id); 	}, 	_shadowShow:function(){ 	Element.show(this.shadow); 	Position.clone(this._e,this.shadow,{setHeight:true, setWidth:true,offsetTop:4,offsetLeft:4}); 	}, 		show:function(evt){ 	if(this.isShow()) 	return; 	this._tgt = evt.target?evt.target : evt.srcElement; 	Element.show(this._e); 	this.position(this._tgt); 	this._shadow(); 	this._shadowShow(); 	this.setStyle({zIndex:99999}); 		this.fixIE(); 	Event.observe(this._e, "click", this.hideListener); 	Event.observe(document, "mousedown", this.mouseListener); 	if(this.onShow) 	this.onShow(evt); 	}, 	hide:function(){ 		this.style.zIndex=2; 	if(this.mask){ 	this.mask.style.zIndex = 1; 	Position.clone(this._e,this.mask); 	} 	Element.hide(this._e); 	if(this.shadow) 	Element.hide(this.shadow); 	if(this.mask) 	Element.hide(this.mask); 	Event.stopObserving(document.body, "mousedown", this.mouseListener); 	Event.stopObserving(this._e, "click", this.hideListener); 	if(this.onHide) 	this.onHide(); 	}, 		position:function(t){ 	var wz = Scroll.view(); 	var tz = Element.getDimensions(t); 	var thz = this.getDimensions(); 	var fix=Scroll.position(); 	var tt=Position.cumulativeOffset(t);	var tp=0,lt=0; 	if(wz[1]-(tt[1]-fix[1])-tz.height < thz.height) 	tp =-thz.height; 	else 	tp = tz.height; 	if(wz[0]-(tt[0]-fix[0]) < thz.width) 	lt = -(thz.width-(wz[0]-(tt[0]-fix[0]))); 	Position.clone(t,this._e,{setHeight:false, setWidth:false,offsetTop: tp,offsetLeft:lt}); 	}, 	ood:function(e){ 	var o = false;	var fix=Scroll.position(); 	 	 var clickX = e.clientX+fix[0]; 	 var clickY = e.clientY+fix[1]; 	 o =!Position.within(this._e,clickX,clickY); 	if(this._tgt &&Position.within(this._tgt,clickX,clickY)) 	o = false; 	 if(o) 	 	this.hide(); 	}, 	remove:function(){ 	Element.remove(this.shadow); 	Element.remove(this._e); 	if(this.mask)Element.remove(this.mask); 	} }); 
bc.w.Popup = Class.create(); bc.w.Popup.prototype = Object.extend(new bc.w.PopupPanel(),{ 		version: '0.1.000', 		type:"bc.w.Popup", 	initialize: function(id,o) { 	this.create(id,o); 	this.showEventListener = this.popup.bindAsEventListener(this); 					if(this._p.classId){ 	var items = document.getElementsByClassName("pop"); 	for(var i=0,l=items.length;i<l;i++){ 	Event.observe(items[i],"mouseover",this.showEventListener); 	Event.observe(items[i],"mouseout",this.hideListener); 	} 	} 	}, 	popup:function(e){ 	this.show(e);  	} }); 
bc.a.Popup = Class.create(); bc.a.Popup.prototype = Object.extend(Object.extend(new bc.w.PopupPanel(),bc.a.Base.prototype),{ 		version: '0.1.000', 		type:"bc.a.Popup", 	initialize: function(id,u,o) { 	this.create(id,o); 	this.setOptions(o); 	this.url = u; 	}, 	popup:function(e){ 	this.show(e); 	this.sendUpdateRequest(this._e);  	},  	indicator:function(b){ 	if(this.options.indicator){ 	this.options.indicator(b,this._e); 	}else 	if(b){ 	this._e.innerHTML=" Lodding ... "; 	} 	}, 	handler:function(r){  	if(this.options.postFunction)  	this.options.postFunction(r);  	this.ri(false);  	},  	error:function(n,e) {  	this.ri(false);  	 	setTimeout(this.ff(e),10);  	},  	ff:function(e){  	this.setContent("");  	this.setContent('<iframe src="javascript:void(0);" width="100%" height="100%" frameborder="10" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" name="'+this.id+'#ep" id="'+this.id+'#ep"></iframe>');  	 	setTimeout(function(){ 	 	var ep=frames[this.id+"#ep"]; 	ep.document.clear(); 	 	ep.document.write(e); 	 	ep.document.close();  	}.bind(this),10);  	} });  
bc.w.ActiveMenu = Class.create(); bc.w.ActiveMenu.prototype = Object.extend(new bc.w.PopupPanel(),{ 	version: "0.1.008", 	type: "bc.w.ActiveMenu", 		initialize: function(id,o) { 	this.create(id,o); 	this.mp = document.createElement("ul"); 	this.mp.id=this.type+":"+this.id; 	this.addChild(this.mp); 	this.entry = null; 	Element.setStyle(this.mp,{listStyle:'none',margin:0,padding:2}); 	new bc.u.c.Ul4Menu(this.mp,Object.extend({cursor:null},o)); 	}, 		addMenuItem:function(i){ 	if(!this.items)this.items=[]; 	if(typeof i == "object"){ 	this.mp.appendChild(i instanceof bc.w.MenuItems?i._e:i); 	this.items.push(i); 	}else{ 	new Insertion.Bottom(this.mp,i); 	} 	}, 		removeMenuItem:function(i){ 	this.items[i].remove(); 	} }); 
bc.w.MenuItems = function(){};bc.w.MenuItems.prototype={ 	version: "0.1.003", 	type: "bc.w.MenuItems", 		crtc:function(n,t,o){	this._e = document.createElement("li"); 	this._e.id=this.type+":"+n; 	this._n=t; 	this._o=o; 	this._e.style.padding="1px"; 
	this.addClass = function (c){ 	Element.addClassName(this._e,c); 	} 	}, 	toString:function(){ 	return this.type + ':' + this.id; 	} } 
bc.w.MenuItem = Class.create(); bc.w.MenuItem.prototype = Object.extend(new bc.w.MenuItems(),{ 	version: "0.1.003", 	type: "bc.w.MenuItem", 	initialize: function(n,t,o) { 	this.crtc(n,t,o); 	this.crt(); 	}, 	crt:function(){ 	this.item=document.createElement("div"); 		this.ibx = null; 	if(this._o && this._o.icon){ 	this.ibx=document.createElement("img"); 	this.ibx.style.border = "0px"; 	this.ibx.src=this._o.icon; 	}else{ 		this.ibx = document.createElement("label"); 	this.ibx.innerHTML = "&nbsp;&nbsp;"; 	Element.setStyle(this.ibx,{width:16,border:0,padding:0}); 	} 	this.item.appendChild(this.ibx); 	if(this._o && this._o.activeIcon){ 	Event.observe(this._e,"mouseover",function(e){ 	this.ibx.src=this._o.activeIcon; 	}.bind(this)); 	Event.observe(this._e,"mouseout",function(e){ 	this.ibx.src=this._o.icon; 	}.bind(this)); 	} 	this.ibx.style.marginRight="5px"; 	var l = document.createElement("label"); 	l.innerHTML = this._n; 	this.item.appendChild(l); 		this._e.appendChild(this.item); 	}, 	remove:function(){ 	Element.remove(this._e); 	}, 	addEventListener:function(t,f){	Event.observe(this._e,t,f); 	if(!this._lisnr)this._lisnr = []; 	this._lisnr.push([t,f]); 	}, 	removeEventListener:function (){ 	if(!this._lisnr) 	return; 	else{ 	for(var i=0,length = this._lisnr.length;i < length;i++){ 	Event.stopObserving(this._e,this._lisnr[i][0],this._lisnr[i][1]); 	} 	} 	} }); 
bc.w.MenuGroup = Class.create(); bc.w.MenuGroup.prototype = Object.extend(new bc.w.MenuItem(),{ 	version: "0.1.000", 	type: "bc.w.MenuGroup", 	initialize: function(n,t,o) { 	this.crtc(n,t,o); 	this.r=0; 	this.overListener = this.over.bindAsEventListener(this); 	this.outListener = this.out.bindAsEventListener(this); 	this.clickListener = this.click.bindAsEventListener(this); 	this.addIndi(); 	this.crt(); 		}, 	addIndi:function(){ 		this.indi = document.createElement("label"); 	this.indi.innerHTML = ">"; 	Element.setStyle(this.indi,{cssFloat:'right',styleFloat:'right',padding:'0 5'}); 	this._e.appendChild(this.indi); 		Event.observe(this._e,"click",function(e){ 	Event.stop(e); 	}); 	Event.observe(this._e,"mousedown",this.clickListener); 	Event.observe(this._e,"mouseover",this.overListener); 	Event.observe(this._e,"mouseout",this.outListener); 	}, 	click:function(evt){ 	this.over(evt); 	Event.stop(evt); 	}, 	over:function(evt){ 	if(this.subMenu && this.subMenu.isShow())return; 	this.subMenu.show(evt); 	
		}, 	out:function(evt){ 	this.r++; 	if(Position.within(this._e,Event.pointerX(evt),Event.pointerY(evt))){ 	$("tp").innerHTML = "in is true."+this.r; 	return; 	}else{ 	$("tp").innerHTML = "in is false."+this.r; 	} 	setTimeout(function(){ 		if(this.subMenu && this.subMenu.isShow()) 	this.subMenu.hide(); 	}.bindAsEventListener(this),150); 	}, 	addSubMenu:function(m){ 	this.subMenu = m; 	document.body.appendChild(m._e); 
	this.subMenu.position=function(t){ 	Position.clone(this._e,this.subMenu._e,{setHeight:false, setWidth:false,offsetTop:-4,offsetLeft:this._e.offsetWidth -4}); 	}.bind(this); 	} }); 
bc.w.MenuSeparator = Class.create(); bc.w.MenuSeparator.prototype = Object.extend(new bc.w.MenuItems(),{ 	version: "0.1.000", 	type: "bc.w.MenuSeparator", 	initialize: function(s) {	this.crtc(); 	this._e.setAttribute('disabled','true'); 	var sp = document.createElement("hr"); 	if(null != s && typeof s != "object"){ 	Element.addClassName(sp,s); 	}else{ 	Element.setStyle(sp,Object.extend({lineHeight:0,height:0,padding:0,borderTop:'0',borderBottom:'#cc2 solid 1px',margin:'2 0'},s)); 	} 	this._e.appendChild(sp); 	} }); 
bc.w.AroundMenu=Class.create(); bc.w.AroundMenu.prototype=Object.extend(new bc.w.Component(),{ 	version: "0.1.000", 	type:"bc.w.AroundMenu", 	initialize: function(id,t,v,o) { 	this.paint(id,o); 	this.overListener = this.over.bindAsEventListener(this); 	this.outListener = this.out.bindAsEventListener(this); 	this.cc(t,v); 	Event.observe(this._e,"mouseover",this.overListener); 	Event.observe(this._e,"mousedown",this.overListener); 	Event.observe(this._e,"mouseup",this.overListener); 	}, 	cc:function(t,v){ 	var c=document.createElement("a"); 	c.href='javascript:void(0);'; 	this.href=c.href; 		this._t=document.createElement("label"); 	this._t.innerHTML=t; 	this._t.style.display="block"; 	c.appendChild(this._t); 		this._v=document.createElement("input"); 	this._v.type="hidden"; 	this._v.name=(this.properties.name||this.id); 	this._v.value=v; 	c.appendChild(this._v); 	this.addChild(c); 		this.ip=document.createElement("div"); 	this.ip.style.position="absolute"; 	c.appendChild(this.ip); 	var i=document.createElement("input"); 	i.type="image"; 	i.src=this.properties.icon; 	this.ip.appendChild(i); 	Element.hide(this.ip); 		this.menu=new bc.w.ActiveMenu(this.type+this.id,{parent:this._e}); 	
	this.menu.onHide=function(){ 	Element.hide(this.ip); 	this._isIS=false; 	}.bind(this); 		Event.observe(this.ip,"click",function(evt){ 	this.menu.show(evt); 	return false; 	}.bindAsEventListener(this)); 	}, 	over:function(evt){ 	Event.observe(this._e,"mouseout",this.outListener); 	if(this._isIS)	return; 	var tz = this.getDimensions(); 	Element.show(this.ip); 	var iz=Element.getDimensions(this.ip); 		Position.clone(this._e,this.ip,{ 	setHeight:false,  	setWidth:false, 	offsetTop: tz.height, 	offsetLeft:tz.width-iz.width 	}); 	this._isIS= true; 	}, 	out:function(evt){ 	Event.stopObserving(this._e,"mouseout",this.outListener); 	if(!this.menu.isShow()){ 	Element.hide(this.ip); 	this._isIS=false; 	} 	}, 	setValue:function(t,v){ 	this._t.innerHTML=t; 	this._v.value=v; 	}, 	addMenuItem:function(i){ 	this.menu.addMenuItem(i); 	}, 	remove:function(e){ 	this.menu.remove(); 	Element.remove(this._e); 	} }); 
bc.w.FilePicker=Class.create(); bc.w.FilePicker.prototype=Object.extend(new bc.w.Component(),{ 	version: "0.1.000", 	type:"bc.w.FilePicker", 	initialize: function(n,o) { 	this.paint(this.type + ":" + this.hashCode(n),o); 	this._isize = o.size||45;	this._tmx = (o.textMax||1024);	this._fmc = o.fileMax||1024;	this.queue = []; 	this.cc(n); 	}, 	cc:function(n){ 	var obj = this; 	var i = new bc.w.FilePicker.Picker(n,Object.extend({ 	size:this._iszie, 	textMax:this._tmx 	})); 	this.addChild(i._e); 
	i.checkExt=function(v){ 	if(this.queue.indexOf(v) > -1 ) 	return true; 	else { 	this.queue.push(v); 	return false; 	} 	}.bind(this); 
	i.onRemove=function(e,v){ 		if(this.queue.length == this._fmc) 	this.cc(this.n); 	var idx = this.queue.indexOf(v); 	if(idx > 0) 	this.queue=this.queue.slice(0,idx).concat(this.queue.slice(idx+1,this.queue.length)); 	else 	this.queue = this.queue.slice(idx+1,this.queue.length); 	Element.remove(e); 	}.bind(this); 
	i.onUpdate=function(e){ 		if(this.queue.length == this._fmc) 	return false; 	this.cc(this.n); 	}.bind(this); 	}, 	setFileMax:function(c){ 	this._fmc = c; 	} }); 
bc.w.FilePicker.Picker = Class.create(); bc.w.FilePicker.Picker.prototype = { 	version: "0.1.000", 	type:"bc.w.FilePicker.Picker", 	initialize: function(n,o) { 	this._o = o; 	this.max = o.textMax; 	this.size = o.size; 	this.cc(n); 	}, 	cc:function(n){ 	this._e= document.createElement("span"); 	this.item=document.createElement("input"); 	this.item.type="file"; 	this.item.name = n; 	this.item.onChange = this.change.bind(this); 	this._e.appendChild(this.item); 	Event.observe(this.item,"change",this.change.bindAsEventListener(this)); 	}, 	change:function(evt){ 	if(this.checkExt(this.item.value)){ 	alert("The file existed."); 	this.item.value = ""; 	return false; 	} 	setTimeout(this.update.bind(this),300); 	}, 	update:function (){ 	this.item.style.display="none"; 	var v=v1= this.item.value; 	var l = v.length; 	var sp ="/"; 	if(v.lastIndexOf(sp) < 0) 	sp = "\\"; 	if(l > this.max){ 	v = v.substr(v.lastIndexOf(sp),l-v.lastIndexOf(sp)); 	v1=v1.substr(0,l-v.length); 	v = v1.substr(0,(this.max-v.length-3))+"..."+v; 	} 	var t = document.createElement("label"); 	t.innerHTML = v; 	t.title = this.item.value; 	this._e.appendChild(t); 	this._e.appendChild(document.createTextNode(" [")); 	var a = document.createElement("a"); 	a.href = "javascript:void(0)"; 	a.innerHTML = this._o.btText||" ç§? é™? "; 	this._e.appendChild(a); 	this._e.appendChild(document.createTextNode("]")); 		Event.observe(a,"click",function(evt){ 	this.onRemove(this._e,this.item.value);	}.bindAsEventListener(this)); 		this.onUpdate(); 	} } 