/*
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
SECTION 01: CUSTOM VARIABLES AND SETTINGS
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
*/

if (cfg)
{
	if (isIE) cfg['MM_MENUTIME']=0;
	
	cfg['BUBBLE_COLOR']	= "FDF3C1";	// DEFAULT TOOL-TIP COLOR
	cfg['NEWS']			= null;		// NEWS TICKER - OBJECT CONTAINER
	cfg['NEWS_BUF']		= null;		// NEWS TICKER - STRING BUFFER
	cfg['NEWS_DELAY']	= 8000;		// NEWS TICKER - DELAY (IN MILLI-SECONDS)
	cfg['NEWS_SUBJ']	= null;		// NEWS TICKER - CURRENT HEADLINE
	cfg['NEWS_TWEEN']	= !isIE;	// NEWS TICKER - APPLY TWEENING EFFECT?
	
	cfg.MakeBubble=function(e,w,h,color,sty,simple)
	{
		var obj,pnt,htm;
		if (!(obj=DM_getObjCopy(e))) return;
		else
		{
			pnt = simple?"bottomleft_v2":"bottomleft";
			htm = new Array;
			
			if (!w) w=200;
			if (!h) h=20;
			if (!color) color="FFFFE1"; else color=color.toUpperCase()
			if (!DM_isStyle(sty)) sty="";
		}
		
		htm.push('<table style="width:'+w+'px;"><tr>');
		htm.push('<td style="padding:0px;background:url(images/SYSTEM/bubble/'+color+'/topleft.gif) left no-repeat;height:7px;font-size:2px;">&nbsp;</td>');
		htm.push('<td style="padding:0px;background:url(images/SYSTEM/bubble/'+color+'/top.gif) top repeat-x;width:'+(w-14)+'px;height:7px;font-size:2px;">&nbsp;</td>');
		htm.push('<td style="padding:0px;background:url(images/SYSTEM/bubble/'+color+'/topright.gif) right no-repeat;height:7px;font-size:2px;">&nbsp;</td>');
		htm.push('</tr><tr>');
		htm.push('<td style="padding:0px;background:#'+color+' url(images/SYSTEM/bubble/left.gif) left repeat-y;width:7px;font-size:2px;">&nbsp;</td>');
		htm.push('<td class="BUBBLE_CONTENT" style="'+sty+';vertical-align:middle;background:#'+color+';width:'+(w-14)+'px;">');
		htm.push(obj.innerHTML);
		htm.push('</td>');
		htm.push('<td style="padding:0px;background:#'+color+' url(images/SYSTEM/bubble/right.gif) right repeat-y;width:7px;font-size:2px;">&nbsp;</td>');
		htm.push('</tr><tr>');
		htm.push('<td style="padding:0px;" colspan="3">');
		htm.push('<table><tr>');
		htm.push('<td style="padding:0px;background:url(images/SYSTEM/bubble/'+color+'/'+pnt+'.gif) top left no-repeat;width:38px;height:28px;font-size:2px;">&nbsp;</td>');
		htm.push('<td style="padding:0px;background:url(images/SYSTEM/bubble/'+color+'/bottom.gif) top repeat-x;width:'+(w-45)+'px;font-size:2px;">&nbsp;</td>');
		htm.push('<td style="padding:0px;background:url(images/SYSTEM/bubble/'+color+'/bottomright.gif) top right no-repeat;width:7px;height:28px;font-size:2px;">&nbsp;</td>');
		htm.push('</tr></table></td></tr></table>');
		
		obj.innerHTML=htm.join("");
		return obj
	};
}


