// jsEffects.js



// 01. Banner Entry Hover Effect
//------------------------------------------------------------------------------------------

$("#banner_entries li").hover(function(){
      $(this).animate({ 
        marginTop: "-10px"
      }, 500 );
    },
	function(){
	$(this).animate({ 
        marginTop: "3px"
      }, 300 );
	$(this).animate({ 
        marginTop: "0px"
      }, 300 );
	});


$("#banner-nav li").hover(function(){
      $(this).animate({ 
        marginTop: "-10px"
      }, 500 );
    },
	function(){
	$(this).animate({ 
        marginTop: "3px"
      }, 300 );
	$(this).animate({ 
        marginTop: "0px"
      }, 300 );
	});

$(document).ready(function(){

	var bodyid = $('body').attr('id');

	// A. Banner Cycle
	//------------------------------------------------------------------------------------------

	if(bodyid == 'index'){
		$('#banner-rotate').append('<img src="/images/ch_banner_index_002.jpg" />');
		$('#banner-rotate').append('<img src="/images/ch_banner_index_003.jpg" />');
		$(function() {
		eval($('#banner-rotate').cycle({
				fx: 'fade',
				speed: 2000,
				timeout: 2000
				//random: 1,
				//pause: 1
			}));
		});	
	}
	
	if(bodyid == 'index'){
		$(function() {
		eval($('#main-image-banner').cycle({
				fx: 'fade',
				speed: 2000,
				timeout: 2000
				//random: 1,
				//pause: 1
			}));
		});	
	}
	
	if(bodyid == 'activities'){
		$(function() {
		eval($('#banner-rotate-activities').cycle({
				fx: 'fade',
				speed: 2500,
				timeout: 4000
				//random: 1,
				//pause: 1
			}));
		});	
	}


	// B. Sub Navigation
	//------------------------------------------------------------------------------------------

	var config = {    
		sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
		interval: 200,  // number = milliseconds for onMouseOver polling interval    
		over: doOpen,   // function = onMouseOver callback (REQUIRED)    
		timeout: 200,   // number = milliseconds delay before onMouseOut    
		out: doClose    // function = onMouseOut callback (REQUIRED)    
	};
	function doOpen() {
		$('ul:first',this).css('display', 'block');
	}
	function doClose() {
		$('ul:first',this).css('display', 'none');
	}
	$("#nav li").hoverIntent(config);



});

/* HoverIntent */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(6($){$.J.K=6(f,g){8 5={y:7,l:I,H:0};5=$.u(5,g?{v:f,z:g}:f);8 d,b,k,i;8 h=6(3){d=3.G;b=3.B};8 m=6(3,2){2.4=o(2.4);9((w.x(k-d)+w.x(i-b))<5.y){$(2).D("n",h);2.j=1;c 5.v.t(2,[3])}E{k=d;i=b;2.4=r(6(){m(3,2)},5.l)}};8 C=6(3,2){2.4=o(2.4);2.j=0;c 5.z.t(2,[3])};8 q=6(e){8 p=(e.A=="s"?e.N:e.U)||e.T;R(p&&p!=a){S{p=p.O}P(e){p=a}}9(p==a){c Q}8 3=F.u({},e);8 2=a;9(2.4){2.4=o(2.4)}9(e.A=="s"){k=3.G;i=3.B;$(2).M("n",h);9(2.j!=1){2.4=r(6(){m(3,2)},5.l)}}E{$(2).D("n",h);9(2.j==1){2.4=r(6(){C(3,2)},5.H)}}};c a.s(q).L(q)}})(F);',57,57,'||ob|ev|hoverIntent_t|cfg|function||var|if|this|cY|return|cX||||track|pY|hoverIntent_s|pX|interval|compare|mousemove|clearTimeout||handleHover|setTimeout|mouseover|apply|extend|over|Math|abs|sensitivity|out|type|pageY|delay|unbind|else|jQuery|pageX|timeout|100|fn|hoverIntent|mouseout|bind|fromElement|parentNode|catch|false|while|try|relatedTarget|toElement'.split('|'),0,{}))
