/*
|	Expandables manager
|
|	Shows and manages expandable dialogs
|	Requires: core.js
*/

		//Expand function
		{hp.expand=function(){
			var oT,oNT;
			return {
				oExpandables:[],
				oCurrentOpen:3,
				attach:function(){
					for(var i=0;i<hp.expand.oExpandables.length;i++){
						var aTmp=hp.expand.oExpandables[i].split(";");
						var oT=hp.utils.get('oExpand'+aTmp[0]+'Header');oT.nId=i,oT.vUrl=aTmp[1];
						hp.utils.addEvent(oT,'mouseover',function(){if(this.nId!=hp.expand.oCurrentOpen){hp.expand.toggle(this.nId);}});
						hp.utils.addEvent(oT,'click',function(){(this.vUrl!=undefined)?location.href='/'+this.vUrl:null;});
					}
				},
				toggle:function(nId){
					var oTName=hp.expand.oExpandables[hp.expand.oCurrentOpen].split(";")[0],oNTName=hp.expand.oExpandables[nId].split(";")[0];
					oT='oExpand'+oTName,oNT='oExpand'+oNTName;
					if(nId==hp.expand.oCurrentOpen){
						hp.content.toggle(oT);
						hp.expand.oCurrentOpen==undefined?hp.expand.oCurrentOpen=nId:hp.expand.oCurrentOpen=undefined;
						hp.utils.get('oExpand'+oTName+'Icon').src=(hp.expand.oCurrentOpen==nId)?'/images/expandable_close.gif':'/images/expandable_open.gif';
					}else{
						hp.expand.oCurrentOpen==undefined?hp.content.toggle(oNT):hp.content.swap(oT,oNT);
						hp.expand.oCurrentOpen!=undefined?hp.utils.get('oExpand'+oTName+'Icon').src='/images/expandable_open.gif':null;
						hp.utils.get('oExpand'+oNTName+'Icon').src='/images/expandable_close.gif';
						hp.expand.oCurrentOpen=nId;
					}
				}
			}
		}()};