/*
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
SECTION 02: INITIALIZER
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
*/
function init(action,x)
{
	/*
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	PRIVATE FUNCTIONS
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	*/
	cfg.getBtnMode=function(imgs)
	{
		for (var i=0;i<imgs.length;i++)
		{
			if (/\/([^\/]+?)(?:_omo)?\.\w+$/i.test(imgs[i].src)) imgs[i].mode=RegExp.$1.toUpperCase();
		}
		return imgs
	};
	
	cfg.DYNWIN=
	{
		Open : function(url)
		{
			var lyr=DM_getObjCopy("DYNWIN_ANY");
			DM_newDynWin(lyr,[640,480],isIE6?[-1,100]:[],[],"float,url="+url)
			var btn=cfg.getBtnMode(lyr.getElementsByTagName("img"));
			
			for (var i=0;i<btn.length;i++)
			{
				if (!btn[i].mode) continue;
				else
				{
					btn[i].lyr=lyr.id;
					DM_setOp(btn[i],100)
				}
				
				switch (btn[i].mode)
				{
					case "BTN_PRINT":
					btn[i].onclick=function()
					{
						this.url=parent.window.frames[0].document.location.href+"&PRINT";
						DM_newWin(this.url,"pdf",[720,screen.availHeight],[],"scrollbars,resizable,status")
					};
					break;
					
					case "BTN_CLOSE":
					btn[i].onclick=function()
					{
						DM_setVis(this.lyr,false);
						setTimeout("DM_setVis(cfg.SHADOW,false,true)",500)
					};

					break;
				}
			}
			
			if (isIE) parent.window.frames[0].document.location.reload(true);
		}
	};
	
	/*
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	WINDOW MANAGEMENT
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	*/
	if (cfg['PG_WINDOW'])
	{
		var url=DM_getLocation();
		var DefaultLocation=cfg['EVED_WIN2_DEFURL'];
		
		switch (cfg['PG_PHPFILE'].toUpperCase())
		{
			/*
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			BRONX TROLLEY
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			*/
			case "BRONXTROLLEY":
			DM_divscroll(true,0);
			break;
			
			
			/*
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			DYNAMIC WINDOW
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			*/
			case "DYNWIN":
				setTimeout("DM_setVis('DYNWIN_PRELOADING',false)",1500);
				DM_divscroll();
				
				var scroller	= DM_getObjCopy("content_a_HOLDER");
				var subj		= DM_getHTTPvar(url,"subj");
				var printable	= /&\bPRINT\b/.test(url);
				var wrapper		= DM_getObjCopy("DYNINF"+(printable?"_P":""));
				var thbs		= DM_getElementsByClassName("thumb","img",wrapper);
				var thbpreview	= DM_getObjCopy("DYNWIN_THBPREVIEW");
				var minihost	= DM_getObjCopy("INFO_MINIHOST"+(printable?"_P":""));
				
				if (scroller) { with (scroller)
				{
					scroller.lyrs=getElementsByTagName("div");
					
					scroller.Init=function() { with (this)
					{
						DM_setVis(lyrs[6],true);
						lyrs[3].firstChild.onmousedown();
						lyrs[3].firstChild.onmouseup()
					}
					};
					
					//setTimeout("DM_getObjCopy('"+scroller.id+"').Init()",1500)
				}
				}
				
				if (printable)
				{
					for (var i=0;i<thbs.length;i++)
					{
						if (/\/PX\.\w+$/i.test(thbs[i].src)) thbs[i].style.display="none";
					}
					break;
				}
				
				if (minihost)
				{
					var more=minihost.getElementsByTagName("img")[0];
					more.url=url;
					more.onmouseover=more.onmouseout=function(){DM_swapImg(this)};
					more.onclick=function(){DM_redir(this.url.replace(/&\bNOHOST\b/,""))};
				}
				
				thbpreview.showing=false;
				thbpreview.defimage="images/px.gif";
				thbpreview.onclick=function()
				{
					DM_setVis(this,false);
					DM_setVis(cfg.SHADOW,false);
					this.showing=false
				};
				
				for (var i=0;i<thbs.length;i++)
				{
					if (/\/PX\.\w+$/i.test(thbs[i].src))
					{
						thbs[i].style.display="none";
						continue
					}
					
					thbs[i].lyr=thbpreview;
					thbs[i].realname=thbs[i].src.replace("_thumb","");
					
					if (isIE)
					{
						thbs[i].onclick=function()
						{
							var pos=DM_getPos(parent.window.document.getElementById("DYNWIN_ANY"));
							DM_newWin(this.realname,"image",[280,300],[pos[0]+200,450])
						};
					}
					else
					{
						thbs[i].onclick=function()
						{
							if (this.lyr.showing && this.lyr.firstChild.src==this.realname) return;
							else
							{
								this.lyr.showing=true;
								this.lyr.firstChild.src=this.lyr.defimage;
								this.lyr.firstChild.src=this.realname;
								if (!isIE) DM_setVis(cfg.SHADOW,true);
								DM_setVis(this.lyr,true,!isIE)
							}
						};
					}
				}
				
				if (o=DM_getObjCopy("INFO_CTRLS"))
				{
					var ctrls=cfg.getBtnMode(o.getElementsByTagName("img"));
					for (var i=0;i<ctrls.length;i++)
					{
						switch (ctrls[i].mode)
						{
							case "BTN_VIEWEVENTS":
							ctrls[i].url=url+"&SHOWEVENTS";
							ctrls[i].onclick=function(){DM_redir(this.url)};
							ctrls[i].onmouseover=ctrls[i].onmouseout=function(){DM_swapImg(this)};
							break;
						}
					}
				}
				
				if (!isIE)
				{
					DM_setOp("DYNWIN_SHADOW",75);
					cfg.SHADOW.style.backgroundColor="#FFFFFF";
					DM_setVis("DYNWIN_SHADOW",true)
				}
				
				switch (subj?subj.toUpperCase():"")
				{
					case "SUBSCRIBERS":
					var page = DM_getObjCopy("DYNWIN_SUBS");
					var form = page.getElementsByTagName("form")[0];
					
					if (form)
					{
						var inps = form.getElementsByTagName("input");
						var subm = DM_getElementsByClassName("pointer","img",form)[0];
						
						for (var i=0;i<inps.length;i++) inps[i].onblur=function(){this.value=DM_sanitize(this.value)};
						
						form.marked	= false;
						form.Mark	= function(name){this.marked=true;eval("this."+name).className="marked"};
						form.Unmark	= function(name){eval("this."+name).className=""};
						form.Submit	= function(){DM_setVis("DYNWIN_PRELOADING",true);this.submit()};
						subm.form	= form;
						
						subm.onclick=function()
						{
							this.form.marked=false;
							
							/\S/.test(this.form.s_firstname.value)?this.form.Unmark("s_firstname"):this.form.Mark("s_firstname");
							/\S/.test(this.form.s_lastname.value)?this.form.Unmark("s_lastname"):this.form.Mark("s_lastname");
							DM_isEmail(this.form.s_email.value)?this.form.Unmark("s_email"):this.form.Mark("s_email");
							
							if (/\S/.test(this.form.s_phone.value))
							  /^\d{10}$/.test(this.form.s_phone.value)?this.form.Unmark("s_phone"):this.form.Mark("s_phone");
							else this.form.Unmark("s_phone");
							
							if (!this.form.marked) this.form.Submit();
						};
					}
					break;
					
					
					case "INFO":
					if (o=cfg.MakeBubble("INFO_COMPANY_BUBBLE",545,null,null,"color:#000000;",true))
					{
						o.innerHTML	= "<p />"+o.innerHTML.replace(/^<(\w+)/,"<$1 class='center'");
						var where	= DM_getElementsByClassName("descr","td",DM_getObjCopy("INFO_COMPANY"))[0].getElementsByTagName("span")[0];
						var moreinf	= DM_getObjCopy("INFO_BTN_MOREINFO");
						
						moreinf.lyr		= o;
						moreinf.where	= where;
						moreinf.opened	= false;
						moreinf.srcs	= ["images/icons/tiny/moreinfo.gif","images/icons/tiny/hide.gif"];
						
						moreinf.onclick=function()
						{
							if (/\S/.test(this.where.innerHTML))
							{
								this.where.innerHTML="";
								this.src=this.srcs[0];
								this.opened=false
							}
							else
							{
								this.where.innerHTML=this.lyr.innerHTML;
								this.src=this.srcs[1];
								this.opened=true
							}
						};
					}
					break;
				}
			break;
			
			case "CALENDAR":
			setTimeout("DM_setVis('PRELOADING',false)",1500);
			
			if (/[\?&]\bDETAILS\b/.test(url))
			{
				var imgs = d.getElementsByTagName("img");
				var zoom = DM_getObjCopy("IMGPREVIEW");
				var wsiz = DM_getWinInnerSize();
				var zsiz = DM_getSize(zoom);
				var zpos = new Array();
				
				for (var i=0;i<imgs.length;i++)
				{
					if (!/_thumb\.\w+$/i.test(imgs[i].src)) continue;
					else
					{
						imgs[i].lyr=zoom;
						imgs[i].realsrc=imgs[i].src.replace(/_thumb\.(\w+)$/i,".$1");
						imgs[i].cmd=new Array();
						
						imgs[i].cmd.push("var preview=DM_getObjCopy('"+zoom.id+"').image");
						imgs[i].cmd.push("preview.src='"+imgs[i].realsrc+"'");
						imgs[i].cmd.push("DM_setOp(preview,100)");
					}
					
					imgs[i].onclick=function()
					{
						var delay;
						if (this.lyr.activated) delay=1000;
						else
						{
							delay=2000;
							DM_setOp(this.lyr,33);
							DM_setVis(this.lyr,true);
							DM_tweenPos(this.lyr,"D",-100,50);
							setTimeout("DM_tweenOp('"+this.lyr.id+"',-1,100)",1500);
							this.lyr.activated=true
						}
						
						DM_setOp(this.lyr.image,0);
						setTimeout(this.cmd.join(";"),delay)
					};
				}
				
				zoom.image=zoom.firstChild;
				zpos.push(Math.floor((wsiz[0]-zsiz[0])/2));
				zpos.push(Math.floor((wsiz[1]-zsiz[1])/2));
				DM_setPos(zoom,zpos[0],zpos[1]);
				zoom.onclick=function(){this.activated=false;DM_setVis(this,false)};
			}
			break;
			
			case "EVENTS":
				DM_divscroll(false,65);
				
				if (o=DM_getElementsByClassName("SCROLLER","table")[0])
				{
					var rows		= o.getElementsByTagName("tr");
					var thbs		= o.getElementsByTagName("img");
					var imgbuf		= DM_getObjCopy("IMGBUF");
					var complyr		= DM_getElementsByClassName("d_company","table")[0];
					
					imgbuf.siz		= DM_getSize(imgbuf);
					imgbuf.onclick	= function(){DM_setVis(this,false)};
					
					for (var i=0;i<thbs.length;i++)
					{
						thbs[i].buf=imgbuf;
						thbs[i].onclick=function()
						{
							var pos=new Array();
							var winsiz=DM_getWinInnerSize();
							
							pos.push(Math.floor((winsiz[0]-this.buf.siz[0])/2));
							pos.push(Math.floor((winsiz[1]-this.buf.siz[1])/2));
							this.buf.firstChild.src="images/px.gif";
							DM_setPos(this.buf,pos[0],pos[1]);
							DM_setVis(this.buf,true,true);
							this.buf.firstChild.src=this.src.replace(/_thumb\.(\w+)$/,".$1")
						};
					}
					
					for (var i=0;i<rows.length;i++)
					{
						rows[i].onmouseover=function(){this.className+=" omo"};
						rows[i].onmouseout=function(){this.className=this.className.replace(/\s*\bOMO\b/i,"")};
					}
					
					if (complyr)
					{
						var thumb=DM_getElementsByClassName("thumb","img",complyr)[0];
						
						if (!/\/px\.gif$/i.test(thumb.src))
						{
							thumb.preview=imgbuf.firstChild;
							thumb.onclick=function()
							{
								var pos=new Array();
								var lyr=this.preview.parentNode;
								var winsiz=DM_getWinInnerSize();
								
								pos.push(Math.floor((winsiz[0]-lyr.siz[0])/2));
								pos.push(Math.floor((winsiz[1]-lyr.siz[1])/2));
								
								this.preview.src=this.src.replace(/_thumb\.(\w+)$/,".$1");
								DM_setPos(lyr,pos[0],pos[1]);
								DM_setVis(lyr,true,true)
							};
						}
					}
				}
				setTimeout("DM_setVis('PRELOADING',false)",750);
			break;
		}
		return
	}
	
	/*
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	SEARCH BOX MANAGER
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	*/
	if (o=DM_getObjCopy("form_search"))
	{
		var btn=o.getElementsByTagName("img")[0];
		
		//o.qu.value="type keywords here";
		//o.qu.onfocus=function(){this.value=""};
		
		DM_setOp(btn,92);
		btn.onmouseover=function(){DM_setOp(this,100)};
		btn.onmouseout=function(){DM_setOp(this,92)};
		btn.onclick=function()
		{
			var f=d.forms[0];
			if (/type keywords here/i.test(f.qu.value)) f.qu.value="";
			if (/\S/.test(f.qu.value)) f.submit();
			else
			{
				alert("You must enter one or more keywords to search.");
				f.qu.focus()
			}
		};
	}
	
	/*
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	QUICK-LINKS MANAGER
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	*/
	if (o=DM_getObjCopy("MENU_1"))
	{
		var imgs=o.getElementsByTagName("img");
		var lyrs=DM_getElementsByClassName("BUBBLE","DIV");
		
		var html=
		[
			'<table><tr>',
			'<td><img src="images/menu_1/%ICON_ID%_small.gif" alt="" /></td>',
			'<td class="middle bold icon_name">%ICON_NAME%</td>',
			'</tr></table>'
		];
		
		for (var i=0;i<imgs.length;i++)
		{
			if (!/\S/.test(imgs[i].parentNode.title)) continue;
			else if (/\bDISABLED\b/i.test(imgs[i].parentNode.title)) {DM_setOp(imgs[i],33);imgs[i].disabled=true;continue}
			
			imgs[i].url=imgs[i].parentNode.title;
			imgs[i].parentNode.title="";
			imgs[i].onclick=function(){DM_redir(this.url)};
			imgs[i].style.cursor="pointer"
		}
		
		html=html.join("");
		for (var i=0,n=1;i<lyrs.length;i++,n++)
		{
			if (lyrs[i].title) n=lyrs[i].title;
			else
			{
				/_(\d+)$/.test(lyrs[i].id);
				n=RegExp.$1.toString().length<2?("0"+RegExp.$1):RegExp.$1
			}
			
			lyrs[i].title="";
			lyrs[i].innerHTML=html.replace(/%ICON_ID%/,n).replace(/%ICON_NAME%/,lyrs[i].innerHTML);
			lyrs[i].style.cursor="pointer";
			lyrs[i].onclick=new Function("DM_redir('"+imgs[i].url+"')");
			DM_setOp(lyrs[i],95)
		}
		
		DM_genBubbleTip(lyrs,[175],cfg.BUBBLE_COLOR,isIE6?"":"white-space:nowrap");
		DM_MenuMan("MENU_1","INIT=opacity:93",[false,"top",isIE?40:-5]);
		for (var i=0;i<imgs.length;i++) if (imgs[i].disabled) imgs[i].onmouseover=imgs[i].onmouseout=null;
		
		if (isIE)
		{
			/*
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			IE6 PATCH - ENSURE THAT ALL ENABLED BUBBLE-TIPS ARE INITIALIZED
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			*/
			for (var i=0;i<imgs.length;i++) if (!imgs[i].disabled) {imgs[i].onmouseover();imgs[i].onmouseout()}
		}
	}
	
	
	/*
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	MAIN NAVIGATION
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	*/
	if (o=DM_getObjCopy("MENU_2"))
	{
		for (var i=0,cols=o.getElementsByTagName("td"),url;i<cols.length;i++)
		{
			if (!/\S/.test(cols[i].innerHTML)) continue;
			else if (/\bactive\b/.test(cols[i].className)) cols[i].onmouseover=function(){this.style.cursor="default"};
			else
			{
				if (/\S/.test(cols[i].title)) url=cols[i].title;
				else url="?pg="+cols[i].innerHTML.split(" ").join("").toLowerCase();
				cols[i].onclick=new Function("DM_redir('"+url+"')");
				cols[i].onmouseover=function(){this.className+=" omo"};
				cols[i].onmouseout=function(){this.className=""};
				DM_swapMousePntr(cols[i])
			}
			cols[i].title=""
		}
	}
	
	/*
	----------------------------------------------------------------------------
	ANIMATED NEWS TICKER
	----------------------------------------------------------------------------
	*/
	if (o=DM_getElementsByClassName("header_c2","td")[0].getElementsByTagName("span")[0])
	{
		cfg['NEWS']=o;
		cfg['NEWS_SUBJ']=DM_getElementsByClassName("NEWS","DIV")[0].getElementsByTagName("span");
		o.parentNode.onmouseover=function(){this.className+=" omo"};
		o.parentNode.onmouseout=function(){this.className=this.className.replace(" omo","")};
		DM_swapMousePntr(o.parentNode);
		isIE?setTimeout("XDM_genNewsTicker()",3000):XDM_genNewsTicker();
	}
	
	/*
	----------------------------------------------------------------------------
	SUBSCRIBE BUTTON
	----------------------------------------------------------------------------
	*/
	if (o=DM_getElementsByClassName("header_c3","td")[0])
	{
		o.onclick=new Function("cfg.DYNWIN.Open('?pg=dynwin&subj="+o.title+"')");
		DM_swapMousePntr(o);
		o.title=""
	}
	
	/*
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	FOOTER LINKS + DYNAMIC WINDOWS
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	*/
	var flinks=DM_getElementsByClassName("footer_links")[0].getElementsByTagName("a");
	for (var i=0;i<flinks.length;i++)
	{
		if (/\S/.test(flinks[i].title))
		{
			flinks[i].url=flinks[i].title;
			flinks[i].onclick=new Function("cfg.DYNWIN.Open(this.url)");
			flinks[i].title=""
		}
	}
	
	/*
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	PAGE MANAGER
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	*/
	switch (cfg['PG_PHPFILE'].toUpperCase())
	{
		default:
		setTimeout("XDM_initSplashBanner()",2000);
		break;
		
		
		/*
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		WALK OF FAME
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		*/
		case "BRONXTROLLEY":
		var container	= DM_getObjCopy("BXT");
		var sidebar		= DM_getObjCopy("BXT_SIDEBAR");
		var optbox		= DM_getObjCopy("BXT_H");
		var form		= optbox.parentNode;
		var mode		= form.section.value.toUpperCase();
		var defurl		= "?pg=bronxtrolley&section="+mode.toLowerCase();
		var bubble		= DM_getObjCopy("BXT_BUBBLE");
		break;
		
		
		/*
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		GLOBAL SEARCH
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		*/
		case "SEARCH":
		var gsbox		= DM_getObjCopy("GS_BOX");
		var gsres		= DM_getObjCopy("GS_RESULTS");
		var rec			= DM_getElementsByClassName("block","td",gsres);
		var printall	= DM_getObjCopy("GS_ADVANCED").getElementsByTagName("img")[0];
		
		var btndisable = function(obj)
		{
			DM_setOp(obj,50);
			obj.onclick=obj.onmouseover=obj.onmouseout=null;
			obj.style.cursor="default";
			obj.disabled=true
		};
		
		if (rec.length==0) DM_setOp(printall,50);
		else
		{
			printall.url="?win=y&"+DM_getLocation().split("?")[1]+"&PRINT";
			printall.onmouseover=printall.onmouseout=function(){DM_swapImg(this)};
			printall.onclick=function(){DM_newWin(this.url,"pdf",[720,screen.availHeight],[],"resizable,scrollbars,status");};
		}
		
		
		for (var i=0;i<rec.length;i++)
		{
			rec[i].number	= rec[i].title;
			
			var iscompany	= /\bCOMPANY\b/i.test(rec[i].getElementsByTagName("table")[0].className);
			var btns		= rec[i].getElementsByTagName("img");
			var title		= rec[i].getElementsByTagName("h1")[0];
			var readmore	= rec[i].getElementsByTagName("a")[0];
			
			for (var j=0;j<btns.length;j++)
			{
				if (/([^\/_]+)(?:_\w+)?\.\w+$/.test(btns[j].src))
				{
					btns[j].mode=RegExp.$1.toUpperCase();
					if (!/\S/.test(btns[j].alt)) btndisable(btns[j]);
					else
					{
						btns[j].data=btns[j].alt;
						btns[j].record=rec[i].number;
						btns[j].onmouseover=btns[j].onmouseout=function(){DM_swapImg(this)};
						btns[j].alt=""
					}
				}
			}
			
			function initDynWinCtrls(lyr,url)
			{
				var ctrls=DM_getElementsByClassName("titlebar","tr",lyr)[0].getElementsByTagName("img");
				if (ctrls[0].onclick) return;
				
				for (var i=0;i<ctrls.length;i++)
				{
					/([^\/_]+)(?:_\w+)?\.\w+$/.test(ctrls[i].src);
					
					switch (RegExp.$1.toUpperCase())
					{
						case "PRINT":
						ctrls[i].url=url;
						ctrls[i].closer=ctrls[i+1];
						ctrls[i].onclick=function()
						{
							DM_newWin(this.url,"pdf",[720,screen.availHeight],[],"resizable,scrollbars,status");
							this.closer.onclick()
						};
						break;
						
						case "XCLOSE":
						ctrls[i].onclick=function(){DM_setVis("DYNWIN_EVENTS",false);DM_setVis("SHADOW",false,true)};
						break;
					}
				}
			};
			
			if (iscompany)
			{
				for (var j=0;j<btns.length;j++)
				{
					if (btns[j].disabled) continue;
					
					switch (btns[j].mode)
					{
						case "WWW":
						btns[j].onclick=function()
						{
							if (!/^https?:/i.test(this.data)) this.data="http://"+this.data;
							DM_newWin(this.data,"xweb",[],[],"FULL")
						};
						break;
						
						case "EMAIL":
						btns[j].onclick=function(){DM_redir("mailto:"+this.data)};
						break;
						
						case "EVENTS":
						btns[j].onclick=function(){cfg.DYNWIN.Open("?pg=dynwin&subj=info&host="+this.record+"&SHOWEVENTS&NOHOST")};
						break;
						
						case "DETAILS":
							btns[j].onclick=function(){cfg.DYNWIN.Open("?pg=dynwin&subj=info&host="+this.record)};
							
							title.mimic=btns[j];
							title.onclick=function(){this.mimic.onclick()};
							title.onmouseover=function(){this.mimic.onmouseover()};
							title.onmouseout=function(){this.mimic.onmouseout()};
							
							if (readmore)
							{
								readmore.invoker=title;
								readmore.onclick=function(){this.invoker.onclick();this.blur()};
								readmore.onmouseover=function(){this.invoker.onmouseover()};
								readmore.onmouseout=function(){this.invoker.onmouseout()};
							}
						break;
						
						case "PRINT":
						btns[j].url="?pg=dynwin&subj=info&host="+btns[j].record+"&win=y&PRINT";
						btns[j].onclick=function(){DM_newWin(this.url,"pdf",[720,screen.availHeight],[],"scrollbars,resizable,status")};
						break;
					}
				}
			}
			else
			{
				for (var j=0;j<btns.length;j++)
				{
					if (btns[j].disabled) continue;
					
					switch (btns[j].mode)
					{
						case "DETAILS":
						btns[j].onclick=function(){cfg.DYNWIN.Open("?pg=dynwin&subj=info&NOHOST&event="+this.record)};
						
						title.mimic=btns[j];
						title.onclick=function(){this.mimic.onclick()};
						title.onmouseover=function(){this.mimic.onmouseover()};
						title.onmouseout=function(){this.mimic.onmouseout()};
						
						if (readmore)
						{
							readmore.invoker=title;
							readmore.onclick=function(){this.invoker.onclick();this.blur()};
							readmore.onmouseover=function(){this.invoker.onmouseover()};
							readmore.onmouseout=function(){this.invoker.onmouseout()};
						}
						break;
						
						case "PRINT":
						btns[j].url="?pg=dynwin&subj=info&event="+btns[j].record+"&win=y&PRINT";
						btns[j].onclick=function(){DM_newWin(this.url,"pdf",[720,screen.availHeight],[],"scrollbars,resizable,status")};
						break;
					}
				}
			}
			rec[i].title=""
		}
		
		gsbox.getElementsByTagName("select")[0].onchange=function(){this.blur()};
		gsbox.btn=DM_getElementsByClassName("pointer","img",gsbox)[0];
		gsbox.btn.form=gsbox.parentNode;
		gsbox.btn.alternative=new Image();
		gsbox.btn.alternative.src=gsbox.btn.src.replace(/\.(\w+)$/,"bw.$1");
		
		gsbox.btn.onclick=function()
		{
			this.form.qu.value=DM_alltrim(DM_striptags(this.form.qu.value));
			
			if (/\S/.test(this.form.qu.value))
			{
				this.onclick=null;
				this.src=this.alternative.src;
				this.form.action="index.php";
				this.form.submit()
			}
			else
			{
				this.form.qu.className+=" marked";
				alert("Please enter a search phrase.");
				this.form.qu.focus()
			}
		};
		break;
		
		/*
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		CALENDAR OF EVENTS
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		*/
		case "CALENDAR":
		var url=DM_getLocation();
		
		if (/[\?&]\b[A-Z]+\b/.test(url)) break;
		else
		{
			cfg['BUF']={
				
				ACTIVERECORD : 0
				};
		}
		
		var cal			= DM_getElementsByClassName("calendar","table")[0];
		var rows		= cal.getElementsByTagName("tr");
		var pn			= DM_getElementsByClassName("pn","td",cal);
		var viewall		= DM_getObjCopy("VIEWALL").getElementsByTagName("tr")[0];
		var srchbox		= DM_getObjCopy("ADVSEARCH");
		var results 	= DM_getObjCopy("RESULTS");
		var printall	= results.getElementsByTagName("img")[0];
		var r			= DM_getElementsByClassName("record","tr",results);
		var qrystr		= "?win=y&"+url.split("?")[1];
		
		if (printall)
		{
			printall.url=qrystr+"&PRINT";
			printall.onmouseover=printall.onmouseout=function(){DM_swapImg(this)};
			printall.onclick=function(){DM_newWin(this.url,"pdf",[720,screen.availHeight],[],"scrollbars,resizable")};
		}
		
		for (var i=0;i<pn.length;i++)
		{
			if (pn[i].firstChild.nodeName!="A")
			{
				if (!isIE) DM_setOp(pn[i],50); else pn[i].innerHTML="&nbsp;";
				continue;
			}
			pn[i].url=pn[i].firstChild.href;
			pn[i].innerHTML=pn[i].firstChild.innerHTML;
			pn[i].onclick=function(){DM_redir(this.url)};
		}
		
		for (var i=0;i<rows.length;i++)
		{
			if (!/\bDAYS\b/i.test(rows[i].className)) continue;
			else var days=rows[i].getElementsByTagName("td");
			
			for (var j=0;j<days.length;j++)
			{
				if (/\S/i.test(days[j].className))
				{
					if (days[j].firstChild.nodeName=="A")
					{
						days[j].url=days[j].firstChild.href;
						days[j].onclick=function(){DM_redir(this.url)};
						days[j].innerHTML=days[j].firstChild.innerHTML;
						days[j].onmouseover=function(){this.className+=" linked_omo"};
						days[j].onmouseout=function(){this.className=this.className.replace(/\s*\bLINKED_OMO\b/i,"")};
					}
					continue
				}
				days[j].onmouseover=function(){this.className+=" omo"};
				days[j].onmouseout=function(){this.className=this.className.replace(/\s*\bOMO\b/i,"")};
			}
		}
		
		viewall.url=viewall.title;
		viewall.onclick=function(){DM_redir(this.url)};
		viewall.title="";
		
		srchbox.btn=srchbox.getElementsByTagName("img")[0];
		srchbox.inp=srchbox.getElementsByTagName("input")[1];
		srchbox.inp.onfocus=function()
		{
			this.value=DM_alltrim(this.value);
			if (/\bKEYWORD\b\s+\bSEARCH\b/i.test(this.value)) this.value="";
		};
		srchbox.btn.inp=srchbox.inp;
		srchbox.btn.form=srchbox.parentNode;
		srchbox.btn.onclick=function()
		{
			this.inp.onfocus();
			var selectedIndex=this.form.mn.options[this.form.mn.selectedIndex];
			
			if (selectedIndex.value>2000)
			{
				this.form.yr.value=selectedIndex.value;
				selectedIndex.value=this.form.showall.value=1
			}
			this.form.submit()
		};
		
		for (var i=0;i<r.length;i++)
		{
			r[i].number	= r[i].title;
			r[i].thumb	= DM_getElementsByClassName("thumb","img",r[i])[0];
			r[i].holder	= DM_getElementsByClassName("holder","td",r[i])[0];
			var btns	= DM_getElementsByClassName("toolbar","table",r[i])[0].getElementsByTagName("img");
			var host	= DM_getElementsByClassName("host","td",r[i])[0].firstChild;
			host.url	= /\S/.test(host.title)?host.title:null;
			host.title	= "";
			
			if (host.url) host.onclick=function(){DM_newWin(this.url,"xweb",[],[],"FULL")};
			else
			{
				DM_setStyle(host.getElementsByTagName("b")[0],"text-decoration:none;cursor:default");
				host.style.cursor="default"
			}
			
			for (var j=0;j<btns.length;j++)
			{
				/([^\/_]+)(?:_\w+)?\.\w+$/.test(btns[j].src);
				
				btns[j].onmouseover	= btns[j].onmouseout=function(){DM_swapImg(this)};
				btns[j].mode		= RegExp.$1.toUpperCase();
				btns[j].url			= qrystr+"&record="+r[i].number+"&"+btns[j].mode;
				btns[j].record		= r[i].number;
				
				switch (btns[j].mode)
				{
					case "DETAILS":
					btns[j].onclick=function()
					{
						cfg.BUF.ACTIVERECORD=this.record;
						cfg.DYNWIN.Open("?pg=dynwin&subj=info&NOHOST&event="+this.record)
					};
					break;
					
					case "PRINT":
					btns[j].url="?pg=dynwin&subj=info&event="+r[i].number+"&win=y&PRINT";
					btns[j].onclick=function(){DM_newWin(this.url,"pdf",[720,screen.availHeight],[],"scrollbars,resizable,status")};
					break;
				}
			}
			
			if (/_thumb\.\w+$/i.test(r[i].thumb.src))
			{
				r[i].thumb.lyr		= DM_getObjCopy("DYNWIN_IMGZOOM");
				r[i].thumb.evtitle	= r[i].thumb.alt;
				r[i].thumb.realsrc	= r[i].thumb.src.replace(/_thumb\.(\w+)$/i,".$1");
				
				r[i].thumb.onclick=function()
				{
					var preview=this.lyr.getElementsByTagName("img")[0];
					this.lyr.getElementsByTagName("h1")[0].innerHTML=this.evtitle;
					DM_newDynWin(this.lyr,[380,240],[],[],'tween,xclick,float,shadow=33');
					preview.src="images/px.gif";
					preview.src=this.realsrc
				};
			}
			else DM_setOp(r[i].thumb,0);
			
			r[i].title=r[i].thumb.alt=""
		}
		break;
		
		
		/*
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		THINGS TO DO
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		*/
		case "THINGSTODO":
		cfg['BUF']={
			TITLES			: new Array(),
			ACTIVERECORD	: null
		};
		
		var container	= DM_getObjCopy("PG_THINGSTODO");
		var sidebar		= DM_getElementsByClassName("sidebar","td",container)[0];
		var advsearch	= DM_getObjCopy("ADVSEARCH").getElementsByTagName("form")[0];
		var submitter	= advsearch.getElementsByTagName("img")[0];
		var res			= DM_getObjCopy("RESULTS");
		var toolbars	= DM_getElementsByClassName("toolbar","td",res);
		var printall	= null;
		var found		= DM_getElementsByClassName("found","td")[0];
		
		if (found && (printall=found.getElementsByTagName("img")[0]))
		{
			printall.url="?win=y&"+DM_getLocation().split("?")[1]+"&PRINTABLE";
			printall.onclick=function(){DM_newWin(this.url,"pdf",[720,screen.availHeight],[],"scrollbars,resizable,status")}
			printall.onmouseover=printall.onmouseout=function(){DM_swapImg(this)};
		}
		
		for (var i=0,rows=container.getElementsByTagName("tr");i<rows.length;i++)
		{
			if (/\bRECORD\b/i.test(rows[i].className))
			{
				rows=DM_getElementsByClassName("record","tr",res);
				break;
			}
			else if (!rows[i].title) continue;
			else rows[i].url="?pg=thingstodo&cat="+rows[i].title;
			rows[i].onclick=new Function("DM_redir(this.url)");
			
			if (!/\S/.test(rows[i].className))
			{
				rows[i].onmouseover=new Function("this.className='omo'");
				rows[i].onmouseout=new Function("this.className=''")
			}
			rows[i].title=""
		}
		
		for (var i=0,j=-1;i<rows.length;i++)
		{
			if (!rows[i].title) continue;
			else
			{
				j++;
				var title	= DM_getElementsByClassName("title","td",rows[i])[0];
				var image	= rows[i].getElementsByTagName("img")[1];
				var h1		= title.getElementsByTagName("h1")[0];
				var icons	= DM_getElementsByClassName("icons","table",toolbars[j])[1].getElementsByTagName("img");
				h1.address	= title.getElementsByTagName("span")[0].innerHTML;
			}
			
			h1.lyr=DM_getObjCopy("DYNWIN_EVENTS");
			h1.record=rows[i].title;
			
			if (h1.title)
			{
				h1.url=h1.title;
				h1.onclick=function(){DM_newWin(cfg['WEB_URL']['decode'](this.url),"xweb",[],[],"FULL")};
				h1.title=""
			}
			else
			{
				DM_swapMousePntr(h1,"default");
				h1.style.textDecoration="none";
			}
			
			h1.openmyevents=function()
			{
				var titlebar		= DM_getElementsByClassName("title","td",this.lyr)[0];
				var title			= titlebar.firstChild;
				var subhead			= titlebar.getElementsByTagName("span")[0];
				var url				= "?pg=events&host="+this.record;
				var printer			= this.lyr.getElementsByTagName("img")[0];
				title.innerHTML		= this.innerHTML;
				subhead.innerHTML	= this.address;
				
				if (isIE6)
				{
					var wait=DM_getObjCopy("DYNWIN_EVENTS_WAIT");
					var winsiz=DM_getWinInnerSize();
					var siz=new Array();
					var pos=new Array();
					
					DM_setVis(wait,true);
					wait.style.zIndex=999;
					DM_setOp(wait,0);
					siz=DM_getSize(wait);
					pos[0]=Math.floor((winsiz[0]-siz[0])/2);
					pos[1]=DM_getScrollPos()[1]+200;
					DM_setPos(wait,pos[0],pos[1]);
					DM_setOp(wait,100);
					
					DM_setOp(this.lyr,0);
					setTimeout("DM_setVis('"+wait.id+"',false);DM_setOp('"+this.lyr.id+"',100);",2500)
				}
				
				cfg['BUF']['ACTIVERECORD']=this.record;
				DM_newDynWin(this.lyr,[640,480],(isIE6?[null,100]:[]),[],"float,url="+url);
			};
			cfg['BUF']['TITLES'].push(h1);
			
			for (var k=0;k<icons.length;k++)
			{
				if (!/_omo\.\w+$/i.test(icons[k].src))
				{
					DM_setOp(icons[k],50);
					continue
				}
				else
				{
					icons[k].className="omo";
					/(\w+?)_omo\.\w+/i.test(icons[k].src)
				}
				
				switch (RegExp.$1.toUpperCase())
				{
					case "MOREINFO":
					icons[k].url="?pg=dynwin&subj=info&host="+cfg.BUF.TITLES[j].record;
					icons[k].onclick=function(){cfg.DYNWIN.Open(this.url)};
					break;
					
					case "WWW":
					icons[k].title="Website";
					icons[k].url=icons[k].alt;
					icons[k].onclick=function(){DM_newWin(cfg['WEB_URL']['decode'](this.url),"xweb",[],[],"FULL")};
					break;
					
					case "EMAIL":
					icons[k].title="Send Email";
					icons[k].email=icons[k].alt;
					icons[k].onclick=function(){DM_redir("mailto:"+this.email)};
					break;
					
					case "PRINT":
					icons[k].title="Printable Version";
					icons[k].url="?win=y&pg=dynwin&subj=info&host="+rows[i].title+"&PRINT";
					icons[k].onclick=function(){DM_newWin(this.url,"pdf",[720,screen.availHeight],[],"scrollbars,resizable,status")};
					break;
					
					case "EVENTS":					
					icons[k].title="View Events";
					icons[k].url="?pg=dynwin&subj=info&host="+cfg.BUF.TITLES[j].record+"&SHOWEVENTS&NOHOST";
					icons[k].onclick=function(){cfg.DYNWIN.Open(this.url)};
					break;
				}
			}
			
			if (!/\bHIDDEN\b/i.test(image.className))
			{
				image.lyr=DM_getObjCopy("DYNWIN_IMGZOOM");
				image.company=title.getElementsByTagName("h1")[0].innerHTML;
				image.container=image.lyr.getElementsByTagName("img")[0];
				
				image.onclick=function()
				{
					this.lyr.getElementsByTagName("h1")[0].innerHTML=this.company;
					this.container.src="images/px.gif";
					DM_newDynWin(this.lyr,[380,240],[],[],'tween,xclick,float,shadow=33');
					this.container.src=this.src.replace("_thumb","")
				};
			}
			
			title.onmouseover=function(){this.className+=" title_omo"};
			title.onmouseout=function(){this.className="title"};
			rows[i].title=""
		}
		
		submitter.form=advsearch;
		advsearch.keyword.onfocus=function(){if (/keyword\s+search/i.test(this.value)) this.value=""};
		submitter.onclick=function()
		{
			if (/keyword\s+search/i.test(this.form.keyword.value)) this.form.keyword.value="";
			else this.form.keyword.value=DM_striptags(DM_alltrim(this.form.keyword.value));
			this.form.submit()
		};
		break;
		
		
		/*
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		TRANSPORTATION
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		*/
		case "TRANSPORTATION": break;
		
		
		/*
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		LINKS
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		*/
		case "LINKS": break;
		
		
		/*
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		FCK DOCUMENT LOADER
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		*/
		case "LOAD":
		cfg.FCK={};
		
		var FCK=
		{
			WRAPPER		: DM_getObjCopy("FCK"),
			DEFURL		: "?pg=load",
			LINKS		: new Array,
			TAB			: null,
			TABS		: new Array,
			TABNAME		: null,
			MENU		: DM_getObjCopy("MENU_2"),
			DIVS		: [],
			
			Select		: function(tab){with(this){if (TAB) Unselect();tab.firstChild.className="omo";TAB=tab}},
			Unselect	: function(){with(this){TAB.firstChild.className="";TAB=null}},
			QryStrVar	: function(name,url){return eval("/[\\?&]"+name+"(?:=([^#&]+))?/").test(url?url:DM_getLocation())?RegExp.$1:""}
		};
		
		with (FCK)
		{
			LINKS			 = WRAPPER.getElementsByTagName("a");
			DEFURL			+= "&loc="+WRAPPER.title.toLowerCase();
			TABS			 = DM_getElementsByClassName("tabs","table",WRAPPER)[0].getElementsByTagName("tr");
			WRAPPER.title	 = "";
			TABNAME			 = QryStrVar("tab");
			MENU.t			 = [];
			DIVS			 = DM_getElementsByClassName('page','td',WRAPPER)[0].getElementsByTagName('div');
			
			
			/*
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			FIX DIVS
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			*/
			for (var i=0;i<DIVS.length;i++) { if (DIVS[i].align)
			{
				DIVS[i].className+=' '+DIVS[i].align
			}
			}
			
			
			/*
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			TOURISM TALK - "BX360" PATCH
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			*/
			for (var i=0;i<TABS.length;i++)
			{
				if (/bx360/i.test(TABS[i].firstChild.innerHTML))
				{
					TABS[i].firstChild.innerHTML="Bx360&deg;";
					
					if (/omo/i.test(TABS[i].firstChild.className))
					{
						WRAPPER.getElementsByTagName("h1")[0].innerHTML=TABS[i].firstChild.innerHTML+": A Guide to Bronx Arts &amp; Entertainment"
					}
					break
				}
			}
			
			for (var i=n=0,buf=MENU.getElementsByTagName("td");i<buf.length;i++)
			{
				if (/\S/.test(buf[i].innerHTML))
				{
					MENU.t[n]=buf[i];
					MENU.t[n].Mark=function()
					{
						this.className="active";
						this.onclick=this.onmouseover=this.onmouseout=null;
						this.style.cursor="default"
					};
					n++
				}
			}
			
			for (var i=0;i<LINKS.length;i++) { with (LINKS[i])
			{
				if (target && /\S/.test(target)) continue;
				else if (/^https?:\/\/([^\/]+)/i.test(href))
				{
					LINKS[i].domain=RegExp.$1.toLowerCase();
					
					if (domain=="localhost") continue;
					else if (!/ilovethebronx\.com/.test(domain)) target="_blank";
				}
			}
			}
		}
		
		for (var i=0;i<FCK.TABS.length;i++) { with (FCK.TABS[i])
		{
			if (firstChild.className.length) FCK.TAB=FCK.TABS[i];
			
			FCK.TABS[i].url		= FCK.DEFURL+"&tab="+title.toLowerCase();
			FCK.TABS[i].onclick	= function(){with(this){FCK.Select(this);DM_redir(url)}};
			title				= ""
		}
		}
		
		switch (FCK.QryStrVar("loc").toUpperCase())
		{
			case "BRONXTROLLEY"		: FCK.MENU.t[3].Mark(); break;
			case "BRONXWEEK"		: FCK.MENU.t[4].Mark(); break;
			case "TOURDEBRONX"		: FCK.MENU.t[5].Mark(); break;
			case "TRADESERVICES"	: FCK.MENU.t[7].Mark(); break;
			case "TOURISMTALK"		: FCK.MENU.t[8].Mark(); break;
		}
		
		switch (FCK.TABNAME.toUpperCase())
		{
			/*
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			RENTALS
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			*/
			case "RENTALS":
			cfg.FCK.REN=
			{
				WRAPPER : DM_getObjCopy("RENTALS")
			};
			
			if (cfg.FCK.REN.WRAPPER) { with (cfg.FCK)
			{
				REN.R		= DM_getElementsByClassName("rec","table",REN.WRAPPER);
				REN.IMGPREV	= DM_getObjCopy("DYNWIN_IMGZOOM");
				REN.PALL	= DM_getElementsByClassName("infobar")[0].getElementsByTagName("img")[0];
			}
			}
			else break;
			
			with (cfg.FCK.REN)
			{
				if (PALL)
				{
					PALL.url="?rentals&win=y&pg=thingstodo&cat=13&PRINTABLE&title=Event Planners/Rentals";
					PALL.onclick=function(){DM_newWin(this.url,"pdf",[720,screen.availHeight],[],"scrollbars,resizable,status")};
					PALL.onmouseover=PALL.onmouseout=function(){DM_swapImg(this)};
				}
				
				IMGPREV.head	= IMGPREV.getElementsByTagName("h1")[0];
				IMGPREV.img		= IMGPREV.getElementsByTagName("img")[0];
				IMGPREV.img.def	= "images/px.gif";
				
				IMGPREV.Open=function(thumb) { with (this)
				{
					img.src=img.def;
					head.innerHTML=thumb.parent.cname.innerHTML;
					img.src=thumb.realname;
					DM_newDynWin(this,[380,240],[],[],'tween,xclick,float,shadow=33')
				}
				};
				
			for (var i=0;i<R.length;i++)
			{
				R[i].idnumb	= R[i].title;
				R[i].t		= DM_getElementsByClassName("btns","table",R[i])[0].getElementsByTagName("img");
				R[i].cname	= R[i].getElementsByTagName("h1")[0];
				R[i].thb	= DM_getElementsByClassName("thb","td",R[i])[0].firstChild;
				R[i].title	= "";
				
				with (R[i])
				{
					if (!/hidden/.test(thb.className))
					{
						thb.parent=R[i];
						thb.realname=thb.src.replace("_thumb","");
						thb.onclick=function(){cfg.FCK.REN.IMGPREV.Open(this)};
					}
					
					for (var j=0;j<R[i].t.length;j++)
					{
						t[j].data		= t[j].alt;
						t[j].enabled	= /_omo\.\w+$/.test(t[j].src)
						t[j].alt		= "";
						
						if (t[j].enabled)
						{
							t[j].parent=R[i];
							
							switch (j)
							{
								case 0: t[j].onclick=function(){cfg.DYNWIN.Open("?rentals&pg=dynwin&subj=info&host="+this.parent.idnumb)}; break;
								
								case 1:
								cname.data=t[j].data;
								t[j].onclick=function(){DM_newWin(cfg.WEB_URL.decode(this.data),"xweb",[],[],"FULL")};
								cname.onclick=t[j].onclick;
								break;
								
								case 2: t[j].onclick=function(){DM_redir("mailto:"+this.data)}; break;
								case 3: t[j].onclick=function(){DM_newWin("?rentals&win=y&pg=dynwin&subj=info&host="+this.parent.idnumb+"&PRINT","pdf",[720,screen.availHeight],[],"scrollbars,resizable,status")}; break;
								case 4: t[j].onclick=function(){cfg.DYNWIN.Open("?rentals&pg=dynwin&subj=info&host="+this.parent.idnumb+"&SHOWEVENTS&NOHOST")}; break;
							}
						}
					}
				}
			}
			}
			break;
			
			
			/*
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			CALENDAR OF EVENTS
			IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
			*/
			case "CALENDAR":
			switch (FCK.QryStrVar("loc").toUpperCase())
			{
				case "BRONXWEEK":
				var BWK		= {};
				BWK.WRAPPER	= DM_getObjCopy("BWK");
				BWK.E		= BWK.WRAPPER.getElementsByTagName("li");
				BWK.P		= DM_getElementsByClassName("printer","img",BWK.WRAPPER);
				BWK.PALL	= DM_getObjCopy("PRINTALL");
				
				with (BWK)
				{
					if (PALL)
					{
						PALL.url="?win=y&pg=bronxweek";
						PALL.onmouseover=PALL.onmouseout=function(){DM_swapImg(this)};
						PALL.onclick=function(){DM_newWin(this.url,"pdf",[800,screen.availHeight],[],"resizable,scrollbars,status")};
					}
					
					for (var i=0;i<E.length;i++)
					{
						E[i].idnumber	= E[i].title;
						E[i].onclick	= function(){cfg.DYNWIN.Open("?pg=dynwin&subj=bronxweekevents&rec="+this.idnumber)};
						E[i].title		= ""
					}
					
					for (var i=0;i<P.length;i++)
					{
						P[i].url			= "?win=y&pg=bronxweek&date="+P[i].alt;
						P[i].onclick		= function(){DM_newWin(this.url,"pdf",[800,screen.availHeight],[],"resizable,scrollbars,status")};
						P[i].onmouseover	= P[i].onmouseout=function(){DM_swapImg(this)};
						P[i].alt			= ""
					}
				}
				break;
			}
			break;
			
			case "GALLERY":
			cfg.GAL=
			{
				WRAPPER	: DM_getObjCopy("GAL"),
				BUBBLE	: DM_getObjCopy("GAL_BUBBLE"),
				LAYER	: DM_getObjCopy("GAL_PREVIEW")
			};
			
			with (cfg.GAL)
			{
				cfg.GAL.SELECTOR=WRAPPER.getElementsByTagName("select")[0];
				
				if (!SELECTOR) break;
				else
				{
					BUBBLE.onmouseover=function(){DM_setVis(this,true)};
					BUBBLE.onmouseout=function(){DM_setVis(this,false)};
					
					cfg.GAL.PHOTOS		= DM_getElementsByClassName("photos","td",WRAPPER)[0].getElementsByTagName("img");
					cfg.GAL.TEXTAREAS	= WRAPPER.getElementsByTagName("div");
					
					with (LAYER)
					{
						LAYER.image	= getElementsByTagName("img")[0];
						LAYER.text	= getElementsByTagName("tr")[1].firstChild;
						LAYER.def	= image.src;
						
						LAYER.Resize	= function(w,h){DM_setSize(this,w,parseInt(h)+45)};
						LAYER.Reset		= function(){this.image.src=this.def};
						LAYER.Insert	= function(filename){this.image.src="images/usersubmitted/gal/"+filename};
					}
					
					LAYER.Show=function(filename,w,h,title,descr)
					{
						if (/DEBUG/.test(d.location.href))
						{
							alert([w,h])
						}
						
						this.Reset();
						this.Resize(w,h);
						this.text.firstChild.innerHTML=title;
						this.text.getElementsByTagName("span")[0].innerHTML=descr;
						cfg.GAL.BUBBLE.onmouseout();
						
						setTimeout("cfg.GAL.LAYER.Insert('"+filename+"')",1500);
						DM_newDynWin(this,[w,h],(isIE6?[-1,100]:[]),[],'tween,xclick,float,shadow=75')
					};
				}
				
				for (var i=0;i<PHOTOS.length;i++)
				{
					PHOTOS[i].lyr		= LAYER;
					PHOTOS[i].filename	= PHOTOS[i].alt;
					PHOTOS[i].t_title	= cfg.GAL.TEXTAREAS[i].title;
					PHOTOS[i].t_descr	= cfg.GAL.TEXTAREAS[i].innerHTML;
					PHOTOS[i].size		= PHOTOS[i].title.split("x");
					PHOTOS[i].content	= PHOTOS[i].bubble=null;
					PHOTOS[i].alt		= PHOTOS[i].title="";
					PHOTOS[i].onclick	= function(){with(this){lyr.Show(filename,size[0],size[1],t_title,t_descr)}};
					
					with (PHOTOS[i])
					{
						if (t_title) {content='<b>'+t_title+'</b>';if (t_descr) content+='<br />'+t_descr}
						else if (t_descr) content=t_descr;
						
						if (content)
						{
							bubble=BUBBLE;
							PHOTOS[i].onmouseout=function(){DM_setVis(this.bubble,false)};
							
							PHOTOS[i].onmouseover=function() { with (this)
							{
								var pos=DM_getPos(this);
								bubble.content.innerHTML=content;
								
								DM_setVis(bubble,true,true);
								DM_setPos(bubble,pos[0]+50,(pos[1]-DM_getSize(bubble)[1])+15)
							}
							};
						}
					}
				}
				
				cfg.MakeBubble(BUBBLE,300);
				BUBBLE.content=DM_getElementsByClassName("BUBBLE_CONTENT","td",BUBBLE)[0]
			}
			break;
			
			case "CELEBS":
			with (FCK)
			{
				FCK.SELECTOR		= WRAPPER.getElementsByTagName("select")[0];
				FCK.SELECTOR.url	= DEFURL+"&tab="+TABNAME;
				FCK.BUFS			= DM_getObjCopy("FCK_walkofamecelebs_BUFFERS").getElementsByTagName("div");
				FCK.BUBBLE			= DM_getObjCopy("FCK_walkofamecelebs_BUBBLE");
				FCK.CEL				= DM_getElementsByClassName("block");
				FCK.PHOTOS			= DM_getElementsByClassName("thb","img",WRAPPER);
				
				SELECTOR.onchange=function(){with(this){DM_redir(url+"&year="+options[selectedIndex].value)}};
				
				for (var i=0;i<CEL.length;i++)
				{
					CEL[i].n		= i;
					CEL[i].record	= CEL[i].title;
					CEL[i].wiki		= CEL[i].getElementsByTagName("img")[0];
					CEL[i].exlink	= CEL[i].getElementsByTagName("img")[1];
					CEL[i].pic		= CEL[i].getElementsByTagName("img")[2];
					CEL[i].read		= CEL[i].getElementsByTagName("a")[0];
					CEL[i].title	= "";
					
					if (/\S/.test(CEL[i].wiki.alt))
					{
						CEL[i].wiki.url=CEL[i].wiki.alt;
						CEL[i].wiki.onclick=function(){if(/\S/.test(this.url))DM_newWin(this.url,"xweb",[],[],"resizable,status,scrollbars")};
						CEL[i].wiki.alt=""
					}
					else DM_setOp(CEL[i].wiki,50);
					
					if (/\S/.test(CEL[i].exlink.alt))
					{
						CEL[i].exlink.url=CEL[i].exlink.alt;
						CEL[i].exlink.onclick=function(){if(/\S/.test(this.url))DM_newWin(this.url,"xweb",[],[],"resizable,status,scrollbars")};
						CEL[i].exlink.alt=""
					}
					else DM_setOp(CEL[i].exlink,50);
					
					CEL[i].pic.file			= CEL[i].pic.title;
					CEL[i].pic.lyr			= DM_getObjCopy("FCK_walkofamecelebs_PREVIEW");
					CEL[i].pic.lyr.def		= CEL[i].pic.lyr.firstChild.src;
					CEL[i].pic.title		= "";
					CEL[i].pic.onmouseout	= function(){DM_setVis(this.lyr,false);this.lyr.firstChild.src=this.def};
					
					CEL[i].pic.onclick=function()
					{
						this.pos=DM_getPos(this);
						this.lyr.firstChild.src="images/usersubmitted/wof/"+this.file;
						DM_setPos(this.lyr,this.pos[0]+52,this.pos[1]);
						DM_setVis(this.lyr,true)
					};
					
					if (CEL[i].read)
					{
						CEL[i].read.n			= CEL[i].n;
						CEL[i].read.bubble		= BUBBLE;
						CEL[i].read.onmouseout	= function(){DM_setVis(this.bubble,false)};
						CEL[i].read.onclick		= function(){this.blur()};
						
						CEL[i].read.onmouseover=function()
						{
							this.pos=DM_getPos(this);
							this.bubble.content.innerHTML=FCK.BUFS[this.n].innerHTML;
							
							DM_setVis(this.bubble,true);
							DM_setPos(this.bubble,this.pos[0],this.pos[1]-DM_getSize(this.bubble)[1])
						};
					}
				}
				cfg.MakeBubble(BUBBLE,300);
				BUBBLE.content=DM_getElementsByClassName("BUBBLE_CONTENT","td",BUBBLE)[0]
			}
			break;
		}
		break;
		
		
		/*
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		SITE MAP
		IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
		*/
		case "SITEMAP": break;
	}
	
	
	/*
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	EXTERNAL LINK MANAGER
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	*/
	if (DM_getObjCopy("PG_LINKS"))
	{
		var cells = DM_getElementsByClassName("block","td",DM_getObjCopy("PG_LINKS"));
		var icons = {a : "images/SYSTEM/bullets/01.gif", b : "images/SYSTEM/bullets/02.gif"};
		
		for (var i=0;i<cells.length;i++)
		{
			cells[i].url			= cells[i].title;
			cells[i].icon			= cells[i].parentNode.getElementsByTagName("img")[(i%2>0)?1:0];
			cells[i].icons			= icons;
			cells[i].onmouseover	= function(){this.icon.src=this.icons.b};
			cells[i].onmouseout		= function(){this.icon.src=this.icons.a};
			cells[i].title			= "";
			cells[i].xweb			= /xweb/.test(cells[i].className);
			cells[i].onclick		= function(){this.xweb?DM_newWin(this.url,"xweb",[],[],"FULL"):DM_redir(this.url)};
		}
		
		if (/tab=sightseeing/i.test(d.location.href))
		{
			for (var i=0;i<cells.length;i++)
			{
				cells[i].getElementsByTagName("h1")[0].onclick=function(){with(this.parentNode)xweb?DM_newWin(url,"xweb",[],[],"FULL"):DM_redir(url)};
				cells[i].onclick=null
			}
		}
	}
	
	
	/*
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	LOW-LEVEL OPERATIONS
	IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
	*/
	var content=DM_getElementsByClassName("content_inner","td")[0];
	var dynwin=DM_getObjCopy("DYNWIN_ANY");
	
	if (!/\S/.test(content.innerHTML)) DM_setSize(content,-1,400);
	XDM_loadExternalLogos();
	return
};


