function replacemail(a,b,c){
	var e=(a + '@' + b + '.' + c); 
	var f=('<a h' + 'ref="mai' + 'lto:' + e + '" class="email">' + e + '<\/a>');
	document.write(f);
}

jQuery(document).ready(function(){

    // Hide controllers and show the loading.gif until the first photo has loaded
    $('#slide_controllers').hide();
    $('#container').prepend('<div id="loader"><img src="images/loader.gif" alt=""/></div>');

    // Function to call after the photo has loaded
	var intervalID;
    function myCallback() {
	   $('#loader').fadeOut('slow');
       $('#slide_controllers').fadeIn('slow');

       $('#right_col').cycle({
        prev:   '#prev', 
	    next:   '#next', 
        timeout:0,     // do not advance automatically
        fit:    0,     // force slides to fit container 
	    pause:  0      // true to enable "pause on hover" 
       });

       $('body.front #section_img').cycle({
        timeout:0,    // do not advance automatically
	    fit:    0,    // force slides to fit container 
	    pause:  0     // true to enable "pause on hover" 
       });

		 // Because the two cycles were falling out of sync on the front page,
	     // here is a dedicated function to step forward the two at the same time
	
		 intervalID = window.setInterval(
	        function() {
			  $('#right_col').cycle('next');
			  $('body.front #section_img').cycle('next');
		    }, 4000
	     );

     }
       
     $('#right_col')
       .find('img')
       .batchImageLoad({loadingCompleteCallback: myCallback});


    // Pause slideshow on hover of controllers

	$('#slide_controllers').hover(
        function(){clearInterval(intervalID);}, 
		function(){
           intervalID = window.setInterval(
	           function(){
                 $('#right_col').cycle('next');
			     $('body.front #section_img').cycle('next');
		       }, 4000
           );
        }
    );
		
	$('a').click( 
		function() {
			this.blur();
		} 
	);

});
