//
//
// common.js
// 
//
//

//mouseover

$(function(){
var conf = {
	className : 'btn',
    postfix : '_ov'
  };
  $('.'+conf.className).each(function(){
    this.originalSrc = this.src;
    this.rolloverSrc = this.originalSrc.replace(/(\.gif|\.jpg|\.png)/, conf.postfix+"$1");
    preloadImage(this.rolloverSrc);
  }).hover(function(){
    this.src = this.rolloverSrc;
  },function(){
	this.src = this.originalSrc ;
  });
  
  
  
});

//preloaded
preloadedImages = [];
function preloadImage(url){
	var p = preloadedImages;
	var l = p.length;
	p[l] = new Image();
	p[l].src = url;
}


//locationAccordion

$(function(){
	$("#navLocal li a").each(function(){
		var current_href = this.href;
		if (document.location == current_href) {
			$(this).parent().addClass("active");
		}
	});
});
