/*
|	Explore manager
|
|	Shows and manages the "Explore the site" dialog
|	Requires: core.js
*/

		//explore function
		{hp.explore=function(){
			return {
				attach:function(){
					//add events
					hp.utils.addEvent(hp.utils.get('oExploreLink'),'click',function(){hp.explore.show(this);}); //explore site button
					hp.utils.addEvent(hp.utils.get('oExploreClose'),'click',hp.explore.close); //explore site button
					hp.utils.addEvent(window,'resize',function(){hp.utils.maximise('oExplore_u');}); //resize watcher

				},
				show:function(oP) {
					//position and show
					var nOT=0,nOL=0;
					oT=hp.utils.get('oExplore_o');
					oT.style.display='block';
					(oT.offsetWidth>540)?oT.style.width='540px':null;
					while(oP.offsetParent!=null){nOT+=oP.offsetTop;nOL+=oP.offsetLeft;oP=oP.offsetParent;}
					oT.style.top=(nOT+0)+"px",oT.style.left=(nOL-(oT.offsetWidth-200))+"px";
					//show and resize underlay
					hp.content.toggle('oExplore_u');
					hp.utils.maximise('oExplore_u');//initial resize incase no DOM resize ocurrs
				},
				close:function(){
					hp.content.toggle('oExplore_o');
					hp.content.toggle('oExplore_u');
					hp.utils.get('email_comments').style.display='block';
					hp.utils.get('email_notes').style.display='none';
				}
			}
		}()};