//*******************************************************************************
// WebApp.js - Softwise WebApp  Class (object _webApp) and Simple Menu class.
//
// Author: Avi A. Elenko                 Company: Softwise Inc. Software Works ™
//*******************************************************************************
// Use of this software is subject to certain restrictions and limitations set
// forth in a license agreement entered into between Softwise Inc. Software 
// Works ™ and the licensee of this software.   Please refer to the license 
// agreement for license use rights and restrictions. 
//
// Softwise Inc. Software Works is a registered trademark, Softwise logo is also
// trademark of Softwise Inc. Software Works ™ in the United States and other
// countries. 
//
// Copyright © 1995-2006 Softwise Inc. Software Works ™      All Rights Reserved.
//
// 6 Whittier Place, Suite # 11N, Boston, MA 02114    http://www.SoftwiseUsa.com
//*******************************************************************************

//
// WebApp Class
//
function WebApp( )
{
    // User Browser and Screen Attributes
    this.UserAgent     = navigator.userAgent;
    this.IsIE          = this.UserAgent.indexOf('MSIE') != -1;
    this.IsNetscape    = this.UserAgent.indexOf('Netscape/') != -1;
    this.IsFirefox     = this.UserAgent.indexOf('Firefox/') != -1;
    this.UserAgentName = navigator.appName;
    this.TiltleNewLine = (this.IsIE ? '\n' : ' ');
    this.AvailScreenWidth  = window.screen.availWidth;
    this.AvailScreenHeight = window.screen.availHeight;
    
    // Open new Browser Utility Methods
    this.OpenSoftwisePageV2= function( u ) { window.open( "http://www.SoftwiseUSA.COM/" + u ); }
    this.OpenSoftwisePage  = function( u ) { window.open( "http://www.SoftwiseUSA.COM/" + u ); }
    
    // Window.Event Helpers
    this.GetEventSource    = function( e ) { if ( !e || e == undefined ) e=window.event; return e.srcElement ? e.srcElement : e.target; }
    this.AbortEventBubbling= function( e ) { if ( this.IsIE ) window.event.cancelBubble = true; else if (e) e.stopPropagation(); }

    //       
    // HTML DOM and Layout Utility Methods
    //
	this.BodyHeight = function()
	{
        if ( window.innerHeight ) return window.innerHeight; // Mozilla, Opera, and Safari
        if ( window.document.documentElement.clientHeight )	return document.documentElement.clientHeight; // IE standard mode
        return window.document.body.clientHeight; // Other IEs
	}
	this.BodyWidth = function() 
	{
        if ( window.innerWidth ) return window.innerWidth; // Mozilla, Opera, and Safari
        if ( window.document.documentElement.clientWidth )	return document.documentElement.clientWidth; // IE standard mode
        return window.document.body.clientWidth; // Other IEs
	}      
	this.BodyScrollLeft = function() { return document.body.scrollLeft; }
	this.BodyScrollTop = function() { return document.body.scrollTop; }
        
    // DOM and Element Utility Methods
    this.Element  = function( o ) {return document.all ? document.all[o] : (document.getElementById ? document.getElementById(o) : null); }
    this.ElementY = function( o ) {var Y=0,p=o; while (p&&p.tagName.toUpperCase()!='BODY') {Y+=p.offsetTop; p=p.offsetParent;} return Y; }
    this.ElementX = function( o ) {var X=0,p=o; while (p&&p.tagName.toUpperCase()!='BODY') {X+=p.offsetLeft; p=p.offsetParent;} return X; }
    this.ElementWidth = function( o )
	{
	    return o.offsetWidth && o.offsetWidth != 0 ? o.offsetWidth :
	           o.offsetParent.offsetWidth && o.offsetParent.offsetWidth != 0 ? o.offsetParent.offsetWidth :
	           o.offsetParent.offsetParent ? o.offsetParent.offsetParent.offsetWidth : 0;
	}
    this.ElementHeight = function( o )
	{
	    return o.offsetHeight && o.offsetHeight != 0 ? o.offsetHeight :
	           o.offsetParent.offsetHeight && o.offsetParent.offsetHeight != 0 ? o.offsetParent.offsetHeight :
	           o.offsetParent.offsetParent ? o.offsetParent.offsetParent.offsetHeight : 0;
	}
	this.ElementRect = function( o ) { return new _WebHtmlElementRect(o); }
	this.ElementMoveTo = function( o, oRelTo, s, v, a )
	{
	    var rectRelTo = this.ElementRect(oRelTo); if (s==undefined) s=0;			
		if ( v )
	    {
    		var rect = this.ElementRect(o);	o.style.top = rectRelTo.Y;

//			if (rectRelTo.Y - rect.Height - this.BodyScrollTop() > 0) // See if can go above...
//				o.style.top = rectRelTo.Y - rect.Height;
			
			var rectOrig; if (!this.IsIE ) rectOrig = new this.ElementRect(o);
			o.style.left = rectRelTo.X + rectRelTo.Width + s - this.BodyScrollLeft();
			rect = this.ElementRect(o); if (this.IsIE) rectOrig = rect;
			
			if (rect.X + rectOrig.Width + s - this.BodyScrollLeft() > this.BodyWidth())
			{
			  if (this.BodyWidth() - rectOrig.Width > 0)
			    o.style.left = rectRelTo.X - rectOrig.Width - s + this.BodyScrollLeft();
			  else o.style.left = 0; // TO-DO:?
			}
	    }
	    else
	    {
	    	o.style.left = rectRelTo.X - document.body.scrollLeft;	o.style.top = rectRelTo.Y + rectRelTo.Height + s;
    		var rect = this.ElementRect(o), bf=this.IsIE?0:16;

		    if (rect.X - document.body.scrollLeft + rect.Width > this.BodyWidth())
		    {
		      if (this.BodyWidth() - rect.Width - bf > 0)  // TO-DO: ?
		        o.style.left = this.BodyWidth() - rect.Width - this.BodyScrollLeft() - bf;
		      else o.style.left = 0; // TO-DO:?
		    }
		    if (rect.Y - this.BodyScrollTop() + rect.Height > this.BodyHeight())
		    {
		      if (rectRelTo.Y - rect.Height - this.BodyScrollTop() > 0) // TO-DO: ?
			    o.style.top = rectRelTo.Y - rect.Height;	 
		    }
		}
		if (a) alert( 'MovTo:\n' + new _webApp.ElementRect(o).toString()  + '\n\nRelTo:\n' + rectRelTo.toString() );
	}
	
    // Event Subscriber Arrays
    this.BodyOnLoadEventSubscribers   = new Array();
    this.BodyOnResizeEventSubscribers = new Array();
    this.FormOnSubmitEventSubscribers = new Array();

    // HTML Body Event Handlers/Delegates: BodyOnLoad, BodyOnResize
    this.BodyOnLoad = function(me,e)
    {
        this.Solution = _vmnSolution;

        for ( var i=0; i<this.BodyOnLoadEventSubscribers.length; ++i ) 
        {
            var f = this.BodyOnLoadEventSubscribers[i]; if (typeof(f) == 'function') { try { f(me,e); } catch ( e ) { ; } }
        }
    }
    this.BodyOnResize = function(me,e)
    {
        for ( var i=0; i<this.BodyOnResizeEventSubscribers.length; ++i ) 
        {
            var f = this.BodyOnResizeEventSubscribers[i]; if (typeof(f) == 'function') { try { f(me,e); } catch ( e ) { ; } }
        }  
    }
    // HTML Form Event Handlers/Delegates: FormOnSubmit
    this.FormOnSubmit = function(me,e)
    {
        var rv = true;
        for ( var i=0; i<this.FormOnSubmitEventSubscribers.length; ++i ) 
        {
            var f = this.FormOnSubmitEventSubscribers[i]; if (typeof(f) == 'function') { try { rv=f(me,e); } catch ( e ) { ; } }
        }
        return rv;    
    }
        
    // Event Subscription Methods
    this.AttachBodyOnLoadEventHandler = function( f ) { this.BodyOnLoadEventSubscribers[this.BodyOnLoadEventSubscribers.length]=f; }
    this.AttachBodyOnResizeEventHandler = function( f ) { this.BodyOnResizeEventSubscribers[this.BodyOnResizeEventSubscribers.length]=f; }
    this.AttachFormOnSubmitEventHandler = function( f ) { this.FormOnSubmitEventSubscribers[this.FormOnSubmitEventSubscribers.length]=f; }
    
    // Utility Methods: DefaultTransformOpen, DefaultTransformClose
    this.DefaultTransformClose = function( parentPanel, mbPanel, filterName )
    {
        if (parentPanel && mbPanel)
        {
            if ( this.IsIE ) 
            {
                parentPanel.style.filter='progid:DXImageTransform.Microsoft.'+filterName+(filterName.indexOf('(')!=-1 ?'' :'()');
                parentPanel.filters[0].apply();  
            }
            mbPanel.style.display='none'; if ( this.IsIE ) parentPanel.filters[0].play();
         } else if (mbPanel) mbPanel.style.display='none';
    }
    this.DefaultTransformOpen=function(parentPanel, mbPanel, filterName)
    {
        if (mbPanel && mbPanel.style.display!='none') this.DefaultTransformClose(parentPanel,mbPanel,filterName);
        if (mbPanel && parentPanel)
        {
            if (this.IsIE)
            {  
               parentPanel.style.filter='progid:DXImageTransform.Microsoft.'+filterName+(filterName.indexOf('(')!=-1 ?'' :'()'); 
               parentPanel.filters[0].apply(); 
            }       
            mbPanel.style.display=''; if ( this.IsIE ) parentPanel.filters[0].play();
        } else if (mbPanel) mbPanel.style.display='';
    } 
    
    this.FormatFileSize=function( bytes )
    {
        var s_K = 1024.0;
        if ( bytes < s_K ) return bytes + ' byte' + (bytes > 1 ? 's' : '');
        var kbSize = bytes  / s_K; if ( kbSize < s_K ) return Math.round(kbSize) + ' KB';
        var mbSize = kbSize / s_K; if ( mbSize < s_K ) return mbSize + ' MB';
        var gbSize = mbSize / s_K; return gbSize + ' GB'; 
    }

    // ADDED FOR TestSites
    this.XorVisibility = function( d, i, mini, maxi )
    {
       if ( this.Element(d) )
         if (this.Element(d).style.display == 'none')
         {
           this.Element(d).style.display=''; 
           if (this.Element(i)) { this.Element(i).src=mini; this.Element(i).alt='Click to collapse'; }
         }
         else
         {
           this.Element(d).style.display='none';
           if (this.Element(i)) { this.Element(i).src=maxi; this.Element(i).alt='Click to expand'; }
         }
    }
    this.XorVisibility1 = function( d, i )
    {
       if ( this.Element(d) )
         if (this.Element(d).style.display == 'none')
         {
           this.Element(d).style.display=''; 
           if (this.Element(i)) { this.Element(i).src='Images/min1.gif'; this.Element(i).alt='Click to collapse'; }
         }
         else
         {
           this.Element(d).style.display='none';
           if (this.Element(i)) { this.Element(i).src='Images/max1.gif'; this.Element(i).alt='Click to expand'; }
         }
    }
    this.IsValidEmail=function(email)
    {   
        var invalidChars = ' /:,;', atPos, periodPos;
        for (i=0; i<invalidChars.length; i++) if (email.indexOf(invalidChars.charAt(i),0) != -1) return false;
        if ((atPos=email.indexOf("@",1))==-1 || email.indexOf("@",atPos+1) != -1) return false;
        if ((periodPos=email.indexOf(".",atPos))==-1 || periodPos+3 > email.length) return false;
        return true;
    }
    //
    // LOGIN DIALOG
    //
    this.LoginDialogId = '_divSswLoginDlg';
    this.LoginDialogShow=function(x,y,z,h)
    {
        var ldContainer=this.Element(this.LoginDialogId),w=300; if (h==undefined||h<150 )h=150;
	    if (!ldContainer)
	    {   // Create Login Dialog Container, and ID
		    ldContainer=this.HtmlElement('div',w,h,(this.IsIE?(x-w-28>=0?x-w-28:0):(x-w-16>=0?x-w-16:0)),(this.IsIE?(y-8>=0?y-8:0):(y-6>=0?y-6:0)),null,null,(this.IsIE?'6px #c0c0c0 outset':'5px black outset'),'white');  ldContainer.id=this.LoginDialogId;
		    document.body.insertBefore(ldContainer,document.body.firstChild);           // Add to HTML DOM
		    ldContainer.style.zIndex=z; ldContainer.style.position='absolute';          // zIndex and position type 
		    ldContainer.onmouseout=this.LoginDialogMouseOut; 
		    ldContainer.onmouseover=this.LoginDialogMouseOver;                          // Plug mouse events
		    if(this.IsIE) ldContainer.style.filter='progid:DXImageTransform.Microsoft.Shadow(color=Gray,direction=135,strength=16);';

            var ldInner=this.HtmlElement('div',w,h); ldContainer.appendChild(ldInner);  // Create and append Inner pane (div) to Container pane
                                                                                        // Create and append Title pane to Inner pane
		    var ldTitle=this.HtmlElement('div',w,null,null,null,null,null,'1px solid gray','url(Images/Backgrounds/Tab.gif) no-repeat center top' );
		    ldInner.appendChild( ldTitle ); ldTitle.innerHTML="<IMG STYLE='position:absolute;top:5px;left:"+(w-21)+"px;' SRC='Images/Close.gif' ONCLICK='_webApp.LoginDialogHide();' TITLE='Click to close' BORDER=0><DIV ALIGN=CENTER STYLE='position:relative;top:5px;width:"+(w-22)+"px;height:24px;color:black;font-family:Arial;font-size:13px;' TITLE='Welcome to Boston Investments Member Login'><B>Boston Investments Member Login</B></DIV>";
		    
                                                                                        // Create and append Main pane to Inner pane
		    var ldMain=this.HtmlElement('div',w,h-26,'100%',null,null,'13px Verdana',null,'#f2f2f2'); ldInner.appendChild(ldMain);
		    var ldFields=this.HtmlElement('div',w-8,h-60); ldMain.appendChild(ldFields);
            var dStyle="style='font-family:Verdana;font-size:13px;width:206px;"+(this.IsIE?"padding-top:3px;":"")+"height:22px;border:1px solid gray;",
                iOnClick="OnClick=\"var i=this.getElementsByTagName('img')[0]; i.src=(i.src.indexOf('nchecked')!=-1?'Images/CBChecked.gif':'Images/CBUnchecked.gif');\"",
		        bStyle="STYLE='width:90px;hight:25px;padding:5 4 4 24;background:url(Images/Backgrounds/Botton90x25.gif) no-repeat; font-family:Times New Roman;font-weight:norma;font-size:14px;",
		        bOver="OnMouseOver=\"this.style.background='url(Images/Backgrounds/BottonSel90x25.gif) no-repeat'; this.style.fontWeight='bold';\" ",
		        bOut="OnMouseOut=\"this.style.background='url(Images/Backgrounds/Botton90x25.gif) no-repeat'; this.style.fontWeight='normal';\" ";
		    ldFields.innerHTML= "<DIV STYLE='PADDING-TOP:6px;MARGIN-LEFT:6px;'>Your&nbsp;Email:&nbsp;<INPUT ID=_textLDEmail type=text "+ dStyle+"'  OnKeyPress='_webApp.LoginDialogKeyPress(event,this);' TABINDEX=1></DIV>" +
		                        "<DIV STYLE='MARGIN-TOP:6px;MARGIN-LEFT:6px;'>Password:&nbsp;<INPUT ID=_textLDPassword type=password " + dStyle+"margin-left:6px;' OnKeyPress='_webApp.LoginDialogKeyPress(event,this);' TABINDEX=2></DIV>" +
		                        "<DIV STYLE='MARGIN-TOP:6px;MARGIN-LEFT:6px;cursor:hand;width:120px;' "+iOnClick+" TABINDEX=3><IMG ID=_imgLDChecked SRC='Images/CBChecked.gif' "+(this.IsIE?'ALIGN=absmiddle':'')+" BORDER=0>&nbsp;Remeber login</DIV>" +
		                        "<DIV STYLE='MARGIN-TOP:6px;MARGIN-LEFT:6px;display:none;color:red;' ID=_divLDError>" + (_sioError==''?"&nbsp;":"<B>Error: </B>"+_sioError) + "</DIV>" +
		                        "<DIV STYLE='MARGIN-TOP:"+(this.IsIE?10:12)+"px;MARGIN-LEFT:6px;'><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=100%><TR>" +
		                             "<TD ALIGHT=left WIDTH=50%><DIV TABINDEX=4 " + bStyle+"' " + bOver + bOut + "OnClick='SMSignIO(); return false;' Title='Click to login'>Sign-in</DIV></TD>" + 
		                             "<TD ALIGHT=right WIDTH=50%><DIV TABINDEX=5 "+ bStyle+";margin-left:"+ (this.IsIE?50:80)+"' " + bOver + bOut + "OnClick='_webApp.LoginDialogHide(); return false;' Title='Click to cancle login'>&nbsp;Cancel</DIV></TD>" + 
                                 "</TR></TABLE></DIV>";
   	    }
	    else
	    {
	        ldContainer.style.left=(this.IsIE?(x-w-28>=0?x-w-28:0):(x-w-16>=0?x-w-16:0));
	    }
	    this.LoginDialogMouseOver(); var lde=_webApp.Element('_textLDEmail');
	    if ( lde )
	    {
	        if (lde.value=='') lde.value=_webApp.Element(_sioHiddenId).value.split(',',1);
            lde.focus(); lde.select();
        }
        else alert( "[" + lde.value + "]" );
	}
	
	this.LoginDialogHide=function()
    {
        var ld=_webApp.Element(_webApp.LoginDialogId); 
        if (ld) {_webApp.Element('_textLDPassword').value='';_webApp.Element('_divLDError').style.display=ld.style.display='none';}
    }
    this.LoginDialogMouseOut=function() 
    { 
        var ld=_webApp.Element(_webApp.LoginDialogId); if (ld) ld.setAttribute('TimeoutId',window.setTimeout('_webApp.LoginDialogHide()',15*1000));
    }
    this.LoginDialogMouseOver=function() 
    { 
        var ld=_webApp.Element(_webApp.LoginDialogId);var tid=ld?ld.getAttribute('TimeoutId'):null;
        if (tid) {window.clearTimeout( tid ); ld.style.display=''; ld.setAttribute("TimeoutId",null);}
    }
    this.LoginDialogKeyPress=function(e,o)
    {
        if (e==undefined || e.keyCode!=13 ) return;
        SMSignIO(); 
        if ( this.IsIE ) { e.returnValue = false; }
        else { e.stopPropagation(); e.preventDefault(); } // Assumes NN
    }
    this.LoginDialogSubmit=function()
    {
        var ld=_webApp.Element(_webApp.LoginDialogId); if (ld) ld.style.display='none';
    }
	this.HtmlElement=function(t,w,h,x,y,ih,f,b,bg,p)
	{
	    var he=document.createElement(t);                                                  // t-created Element Tag
	    if (w!=undefined && w) he.style.width=w; if (h!=undefined && h) he.style.height=h; // w-Width, h-Hight
	    if (x!=undefined && x) he.style.left=x;  if (y!=undefined && y) he.style.top=y;    // x-left, y-top
	    if (ih!=undefined && ih) he.innerHTML=ih;                                          // ih-innerHTML
	    if (f!=undefined && f) he.style.font=f;  if (b!=undefined && b) he.style.border=b; // f-font, b-border
	    if (bg!=undefined && bg) he.style.background=bg;                                   // bg-background
	    if (p!=undefined && p) he.style.padding=p;                                         // p-padding
	    return he;
	}
}
var _webApp = new WebApp(); // One and only Web Application Object.

