/*** Shorthand of document.getElementById().. *******************************************************/
function $(id) {
	
	// Define variables..
	var elements = new Array();
	
	// For every argument..
	for (i = 0; i < arguments.length; i++) {
		
		// Set element variable..
    	var element = arguments[i];
		
		// Check if element is a string..
    	if (typeof element == 'string') {
      		element = document.getElementById(element);
		}
		
		// If there was only one argument return element..
    	if (arguments.length == 1) {
     		return element;
		}
		
		// If more than one argument add to elements array..
		elements.push(element);

	}
	
	// Return elements array..
	return elements;
}

/*** Add an event to an element.. *******************************************************************/
function addEvent(element, eventType, callFunction, useCapture) {
	
	// Add event listener with some cross-browser stuff..
	if(element.addEventListener) {
		element.addEventListener(eventType, callFunction, useCapture);
	} else if(element.attachEvent) {
		element.attachEvent('on'+eventType, callFunction);
	}

}

/*** Initialize.. ***********************************************************************************/
var over = function() {	

	var archives = $('archives');
	addEvent(archives, 'mouseover', over.archivesOver, false);
	addEvent(archives, 'mouseout', over.archivesOut, false);
	
	var hotlist = $('hotlist');
	addEvent(hotlist, 'mouseover', over.hotlistOver, false);
	addEvent(hotlist, 'mouseout', over.hotlistOut, false);
	
	var aboutus = $('aboutus');
	addEvent(aboutus, 'mouseover', over.aboutusOver, false);
	addEvent(aboutus, 'mouseout', over.aboutusOut, false);

}

/*** Archives.. ************************************************************************************/
over.archivesOver = function() {
	var archives = $('archives');
	archives.src = 'wp-content/themes/celebs/images/archivesover.gif';
}
over.archivesOut = function() {
	var archives = $('archives');
	archives.src = 'wp-content/themes/celebs/images/archives.gif';
}

/*** Hot List.. ************************************************************************************/
over.hotlistOver = function() {
	var hotlist = $('hotlist');
	hotlist.src = 'wp-content/themes/celebs/images/hotlistover.gif';
}
over.hotlistOut = function() {
	var hotlist = $('hotlist');
	hotlist.src = 'wp-content/themes/celebs/images/hotlist.gif';
}

/*** About Us.. ************************************************************************************/
over.aboutusOver = function() {
	var aboutus = $('aboutus');
	aboutus.src = 'wp-content/themes/celebs/images/aboutusover.gif';
}
over.aboutusOut = function() {
	var aboutus = $('aboutus');
	aboutus.src = 'wp-content/themes/celebs/images/aboutus.gif';
}
	

/*** Initialize on window load.. *********************************************************************/
addEvent(window, 'load', over, false);

