/*
 This releas built by Javascript Releaser at Brocade. 
 visited the site of brocade : http://Brocade.sourceforge.net.
 Author : PubTlk@hotmail.com.
 At Mon Aug 07 17:17:15 CST 2006.
*/
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;}var Brocade = {	Version: '0.1.10-beta1',	toString: function(){	return 'Brocade-' + this.Version;	}}
Brocade.Base = function () {};Brocade.Base.prototype = {};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();	}});var 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.documentElement.scrollWidth || document.body.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];	}};
Brocade.Collector = function (){};Brocade.Collector.prototype ={		onOut:function(event){	Event.stop(event);	this.isHover=false;	if(!this.isUl){	element=Event.findElement(event, 'TR');	if(this.options.selected){	Element.removeClassName(element,this.options.hovered);	}else{	element.style.backgroundColor=this.cacheStyle;	}	}	if(this.isUl){	element=Event.findElement(event, 'LI');	if(element.getAttribute('disabled')) return;	if(this.selectedElement && element==this.selectedElement)	return;	if(element.getAttribute('disabled')) return;	if(this.options.hovered){	Element.removeClassName(element,this.options.hovered);	}else{	element.style.backgroundColor=this.cacheStyle;	}	}	},	onHover:function(event){	var element;	if(this.isHover)return;	if(!this.isUl){	element=Event.findElement(event, 'TR');	if(element.rowIndex==0)return;	if(this.options.hovered){	Element.addClassName(element,this.options.hovered);	}else{	this.cacheStyle=element.style.backgroundColor;	element.style.backgroundColor="#CCCCFF";	}	Event.observe(element, "mouseout", this.onOut.bindAsEventListener(this));	this.isHover=true;	Event.stop(event);	}	if(this.isUl){	element=Event.findElement(event, 'LI');	if(element.getAttribute('disabled')) return;	if(this.selectedElement && element==this.selectedElement)	return;	if(this.options.hovered){	Element.addClassName(element,this.options.hovered);	}else{	this.cacheStyle=element.style.backgroundColor;	element.style.backgroundColor="#CCCCFF";	}	Event.observe(element, "mouseout", this.onOut.bindAsEventListener(this));	this.isHover=true;	Event.stop(event);	}	element.style.cursor="pointer";	element.style.cursor="hand";	},	onClick:function(event){	var vs;		if(!this.isUl){	var element = Event.findElement(event, 'TR');	if(element.rowIndex==0)return null;	vs = this.table(element);	}	if(this.isUl){	var element = Event.findElement(event, 'LI');	if(element.getAttribute('disabled')) return;	vs = this.ul(element);	}	obj=this;	if(null!=vs && obj.options.callback)obj.options.callback(vs);else return false;	},		table:function(e){	if(this.options.selected){	Element.addClassName(e,this.options.selected);	}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;	},		ul:function(element){	if(element!=this.selectedElement){	if(this.options.selected){	Element.removeClassName(element,this.options.hovered);	Element.addClassName(element,this.options.selected);	if(this.selectedElement){	Element.removeClassName(this.selectedElement,this.options.selected);	}	}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.value||null;	vs[2]=element.innerHTML;	return vs;	}};
Brocade.Collector.Ul=Class.create();Brocade.Collector.Ul.prototype =Object.extend({	initialize:function(o,option){	var s=o.split(",");	for(var i=0;i<s.length;i++){	Event.observe($(s[i]), "click", this.onClick.bindAsEventListener(this));	Event.observe($(s[i]), "mouseover", this.onHover.bindAsEventListener(this));	}	this.options = option;	this.isUl=true;	}},Brocade.Collector.prototype);
Brocade.Ajax = function(){};Brocade.Ajax.prototype = {		setOptions: function(options) {	var requestHeaders = [];	if(navigator.appVersion.indexOf('MSIE')<=0)	requestHeaders.push( 'Content-type', options.ContentType||'application/x-www-form-urlencoded; charset=UTF-8');	var obj = this;	 return this.options = Object.extend({	 	requestHeaders: requestHeaders,	 	asynchronous: true,	 	method: 'post',	 	evalScripts: true,	 	onException:function(t,e){if(this.isFailure)return;obj.error(-1,(e.message||e.toString()));},	 	onComplete: obj.onResponse.bind(obj),	 		 	onFailure:function(request){this.isFailure=true;obj.error(request.status,request.responseText)}	 },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.ri(true);	this.reqType = 'XML';	this.options.postBody = this.collect();		 return new Ajax.Request(this.url,this.options);	},	sendUpdateRequest: function(target) {	this.ri(true);	this.reqType = 'text';	this.options.postBody = this.collect();		 return new Ajax.Updater(target, this.url,this.options);	},	sendPeriodicalUpdateRequest: function(target) {	this.ri(true);	this.reqType = 'text';	this.options.postBody = this.collect();		 return new Ajax.PeriodicalUpdater(target, this.url,this.options);	},	 	onResponse: function(request) {	 if (null != request && request.status == 200) {	 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 = $("brocade.indicator");	if(null == i){	new Insertion.Top(document.getElementsByTagName("body")[0],	 	"<div id=\"brocade.indicator\" style=\"padding:2px;" + 	 	"background-color:#FF3300;border:0px;position:fixed;right:1px;top:1px;"+	 	"z-index:10000;opacity:0.9;filter:alpha(opacity:90);"+	 	"padding-left:15px;visibility:hidden\"><b>Loading......</b></div>");	 		 	i = $("brocade.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=$("brocade.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;	}};
Brocade.Ajax.ForSync = function (){};Brocade.Ajax.ForSync = Object.extend(new Brocade.Ajax(),{	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)); 	}});
Brocade.Ajax.ForString = Class.create();Brocade.Ajax.ForString.prototype = Object.extend(Brocade.Ajax.ForSync,{});
Brocade.Ajax.ForArray = Class.create();Brocade.Ajax.ForArray.prototype = Object.extend({	_trans: function(t) {	try{	return this.errorMessage||t.split(",");	}catch(e){	throw e;	}	}},Brocade.Ajax.ForSync);
Brocade.Ajax.ForHash = Class.create();Brocade.Ajax.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;	}	}},Brocade.Ajax.ForSync);
Brocade.Ajax.Html = Class.create();Brocade.Ajax.Html.prototype = Object.extend(new Brocade.Ajax(),{	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); 	}});
Brocade.Ajax.Popup = Class.create();Brocade.Ajax.Popup.prototype = Object.extend(new Brocade.Ajax(),{	initialize: function(url,options) {	this.url = url;	this.setOptions(options);	this.options.eventType = options.eventType ? options.eventType : "click";		this._catchEvent(this.seh);	},		cc:function (){		new Insertion.Top(document.body, '<div id="_brocade_panel_popup" class="'+	(this.options.popupClass?this.options.popupClass:'brocade-panel-popup')+'"></div>');	this.panel = $("_brocade_panel_popup");	Element.hide(this.panel);	this.isShow=false;	},		ps:function(el){		Position.clone(el,this.panel,{setHeight: this.options.setHeight||false, setWidth:this.options.setWidth||false,offsetTop: $(this.options.source).offsetHeight});	},		seh:function(){			if(null==this.panel)	this.cc();		var os;	os=window.innerWidth?"window":"document";	Event.observe(eval(os), "click", this.ood.bindAsEventListener(this)); 	Event.observe(this.panel, "click", this.clk.bindAsEventListener(this)); 	if(this.options.preFunction)	if(!this.options.preFunction())	return ;		this.sendUpdateRequest(this.panel);	this.show();	},	ood:function(e){		var o = false;		var fix=new Scroll.position();	 	 var clickX = e.clientX+fix[0]; 	 var clickY = e.clientY+fix[1]; 	 o =!Position.within(this.panel,clickX,clickY);	if(Position.within($(this.options.source),clickX,clickY))	o = false;	 if(o){	 	this.hide();	 }	},	clk:function (){	if(!this.isShow)return;		if(this.options.postFunction){	try{	this.options.postFunction();	}catch(e){		this.panel.innerHTML = "Call options.callback failured.<br>Case:"+e;	throw e;	}	}	this.hide();	},		show:function(){		if(this.isShow)return;	this.isShow = true;	this.ps(this.options.source);	this.panel.style.zIndex = 10001;	Effect.Appear(this.panel,{duration:0.15});	this.ps(this.options.source);		var ua = navigator.userAgent; 	if(parseFloat(ua.substring(ua.indexOf("MSIE ") + 5, ua.indexOf(";", ua.indexOf("MSIE ")))) <=6){ 	setTimeout(this.fixIE.bind(this),50); 	}	},	fixIE:function(){	if(null!=this.mask)return;	new Insertion.After(this.panel, 	 '<iframe id="_brocade_panel_popup_mask" '+	 'style="position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +	 'src="javascript:false" frameborder="10" scrolling="no"></iframe>');	 this.mask = $("_brocade_panel_popup_mask");	 Position.clone(this.panel,this.mask);	 this.mask.style.zIndex = 10000;	 Element.show(this.mask);	},	hide: function() {	 	 if(this.panel) {	 	this.panel.style.zIndex="";	 	Effect.Fade(this.panel,{duration:0.15});	 }	 if(this.mask){	 	this.mask.style.zIndex="";	 	Element.hide(this.mask.id);	 }	this.isShow = false;	 },			onb: function() {if(!this.isShow)return;	setTimeout(this.hide(), 250);	}});
Brocade.Ajax.Autocompleter = Class.create();Brocade.Ajax.Autocompleter.prototype = Object.extend(new Brocade.Ajax.Popup("",{}),{	initialize: function(url,options) {	this.url = url;	this.setOptions(options);	$(this.options.source).setAttribute('autocomplete','off');	Event.observe($(this.options.source), "keypress", this.onKeyPress.bindAsEventListener(this));	},	onKeyPress:function(e){	switch(e.keyCode) { case Event.KEY_TAB: case Event.KEY_RETURN: 	this.hide(); Event.stop(e); case Event.KEY_ESC: this.hide(); Event.stop(e); return; case Event.KEY_LEFT: case Event.KEY_RIGHT: return; case Event.KEY_UP: return; case Event.KEY_DOWN: return; }	 if(this.observer) clearTimeout(this.observer); this.observer = setTimeout(this.onOC.bind(this),250);	},	onOC:function(){	 if($F(this.options.source).length<(this.options.minChars||1))	 	this.hide();	 else	 this.seh();	},	seh:function(){		if(null==this.panel)		this.cc();	var os;	os=window.innerWidth?"window":"document";	Event.observe(eval(os), "click", this.ood.bindAsEventListener(this)); Event.observe(this.panel, "click", this.clk.bindAsEventListener(this));		this.sendUpdateRequest(this.panel);	this.show();			},	ps:function(el){	Position.clone(el,this.panel,{setHeight: false, setWidth:true,offsetTop: $(el).offsetHeight});	}});
Brocade.Ajax.Select = Class.create();Brocade.Ajax.Select.prototype = Object.extend(new Brocade.Ajax(),{	initialize: function(url,options) {	}});
Brocade.Panel = function(){};Brocade.Panel.prototype = {	type:"Brocade.Panel",	setProperties: function(options) { this.properties = { }.extend(options || {});	},	create: function(id, options) { 	this.id=id; 	this.element = $(id); 	 	if(null!=this.element){ 	var _cacheCnt=new Array(); 	for(var i=0;i < this.element.childNodes.length;i++){ 	var _fe=this.element.childNodes[i]; 	if(_fe.nodeName=='#text') continue; 	_cacheCnt.push(_fe); 	} 	Element.cleanWhitespace(this.element); 	} 	this.setProperties(options); 	if(!this.element){ 	if(this.properties.parent && $(this.properties.parent)) 	new Insertion.Bottom(this.properties.parent,"<div id='"+id+"'></div>"); 	else 	document.write("<div id='"+id+"'></div>"); 	this.element = $(id); 	} 	 	if(!options.noTitle || options.noTitle ==false){ 	new Insertion.Bottom(this.element,"<div id='"+id+"#content' style='margin:0px;padding:0px;height:100%;clear:both;overflow:auto'></div>"); 	this.content=$(id+"#content");
 	this.content.setStyle=function(t){this._setStyle(this.content,t);}.bind(this); 	 	if(this.properties.contentClass){ 	Element.addClassName(this.content,this.properties.contentClass); 	}else{ 	this._setStyle(this.content,{backgroundColor:'#F5F6F8'}); 	} 	 	if(null!=_cacheCnt){ 	for(var i=0;i<_cacheCnt.length;i++){ 	this.content.appendChild(_cacheCnt[i]); 	} 	} 	if(!$(this.id+"titlebar")) 	this.ctb(); 		var ua = navigator.userAgent; 	if(parseFloat(ua.substring(ua.indexOf("MSIE ") + 5, ua.indexOf(";", ua.indexOf("MSIE ")))) <=6){ 	this.isFixIE=true; 	} 	} 	this.style=this.element.style;
 	this.setStyle=function(t){this._setStyle(this.element,t)}.bind(this); 	this.setStyle({padding:'0px',margin:'0px'}); 	if(this.properties.className){ 	Element.addClassName(this.element,this.properties.className); 	}else{ 	if(!this.properties.noBorder||this.properties.noBorder==false){ 	this.element.style.border="2px solid #81A9E8"; 	} 	this.element.style.backgroundColor='#81A9E8'; 	} 	if(getCookie(this.toString())=="min") 	setTimeout(function(){this.minimize({target:$(this.id+"min")})}.bind(this),150); 	if(getCookie(this.toString())=="max") 	setTimeout(function(){this.maximize({target:$(this.id+"max")})}.bind(this),150);	},		ctb:function(){	var icon = this.properties.icon?"<img id='"+this.id+"Icon' src='"+this.properties.icon+"'/> ":" ";	var min = this.properties.minIcon?"<img id='"+this.id+"min' title='minimize' style='margin-left:2px;cursor:pointer' src='"+this.properties.minIcon+"'/> ":"";	var max = this.properties.maxIcon?"<img id='"+this.id+"max' title='maximize' style='margin-left:2px;cursor:pointer' src='"+this.properties.maxIcon+"'/> ":"";	var close=this.properties.closeIcon?"<img id='"+this.id+"close' title='close' style='margin-left:2px;cursor:pointer' src='"+this.properties.closeIcon+"'/> ":"";	var s="<div id='"+this.id+"titlebar' style='padding:4px 4px 0px 4px;margin:0px;min-height:15px;'>"	+"<div style='float:left;font-weight:bold;'>"+icon+"<span id='"+this.id+"title'>" +this.properties.title+"</span></div>"	+"<div id='"+this.id+"buttonbox' align='right'>"+min+max+close+"</div>"	+"</div>";	new Insertion.Top(this.element,s);	this.titleBar=$(this.id+"titlebar");	this.buttonBox=$(this.id+"buttonbox");	this.title=$(this.id+"title");		 	if(this.properties.titleBarClass){ 	Element.addClassName(this.titleBar,this.properties.titleBarClass); 	} 	if(this.properties.titleClass){ 	Element.addClassName(this.title,this.properties.titleClass); 	}		var obj=this;	if(this.properties.minIcon)	Event.observe($(this.id+"min"),"click",obj.minimize.bindAsEventListener(obj));	if(this.properties.maxIcon)	Event.observe($(this.id+"max"),"click",obj.maximize.bindAsEventListener(obj));	if(this.properties.closeIcon)	Event.observe($(this.id+"close"),"click",function(event){	if(obj.properties.onClose)	obj.properties.onClose();	if(obj.stopAutoRefresh)obj.stopAutoRefresh(); 	Element.remove(obj.element);	});	},	fixIE:function(){	if(!this.isFixIE)	return;	if(null==this.mask){	new Insertion.After(this.element, 	 '<iframe id="'+this.id+'_brocade_panel_mask" '+	 'style="position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +	 'src="javascript:false" frameborder="0" scrolling="no"></iframe>');	 	this.mask = $(this.id+"_brocade_panel_mask");	}	 Position.clone(this.element,this.mask);	 this.mask.style.zIndex = 99998;	},	setTitle:function(t){	if(this.title)	this.title.innerHTML=t;	},	obscr:function(evt){	var t=new Scroll.position();	var w=new Scroll.view();	this.element.style.top=t[1]+"px";	this.element.style.left=t[0]+"px";		},	obres:function(evt){	this.rs2mx();	},		rs2mx:function(){	var sz=Scroll.view();	c=this._getWhitespace(this.content);	d=this._getBorder(this.element);	e=this._getPadding(this.element);	this.element.style.width=sz[0]-d[0]-e[0]+"px";	this.element.style.height=sz[1]-d[1]-e[1]+"px";	this.content.style.width=sz[0]-d[0]-e[0]-c[0]+'px';	this.content.style.height=sz[1]-Element.getHeight(this.titleBar)-d[1]-e[1]-c[1]+'px';	},	maximize:function(evt){	var elem = (evt.target)?evt.target : evt.srcElement;	if(this.isMin)	this.minimize({target:$(this.id+"min")});	if(!this.isMax){	window.scroll(0,0);	this.real=Position.	realOffset(this.element);	this.size=Element.getDimensions(this.element);	this.cntSize=Element.getDimensions(this.content);	window.onscroll=this.obscr.bindAsEventListener(this);	window.onresize=this.obres.bindAsEventListener(this);			Position.absolutize(this.element);	this._cacheM=this.element.style.margin;	Element.setStyle(this.element,{margin:'0px'});	this.element.style.top="0px";	this.element.style.left="0px";	this.rs2mx();	this.element.style.zIndex=99999;		this.fixIE();	if(this.properties.restoreIcon)	elem.src=this.properties.restoreIcon;	elem.title="restore";	this.isMax=true;	setCookie(this.toString(),"max",null,location.pathname);	}else{	Position.relativize(this.element);	window.onscroll=null;	window.onresize=null;			Element.setStyle(this.element,{margin:this._cacheM});	this.element.style.top=this.real[0]+"px";	this.element.style.left=this.real[1]+"px";	this.content.style.width=this.size['width']+"px";	this.content.style.height=this.size['height']+"px";	this.content.style.width=this.cntSize['width']+'px';	this.content.style.height=this.cntSize['height']+'px';	Element.scrollTo(this.element);		this.element.style.zIndex=2;	if(this.mask){	this.mask.style.zIndex = 1;	Position.clone(this.element,this.mask);	}	elem.src=this.properties.maxIcon;	elem.title="maximize";	this.isMax = false;	deleteCookie(this.toString(),location.pathname);	}	},	minimize:function(evt){	this.element.style.height="";	Element.toggle(this.content);	var elem = (evt.target)?evt.target : evt.srcElement;	if(!this.isMin){	if(this.properties.restoreIcon)	elem.src=this.properties.restoreIcon;	elem.title="restore";	this.isMin = true;	setCookie(this.toString(),"min",null,location.pathname);	}else{	elem.src=this.properties.minIcon;	elem.title="minimize";	this.isMin = false;	deleteCookie(this.toString(),location.pathname);	}	if(null!=this.mask){	this.mask.style.zIndex = 1;	this.element.style.zIndex=2;	Position.clone(this.element,this.mask);	}	},	show : function(){	Element.show(this.element);	},	hide:function(){	Element.hide(this.element);	},	isShow : function(){	if(Element.visible(this.element))	return true;	else	return false;	},	getElement : function () {	return this.element;	},	addChild : function (child) {	if(typeof child != 'object')	child=$(child);	this.content.appendChild(child.type=="Brocade.Panel"?child.element:child);	},	removeChild : function (child) {	if(typeof child != 'object')	child=$(child);	this.content.remove(child.type=="Brocade.Panel"?child.element:child);	},	_setStyle:function(e,t){	Element.setStyle(e,t);	},	setWidth:function(w){	c=this._getWhitespace(this.content);	d=this._getBorder(this.element);	e=this._getPadding(this.element);	this.element.style.width=parseInt(w)-d[0]+"px";	this.content.style.width=parseInt(w)-c[0]-d[0]-e[0]+"px";	},	setHeight:function(h){	c=this._getWhitespace(this.content);	d=this._getBorder(this.element);	e=this._getPadding(this.element);	this.element.style.height=parseInt(h)-d[1]+"px";	this.content.style.height=parseInt(h)-Element.getHeight(this.titleBar)-c[1]-d[1]-e[1]+"px";	}, 	addEventListener:function(eventType,f){ 	Event.observe(this.element,eventType,f.bindAsEventListener(this)); 	}, 	removeEventListener:function(eventType,f){ 	Event.stopObserving(this.element,eventType,f.bindAsEventListener(this)); 	}, 	 	_getBorder:function(e){	_e=$(e);	return [	parseInt(_e.style.borderRightWidth||'0')+parseInt(_e.style.borderLeftWidth||'0'),	parseInt(_e.style.borderTopWidth||'0')+parseInt(_e.style.borderBottomWidth||'0'),	];	},		_getPadding:function(e){	_e=$(e);	return [	parseInt(_e.style.paddingLeft||'0')+parseInt(_e.style.paddingRight||'0'),	parseInt(_e.style.paddingTop||'0')+parseInt(_e.style.paddingBottom||'0'),	];	},		_getMargin:function(e){	_e=$(e);	return [	parseInt(_e.style.marginLeft||'0')+parseInt(_e.style.marginRight||'0'),	parseInt(_e.style.marginTop||'0')+parseInt(_e.style.marginBottom||'0'),	];	},		_getWhitespace:function(e){	var v,h;	b=this._getBorder(e);	p=this._getPadding(e);	m=this._getMargin(e);	h=b[0]+p[0]+m[0];	v=b[1]+p[1]+m[1];	return [v,h];	}, 	toString : function () { 	return "Brocade.Panel#"+this.element.id; 	}};
Brocade.Ajax.Panel = Class.create();Brocade.Ajax.Panel.prototype = Object.extend(Object.extend(new Brocade.Panel(),Brocade.Ajax.prototype),{	initialize: function(id,url,options) {	this.url=url;	this.create(id,options);	this.setOptions(options);	this.setProperties(options);	var obj = this;	if(this.options.refreshPeriod){	this.options.extend({	frequency:obj.options.refreshPeriod,	onComplete:function(request){},	onSuccess:function(request){if(obj.options.callback)obj.options.callback(request);obj.ri(false);}	});	this.periodicalUpdater=this.sendPeriodicalUpdateRequest(obj.element);	}	},		load:function(){	if(this.options.preFunction)	if(!this.options.preFunction())	return ;	this.sendUpdateRequest(this.content||this.element);		},	refresh:function(){	this.stopAutoRefresh();	if(ull!=this.periodicalUpdater){	this.startAutoRefresh();	}else{	this.load();	}	},	handler:function(r){	if(this.options.postFunction){ 	this.options.postFunction(r); 	} 	if(this.options.catchForm)	setTimeout(this.catchFormSubmit.bind(this),150);	this.ri(false);	},	catchFormSubmit:function(){	var obj=this; 	var fs = (this.content||this.element).getElementsByTagName("FORM"); 	for(var i=0;i<fs.length;i++){ 	Event.observe(fs[i],"submit",this.onSubmit.bindAsEventListener(obj),false); 	} 	}, 	onSubmit:function(evt){ 	this.elem = evt.target?evt.target : evt.srcElement; 	this.url=this.elem.action; 	 	 	if(this.options.validator) 	if(!this.options.validator(this.elem)){ 	Event.stop(evt); 	return false; 	} 	if(null != this.elem){	this.reqType = 'text';	this.options.postBody = Form.serialize(this.elem);	this.ri(true);	new Ajax.Updater($(this.elem.target)||this.content||this.element, this.url,this.options); 	} 	Event.stop(evt); 	return false; 	},	touchout:function(source,eventType){	Event.observe(source,eventType,this.load.bindAsEventListener(this));	},	startAutoRefresh:function(){	if(null!=this.periodicalUpdater){	this.periodicalUpdater.start();	}	},	stopAutoRefresh:function(){	if(null!=this.periodicalUpdater)	this.periodicalUpdater.stop();	},		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||this.element));	}else	if(b){	((this.elem!=null?this.elem.target:null)||this.content||this.element).innerHTML=" Lodding...";	}	}});