/*JICS THEME SCRIPT - SAFETYby cornerstone interactivecornerstoneinteractive.comproduction version should be minified and cached foroptimum portal performance*/// Execute on DOM Ready$(function(){  csTabs();  $('body').supersleight();  csSBCurrent();  csSiteManager();  csPortletHeaders();  //csSlideshow();}); // Execute on Window Resize$(window).resize(function(){  csTabOverflow();});/* =Do not edit below this line-----------------------------------------*/function csSiteManager() {  if ($('#sideBar').children().length==0){    $('#sideBar').css('display','none');  }}function csBannerHeight() {  newHeight = $('#masthead').height() + $('#headerTabs ul').height();  $('#masthead').css('height',newHeight + 'px');}function csSBCurrent() {  if ($('li.currentPage ul').length>0){     $('li.currentPage').prepend('<a id="xpndPrtlts" href="javascript:void(0);" title="View Portlets on this page">view</a>');    $('#xpndPrtlts').click(function(){      $('li.currentPage ul').toggle();      if($('li.currentPage ul').is(':visible')){        $(this).addClass('expanded');      }else{       $(this).removeClass('expanded');          }    });       //If portlet is clicked, expand portlet list    $('li.currentPage ul li a').each(function(){      if (location.href.indexOf($(this).attr('href'),0)>-1){        $('li.currentPage ul').show();        $(this).addClass('selected');      }else{        $('li.currentPage ul').hide().removeClass('expanded');      }    });  }}function csFeature() {// First portlet full-width in the 'Feature' location if custom content  if (($('.pColumn1 .portlet:eq(0) .wysiwygtext').length>0)&&($('.pColumn2 .portlet:eq(0) .wysiwygtext').length==0)){$('.pColumn1 .portlet:eq(0)').appendTo($('#feature'));}}function csSlideshow() {// Start a slideshow of content if there is more than one child element	$('.slideshow').each(function(){    $(this).css('display','block');		if ($(this).children().length>1) {      $('head').append('<script src="ui/common/scripts/cycle.js"></script>');      $(this).cycle();    }    	});}function csAjax(module){// Load content from link asynchronously  if (module.attr('href').indexOf('http')>-1){    ajaxFrame = module.replaceWith('<iframe class="ajaxFrame" src="'+module.attr('href')+'" width='+module.attr('title')+' frameborder="0" />');  }else{   module.parent().load(module.attr('href'));   module.remove();  }}function csIframe(){	o = document.getElementsByTagName('iframe');	for(i=0;i<o.length;i++){		if (/\bautoHeight\b/.test(o[i].className)){			csHeight(o[i]);			csEvent(o[i],'load', csIframe);		}	}}function csHeight(e){	if(e.contentDocument){		e.height = e.contentDocument.body.offsetHeight + 35;	} else {		e.height = e.contentWindow.document.body.scrollHeight;	}}function csEvent(obj, evType, fn){	if(obj.addEventListener)	{	obj.addEventListener("on"+evType, fn,false);	return true;	} else if (obj.attachEvent){	var r = obj.attachEvent("on"+evType, fn);	return r;	} else {	return false;	}}function csPortletHeaders() {  $('.pHead div').hide();  // Show Portlet Head icons on mouseover  $(".pHead").mouseover(function(){$("div",this).show();}).mouseout(function(){$("div",this).hide();});  // Move edit icon to Portlet Head  $("div[id*=divEditOrAdd]").each(function(){$(this).appendTo($(this).closest('.portlet').find('.pHead div'));$(this).css({'display':'block','margin':'0 32px 0 0'})});}if (document.getElementById && document.createTextNode){ csEvent(window,'load', csIframe);	}jQuery.fn.supersleight = function(settings) {	settings = jQuery.extend({		imgs: true,		backgrounds: true,		shim: 'images/blank.gif',		apply_positioning: true	}, settings);		return this.each(function(){		if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 7 && parseInt(jQuery.browser.version, 10) > 4) {			jQuery(this).find('*').andSelf().each(function(i,obj) {				var self = jQuery(obj);				// background pngs				if (settings.backgrounds && self.css('background-image').match(/\.png/i) !== null) {					var bg = self.css('background-image');					var src = bg.substring(5,bg.length-2);					var mode = (self.css('background-repeat') == 'no-repeat' ? 'crop' : 'scale');					var styles = {						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')",						'background-image': 'url('+settings.shim+')'					};					self.css(styles);				};				// image elements				if (settings.imgs && self.is('img[src$=png]')){					var styles = {						'width': self.width() + 'px',						'height': self.height() + 'px',						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + self.attr('src') + "', sizingMethod='scale')"					};					self.css(styles).attr('src', settings.shim);				};				// apply position to 'active' elements				if (settings.apply_positioning && self.is('a, input') && (self.css('position') === '' || self.css('position') == 'static')){					self.css('position', 'relative');				};			});		};	});};function csTabs() {  $('#headerTabs').append("<a id='more'>more</a>");  $('#more').css('display','none');  $('#more').append("<ul id='moreList'></ul>");  $('#more').mouseenter(function(){showMore();});  $('#more').mouseleave(function(){hideMore();});  csTabOverflow();}function showMore(){  $('#more').addClass('moreSelected');  $('#moreList').css('display','block');}function hideMore(){  if (!$('#moreList .selected').length>0){ $('#more').removeClass('moreSelected');}  $('#moreList').css('display','none');}function csTabOverflow(){  try  {    //Move all tabs to tab container    $('#moreList li').each(function(){      $('#headerTabs ul').append($(this));    });        $('#moreList').empty();    //Check width and move as needed    tabTotalWidth = 0;    $('#headerTabs ul li').each(function(){      tabTotalWidth += $(this).width();      if (tabTotalWidth>($('#headerTabs').width()-100))      {        $('#more').css('display','block');        $('#more').css('margin-left',$('#headerTabs').width()-60);        $('#moreList').append($(this));      }          });    if ($('#moreList .selected').length>0){ $('#more').addClass('moreSelected');}else{ $('#more').removeClass('moreSelected');}  }catch(e){}}