//
// _WebHtmlElementRect helper Class
//
function _WebHtmlElementRect(o)
{   // Width=this.Width, Height=this.Height, Top=this.Y, Left=this.X, Bottom=this.Y+this.Height, Right=this.X+this.Wdith
	var h=(o.style.display=='none'); if (h) o.style.display='';	this.Width=_webApp.ElementWidth(o); this.Height=_webApp.ElementHeight(o); this.Y=_webApp.ElementY(o); this.X=_webApp.ElementX(o); this.Y=_webApp.ElementY(o); this.Bottom=(this.Y+this.Height); this.Right=(this.X+this.Width); if (h) o.style.display='none';
	this.toString=function() { return 'Top (Y): ' + this.Y + '\nLeft (X): ' + this.X + '\nBottom: ' + this.Bottom + '\nRight: ' + this.Right + '\n\nWidth: ' + this.Width + ', Height: ' + this.Height; }
}

//
// SswSimpleWebMenu Class
//
function SswSimpleWebMenu(id,v,vs,hs,sic,sisc,sihc,pic,pisc,pihc)
{
    this.Id=id; this.MyVar=v; this.vSpace=vs, this.hSpace=hs; this.Sic=sic; this.Sisc=sisc; this.Sihc=sihc; this.Pic=pic; this.Pisc=pisc; this.Pihc=pihc;

    this.MIMouseOver = function( o )
    {
        var miid = o.getAttribute('AAEMIID'),v=!o.parentNode.getAttribute('Horizontal'),childMenu;
        if ( o.firstChild )
        {
            if ( v ) o.firstChild.className=o.firstChild.firstChild.className=this.Pihc;
            else if (!o.getAttribute('Selected')) o.firstChild.className=o.firstChild.firstChild.className=this.Sihc;
        }
        if ( miid && (childMenu=_webApp.Element(this.Id+miid)) )
        {
            if (childMenu.parentNode.tagName.toUpperCase()!='BODY')
            {
                childMenu.parentNode.removeChild( childMenu ); document.body.appendChild(childMenu); 
            }
            _webApp.ElementMoveTo(childMenu,o,(v?this.vSpace:this.hSpace),(v?1:null)/*,(miid=='0_1'?1:null)*/); 
            this.MMouseOver( childMenu );
        }
    }
    this.MIMouseOut = function( o )
    {   
        var miid = o.getAttribute('AAEMIID'),v=!o.parentNode.getAttribute('Horizontal'),childMenu;

        if ( o.firstChild ) o.firstChild.className=o.firstChild.firstChild.className=o.getAttribute('Selected')?(v?this.Pisc:this.Sisc):(v?this.Pic:this.Sic);
           
        if ( miid && (childMenu=_webApp.Element(this.Id+miid)) ) 
        {
            this.MMouseOut( childMenu ); // Hide child menu, if any
        }
   }   
   this.MMouseOver = function(o) 
   { 
        var p=o, i=0;
        while (p && p.id != _webApp.Element(this.Id).id && i++<4)
        {
            var t=p.getAttribute('TimeoutId'); if (t) window.clearTimeout(t); p.setAttribute('TimeoutId',null); p.style.display=''; p=this.MGetParent(p);
        }
   }
   this.MMouseOut = function(o) 
   {         
        var p=o, i=0;
        while (p && p.id != _webApp.Element(this.Id).id && i++<4)
        {
            p.setAttribute('TimeoutId',window.setTimeout(this.MyVar+'.MMouseOutTimeout('+p.id+')',100));  p=this.MGetParent(p);
        }
   }
   this.MMouseOutTimeout = function(id) 
   {
        var o=eval(id), t=o.getAttribute('TimeoutId'); if (t) o.style.display='none'; o.setAttribute('TimeoutId',null); 
   }    

   // Menu Utility Methods
   this.MGetParent = function(o)
   {
        var mid=o.getAttribute('AAEMID'), ancestors=(mid? mid.split('_'): null); 
        return _webApp.Element((!ancestors || ancestors.length<2? this.Id: (this.Id+mid.substring(0,mid.lastIndexOf('_')))));       
   }
   this.MGetParentMI = function(o)
   {
        var p=this.MGetParent(o),mid=o.getAttribute('AAEMID'),miid=(mid?(mid.lastIndexOf('_')!=-1?mid.substring(0,mid.lastIndexOf('_')):mid):'Y'), mis=p.getElementsByTagName('td'), s='';
        if (mid) for (var i=0; i<mis.length; ++i ) if ( mis[i].getAttribute('AAEMIID') == miid ) return mis[i];
        // AAE alert(  "MIs: " + mis.length + ', MID:[' + mid + '], miid:[' + miid + '], p:' + p.id + ', s:' + s );
        return null;
   }  
   // Menu Item Utility Methods: MIFind, MIClose, MICloseAll
   this.MIFind = function(o)
   {
        while (o) if (o.tagName && o.tagName.toUpperCase()=='TD' && o.getAttribute('AAEMIID')) return o; else o=o.parentNode;
        return null;
   }  
   this.MIGetParentM = function(o)
   {
        o=this.MIFind(o); while (o) if (o.tagName && o.tagName.toUpperCase()=='DIV' && o.getAttribute('AAEMID')) return o; else o=o.parentNode;
        return null;
   }
   this.MIClose = function(o) { o=this.MIFind(o); this.MIMouseOut(o); }
   this.MICloseAll = function(o) { o=this.MIFind(o); this.MMouseOut(this.MIGetParentM(o)); }
   this.MISelect = function(o)
   { 
       o=this.MIFind(o); var v=!o.parentNode.getAttribute('Horizontal');
       if ( o.firstChild ) { o.firstChild.className=o.firstChild.firstChild.className=(v?this.Pisc:this.Sisc); o.setAttribute('Selected',1); }
   }
   this.MIUnselect = function(o)
   { 
       o=this.MIFind(o); var v=!o.parentNode.getAttribute('Horizontal');
       if ( o.firstChild ) { o.firstChild.className=o.firstChild.firstChild.className=(v?this.Pic:this.Sic); o.removeAttribute('Selected'); }
   }

}

    // End of script file: WebApp.js