// RollOver
$(function () {
	$.rollover = {
		init : function () {
			$('a img,input[type="image"]').not('[src*="_on."]')
				.bind('mouseover', this.over)
				.bind('mouseout',  this.out)
				.each(this.preload);
		},

		over : function () {
			this.setAttribute('src', this.getAttribute('src').replace('_off.', '_on.'));
		},

		out : function () {
			this.setAttribute('src', this.getAttribute('src').replace('_on.', '_off.'));
		},

		preload : function () {
			new Image().src = this.getAttribute('src').replace('_off.', '_on.');
		}
	};

	$.rollover.init();
});

//extension
$(document).ready(function(){

	$('a[href$=pdf]').addClass('pdf');

	$('a[href$=doc]').addClass('doc');

	$('a[href$=xls]').addClass('xls');
	
//	$("a[@href$=gif]").addClass("img");
	
//	$("a[@href$=jpg]").addClass("img");

//	$("a[@href$=ram]").addClass("sound");

//	$("a[@href$=mp3]").addClass("sound");

});


// PNG fix
if (window.DD_belatedPNG) DD_belatedPNG.fix('h2');



// Highlight
function highlightpage(){
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById("body")) return false;
	var nav = document.getElementById("body");
	var links = nav.getElementsByTagName("a");
	
	for(var i=0; i<links.length; i++){
            var linkurl = links[i].getAttribute("href");
	    var currenturl = window.location.href;
		if(currenturl.indexOf(linkurl) != -1){
		 links[i].className = "selected";		
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", highlightpage, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", highlightpage);
}



// table
$(document).ready(function(){
    $("tr:even,tr td:e").addClass("odd");
    $("tr:odd").addClass("even");
});

