        var AnimationsOn=true;


/////////////
//This is all for moving Divs
/////////////


        var resizing=false;
        var wait=0;
        
         function resizeElement(objResize,tL,tT,tLW,tTH,goback,hideType,percentIncr){ 
            if(resizing==true){return;}else{resizing=true;}
            /* 
                passed in Vars
                objResize         the element being resized
                tL          target Left
                tT          target Top
                tLW         target Left+Width
                tTH         target Top+Height
                goback      if true then target values are ignored and come from attribute
                percentIncr default is 15, amount to get close to target
            */
            if(percentIncr==null){percentIncr=15;}
            if(hideType==null){hideType=0;}
            var percent=0;
            var cValues;
            cValues = [objResize.offsetLeft, objResize.offsetTop, objResize.offsetLeft+objResize.offsetWidth, objResize.offsetTop+objResize.offsetHeight];
            var tValues
            if (goback==null || goback==false){
                //use passed in vars
                tValues=[tL,tT,tLW,tTH]
                //Save some attributes on the objResizeect for use later
                objResize.setAttribute('startPoints',cValues[0]+','+cValues[1]+','+cValues[2]+','+cValues[3]);
                objResize.setAttribute('oIndex',objResize.style.zIndex);
                objResize.style.zIndex=2005;
            }else{
                //Use starting point recieved from attributes
                var destSize=objResize.getAttribute('startPoints').split(',');
                tValues = [
                            parseInt(destSize[0]),
                            parseInt(destSize[1]),
                            parseInt(destSize[2]),
                            parseInt(destSize[3])
                          ]
            }
            
           
            
           
            this.processResize = function(){
                percent+=percentIncr;
                if (percent>100){percent=100;}
                var l,t,w,h,cstyle;
                l=cValues [0]-((cValues [0]-tValues [0])*(percent / 100))+'px';
                t=cValues [1]-(((cValues [1])-tValues [1])*(percent / 100))+'px';
                w=(cValues [2]-cValues [0])-(((cValues [2]-cValues [0])-(tValues [2]-tValues [0]))*(percent / 100))+'px';
                h=(cValues [3]-cValues [1])-(((cValues [3]-cValues [1])-(tValues [3]-tValues [1]))*(percent / 100))+'px';
                if( typeof( objResize.style.cssText ) != 'undefined' ) {
                        cstyle=objResize.style.cssText;
                }else{
                        cstyle=objResize.getAttribute('style');
                }
                cstyle=cstyle.toUpperCase();
                cstyle=cstyle.replace( RegExp("TOP:(.*?);"),'').replace( RegExp("HEIGHT:(.*?);"),'').replace( RegExp("WIDTH:(.*?);"),'').replace( RegExp("LEFT:(.*?);"),'')
                cstyle+=';TOP:'+t+';LEFT:'+l+';WIDTH:'+w+';HEIGHT:'+h+';';
                setStyle (objResize,cstyle)
                
                if(percent>0 && percent<100){
                    window.setTimeout(this.processResize,15);
                }else{
                    //alert(1);
                    resizing=false;
                    if(hideType==1){objResize.style.visibility='hidden';}
                    else if(hideType==2){objResize.style.display='none';}
                    objResize.style.zIndex=objResize.getAttribute('oIndex');
                }
            }
            
            //Begin
            if (AnimationsOn==false){percent=100;}
            this.processResize();
            
        }
        
        










