function RGBtoHex(R,G,B) {
return toHex(R) + toHex(G) + toHex(B);
}
function toHex(N) {
if (N == null){
return "00";
}
N = parseInt(N);
if (N == 0 || isNaN(N)) {
return "00";
}
N = Math.max(0,N);
N = Math.min(N,255);
N = Math.round(N);
return "0123456789ABCDEF".charAt((N - N % 16) / 16) + "0123456789ABCDEF".charAt(N % 16);
}
$(document).ready(function() {
$("body").css({
"background": "#9cb70a url(/bg.php?scolor=3a4206&ecolor=9cb70a&h=" + $(document).height() + ") repeat-x"
});
$("a[rel*='lightbox']").lightBox();
if ($("#team-content").height() > $("#content-wrapper").height() && $("#team-content>div").hasClass("left")) {
var limit = Math.floor($("#content-wrapper").height() / ($("#team-content>div>p").height() + 5))
var count = 0;
var divLeft = $("
");
var divRight = $("");
$("#team-content>div").children().each(function () {
count++;
if (count >= limit) {
divRight.append($(this));
}
else {
t.append($(this));
}
});
$("#team-content>div").empty();
$("#team-content>div").html(divLeft.html());
$("#main").height(0);
$("#main").height($(document).height() - 310);
$("#content-wrapper").height($("#main").height() - 150);
$("#team-content").append(divRight);
}
$(".research-project-content:last").css({
"border": "0"
});
if ($.browser.msie) {
$("#home-right").css({
"margin-right": "-13px"
});
}
$(".gradient-background").each(function () {
var left = $("
");
var right = $("
");
left.attr("src", "/style/images|top-left.png");
left.css({
"float": "left"
});
right.attr("src", "/style/images|top-right.png");
right.css({
"float": "right"
});
var color = $(this).css("background-color");
if ($.browser.msie) {
color = color.replace(/#/i, "");
}
else {
color = color.replace(/RGB\(/i, "");
color = color.replace(/\)/i, "");
color = color.split(", ", 3);
color = RGBtoHex(color[0], color[1], color[2]);
}
$(this).css({
"background": "#fdfefc url(/bg.php?scolor=" + color + "&ecolor=fcfcfa&h=" + $(this).height() + ") repeat-x"
});
$(this).prepend(right);
$(this).prepend(left);
});
$(".gradient-background2").each(function () {
var color = $(this).css("background-color");
if ($.browser.msie) {
color = color.replace(/#/i, "");
}
else {
color = color.replace(/RGB\(/i, "");
color = color.replace(/\)/i, "");
color = color.split(", ", 3);
color = RGBtoHex(color[0], color[1], color[2]);
}
$(this).css({
"background": "#fdfefc url(/bg.php?scolor=" + color + "&ecolor=fcfcfa&h=" + $(this).height() + ") repeat-x"
});
});
$(".news-group").click(function () {
var year = $(this).attr("id");
if ($("#news-" + year).css("display") != "none") {
$.scrollTo(0, 800, {onAfter:function () {
$("#news-" + year).slideToggle("slow", function() {
$("#downarrow-" + year).toggle();
$("#uparrow-" + year).toggle();
});
}});
}
else {
$("#news-" + year).slideToggle("s", function() {
$("#downarrow-" + year).toggle();
$("#uparrow-" + year).toggle();
$.scrollTo($(this), 800, {offset:-50});
});
}
});
});