
$(function(){

//preload images with hovering
$('#container').append("<div style='position:absolute; top:-20000px;left:-20000px'><img src='/en_GX/gx/technology/technology-executive-connections/vol7/assets/downloadthesurvey_hover.jpg' /><img src='/en_GX/gx/technology/technology-executive-connections/vol7/assets/downloadthesurvey.jpg' /><img src='/en_GX/gx/technology/technology-executive-connections/vol7/assets/orderacopyy_hover.jpg' /><img src='/en_GX/gx/technology/technology-executive-connections/vol7/assets/orderacopyy.jpg' /><img src='/en_GX/gx/technology/technology-executive-connections/vol7/assets/aboutthesurvey_hover.jpg' /><img src='/en_GX/gx/technology/technology-executive-connections/vol7/assets/aboutthesurvey.jpg' /></div>");




	    /*js pagination*/
	    $(".jmp_links a.number").click(function(){
		 if($(this).hasClass("selected")) return false;
		 $(".jmp_links a.number.selected").removeClass("selected");		 
		 var index =$(this).prevAll("a.number").size();
		
		 $('.jmp_links').find('a.number:eq(' + index + ')').addClass('selected');
		 
		 if($('.jmp_links a.number.selected').next('a.number').size() > 0) $('.jmp_links a.next').css('display','inline-block');  else $('.jmp_links a.next').css('display','none');
		 if($('.jmp_links a.number.selected').prevAll('a.number').size() > 0) $('.jmp_links a.prev').css('display','inline-block'); else $('.jmp_links a.prev').css('display','none');
		 $("div.page:visible").fadeOut(500,function(){
			 $("div.page:eq(" + index + ")").fadeIn();
		 });
		 return false;
	    }); 
	 
	  $(".jmp_links a.next").click(function(){
			$(".jmp_links a.number.selected").next('a.number').click();			
	  });
	  
	  $(".jmp_links a.prev").click(function(){
			$(".jmp_links a.number.selected").prev('a.number').click();			
	  });
	  
	   $(".jmp_links a").hover(
			function(){
				$(this).addClass('hover');
			},
			function(){
				$(this).removeClass('hover');
			}
	   );

/* Explore the data 
	var i = 1;
	var newHTML = '';
	while($('#question'+i).length > 0){
		newHTML =  '<div class = "modalStripe strong">' + $('#question'+i).attr('title') + '<span class="jqmClose"> Close</span></div><div class="modal_content">' + $('#question'+i).html() + 
		           '</div><div class="modalStripe strong"></div>' ;
	
		//<div class="modalcontent">' + $('#question'+i).html() + '</div><div class="modalStripe strong"></div>';
	
		$('#question'+i).html(newHTML).jqm({toTop : true});
		$('#question'+i).jqmAddTrigger($('#question'+i+'_trigger'));
		i++;
	}
*/

	  
	  /**/
	  $('#questions .question_group ul li, #survey_respondant .question_group ul li').hover(
		  function(){
			$(this).addClass('hover');
		  },
		  function(){
			$(this).removeClass('hover');
		  }
	  );

$('#past_issues .publication a').click(function(e){
	e.preventDefault();
	$(this).closest('.publication').click();
	return false;
});

	$('#past_issues .publication').click(function(){
		window.open($(this).find('a').attr('href'));
	});

	  $('#past_issues .publication').hover(
		function(){
			$(this).addClass('hovering');
		},
		function(){
			$(this).removeClass('hovering');
		}	
	  );
	  
	  var download_the_survey_html = 
	           '<div id="downloadbox">' +
			   '<div id="downloadinner">' +
					'<h2>Download the survey</h2>' +
					'<div class="dotted_line">&nbsp;</div>' +
					'<span id="tectitle">Technology executive connections</span> is a series of survey reports designed to provide executives' + 
					'in the technology industries an opportunity to explore, understand and share ideas about' +
					'<img src="/en_GX/gx/technology/technology-executive-connections/vol7/assets/cover.jpg" id="teccover" />' +
					" today's pressing busibess and strategic issues." +
					'<a target="_blank" href="/gx/en/technology/technology-executive-connections/assets/TEC_7_Globalisation_Final_3-24.pdf" >' + 
						'<img id="downloadsurvey" src="/en_GX/gx/technology/technology-executive-connections/vol7/assets/downloadthesurvey.jpg" />&nbsp;' +
						
					'</a>' +
					'<a target="_blank" href="https://www.materialogic.com/webapps/CUSTOM/ORDERSITES/bin/OrderSites/pwc_techcon_int">' +
						'<img id="ordercopy" src="/en_GX/gx/technology/technology-executive-connections/vol7/assets/orderacopyy.jpg" >' +
						
					'</a>' +					
				'</div>' +
				'</div>' ;
	  
	  $('#right .rhcontacts').after(download_the_survey_html);


$('#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')

});



	  
	 /*PwC Connections nav */
	 $('.connblock').hover(function(){
	  $(this).addClass('hovering');
	 },function(){
	  $(this).removeClass('hovering');
	 });

	$('.connblock').click(function(){
   	 $('.connblock').removeClass('selected');
  	  $(this).addClass('selected');

  	  var index =$(this).prevAll(".connblock").size();

  	  $(".page:visible").fadeOut(300,function(){
  	      $(".page:eq(" + index + ")").fadeIn(300);
		$('#right .rhcontacts').html($("#dynamic_contacts .rhcontacts").eq(index).html());
   	 });

});

});



	

