$(window).ready(function(){			
// 1
			$('.thumbnailWrapper_mn0').hover(function(){
				
				//show the caption using slideDown event
				//$('.caption0:not(:animated)').slideDown();
				$('.caption0:not(:animated)').show();
				$('.bigcircle0:not(:animated)').show();
				
				$(this).find(".dvtxt0").css("color","#000");
				$(this).css("background","url(/images/img_main_big_hover.png)");
				$(this).css("background-position","top left");				
				$(this).css("background-repeat", "no-repeat");
				
				$(this).find('.mainimg img').attr("src", $(this).find('img').attr("src").split(".").join("-hover."));
			
			
				$(".bigcircle1sp").hide();
				$(".caption1sp").hide();				
				$(this).find(".bigcircle1sp").show();
				$(this).find(".caption1sp").show();
							
			}, function(){
				//$('.caption0').slideUp();
				$('.caption0').hide();
				$('.bigcircle0').hide();
				$(this).find(".dvtxt0").css("color","#fff");
				$(this).css("background","url(/images/img_main_big.png)");
				$(this).css("background-position","top left");								
				$(this).css("background-repeat", "no-repeat");
				
				$(this).find('.mainimg img').stop(true,false); // prevents the creation of stacked actions
	         $(this).find('.mainimg img').attr("src", $(this).find('img').attr("src").split("-hover.").join("."));  // removes -hover from the name of the image				


				$(".mainimg_sp").show();
				$(".dvtxt1sp").show();
				$(".bigcircle1sp").show();
				$(".caption1sp").show();
			});
			
			
// 2					
			$('.thumbnailWrapper_mn1').hover(function(){
				
				//show the caption using slideDown event
				//$('.caption1:not(:animated)').slideDown();
				$('.caption1:not(:animated)').show();
				$('.bigcircle1:not(:animated)').show();
				
				$(this).find(".dvtxt1").css("color","#000");
				$(this).css("background","url(/images/img_main_big_hover.png)");
				$(this).css({backgroundPosition: '-251px 0'});
				$(this).css("background-repeat", "no-repeat");
				
				$(this).find('.mainimg img').attr("src", $(this).find('img').attr("src").split(".").join("-hover."));  // adds -hover to the name of the image
			
			
				$(".bigcircle1sp").hide();
				$(".caption1sp").hide();				
				$(this).find(".bigcircle1sp").show();
				$(this).find(".caption1sp").show();
			
			}, function(){
				//$('.caption1').slideUp();
				$('.caption1').hide();
				$('.bigcircle1').hide();
				$(this).find(".dvtxt1").css("color","#fff");
				$(this).css("background","url(/images/img_main_big.png)");
				$(this).css({backgroundPosition: '-251px 0'});
				$(this).css("background-repeat", "no-repeat");
				
				$(this).find('.mainimg img').stop(true,false);
	         $(this).find('.mainimg img').attr("src", $(this).find('img').attr("src").split("-hover.").join("."));


				$(".mainimg_sp").show();
				$(".dvtxt1sp").show();
				$(".bigcircle1sp").show();
				$(".caption1sp").show();
			});
			
			
// 3					
			$('.thumbnailWrapper_mn2').hover(function(){
				
				//show the caption using slideDown event
				//$('.caption2:not(:animated)').slideDown();
				$('.caption2:not(:animated)').show();
				$('.bigcircle2:not(:animated)').show();
				
				$(this).find(".dvtxt2").css("color","#000");
				$(this).css("background","url(/images/img_main_big_hover.png)");
				$(this).css({backgroundPosition: '-501px 0'});
				$(this).css("background-repeat", "no-repeat");
				
				$(this).find('.mainimg img').attr("src", $(this).find('img').attr("src").split(".").join("-hover."));  // adds -hover to the name of the image
			
			
				$(".bigcircle1sp").hide();
				$(".caption1sp").hide();				
				$(this).find(".bigcircle1sp").show();
				$(this).find(".caption1sp").show();
			
			}, function(){
				//$('.caption2').slideUp();
				$('.caption2').hide();
				$('.bigcircle2').hide();
				$(this).find(".dvtxt2").css("color","#fff");
				$(this).css("background","url(/images/img_main_big.png)");
				$(this).css({backgroundPosition: '-501px 0'});
				$(this).css("background-repeat", "no-repeat");
				
				$(this).find('.mainimg img').stop(true,false);
	         $(this).find('.mainimg img').attr("src", $(this).find('img').attr("src").split("-hover.").join("."));


				$(".mainimg_sp").show();
				$(".dvtxt1sp").show();
				$(".bigcircle1sp").show();
				$(".caption1sp").show();
			});
			
			
// 4					
			$('.thumbnailWrapper_mn3').hover(function(){
				
				//show the caption using slideDown event
				//$('.caption3:not(:animated)').slideDown();
				$('.caption3:not(:animated)').show();
				$('.bigcircle3:not(:animated)').show();
				
				$(this).find(".dvtxt3").css("color","#000");
				$(this).css("background","url(/images/img_main_big_hover.png)");
				$(this).css({backgroundPosition: '-501px 0'});
				$(this).css("background-repeat", "no-repeat");
				
				$(this).find('.mainimg img').attr("src", $(this).find('img').attr("src").split(".").join("-hover."));  // adds -hover to the name of the image
			
			
				$(".bigcircle1sp").hide();
				$(".caption1sp").hide();				
				$(this).find(".bigcircle1sp").show();
				$(this).find(".caption1sp").show();
				
			}, function(){
				//$('.caption3').slideUp();
				$('.caption3').hide();
				$('.bigcircle3').hide();
				$(this).find(".dvtxt3").css("color","#fff");
				$(this).css("background","url(/images/img_main_big.png)");
				$(this).css({backgroundPosition: '-501px 0'});
				$(this).css("background-repeat", "no-repeat");
				
				$(this).find('.mainimg img').stop(true,false);
	         $(this).find('.mainimg img').attr("src", $(this).find('img').attr("src").split("-hover.").join("."));


				$(".mainimg_sp").show();
				$(".dvtxt1sp").show();
				$(".bigcircle1sp").show();
				$(".caption1sp").show();
			});
			
			
});

$(function(){
		
				function auto_margin(){

				if ( $(this).width() >= 1600 )
				{ 
					$(".bgstretcher").css("width", "1600px");
					$(".bgstretcher").css("left", "50%");
					$(".bgstretcher").css("margin-left", "-800px");
					
					$(".bgstretcher3").css("width", "1600px");
					$(".bgstretcher4").css("width", "1600px");
				}
				else {
					//alert ('');
					$(".bgstretcher").css("width", "100%");
					$(".bgstretcher").css("margin", "0 auto");
					$(".bgstretcher").css("left", "0"); 
					
					$(".bgstretcher3").css("width", "100%");
					$(".bgstretcher4").css("width", "100%");
				}
			}
		 
			$(window).resize(auto_margin);
			$(window).ready(auto_margin);
});



