


/*
$(function () {
    var d1 = [];
    for (var i = 0; i < 14; i += 0.5)
        d1.push([i, Math.sin(i)]);

    var d2 = [[1196463600000, 0], [1196550000000, 0], [1196636400000, 0], [1196722800000, 77], [1196809200000, 553], [1196895600000, 579], [1196982000000, 1200], [1197068400000, 1086], [1197154800000, 676], [1197241200000, 1205], [1197327600000, 906], [1197414000000, 710], [1197500400000, 639], [1197586800000, 540], [1197673200000, 435], [1197759600000, 301], [1197846000000, 575], [1197932400000, 481], [1198018800000, 591], [1198105200000, 608], [1198191600000, 459], [1198278000000, 234], [1198364400000, 1352], [1198450800000, 686], [1198537200000, 279], [1198623600000, 449], [1198710000000, 468], [1198796400000, 392], [1198882800000, 282], [1198969200000, 208], [1199055600000, 229], [1199142000000, 177], [1199228400000, 374], [1199314800000, 436], [1199401200000, 404], [1199487600000, 253], [1199574000000, 218], [1199660400000, 476], [1199746800000, 462], [1199833200000, 448], [1199919600000, 442], [1200006000000, 403], [1200092400000, 204], [1200178800000, 194], [1200265200000, 327], [1200351600000, 374], [1200438000000, 507], [1200524400000, 546], [1200610800000, 482], [1200697200000, 283], [1200783600000, 221], [1200870000000, 483], [1200956400000, 523], [1201042800000, 528], [1201129200000, 483], [1201215600000, 452], [1201302000000, 270], [1201388400000, 222], [1201474800000, 439], [1201561200000, 559], [1201647600000, 521], [1201734000000, 477], [1201820400000, 442], [1201906800000, 252], [1201993200000, 236], [1202079600000, 525], [1202166000000, 477], [1202252400000, 386], [1202338800000, 409], [1202425200000, 408], [1202511600000, 237], [1202598000000, 193], [1202684400000, 357], [1202770800000, 414], [1202857200000, 393], [1202943600000, 353], [1203030000000, 364], [1203116400000, 215], [1203202800000, 214], [1203289200000, 356], [1203375600000, 399], [1203462000000, 334], [1203548400000, 348], [1203634800000, 243], [1203721200000, 126], [1203807600000, 157], [1203894000000, 288]];

    // a null signifies separate line segments
    var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];
    
    $.plot($("#chartholder"), [ d2 ],{ xaxis: { mode: "time" } });
});
*/

Object.extend = function(destination, source) {
  for (property in source) {
    destination[property] = source[property];
  }
  return destination;
};


$(document).ready(function(){ 
    $('#mboxann').hide();
	$('#mboxann-text').hide();
	//$('#mboxedu').hide();
	//$('#mboxedu-text').hide();  
   	//$('#mboxap').hide();
	//$('#mboxap-text').hide();	
	
});
		
/* $(document).ready(function(){ 
  $('a.edu').click(function() {
	$('#mboxedu').toggle(800);
	$('#mboxedu-text').toggle(800);
	$('#mboxann').hide();
	$('#mboxann-text').hide();
	$('#mboxap').hide();
	$('#mboxap-text').hide();
	return false;
  });
});
 
  $(document).ready(function(){ 
  $('a.ap').click(function() {
	$('#mboxap').toggle(800);
	$('#mboxap-text').toggle(800);
	$('#mboxann').hide();
	$('#mboxann-text').hide();
	$('#mboxedu').hide();
	$('#mboxedu-text').hide();
	return false;
  });
  
  
  
   $('a.ann').click(function() {
		$('#mboxann').toggle(800);
		$('#mboxann-text').toggle(800);
    $('#mboxedu').hide();
	$('#mboxedu-text').hide();
	$('#mboxap').hide();
	$('#mboxap-text').hide();
	return false;
  });  
});*/

		
$(document).ready(function(){
						   
// show ann box when the page load						   
	$('#mboxann').toggle(800);
	$('#mboxann-text').toggle(800);
  
/*index page slides show*/
  $('#indexbg').show();
  
  $('#indexbg').cycle({ 
    fx:    'fade', 
	timeout:  3500,
    speed:  1000 
   });

/*left navigation animation*/
  $("ul#navigation li.about span.activator").toggle(function() {
  $("ul#navigation li.about").addClass("open").find("ul").slideDown("normal").end();
  		},function(){
  $("ul#navigation li.about").removeClass("open").find("ul").slideUp("normal").end();
  });
  
  $("ul#navigation li.aprogram span.activator").toggle(function() {
  $("ul#navigation li.aprogram").addClass("open").find("ul").slideDown("normal").end();
  		},function(){
  $("ul#navigation li.aprogram").removeClass("open").find("ul").slideUp("normal").end();
  });

  $("ul#navigation li.resources span.activator").toggle(function() {
  $("ul#navigation li.resources").addClass("open").find("ul").slideDown("normal").end();
  		},function(){
  $("ul#navigation li.resources").removeClass("open").find("ul").slideUp("normal").end();
  });
  
  

  
  
  
  
 // toggles the slickbox on clicking the noted link

});




