
var sliding = false;
var auto = true;
var auto_id =0;
function slide(index){
	var inView = $('.slide:eq(0)');
		
	if(sliding || inView.attr('index') == index) 
		return false;
		
	sliding = true;
	
	$('.index_box').removeClass('selected');
	$('.index_box').eq(index).addClass('selected');
	
	inView.after($('.slide[index='+index+']').remove());

	inView.animate({'marginLeft': '-=625px'}, 'slow','swing',function(){
		$('#slide_container').append($(this).css('margin-left', '').remove());
		sliding=false;
	});
	
	return true;
	
}


function auto_slide(){
	if(auto){
		index = $('.selected').prevAll().length;
		index=(index+1)%5;
		slide(index);
		auto_id = setTimeout("auto_slide()",10000);
	}
}



$(function(){


	$('.index_box').hover(function(){
		$(this).addClass('hovering');
	},function(){
		$(this).removeClass('hovering');
	});

	$('.index_box').click(function(){
		auto = false;
		clearTimeout (auto_id);
		var index = $(this).prevAll().length;
		slide(index);
		
	});


	$("div.navbox").hover(
		function(){$(this).addClass("navboxhover");},
		function(){$(this).removeClass("navboxhover");}
	).click(function(){
		location.href = $(this).find('a').attr('href');
		return false;
	});


	$("#highlightsbottom").hover(
		function(){$(this).addClass("hover");},
		function(){$(this).removeClass("hover");}
	).click(function(){
		location.href = $(this).find('a').attr('href');
		return false;
	});

$('#downloadsurvey').hover(
function(){
$(this).attr('src', '/en_GX/gx/technology/technology-executive-connections/vol7/assets/downloadthesurvey_hover.jpg')

},
function(){
$(this).attr('src', '/en_GX/gx/technology/technology-executive-connections/vol7/assets/downloadthesurvey.jpg')

});

$('#ordercopy').hover(
function(){
$(this).attr('src', '/en_GX/gx/technology/technology-executive-connections/vol7/assets/orderacopyy_hover.jpg')

},
function(){
$(this).attr('src', '/en_GX/gx/technology/technology-executive-connections/vol7/assets/orderacopyy.jpg')

});

$('#about_survey_trigger').hover(
function(){
$(this).attr('src', '/en_GX/gx/technology/technology-executive-connections/vol7/assets/aboutthesurvey_hover.jpg')

},
function(){
$(this).attr('src', '/en_GX/gx/technology/technology-executive-connections/vol7/assets/aboutthesurvey.jpg')

});


	
	auto_id = setTimeout("auto_slide()",10000);

});






