fade_speed = 500;
delay_time = 5000;
disable_menu_effect = 1;
disable_submenu_effect = 1;
main_menu_a = "#000000";
main_menu_a_hover = "#89BAFF";
submain_menu_a = "#FFFFFF";
submain_menu_a_hover = "#89BAFF";

$(function() {
	$('#slideshow').cycle({
		speed:       fade_speed,
		timeout:     delay_time,
		delay:       0, 
		pager:      '#nav',
		pagerEvent: 'click',
		pauseOnPagerHover: true,
		pagerAnchorBuilder: function(idx, slide) {
			return '#recentimages li:eq(' + idx + ')';
		} 
	});

	
	$('#news_ticker').cycle({ 
		cleartype:  10,
		cleartypeNoBg: true
	});
});
$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) {
	$(pager).find('li').removeClass('selected').filter('li:eq('+currSlideIndex+')').addClass('selected');
};

/* Starting the site scripts */
$(document).ready(function(){ 
	if(disable_submenu_effect == 1){
		superfish_dropdown();
	}
	banner_buttons();   
	slideshow_control();   
	go_top();
	portfolio_zoom();
	
	$(".activefocus").focus(function () {
			if ($(this).attr("value") == $(this).attr("defaultValue")) {
					$(this).attr("value", '');
			}

	});

	$(".activefocus").blur(function () {
			if ($(this).attr("value") == '') {
					$(this).attr("value", $(this).attr("defaultValue"));
			}

	});
});

/* Banner Button Effect */
function banner_buttons(){
	$('#recentimages li').append('<div class="hover"></div>');  
	$('#recentimages li').hover(  
		function() {  
			$(this).children('div').fadeIn('500');   
		},   
		function() {  
			$(this).children('div').fadeOut('500');      
		}).click(function () {
			$('#recentimages li').removeClass('selected');
			$(this).addClass('selected');
			return false;
		});

	$('#recentimages_details li').append('<div class="hover_details"></div>');  
	$('#recentimages_details li').hover(  
		function() {  
			$(this).children('div').fadeIn('500');   
		},   
		function() {  
			$(this).children('div').fadeOut('500');      
		}).click(function () {
			$('#recentimages_details li').removeClass('selected');
			$(this).addClass('selected');
			return false;
		});

}

/* Slide show play & pause */
function slideshow_control(){
	$('#slideshow').hover(  
		function() {
			jQuery('#slideshow').cycle('pause')
		},   
		function() {  
		 	jQuery('#slideshow').cycle('resume')
	});
	$('#slideshow_details').hover(  
		function() {
			jQuery('#slideshow_details').cycle('pause')
		},   
		function() {  
		 	jQuery('#slideshow_details').cycle('resume')
	});
}
