
if(typeof Widgets=="undefined"){Widgets={};}
Widgets.Collapsible=Class.create();Widgets.Collapsible.prototype={open:false,htmlProvider:null,domElement:null,initialize:function(id,_2,_3){this.id=id;this.url=_2;this.options=Object.extend({method:"get",load_on_demand:true,dimensions:{},has_width:false,has_height:false},_3||{});var _4=new Kore.JSLoader();_4.addFile("includes/jaxon/widgets/widgets.js");_4.addFile("includes/kore/js/browser/browser.js");_4.addFile("includes/yui/yahoo/yahoo.js");_4.addFile("includes/yui/dom/dom.js");_4.addFile("includes/yui/event/event.js");if(this.url!=null){_4.addFile("includes/yui/connection/connection.js");_4.addFile("includes/kore/js/error.js");_4.addFile("includes/kore/js/dataprovider/transporter.js");_4.addFile("includes/kore/js/dataprovider/dataprovider.js");_4.addFile("includes/kore/js/dataprovider/htmlprovider.js");_4.addFile("includes/kore/js/dataprovider/htmlprocessor.js");}
try{_4.loadFiles(function(){if(!Kore.isOkForAjax()){return false;}
if(Kore.is.ie&&(Kore.is.version==6)){try{document.execCommand("BackgroundImageCache",false,true);}
catch(e){}}
Widgets.general_actions.addActions(this);this.render();}.bind(this));}
catch(e){}},render:function(){if(!YAHOO.util.Dom.get(this.id).offsetHeight){window.setTimeout(function(){this.render();}.bind(this),10);return;}
if(this.url){this.loadedElement=!this.options["load_on_demand"];this.htmlProvider=new Kore.HtmlProvider(null,this);var _5=YAHOO.util.Dom.get(this.id+"-body");this.domElement=YAHOO.util.Dom.getElementsByClassName("collapsibleContent","div",_5)[0];this.htmlProvider.finalizeEvent.subscribe(this.onUpdate,this,true);}else{this.loadedElement=true;}
YAHOO.util.Dom.removeClass(this.id,"collapsible_phprendering");this.open=YAHOO.util.Dom.hasClass(this.id,"collapsible_open");this.detectStyle();this.options.dimensions.width=parseInt(YAHOO.util.Dom.getStyle(this.id,"width"),10);this.options.dimensions.height=parseInt(YAHOO.util.Dom.getStyle(this.id,"height"),10);this.removeDimensions();this.title_height=parseInt(YAHOO.util.Dom.get(this.id).getElementsByTagName("h3")[0].offsetHeight,10);if(this.options.has_width){YAHOO.util.Dom.get(this.id).style.width=(this.options.dimensions.width)+"px";}
if(this.open){this.setDimensions();}
var el=YAHOO.util.Dom.get(this.id);var _7=el.getElementsByTagName("h3")[0];YAHOO.util.Event.addListener(_7,"click",this.toggleEvt,this,true);var _8=_7.getElementsByTagName("a")[0];_8.hideFocus=true;},detectStyle:function(){var s=YAHOO.util.Dom.get(this.id).getAttribute("style");if(typeof s=="undefined"||s==null){this.options.has_width=false;this.options.has_height=false;}else{if(typeof s=="object"){s=s.cssText;}else{s=s.toString();}
this.options.has_width=s.match(/width\s*:/i);this.options.has_height=s.match(/height\s*:/i);}},setContainerDimensions:function(){if(this.options.has_width){YAHOO.util.Dom.get(this.id).style.width=(this.options.dimensions.width)+"px";}
if(this.options.has_height){YAHOO.util.Dom.get(this.id).style.height=(this.options.dimensions.height)+"px";}},setDimensions:function(){if(this.options.has_width){YAHOO.util.Dom.get(this.id).style.width=(this.options.dimensions.width)+"px";YAHOO.util.Dom.get(this.id+"-body").style.width=(this.options.dimensions.width)+"px";YAHOO.util.Dom.get(this.id+"-body").style.overflowX="auto";}
if(this.options.has_height){YAHOO.util.Dom.get(this.id).style.height=(this.options.dimensions.height)+"px";YAHOO.util.Dom.get(this.id+"-body").style.height=(this.options.dimensions.height-this.title_height)+"px";YAHOO.util.Dom.get(this.id+"-body").style.overflowY="auto";}},removeDimensions:function(){YAHOO.util.Dom.get(this.id).style.height="";},toggle:function(){this.open=!this.open;if(this.open){if(!this.loadedElement){this.loadInfo();}else{YAHOO.util.Dom.addClass(this.id,"collapsible_open");this.setDimensions();}}else{YAHOO.util.Dom.removeClass(YAHOO.util.Dom.get(this.id),"collapsible_open");this.removeDimensions();}},setUrl:function(_a){this.url=_a;},loadInfo:function(_b){this.htmlProvider=new Kore.HtmlProvider(null,this,_b);this.htmlProvider.finalizeEvent.subscribe(this.onUpdate,this,true);var _c=this.url;var _d=Kore.Url.getParamsFromCurrentUrl(true);var _e=_d[1];var _f=_d[0];if(/__state/.test(_e)){if(_e!=""){_c+=((/\?/.test(_c))?"&":"?")+_e;}}else{if(_f!=""){_c+=((/\?/.test(_c))?"&":"?")+_f;}}
if(!/KT_ajax_request=true/.test(_c)){_c+=((/\?/.test(_c))?"&":"?")+"KT_ajax_request=true";}
this.htmlProvider.URL=_c;if(this.fullUrl==null){this.fullUrl=window.location.href.toString().replace(/\/[^\/]*$/,"/")+this.url;}
this.htmlProvider.getContent();},onUpdate:function(){this.loadedElement=true;YAHOO.util.Dom.addClass(this.id,"collapsible_open");this.setDimensions();this.initLinks();this.initForms();},toggleEvt:function(e){this.toggle();YAHOO.util.Event.stopEvent(e);}};function collapsible_toggle(e,_12){window[_12].toggle();Event.stop(e);}
