/*******////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////********/

/*            The following functions are a basic utilitarian                     */

/*******////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////********/



		/*******************************************
		FUNCTION: browserCheck		
		PURPOSE: To check for DOM supprt in browser
		*******************************************/

				  
function browserCheck () {
			//DOM check
			var advancedJSSupport;
			if (!document.getElementsByTagName) return false;
			if (!document.getElementById) return false;
			
			else {
			return true;
			     } //end else
					}	//end browserCheck					






		/*******************************************
		FUNCTION: AddOnload		
		PURPOSE: Used for adding functions to the onLoad 
		         event handler.
		*******************************************/



function AddOnload(myfunc)
{
if(window.addEventListener)
window.addEventListener('load', myfunc, false);
else if(window.attachEvent)
window.attachEvent('onload', myfunc);
}





		/*******************************************
		FUNCTION: getElementsByClassName		
		PURPOSE: Used to grab elements by their
		         class. Eventually, we'll use yui's
		         version of this.
		*******************************************/


function getElementsByClassName(className) { 
results = []; 
walkTheDOM(document.body, mw, className); 
 
                                           } 
                                           
function getElementsByClassName2(className, element) { 

results = []; 
walkTheDOM(element, mw, className); 
 
                                           } //getElementsByClassName				  


//be careful with this function, esp in ff. All noded will be returned, including white space				  
function walkTheDOM(node, func, className) {

   func(node, className); 
   node = node.firstChild; 
     while (node) { 
     walkTheDOM(node, func, className); 
      node = node.nextSibling; 
                  } 
                                            } 
                                            
                                            
 function mw (node, className) { 
  var a, c = node.className, i; 
        
            if (c) { 
                   a = c.split(' '); 
                   for (i = 0; i < a.length; i += 1) { 
                                                        if (a[i] === className) {results.push(node); 
                                                                                 break; 
                                                                                 } //end if (a[i]
                                                     } //end for
                   } //end if (c)
                   }//end mw






function parseURL (regexS) {

regexS = regexS.toLowerCase();
var regex = new RegExp( regexS );
var tmpURL = window.location.href;
GlobaltmpURL = tmpURL.toLowerCase();

var results = regex.exec( GlobaltmpURL );

 if ( results == null )
 return false;
 else if ( typeof(results[0]) == "string" )
 return true;
 else
 return false;
 } //end parseURL


 













                                          
                                            
                                            
                                            
                                            
                                            
                                            
                                            
                                            
                                            