/*
        var objDiv;
        var div = [];
        div['psx']=0;
        div['psy']=0;
        div['plx']=0;
        div['ply']=0;
        var resizing=false;
        var percentIncr=15; //speed
        var direction=1; //leave alone, checking if first run through or returning
        var percent; //current percent, leave alone
        var sizeBack=false;
        var wait=0;
        
         function resizeMe(obj,nsx,nsy,nlx,nly,goback,depth){ 
            //to go back to previous item, set goback = 0
            if(resizing==true){return;}else{resizing=true;}
            objDiv=obj;
            if (depth==null){depth='';}
            if (goback==null){direction=1;}else{direction=goback;}
            sx=nsx;
            sy=nsy;
            lx=nlx;
            ly=nly;

            if (direction==1){
            
                //Save info if moving to a new spot                
                div['psx']=parseInt(objDiv.style.left.replace('px',''));
                div['psy']=parseInt(objDiv.style.top.replace('px',''));
                div['plx']=parseInt(parseInt(objDiv.style.left.replace('px',''))+parseInt(objDiv.style.width.replace('px','')));
                div['ply']=parseInt(parseInt(objDiv.style.top.replace('px',''))+parseInt(objDiv.style.height.replace('px','')));
                
                objDiv.setAttribute('starting'+depth,div['psx']+','+div['psy']+','+div['plx']+','+div['ply'])
                objDiv.setAttribute('oIndex',obj.style.zIndex);
                obj.style.zIndex =2005;
                percent=0;
                
            }else{
                //This means going back to the last spot
                sx=obj.offsetLeft;
                sy=obj.offsetTop;
                lx=obj.offsetLeft+obj.offsetWidth;
                ly=obj.offsetTop+obj.offsetHeight;
                
                sx=obj.style.left.replace('px','');

                sy=obj.style.top.replace('px','');
                lx=parseInt(obj.style.left.replace('px',''))+parseInt(obj.style.width.replace('px',''));
                ly=parseInt(obj.style.top.replace('px',''))+parseInt(obj.style.height.replace('px',''));

                percent=100;
                destSize=objDiv.getAttribute('starting'+depth).split(',');
                div['psx']=parseInt(destSize[0]);
                div['psy']=parseInt(destSize[1]);
                div['plx']=parseInt(destSize[2]);
                div['ply']=parseInt(destSize[3]);
                
            }
                resizeObj();
                
        
        }
        
        
       
        
        function resizeObj(){
            if (direction==1){ percent+=percentIncr;}else{percent-=percentIncr}
            
            var l,t,w,h,cstyle;
            l=div['psx']-((div['psx']-sx)*(percent / 100))+'px';
            t=div['psy']-(((div['psy'])-sy)*(percent / 100))+'px';
            w=(div['plx']-div['psx'])-(((div['plx']-div['psx'])-(lx-sx))*(percent / 100))+'px';
            h=(div['ply']-div['psy'])-(((div['ply']-div['psy'])-(ly-sy))*(percent / 100))+'px';
            if( typeof( objDiv.style.cssText ) != 'undefined' ) {
                    cstyle=objDiv.style.cssText;
            }else{
                    cstyle=objDiv.getAttribute('style');
            }
            cstyle=cstyle.toUpperCase();
            cstyle=cstyle.replace( RegExp("TOP:(.*?);"),'').replace( RegExp("HEIGHT:(.*?);"),'').replace( RegExp("WIDTH:(.*?);"),'').replace( RegExp("LEFT:(.*?);"),'')
            cstyle+=';TOP:'+t+';LEFT:'+l+';WIDTH:'+w+';HEIGHT:'+h+';';
            setStyle (objDiv,cstyle)
            //objDiv.style.left=div['psx']-((div['psx']-sx)*(percent / 100))+'px';
            //objDiv.style.top=div['psy']-(((div['psy'])-sy)*(percent / 100))+'px';
            //objDiv.style.width=(div['plx']-div['psx'])-(((div['plx']-div['psx'])-(lx-sx))*(percent / 100))+'px';
            //objDiv.style.height=(div['ply']-div['psy'])-(((div['ply']-div['psy'])-(ly-sy))*(percent / 100))+'px';
            
            if(percent>0 && percent<100){
                window.setTimeout(resizeObj,20);
            }else{
            
                
                //if (percent ==0 || percent ==100){
                    resizing=false;
                    if(objDiv.getAttribute('hide')==1){objDiv.setAttribute('hide',0);objDiv.style.visibility='hidden';}
                    if(objDiv.getAttribute('hide')==2){objDiv.setAttribute('hide',0);objDiv.style.display='none';}
                    objDiv.style.zIndex=objDiv.getAttribute('oIndex');
                    objDiv=null;
                //}
            }
            
        }
        */
        
        
        function getHeight(tdiv){
            var ndiv = document.createElement ("div");
            ndiv.id="ndiv"
            document.body.appendChild (ndiv);
            ndiv=document.getElementById ('ndiv');
            ndiv.innerHTML=tdiv.innerHTML
            ndiv.style.width=tdiv.offsetWidth+'px';
            var ht = ndiv.offsetHeight;
            ndiv.parentNode.removeChild (ndiv)
            return ht;
        }
        
        
        
        
        function setStyle(obj,style){
            if( typeof( obj.style.cssText ) != 'undefined' ) {
                obj.style.cssText = style;
            } else {
                obj.setAttribute('style',style);
            }
        }
        
        
        
        
        
        
        var fading = false;
        
        //    fadeDiv(divObjFade,fadeOut, '',null,8,1);     
        function fadeDiv(div1, fadeOut,fadeDirection, div2, maxOpac, flag){
            /*
                div1 primary div to fade, 
                fo=true or false if fading out, 
                fade direction (left up or down etc)  
                div2 optional second div to fade at the same time
                maxopac = optional highest level of opac, default is 10
                flag = if "1" is passed, do not use IE fix on IE
            */
            if (fading==true){return}
            fading=true;
            var fadeOpac;
            if (maxOpac==null){maxOpac=10;}
            if(fadeOut==true){
                if (AnimationsOn==true){
                    fadeOpac=maxOpac;
                }else{
                    fadeOpac=1;
                }
            }else{
                if (AnimationsOn==true){
                    fadeOpac=1;
                }else{
                    fadeOpac=maxOpac;
                }
            }
            var tempDiv = document.getElementById('tfdiv');
            if (document.all && fadeDirection=="" && tempDiv==null && flag!=1 ){
                tempDiv = document.createElement('div');
                tempDiv.id='tfdiv';
                div1.parentNode.appendChild(tempDiv);
                tempDiv=document.getElementById('tfdiv')
                var cstyle="";
                if( typeof( div1.style.cssText ) != 'undefined' ) {
                    cstyle=div1.style.cssText;
                }else{
                    cstyle=div1.getAttribute('style');
                }
                var t = div1.offsetTop-parseInt(div1.style.marginTop.replace('px',''))
                if( isNaN (t)==true ){
                   t = div1.offsetTop;
                }
                var w;
                if (div1==document.getElementById ('mainContent')){
                    w=775;
                }else{
                    w=div1.offsetWidth;
                }
                cstyle +=';background-color:#FFFFFF; filter:alpha(opacity=0);position:absolute; z-index:5000;'+
                        'top:'+t+'px;left:'+div1.offsetLeft+'px;width:'+w+'px;height:'+div1.offsetHeight+'px;';
                setStyle(tempDiv,cstyle)
            }
            
            
            
            
            
            
            
            //this is the function that is recursive
            this.fadeAwayDiv=function(){
                var left=0; 
                var top = 0;
                if (fadeDirection.indexOf("l")>=0){left=-15;}
                if (fadeDirection.indexOf("r")>=0){left=15;}
                if (fadeDirection.indexOf("u")>=0){top=-15;}
                if (fadeDirection.indexOf("d")>=0){top=15;}
                if(fadeOut==true){fadeOpac-=1;}else{fadeOpac+=1;}
                if(document.getElementById('tfdiv')){
                    this.fadeIE();
                }else{
                    this.processFade(div1,left,top);
                    
                    if(div2 != null) {                        
                        this.processFade(div2,left,top);
                    }
                }
                if (fading==true){
                    setTimeout(this.fadeAwayDiv,30);
                }
                
            }


            //process the normal fade flow
            this.processFade=function (fdiv, left, top){
                if (fdiv.getAttribute('maxopac')){
                    var fo=fadeOpac;
                    if (parseInt(fadeOpac)>fdiv.getAttribute('maxopac')){fo=fdiv.getAttribute('maxopac');}
                    fdiv.style.opacity=(parseInt(fo)/10);
                    fdiv.style.filter='alpha(opacity='+(parseInt(fo)*10)+')';
                }else{
                    fdiv.style.opacity=(parseInt(fadeOpac)/10);
                    fdiv.style.filter='alpha(opacity='+(parseInt(fadeOpac)*10)+')';
                }
                if(left!=0 && fdiv.style.left!=null){
                    fdiv.style.left=parseInt(fdiv.style.left.replace('px',''))+left+'px';
                }
                if(top!=0 && fdiv.style.top!=null){
                    fdiv.style.top=parseInt(fdiv.style.top.replace('px',''))-top+'px';
                }
                if (fadeOpac<=0 || fadeOpac>=maxOpac){
                 
                    //All done, check if need to hide
                    if(fadeOpac<=0){                  
                        
                        switch(fdiv.getAttribute('hide')){
                            case '1':
                                fdiv.setAttribute('hide','0');
                                fdiv.style.visibility='hidden';                               
                                break;
                            case '2':
                                fdiv.setAttribute('hide','0');
                                fdiv.style.display='none';
                                break;
                        }
                        if(fdiv==div2){
                            fdiv=div1;
                            switch(fdiv.getAttribute('hide')){
                                case '1':
                                    fdiv.setAttribute('hide','0');
                                    fdiv.style.visibility='hidden';
                                    break;
                                case '2':
                                    fdiv.setAttribute('hide','0');
                                    fdiv.style.display='none';
                                    break;
                            }
                        
                        }
                    }
                    fading=false;
                }
            }
                
            //For IE only, instead of fade, we put white box OVER object
            this.fadeIE= function (){
                OppFade=10-fadeOpac;
                tempDiv.style.filter='alpha(opacity='+(OppFade*10)+')';
                try{
                    if (div2!=null){this.processFade(div2,0,0);}
                }catch(ignore){}
                if (parseInt(OppFade)<=0 || parseInt(OppFade)>=maxOpac){
                    if(OppFade<=0){tempDiv.parentNode.removeChild(tempDiv);}
                    fading=false;
                }
            }
            
            
            
            
            
            //Begin the process of fading
            this.fadeAwayDiv();
         
        }

 
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        