SlideShow = function() { this.init.apply(this, arguments); }

SlideShow.prototype = {
	init: function(options) {
		var dOptions = {
			autoStart: true,
			interval: 2500,
			selector: '#mast',
			stopOnHover: true,
			fade: 'normal'
		};
		
		this.options = Object.extend(dOptions, options);
		if (this.options.autoStart)
			this.go();
	},

	go: function() {
		$(this.options.selector).css('position', 'relative');
		

		this.divs = $(this.options.selector + ' div').css({
			display: 'none',
			position: 'absolute'
		}).get();

		this.count = this.divs.length;

		this.divs[0].style.display = 'block';
		
		this.curDiv = this.divs[0];
		
		this.initEvents();
		this.start();
	},

	initEvents: function() {
		var self = this;
		
		$(this.options.selector + '-controls .ss-next').click(function() {
			self.next.apply(self);
			return false;
		});

		$(this.options.selector + '-controls .ss-prev').click(function() {
			self.prev.apply(self);
			return false;
		});

		$(this.options.selector + '-controls .ss-start').click(function() {
			self.start.apply(self);
			return false;
		});

		$(this.options.selector + '-controls .ss-stop').click(function() {
			self.stop.apply(self);
			return false;
		});

		$('a[@href$="' + this.options.selector + '"]').click(function() {
			self.stop();
			var cClass = this.className;
			var selector = self.options.selector + ' .' + cClass;
			var switchTo = $(selector).get(0);
			
			if (switchTo == self.curDiv) return false;
			
			self.switchPanes.apply(self, [switchTo]); 
			return false;
		});

		if (this.options.stopOnHover) {
			$(this.options.selector + ' div').hover(function() { self.stop.apply(self); }, function() { self.start.apply(self); });
		}
	},

	getNext: function(div) {
		for (var i = 0; i < this.count; i++) {
			if (this.divs[i] == div) break;
		}
		
		if (i == this.count - 1) return this.divs[0];
		return this.divs[i + 1];
	},
	
	getPrev: function(div) {
		for (var i = 0; i < this.count; i++) {
			if (this.divs[i] == div) break;
		}
		
		if (i == 0) return this.divs[this.count - 1];
		return this.divs[i - 1];

	},
	
	start: function() {
		var self = this;
		this.theInterval = setInterval(function() { self.next.apply(self); }, this.options.interval);
	},

	stop: function() {
		clearInterval(this.theInterval);
	},

	next: function() {
		this.switchPanes(this.getNext(this.curDiv));
	},

	prev: function() {
		this.switchPanes(this.getPrev(this.curDiv));
	},

	switchPanes: function(pNew) {
		this.curDiv.style.zIndex = 50;
		pNew.style.zIndex = 100;
		
		var self = this;
		
		$(pNew).fadeIn(this.options.fade, {
			onComplete: function() {
				$(self.curDiv).hide();
				self.curDiv = pNew;
			}
		});
	},

	getAnchor: function(s){
	  var strReturn = '';
	  if ( s.indexOf('#') > -1 )
	   	strReturn = s.substr(s.indexOf('#') + 1).toLowerCase();

  	return strReturn;
	}
	
};

			$(document).ready( function() {
				new SlideShow();
				
		
				
			}); 
			
			
			
			
$(function () {
  $('.bubbleInfo').each(function () {
    // options
    var distance = 10;
    var time = 250;
    var hideDelay = 300;

    var hideDelayTimer = null;

    // tracker
    var beingShown = false;
    var shown = false;
    
    var trigger = $('.trigger', this);
    var popup = $('.popup', this).css('opacity', 0);

    // set the mouseover and mouseout on both element
    $([trigger.get(0), popup.get(0)]).mouseover(function () {
      // stops the hide event if we move from the trigger to the popup element
      if (hideDelayTimer) clearTimeout(hideDelayTimer);

      // don't trigger the animation again if we're being shown, or already visible
      if (beingShown || shown) {
        return;
      } else {
        beingShown = true;

        // reset position of popup box
        popup.css({
          top: -100,
          left: -33,
          display: 'block' // brings the popup back in to view
        })

        // (we're using chaining on the popup) now animate it's opacity and position
        .animate({
          top: '-=' + distance + 'px',
          opacity: 1
        }, time, 'swing', function() {
          // once the animation is complete, set the tracker variables
          beingShown = false;
          shown = true;
        });
      }
    }).mouseout(function () {
      // reset the timer if we get fired again - avoids double animations
      if (hideDelayTimer) clearTimeout(hideDelayTimer);
      
      // store the timer so that it can be cleared in the mouseover if required
      hideDelayTimer = setTimeout(function () {
        hideDelayTimer = null;
        popup.animate({
          top: '-=' + distance + 'px',
          opacity: 0
        }, time, 'swing', function () {
          // once the animate is complete, set the tracker variables
          shown = false;
          // hide the popup entirely after the effect (opacity alone doesn't do the job)
          popup.css('display', 'none');
        });
      }, hideDelay);
    });
  });
});			