Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n>1)); }, 'strings': {"Edit":"Edita","Upload":"Carregueu","Configure":"Configura","Not published":"No publicat","Your server has been successfully tested to support this feature.":"Ha estat comprovat satisfact\u00f2riament que el vostre servidor pot fer servir aquesta funcionalitat.","Your system configuration does not currently support this feature. The \u003ca href=\"http:\/\/drupal.org\/node\/15365\"\u003ehandbook page on Clean URLs\u003c\/a\u003e has additional troubleshooting information.":"La vostra configuraci\u00f3 de sistema no pot fer servir aquesta funcionalitat. A la p\u00e0gina \u003ca href=\"http:\/\/drupal.org\/node\/15365\"\u003e del manual d'URL nets\u003c\/a\u003e trobareu informaci\u00f3 addicional per solucionar-ho.","Testing clean URLs...":"S'estan provant els URL nets...","Select all rows in this table":"Selecciona totes les fileres d'aquesta taula","Deselect all rows in this table":"Deselecciona totes les fileres d'aquesta taula","Join summary":"Uneix el resum","Split summary at cursor":"Separa el resum al cursor","Drag to re-order":"Arrossegueu per canviar l'ordre","Changes made in this table will not be saved until the form is submitted.":"Els canvis fets en aquesta taula no es guardaran fins que no envieu el formulari.","Unspecified error":"Error no especificat","An error occurred. \n@uri\n@text":"Hi ha hagut un error.\r\n@uri\r\n@text","An error occurred. \n@uri\n(no information available).":"Hi ha hagut un error.\r\n@uri\r\n(informaci\u00f3 no disponible).","An HTTP error @status occurred. \n@uri":"Hi ha hagut un error HTTP @status\r\n@uri","Only files with the following extensions are allowed: %files-allowed.":"Nom\u00e9s els arxius amb les seg\u00fcents extensions estan permesos: %files-allowed","The changes to these blocks will not be saved until the \u003cem\u003eSave blocks\u003c\/em\u003e button is clicked.":"Els canvis fets a aquest bloc no es desaran fins que no es premi el bot\u00f3 \u003cem\u003eDesar blocs\u003c\/em\u003e.","Show":"Mostra","Remove group":"Elimina el grup","Apply (all displays)":"Aplica (a totes les presentacions)","Apply (this display)":"Aplica (a aquesta presentaci\u00f3)","Done":"Fet","Please wait...":"Si us plau, espereu...","Hide":"Oculta","Loading":"Carregant","By @name on @date":"Per @name el @date","By @name":"Per @name","Not in menu":"No est\u00e0 al men\u00fa","Alias: @alias":"\u00c0lies: @alias","No alias":"No hi ha \u00e0lies","New revision":"Nova revisi\u00f3","Show shortcuts":"Mostra els accessos directes","This permission is inherited from the authenticated user role.":"Aquest perm\u00eds s'hereta del rol d'usuari autentificat.","No revision":"No hi ha cap revisi\u00f3","@number comments per page":"@number comentaris per p\u00e0gina","Not restricted":"Sense restriccions","(active tab)":"(pestanya activa)","An AJAX HTTP error occurred.":"Hi ha hagut un error HTTP d'AJAX.","HTTP Result Code: !status":"Codi de resultat HTTP: !status","An AJAX HTTP request terminated abnormally.":"Una petici\u00f3 HTTP d'AJAX ha acabat de forma anormal.","Debugging information follows.":"A continuaci\u00f3 hi ha informaci\u00f3 de depuraci\u00f3.","Path: !uri":"Cam\u00ed: !uri","StatusText: !statusText":"StatusText: !statusText","ResponseText: !responseText":"ResponseText: !responseText","ReadyState: !readyState":"ReadyState: !readyState","Not customizable":"No personalitzable","Restricted to certain pages":"Restringit a certes p\u00e0gines","The block cannot be placed in this region.":"No es pot posar el bloc en aquesta regi\u00f3.","Customize dashboard":"Personalitza el tauler","Hide summary":"Amaga el resum","Edit summary":"Edita el resum","@title dialog":"Quadre de @title","Re-order rows by numerical weight instead of dragging.":"Reordeneu les files per pes num\u00e8ric en comptes d'arrossegar-les.","Show row weights":"Mostra el pes de les files","Hide row weights":"Amaga el pes de les files","Autocomplete popup":"Autocompleci\u00f3 en finestra emergent","Searching for matches...":"Buscant coincid\u00e8ncies...","Hide shortcuts":"Amaga els accessos directes"} };;
jQuery(document).ready(function($) {	

	//Set Default State of each portfolio piece
	$(".paging").show();
	$(".paging a:first").addClass("active");

	//Get size of images, how many there are, then determin the size of the image reel.
	var imageWidth = $(".window").width();
	var imageSum = $(".image_reel img").size();
	var imageReelWidth = imageWidth * imageSum;
	
	//Adjust the image reel to its new size
	$(".image_reel").css({'width' : imageReelWidth});

	//Paging + Slider Function
	rotate = function(){	
	    var triggerID = $active.attr("rel") - 1; //Get number of times to slide
	    var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide
	
	    $(".paging a").removeClass('active'); //Remove all active class
	    $active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
	    
		$(".desc").stop(true,true).slideUp('slow');
		
		$(".desc").eq( $('.paging a.active').attr("rel") - 1 ).slideDown("slow"); 
		
	    //Slider Animation
	    $(".image_reel").animate({ 
	        left: -image_reelPosition
	    }, 500 ); 
	
		
	}; 

	//Rotation + Timing Event
	rotateSwitch = function(){	
	$(".desc").eq( $('.paging a.active').attr("rel") - 1 ).slideDown("slow");	
	    play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
	        $active = $('.paging a.active').next();
	        if ( $active.length === 0) { //If paging reaches the end...
	            $active = $('.paging a:first'); //go back to first
	        }
	        rotate(); //Trigger the paging and slider function
	    }, 10000); //Timer speed in milliseconds (3 seconds)	
	
	};
	
	rotateSwitch(); //Run function on launch

 //On Click
    $(".paging a").click(function() {    
        $active = $(this); //Activate the clicked paging
        //Reset Timer
        clearInterval(play); //Stop the rotation
        rotate(); //Trigger rotation immediately
        rotateSwitch(); // Resume rotation
        return false; //Prevent browser jump to link anchor
    });    

});
;

