/* BANNER CYCLE SCRIPT START */

$.fn.cycle.defaults.timeout = 6000;
$(function() {
    $('#banner-slide').cycle({
    fx:    'scrollHorz',
	speed:  300,
	cleartypeNoBg: true,
    delay: -1000,
	next:   '.right-arrow', 
    prev:   '.left-arrow',
	pause:   1,
	startingSlide: 0
	});
	
	$('#tab-nav .e-commerce').click(function() { 
		$('#banner-slide').cycle(0); 
		$('#banner-slide').cycle('pause');
		return false; 
	});  
	 
	$('#tab-nav .web-development').click(function() { 
		$('#banner-slide').cycle(1); 
		$('#banner-slide').cycle('pause');
		return false; 
	}); 
	
	$('#tab-nav .web-design').click(function() { 
		$('#banner-slide').cycle(2); 
		$('#banner-slide').cycle('pause');
		return false; 
	}); 
	
	$('#tab-nav .seo').click(function() { 
		$('#banner-slide').cycle(3); 
		$('#banner-slide').cycle('pause');
		return false; 
	}); 
	
	/* BANNER CYCLE SCRIPT END */
	
	/* HTML REPLACEMENTS */

	$("#e-commerce-tab h2").html('<h2><img src="images/slide-e-commerce.png" /></h2>');
	$("#web-development-tab h2").html('<h2><img src="images/slide-development.png" /></h2>');
	$("#web-design-tab h2").html('<h2><img src="images/slide-design.png" /></h2>');
	$("#seo-tab h2").html('<h2><img src="images/slide-seo.png" /></h2>');
	$("#web-hosting-tab h2").html('<h2><img src="images/slide-hosting.png" /></h2>');
	$("#portfolio-tab h2").html('<h2><img src="images/slide-portfolio.png" /></h2>');
	$("#contact-top-tab h2").html('<h2><img src="images/slide-contact.png" /></h2>');
	$("#about-tab h2").html('<h2><img src="images/slide-about.png" /></h2>');
	$("#accessibility-tab h2").html('<h2><img src="images/slide-accessibility.png" /></h2>');
	$("#sitemap-tab h2").html('<h2><img src="images/slide-sitemap.png" /></h2>');
	$("#our-services-tab h2").html('<h2><img src="images/slide-our-services.png" /></h2>');
	$("#news-tab h2").html('<h2><img src="images/slide-company-news.png" /></h2>');
	$("#get-a-quote-tab h2").html('<h2><img src="images/slide-get-a-quote.png" /></h2>');
    $("#heading-meet-the-team").html('<h2><img src="images/slide-meet-the-team.png" /></h2>');
}); 

/* RECENT WORK */

$(function() {
		$('#recentwork a').hover(function(){
				$(this).find('img').animate({top:'222px'},{queue:false,duration:500});
		}, function(){
				$(this).find('img').animate({top:'1px'},{queue:false,duration:500});
		});
});

/* MENU FUNCTION */

function mainmenu(){
$(" #topbar-nav ul ").css({display: "none"}); // Opera Fix
$(" #topbar-nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(200);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

/* ON READY ACTIONS */

$(document).ready(function(){					
	$("#drop-form .container div:not(:last)").addClass('bright');
	$("#footer .container div:not(:last)").addClass('bright');
	$("#blocks div:not(:last)").addClass('bright');
	
	$(document).pngFix();
	
	$("#get-a-quote").click(function(){
		$("#drop-form").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
	
	$("#drop-form .form-button-close").click(function(){
		$("#drop-form").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
	
	$(function(){
		$('a.new-window').click(function(){
			window.open(this.href);
			return false;
		});
	});
	
	mainmenu();
});
