var min=8;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}
function mainmenu(){
jQuery(" #nav li").hover(function(){
jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn(1);
},function(){
jQuery(this).find('ul:first').fadeOut(1);
});
}
 
jQuery(document).ready(function(){					
mainmenu();
});
jQuery(document).ready(function() {
jQuery('.eco-dev').append('<span class="hover"></span>').each(function () {
  var $span = jQuery('> span.hover', this).css('opacity', 0);
  jQuery(this).hover(function () {
    $span.stop().fadeTo(500, 1);
  }, function () {
    $span.stop().fadeTo(500, 0);
  });
});
});
jQuery(document).ready(function() {
jQuery('.eco-data').append('<span class="hover"></span>').each(function () {
  var $span = jQuery('> span.hover', this).css('opacity', 0);
  jQuery(this).hover(function () {
    $span.stop().fadeTo(500, 1);
  }, function () {
    $span.stop().fadeTo(500, 0);
  });
});
});
jQuery(document).ready(function() {
jQuery('.eco-research').append('<span class="hover"></span>').each(function () {
  var $span = jQuery('> span.hover', this).css('opacity', 0);
  jQuery(this).hover(function () {
    $span.stop().fadeTo(500, 1);
  }, function () {
    $span.stop().fadeTo(500, 0);
  });
});
});
jQuery(document).ready(function() {
jQuery('.publications').append('<span class="hover"></span>').each(function () {
  var $span = jQuery('> span.hover', this).css('opacity', 0);
  jQuery(this).hover(function () {
    $span.stop().fadeTo(500, 1);
  }, function () {
    $span.stop().fadeTo(500, 0);
  });
});
});
/* jQuery(document).ready(function(){
jQuery(".accordion h3:first").addClass("active");
jQuery(".accordion p:not(:first)").hide();
jQuery(".accordion h3").click(function(){
jQuery(this).next("p").slideDown("slow")
.siblings("p:visible").slideUp("slow");
jQuery(this).toggleClass("active");
jQuery(this).siblings("h3").removeClass("active");
});
}); */
jQuery(document).ready(
/*
This function gets loaded when all the HTML, not including the portlets, is
loaded.
*/
function() {
}
);
Liferay.Portlet.ready(
/*
This function gets loaded after each and every portlet on the page.
portletId: the current portlet's id
jQueryObj: the jQuery wrapped object of the current portlet
*/
function(portletId, jQueryObj) {
}
);
jQuery(document).last(
/*
This function gets loaded when everything, including the portlets, is on
the page.
*/
function() {
}
);
function setFontPlus(id){
var size = document.getElementById(id).style.fontSize;
if(size == "" || size == null) {
size = 13;
} else {
size = size.substr(0,2);
}
if(size < 15) {
if(size == 14) {
size = eval(size) + 2;
} else {
size = eval(size) + 1;
}
var fontSize = size + "px";
document.getElementById(id).style.fontSize=fontSize
}
}// end setFontPlus
function setFontMinus(id){
var size = document.getElementById(id).style.fontSize;
if(size == "" || size == null) {
size = 11; 
} else {
size = size.substr(0,2);
} 
if(size > 11) {
if(size == 16) {
size = eval(size) - 2;
} else {
size = eval(size) - 1;
}
var fontSize = size + "px";
document.getElementById(id).style.fontSize=fontSize
}
}
function revertStyles(id){
var size = document.getElementById(id).style.fontSize;
if(size == "" || size == null) {
size = 12; 
} else {
size = size.substr(0,2);
} 
if(size > 10) {
if(size == 16) {
size = 12;
} else {
size = 12;
}
var fontSize = size + "px";
document.getElementById(id).style.fontSize=fontSize
}
changecss('body','color','black');
changecss('a','color','black');
changecss('a:hover','color','#7EACD6');
}
function changecss(theClass,element,value) {
//Last Updated on May 21, 2008
//documentation for this script at
//http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html
 var cssRules;
 if (document.all) {
 cssRules = 'rules';
 }
 else if (document.getElementById) {
 cssRules = 'cssRules';
 }
 var added = false;
 for (var S = 0; S < document.styleSheets.length; S++){
 for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
 if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
 if(document.styleSheets[S][cssRules][R].style[element]){
 document.styleSheets[S][cssRules][R].style[element] = value;
 added=true;
 break;
 }
 }
 }
 if(!added){
 if(document.styleSheets[S].insertRule){
 document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);
 }
 else if (document.styleSheets[S].addRule) {
 document.styleSheets[S].addRule(theClass,element+': '+value+';');
 }
 }
 }
}
// end function changecss
function fontRed(){
changecss('body','color','red');
changecss('a','color','red');
changecss('a:hover','color','blue');
}
function fontBlue(){
changecss('body','color','blue');
changecss('a','color','blue');
changecss('a:hover','color','red');
}
function fontGreen(){
changecss('body','color','green');
changecss('a','color','green');
changecss('a:hover','color','blue');
}
jQuery(document).ready(function() {
//When page loads...
jQuery(".tabs_content").hide(); //Hide all content
jQuery("ul.tabss li:first").addClass("active").show(); //Activate first tab
jQuery(".tabs_content:first").show(); //Show first tab content
//On Click Event
jQuery("ul.tabss li").click(function() {
jQuery("ul.tabss li").removeClass("active"); //Remove any "active" class
jQuery(this).addClass("active"); //Add "active" class to selected tab
jQuery(".tabs_content").hide(); //Hide all tab content
var activeTab = jQuery(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
jQuery(activeTab).fadeIn(); //Fade in the active ID content
return false;
});
});
jQuery(document).ready(function() {
//When page loads...
jQuery(".tabscentric_content").hide(); //Hide all content
jQuery("ul.tabsscentric li:first").addClass("active").show(); //Activate first tab
jQuery(".tabscentric_content:first").show(); //Show first tab content
//On Click Event
jQuery("ul.tabsscentric li").click(function() {
jQuery("ul.tabsscentric li").removeClass("active"); //Remove any "active" class
jQuery(this).addClass("active"); //Add "active" class to selected tab
jQuery(".tabscentric_content").hide(); //Hide all tab content
var activeTab = jQuery(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
jQuery(activeTab).fadeIn(); //Fade in the active ID content
return false;
});
});