/////////////
//This section is for the fading management
/////////////
/*
        var fading = false;
        var fadeDirection="";
        var fadeOut=true;
        var maxOpac=10;
        var fadeOpac;
        var divObjFade;
        var divObjFade2;
       
        function fadeDiv(div, fo,fd, useIEFix){
           //  
           //     div to fade, fo=true or false if fading out, and fd = fade direction (left up or down etc)  
           //     To fade two objects, make sure to set divObjFade2 before calling
           //
            if (fading==true){return}
            fading=true;
            fadeOut=fo;
            fadeDirection=fd
            divObjFade=div;
            if(fadeOut==true){fadeOpac=maxOpac;}else{fadeOpac=1;}
            if (document.all && fadeDirection=="" && document.getElementById('tfdiv')==null && useIEFix==null){
                var tempDiv = document.createElement('div');
                tempDiv.id='tfdiv';
                divObjFade.parentNode.appendChild(tempDiv);
                tempDiv=document.getElementById('tfdiv')
                document.getElementById('tfdiv').style.cssText=divObjFade.cssText;
                tempDiv.style.filter='alpha(opacity=0)';
                tempDiv.style.backgroundColor="#FFFFFF"
                tempDiv.style.position='absolute';
                tempDiv.style.top=divObjFade.offsetTop+'px';
                tempDiv.style.left=divObjFade.offsetLeft+'px';
                tempDiv.style.width=divObjFade.offsetWidth+'px';
                tempDiv.style.height=divObjFade.offsetHeight+'px';
                tempDiv.style.zIndex=5000;
            }
            fadeAwayDiv();
            
        }

        //Recursive Fader
        function fadeAwayDiv(){ 
            if (fading==false){return}
            var left=0; 
            var top = 0;
            if (fadeDirection.indexOf("l")>=0){left=-15;}
            if (fadeDirection.indexOf("r")>=0){left=15;}
            if (fadeDirection.indexOf("u")>=0){top=-15;}
            if (fadeDirection.indexOf("d")>=0){top=15;}
            
            if(fadeOut==true){fadeOpac-=1;}else{fadeOpac+=1;}
            if(document.getElementById('tfdiv')){
                fadeIE();
            }else{
                processFade(divObjFade,left,top);
                if (divObjFade2!=null){processFade(divObjFade2,left,top);} //In case you need to fade something else with it
            }
            if (fading==true){
                setTimeout(fadeAwayDiv,50);
            }
            
        }
        
        function fadeIE(){
            var tdiv=document.getElementById('tfdiv');
            var OppFade=10-parseInt(fadeOpac);
            tdiv.style.filter='alpha(opacity='+(parseInt(OppFade)*10)+')';
            try{
                if (divObjFade2!=null){processFade(divObjFade2,0,0);}
            }catch(ignore){}
            if (parseInt(OppFade)<=0 || parseInt(OppFade)>=maxOpac){
                if(OppFade==0){tdiv.parentNode.removeChild(tdiv);}
                fading=false;
                maxOpac = 10;
            }
        }
    
        function processFade(fdiv, left, top){
            fdiv.style.opacity=(parseInt(fadeOpac)/10);
            fdiv.style.filter='alpha(opacity='+(parseInt(fadeOpac)*10)+')';
            if(left!=0 && fdiv.style.left!=null){
                fdiv.style.left=parseInt(fdiv.style.left.replace('px',''))+left+'px';
            }
            if(top!=0 && fdiv.style.top!=null){
                fdiv.style.top=parseInt(fdiv.style.top.replace('px',''))-top+'px';
            }
            
           
            if (parseInt(fadeOpac)<=0 || parseInt(fadeOpac)>=maxOpac){
                if(fadeOpac==0){
                    if (divObjFade.getAttribute('hide')==1){divObjFade.setAttribute('hide',0);divObjFade.style.visibility='hidden';}
                    if (divObjFade.getAttribute('hide')==2){divObjFade.setAttribute('hide',0);divObjFade.style.display='none';}
                }
                
                if(fdiv==divObjFade2){
                    if(fadeOpac==0){
                        if (divObjFade2.getAttribute('hide')==1){divObjFade2.setAttribute('hide',0);divObjFade2.style.visibility='hidden';}
                        if (divObjFade2.getAttribute('hide')==2){divObjFade2.setAttribute('hide',0);divObjFade2.style.display='none';}
                    }
                    divObjFade2=null
                }else{
                    //If done with bringing into focus AND IE then need to fix the font
                    //if(fadeOpac==10 && document.all){fixClearType(fdiv);   }
                }
                fading=false;
                maxOpac =10;
            }
        }
    */
    function fixClearType(odiv){
        var div = document.createElement('div');
        div.innerHTML='<div  class=generalContent>Account Mgmt</div>';
        div.innerHTML=odiv.innerHTML;
        var style = odiv.style;
        var nID=odiv.id;
        var newStyle = clearFilter(odiv.style.cssText);
        odiv.parentNode.replaceChild(div,odiv);
        div.id=nID;
        document.getElementById(nID).style.cssText=newStyle;
    /*
        var odiv = document.getElementById('mainContent');
        var div = document.createElement('div');
        div.innerHTML='<div  class=generalContent>Account Mgmt</div>';
        div.innerHTML=odiv.innerHTML;
        var style = odiv.style
        document.getElementById('MC').replaceChild(div,odiv);
        div.id='mainContent';
        document.getElementById('mainContent').style.marginTop='15px';
      */  
    }
    function clearFilter(txt){
        var nstyle='';
        nstyle=txt.substring(0,txt.indexOf('FILTER'))
        txt=txt.substring(txt.indexOf('FILTER'))
        txt=txt.substring(txt.indexOf(';')+1)
        return nstyle+txt
    }
    

    function fadeBG(fadeOut){
        //Before running this you should set fadeOut 
        //   (false if hiding background, true if restoring)
        var divObjFade=document.getElementById('divFade');
        var divAboveFade=document.getElementById('divAboveFade');
/*
        if(navigator.appName=="Microsoft Internet Explorer"){
            divObjFade.style.height=(document.documentElement.scrollHeight)+20+'px';
        }else{
            divObjFade.style.height=document.documentElement.offsetHeight+'px';
        }
*/
        divObjFade.style.display='';
        divObjFade.style.visibility='visible';
        fadeDiv(divObjFade,fadeOut, '',null,8,1);
      
    }
         
         
         
    function mouseX(evt) {
        if (evt.pageX) 
            return evt.pageX;
        else if (evt.clientX)
            return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
        else return null;
    }
    function mouseY(evt) {
        if (evt.pageY) 
            return evt.pageY;
        else if (evt.clientY)
            return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
        else return null;
    }
         
         
         
         
         
         
         
         
         
         
         
         
        /*
        
		*/
		function is_child_of(parent, child) {
			if( child != null ) {
				while( child.parentNode ) {
					if( (child = child.parentNode) == parent ) {
						return true;
					}
				}
			}
			return false;
		}
		function fixOnMouseOut(element, event, JavaScript_code) {
			var current_mouse_target = null;
			if( event.toElement ) {				
				current_mouse_target 			 = event.toElement;
			} else if( event.relatedTarget ) {				
				current_mouse_target 			 = event.relatedTarget;
			}
			if( !is_child_of(element, current_mouse_target) && element != current_mouse_target ) {
				eval(JavaScript_code);
			}
		}
		
		
		// adds flash player...
		function insertFlash()
        {
            var divFlash = document.getElementById("home_flash");
            if (divFlash!=null){
                divFlash.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="516" height="328" id="arbitech_home" align="middle" style="z-index:-1">' +
                                 '<param name="FlashVars" value="xmlFile=arbitech_home.xml&preloaderBackColor=0x0099FF&preloaderBorderColor=0x" />' +
                                 '<param name="movie" value="slideshowpro.swf" />' +
                                 '<param name="quality" value="best" />' +
                                 '<param name="scale" value="noscale" />' +
                                 '<param name="wmode" value="opaque" />' +            
                                 '<param name="wmode" value="opaque" />' +
                                 '<param name="bgcolor" value="#FFFFFF" />' +
                                 '<embed src="slideshowpro.swf" id="arbitech_home" wmode="transparent" quality="best" flashvars="xmlFile=arbitech_home.xml&preloaderBackColor=0x0099FF&preloaderBorderColor=0x" scale="noscale" bgcolor="#FFFFFF" type="application/x-shockwave-flash" width="516" height="328" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
                                 '</object>';
            }
            else
            {
                alert(divFlash);
            }
        }   
        
        
        
    ////////
    ///  clean nodes so no whitespace so firefox and ie see same number of elements
    ///////
    var notWhitespace = /\S/;
    function cleanWhitespace(node) {
        for (var x = 0; x < node.childNodes.length; x++) {
            var childNode = node.childNodes[x]
            if ((childNode.nodeType == 3)&&(!notWhitespace.test(childNode.nodeValue))) {
                // that is, if it's a whitespace text node
                node.removeChild(node.childNodes[x])
                x--
            }
            if (childNode.nodeType == 1) {
                // elements can have text child nodes of their own
                cleanWhitespace(childNode)
            }
        }
    }
    
