﻿/******************************************************
	Research Activities Homepage Block JS
******************************************************/

swfobject.registerObject("404_flash", "9.0.0", "swfobject/expressInstall.swf");

jQuery(document).ready( function() {

	jQuery(".btn_trailer").attr('href', '#TB_inline?height=370&width=570&inlineId=trailer_code').addClass('thickbox');
	
	jQuery("#content a[href$=.jpg]").each(function() {
		
		jQuery(this).addClass('thickbox');
		
	});
	
		jQuery("#content a[href$=.JPG]").each(function() {
			
			jQuery(this).addClass('thickbox');
			
		});
	
	jQuery("#content a[href$=.gif]").each(function() {
		
		jQuery(this).addClass('thickbox');
		
	});
	
		jQuery("#content a[href$=.GIF]").each(function() {
		
			jQuery(this).addClass('thickbox');
			
		});
	
	jQuery("#content a[href$=.jpeg]").each(function() {
		
		jQuery(this).addClass('thickbox');
		
	});
	
		jQuery("#content a[href$=.JPEG]").each(function() {
			
			jQuery(this).addClass('thickbox');
			
		});
	
	jQuery("#content a[href$=.png]").each(function() {
		
		jQuery(this).addClass('thickbox');
		
	});
	
		jQuery("#content a[href$=.PNG]").each(function() {
			
			jQuery(this).addClass('thickbox');
			
		});
		
	
});

/******************************************************/
/******************************************************
	Main Navigation Background Animations
******************************************************/

/**
 * @author Alexander Farkas
 * v. 1.02
 */
/*
(function($) {
	$.extend($.fx.step,{
	    backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
			}
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
	});
})(jQuery);

jQuery(document).ready( function() {

		jQuery('#main_nav #nav_department')
		.css({backgroundPosition: "0 0"})
		.mouseover(function(){
			jQuery(this).stop().animate({backgroundPosition:"(0 -235px)"}, {duration:1});
			jQuery('#main_nav #nav_department .icon').addClass('icon_over');
			jQuery('#main_nav #nav_department .icon').removeClass('icon');
		})
		.mouseout(function(){
			jQuery(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:1});
			jQuery('#main_nav #nav_department .icon_over').addClass('icon');
			jQuery('#main_nav #nav_department .icon_over').removeClass('icon_over');
		})

});
*/

/******************************************************/
/******************************************************
	FUNCTIONS TO EMPTY AND RE-FILL A TEXT FIELD
******************************************************/

function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
	thisfield.value = "";
	}
}

function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
	thisfield.value = defaulttext;
	}
}

/******************************************************/
