$(document).ready(function(){

 
    //Open external links in a new window
    $("a[href^='http:']").attr('target','_blank');

    $("a[href*=pdf]").attr('target','_blank');
    // Mask for slides
    $("#slides .section").append('<img class="mask-slide" src="/image/mask-slide.png" width="441" height="425" alt="" />');
	
	

    // Slides
    $(".home #slides").after('<div class="slides-pager">').cycle({ 
        fx:     'fade', 
        speed:  'slow', 
        pager:  '.slides-pager',
        activePagerClass: 'active-slide',
        cleartype: true,
        timeout: 8000
        // pagerAnchorBuilder: function(idx, slide) { 
        //     return '<span></span>'; 
        // }
    });
    
    $("div#featured-members #slides").cycle();
    
   	// Split Sitemap Page into Columns
   	$(".sitemap_list").easyListSplitter({colNumber: 2});
    
    $('ol li').each(function(index) {
     	$(this).html('<span>'+(index + 1)+'</span>' + $(this).html());
   	});
   
   
   	$("#tech-one").show();
		$("#tech-nav a").click(function(){
			var id = this.href;
			var id = id.split("#");
			var id = id[1];
			$this = $(this);
			$("#tech-info div").hide();
			$this.siblings().removeClass("active");
			$this.addClass("active");
			$("#" + id).fadeIn("slow")
		return false;
	});
	
	$("a.fancybox").fancybox();


//	$("a#inline").fancybox({
//		'hideOnContentClick': true,
//		'padding':0,
//		'scrolling':'no'
//	});



var mySRC =""; 
$("a#inline").fancybox({ 
		'hideOnContentClick': false,
		'padding':0,
		'scrolling':'no',
// other API options etc 
'onComplete': function() { 
//mySRC = $('#video_one_lightbox iframe').attr('src'); 
mySRC = eval("$('"+$(this).attr('href')+"')").find('iframe').attr('src');
}, 

'onClosed': function() { 
eval("$('"+$(this).attr('href')+"')").find('iframe').attr('src',mySRC); 
} 
});

	
    // Select box
    $("select").sb({
        fixedWidth: true,
        animDuration: 0,
        ddCtx: function() { return $(this).closest("form"); }
    });
    
    $(".items li a").click(function(){
        $(this).css("background-color", "#fff")
    });
    
    $(".items li a").hover(function(){
        $(this).css("background-color", "#eee")
    }, function(){
        $(this).css("background-color", "#fff")
    })
    
    $("select#select-month").change(function(){
    	if($(this).val()!="")
    		document.location.href=$(this).val();
    });
    
    $("select#select-category").change(function(){
    	if($(this).val()!="")
    		document.location.href=$(this).val();
    });
    
    $("select#select-metting-category").change(function(){
    	if($(this).val()!="")
    		document.location.href=$(this).val();
    });
    
	

    if ( $("#date-picker").length > 0 ) {
    	$("#date-picker").EventCalendar({
    		calendarEntries: events,
            domEvents: {
                click: function(domEvent, details) {
    				if(details.dayEntries[0].url!="")
    					document.location.href=details.dayEntries[0].url;
                }
            }
    	});
    }

        
});