/*
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
SECTION 03: CUSTOM SUBROUTINES
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
*/
function XDM_submit(n)
{
	var o,inp,die;
	if (!DM_isNumb(n,"POSINT") || !(o=d.forms[n])) return;
	
	for (var i=0,j=o.getElementsByTagName("input"),inp=[];i<j.length;i++)
	{
		if (/^\s*(text)\s*$|^\s*(password)\s*$/i.test(j[i].type))
		{
			inp.push(j[i]);
			inp[inp.length-1].type=RegExp.$1||RegExp.$2
		}
	}
	
	switch (cfg['PG_PHPFILE'].toUpperCase())
	{
		default: die=true; break;
		
		case "HOME":
		for (var i=0;i<inp.length;i++) if (!/^\w+$/.test(inp[i].value)) {die=true;break}
		if (die)
		{
			DM_clrFormFields(o);
			alert("Invalid username/password combination. Please try again.")
		}
		break;
	}
	
	if (!die)
	{
		o.action="index.php";
		o.submit()
	}
	return
};

function XDM_initSplashBanner(n)
{
	var o;
	if (o=DM_getElementsByClassName("splash_overlay","div")[0])
	{
		var btn		= o.getElementsByTagName("img")[0];
		var bubble	= DM_getElementsByClassName("SPLASH_BUBBLE","div")[0];
		var pos		= DM_getPos(o);
		var offset	= [140,-80];
		var data	= o.title.split(",");
		var imgfile	= data[0];
		var url		= data[1];
	}
	else return;
	
	o.title							 = "";
	o.style.background				 = "url(images/bg/13.gif) center no-repeat";
	o.parentNode.style.background	 = "url("+imgfile+") center no-repeat";
	btn.src							 = "images/calendar/whatshot.gif";
	btn.style.padding				 = "2px";
	bubble.id	 					 = "SPLASH_BUBBLE";
	pos[0]							+= offset[0];
	pos[1]							+= offset[1];
	
	o.onmouseover=new Function(
		  'var o=DM_getElementsByClassName("splash_overlay","div")[0];'
		+ 'var pos=DM_getPos(o);'
		+ 'pos[0]+='+offset[0]+';'
		+ 'pos[1]+='+offset[1]+';'
		+ 'DM_setPos("'+bubble.id+'",pos[0],pos[1]);'
		+ 'DM_setVis("'+bubble.id+'",true)'
		);
	
	o.onmouseout			= new Function("DM_setVis('"+bubble.id+"',false)");
	btn.parentNode.onclick	= new Function("cfg.DYNWIN.Open('"+url+"')"); // new Function("document.location.href = '"+url+"'");
	bubble.onmouseover		= function(){DM_setVis(this,true)};
	bubble.onmouseout		= function(){DM_setVis(this,false)};
	
	DM_genBubbleTip(bubble,[300],"FFFFFF");
	DM_swapMousePntr(o);
	DM_swapMousePntr(bubble);
	DM_setOp(bubble,90)
};

