/**
 * Name: scripts/front.js
 * Author: Abhishek Dilliwal (abhishekdilliwal@yahoo.com)
 * Date: 13 oct 2008
 * Description: front page specific javascripts
 */


function mycarousel_itemLoadCallback(carousel, state)
{
    for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }

        if (i > mycarousel_itemList.length) {
            break;
        }

        carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[i-1]));
    }
};

 
 
$(document).ready(function(){
	/*
	$("#event_cover").hover(
	function () {
		$("#event_content").animate({ height: '250px'}, 800);
	
	},
	function () {
		$("#event_content").animate({ height: '100px'}, 300);
	}
	); //end of hover on events
	
	$("#news_cover").hover(
	function () {
		$("#news_content").animate({ height: '250px'}, 800);
	
	},
	function () {
		$("#news_content").animate({ height: '100px'}, 300);
	}
	); //end of hover on news	
	*/

	 jQuery('#mycarousel').jcarousel({
        size: mycarousel_itemList.length,
        scroll: 1,
        animation: 700,
        auto: 10,
        wrap: "last",
        itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback}
    });
    
     $("#toggle_event").toggle(

					function () {
						$("#event_content").animate({ height: 'hide', opacity: 0}, 500);
						$(".toggle_event_btn").toggle();
					}, 
					function () {
						$("#event_content").animate({ height: "show", opacity: 1}, 800);
						$(".toggle_event_btn").toggle();
					}
    );   

     $("#toggle_news").toggle(
					function () {
						$("#news_content").animate({ height: 'hide', opacity: 0}, 500);
						$(".toggle_news_btn").toggle();
					},
					function () {
						$("#news_content").animate({ height: 'show', opacity: 1}, 800);
						$(".toggle_news_btn").toggle();
					} 
    );     
  
     $("#toggle_qklinks").toggle(
					
					function () {
						$("#qklinks_content").animate({ height: 'hide', opacity: 0}, 500);
						$(".toggle_qklinks_btn").toggle();
					},					
					function () {
						$("#qklinks_content").animate({ height: 'show', opacity: 1}, 800);
						$(".toggle_qklinks_btn").toggle();
					}
 
    );    


    
});//end of document ready()