// JavaScript Document


			$(function()
			{
				// this initialises the demo scollpanes on the page.
				$('.scroll-pane').jScrollPane({showArrows:true});
				
			});



$(document).ready(function() {
						   
						   
						   
						   
			    ////////////////// photo viewer pagina gallery foto
				
				
				var num_a_gallery = 0;
				var total_a_gallery = $(".a_thumb_gallery").size();

				
				$(".a_thumb_gallery").click(function(){
						
						var index = $(this).attr("id");
						num_a_gallery = index;
						var fileurl = $(this).attr("href");
						LoadImageGallery(fileurl)
						
						return false;
													
				});
						   
				
				$("#PhotoViewer a.next").click(function(){
						num_a_gallery++;
						var fileurl = $(".a_thumb_gallery").eq(num_a_gallery).attr("href");					
						LoadImageGallery(fileurl);							
				});
						   
				$("#PhotoViewer a.prev").click(function(){
						num_a_gallery--;
						var fileurl = $(".a_thumb_gallery").eq(num_a_gallery).attr("href");					
						LoadImageGallery(fileurl);							
				});  
						  




				function LoadImageGallery(fileurl){
						
						
						if((num_a_gallery>=0) && (num_a_gallery<total_a_gallery)){
						
						$("#PhotoViewer div").empty();
						$(".a_thumb_gallery").removeClass("active");
						
							if(fileurl!=""){
							
							var img = $('<img>');
							$(img).attr("src",fileurl);
							$(img).hide();
							
						   $(img).bind("load", function () { 								 
														 
							var img_w = $(this).width();
							var img_h = $(this).height();
							$("#PhotoViewer a.prev, #PhotoViewer a.next, #PhotoViewer div").height(img_h);
							$(this).css("margin-left",(($("#PhotoViewer").width()-img_w)/2)+"px");
							$(this).fadeIn('slow'); 
							});
							
							$("#PhotoViewer div").append(img);
							
							$(".a_thumb_gallery").eq(num_a_gallery).addClass("active");
							
							}
						
						}
				
				}





				
				
				if($(".a_thumb_gallery").size()>0){
				fileurl = $(".a_thumb_gallery").eq(0).attr("href");	
				LoadImageGallery(fileurl);
				}
						  
						   
						   
						   
						   
				////////////////////////marquee sponsor		
				if(document.getElementById("scroll_logo_sponsor")){
					
					
			 $("#scroll_logo_sponsor").imageScroller( {speed:'4000', direction:'left'} );

					
/*
               
				marqueeInit({
					uniqueid: 'scroll_logo_sponsor',
					style: {
						'padding': '0px',
						'width': '1100px',
						'height': '260px'
					},
					inc: 5, //speed - pixel increment for each iteration of this marquee's movement
					mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
					moveatleast: 2,
					neutral: 150,
					savedirection: true
				}); */
			
				
				}


	
	
	              ///////////////////////
				  
				  var hContentLeft = $("#ContentLeft").outerHeight();
				  var hContentRight = $("#ContentRight").outerHeight();
				  if(hContentRight>hContentLeft){
					 $("#ContentLeft").height((hContentRight-45));
				  }
	
	
	
	
	
	
});
