Array.prototype.indexOf = function(str) {
	for (i=0;i<this.length;i++) {
		if (str == this[i]) return i;
	}
	return -1;
}
/*
String.prototype.lastIndexOf = function(str) {
	
}
*/
//use for highlighting a particular link, meaning you are on the page.
var links = ['css', 'about', 'committee', 'activities', 'event', 'contact'];

var loc = window.location.toString();
//throw the last slash
loc = loc.substring(0, loc.length-1);
var page = loc.substring(loc.lastIndexOf('/')+1);

var pageId = links.indexOf(page);

$(document).ready(function() {
	$('#header div a').mouseover(function() {
		if ($(this).attr('id') == 'link_'+pageId) return;
		var anchorId = $(this).attr('id').toString();
		var id = anchorId.substring(anchorId.indexOf('_')+1);
		$(this).children('img').fadeTo(100, 1);
	});
	$('#header div a').mouseout(function() {
		if ($(this).attr('id') == 'link_'+pageId) return;
		var anchorId = $(this).attr('id').toString();
		var id = anchorId.substring(anchorId.indexOf('_')+1);
		$(this).children('img').fadeTo(0, 0.3);
	});
	
	//the search-box, the anchor there..
	$('#search-box a').click(function() {
		$(this).next().submit();
	});
	
	setTimeout(function(){
		$('#sidebar').css('height',$('#wrapper').height());
		$('#sidebar-left').css('height',$('#wrapper').height()-50);
	}, 100);

	$('#link_'+pageId).children('img').fadeTo(10,1);
});