function XDM_loadExternalLogos(init)
{
	var o=DM_getElementsByClassName("logos","table")[0];
	if (init)
	{
		for (var i=0,j=1,imgs=o.getElementsByTagName("img");i<imgs.length;i++,j++)
		  imgs[i].src=imgs[i].src.replace(/\/px\.(gif)/,"/logos/"+j+".$1");
		return
	}
	for (var i=0,j=1,imgs=o.getElementsByTagName("img");i<imgs.length;i++,j++)
	{
		imgs[i].onclick=new Function('DM_newWin("'+imgs[i].parentNode.href+'","xweb",[],[],"FULL")');
		imgs[i].parentNode.href="javascript:void(0)";
	}
	if (!/\bcached\b/i.test(o.className)) setTimeout("XDM_loadExternalLogos(true)",3000);
	return
};

if (/\?DEMO/.test(d.location.href))
{
	/*
	<div class="hidden NEWS" style="display:none;">
		<span title="javascript:void(0)">Welcome to The Bronx Tourism Council's New iLoveTheBronx.com Website!</span>
		<span title="javascript:DM_newWin('http://ilovethebronx.com/index.php?pg=load&loc=bronxweek',null,[],[],'FULL')">Celebrate Bronx Week 2008 ~ June 12th - 22nd</span>
		<span title="http://ilovethebronx.com/index.php?pg=load&loc=bronxweek&tab=calendar">Don't miss the borough's biggest social event of the year! ~ The Bronx Ball ~ Saturday, June 21st ~ Orchard Beach. Call 718.590.3949 for ticket info.</span>
		<span title="javascript:void(0)">New York Celebrates America ~ Friday, June 27 ~ Orchard Beach</span>
	</div>
	*/
	
	function XDM_genNewsTicker(n,mode,x)
	{
		if (!cfg.NEWS_SUBJ.length) return;
		else
		{
			n=(n==null || !cfg.NEWS_SUBJ[n])?0:parseInt(n);
			mode=mode==null?"":mode.toUpperCase()
		}
		
		alert(mode)
	};
}
else
{
	function XDM_genNewsTicker(n,mode,x)
	{
		if (!cfg['NEWS_SUBJ'].length) return; else if (n==null || !cfg['NEWS_SUBJ'][n]) n=0;
		
		switch (mode?mode.toUpperCase():"")
		{
			default:
			cfg.LONG_WAIT=false;
			cfg.NEWS_DELAY=8000;
			cfg['NEWS'].innerHTML="";
			cfg.NEWS_BUF=cfg.NEWS_SUBJ[n].innerHTML.split("");
			
			try
			{
				cfg.NEWS.onclick=new Function(cfg.NEWS_SUBJ[n].title);
			}
			catch(e)
			{
				cfg.NEWS.onclick=new Function("DM_redir('"+cfg.NEWS_SUBJ[n].title+"')");
			}
			
			XDM_genNewsTicker(n++,"UPD");
			setTimeout("XDM_genNewsTicker("+n+")",cfg.LONG_WAIT?(cfg.NEWS_DELAY*2):cfg.NEWS_DELAY+2);
			
			if (!cfg['NEWS_TWEEN'])
			{
				DM_tweenOp(cfg['NEWS'],0,100,2000,250);
				setTimeout("DM_tweenOp(cfg['NEWS'],-1,0)",cfg['NEWS_DELAY']-750)
			}
			break;
			
			case "UPD":
			if (x==null) x=0;
			if (x<cfg['NEWS_BUF'].length)
			{
				cfg['NEWS'].innerHTML+=cfg['NEWS_BUF'][x++];
				
				if (cfg.NEWS.innerHTML.length>120)
				{
					cfg.LONG_WAIT=true;
					cfg.NEWS.innerHTML=cfg.NEWS.innerHTML.substring(1)
				}
				
				setTimeout('XDM_genNewsTicker('+n+',"UPD",'+x+')',25);
			}
			break;
		}
		return
	};
}

function PrepareScheduleMenu() { with (d.forms[1])
{
	var selected = mn.options[mn.selectedIndex];
	var new_year = selected.innerHTML.replace(/\D/g,'');
	    yr.value = /\d{4}/.test(new_year) ? new_year : yr.className;
}
};

