$(document).ready(function(){

//Slideshow
$('#slider_control_clients').prepend('<div class="slider_prev" id="slider_prev_clients">');
$('#slider_control_clients').append('<div class="slider_next" id="slider_next_clients">');
$('#slider_control_clients').append('<div class="slider_stop" id="slider_stop_clients">stop');

$('#slider_control_news').prepend('<div class="slider_prev" id="slider_prev_news">');
$('#slider_control_news').append('<div class="slider_next" id="slider_next_news">');
$('#slider_control_news').append('<div class="slider_stop" id="slider_stop_news">stop');


$("#slider_clients") 
.cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    pager:  '#slider_items_clients' ,
    timeout: 5000,
    pause:   1 ,
    next:   '#slider_next_clients',
    prev:   '#slider_prev_clients'
});

$('#slider_stop_clients').click(
	function () {
		$('#slider_clients').cycle('pause');
	}
)

$("#slider_news") 
.cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    pager:  '#slider_items_news' ,
    timeout: 5000,
    pause:   1 ,
    next:   '#slider_next_news',
    prev:   '#slider_prev_news'
});

$('#slider_stop_news').click(
	function () {
		$('#slider_news').cycle('pause');
	}
)


// $("#product_expander").css({ height : "45em"});
$("#product_expander dd").css({ height : "2em"});
// Product Expander Menu
if($.browser.safari){
		$("#product_expander dd").hover(
			function() {			
				$(this).addClass("hoverstate").stop()
				.animate({
					height : "12em"
				})
				.prev("dt").find("img")
				.animate({
					width : "46px",
					height : "46px"
				});
			},	
		    function() {
		    	$(this).removeClass("hoverstate").stop()
		    	.animate({
		    		height : "2em"
		    	})
		    	.prev("dt").find("img")
		    	.animate ({
		    		width : "30px" ,
		    		height : "30px"
		    	});
		});
	}else{
		$("#product_expander dd").hover(
			function() {			
				$(this).addClass("hoverstate").stop()
				.animate({
					backgroundColor : "#fdfced" ,
					height : "12em"
				})
				.prev("dt").find("img")
				.animate({
					width : "46px",
					height : "46px"
				});
			},	
		    function() {
		    	$(this).removeClass("hoverstate").stop()
		    	.animate({
		    		backgroundColor : "#fff" ,
		    		height : "2em"
		    	})
		    	.prev("dt").find("img")
		    	.animate ({
		    		width : "30px" ,
		    		height : "30px"
		    	});
		});
}

//Login Button and Drop Down Menu   
	$("#login_button").toggle(
		function() {
	   		$("#login").fadeIn('slow')
	   	},
	   	function() {
	   		$("#login").fadeOut('slow')
	   	}
	);
	
// BreadCrumb Menu 

	$("#breadcrumbs ul li a").each(function(){
		if ($(this).hasClass("current") ) 	
		$(this).hover(
			function(){
	     		$(this).stop().animate({ 
					paddingRight : "4em" ,
					paddingLeft : "2em" 
	      		});      		
			},
			function() {
	     		$(this).stop().animate({ 
					paddingRight : "4em" ,
					paddingLeft : "2em" 
	      		});
		});	
		else 	
		$(this).hover(
			function(){
	     		$(this).animate({ 
					paddingRight : "4em" ,
					paddingLeft : "2em"
	      		}).find("span").animate({
	      			width : "12em" ,
	      			opacity : "1"
	      		}, { duration: "slow", queue: false });
			},
			function(){
	     		$(this).stop().animate({ 
					paddingRight : "3.1em" ,
					paddingLeft : "1.1em"
	      		}).find("span").animate({
	      			width : "0" ,
	      			opacity : "0"
	      		}, { duration: "slow", queue: false  });
		});		 
	});	
Standardiser.init();
prepareSlider();	
assignExpanders(); 
});	