		
		$(document).ready(function(){

			// calc img size for user
			if (typeof img_id != 'undefined'){
				
				//if( $(".no_bg_image").length == 0 ){
					
					// calc img size
					user_window_width 	= $(window).width();
					aspect_ratio		= img_orignal_height / img_original_width;
					user_img_width 		= parseInt(user_window_width);
					user_img_height 	= parseInt(user_img_width * aspect_ratio);
								
					// preload image
					$('<img />')
						.attr({
							src:	img_path,
							width:	user_img_width,
							height:	user_img_height,
							id:		img_id
						})
					    .load(function(){
					    	
					    	// fade img
					    	$("#panel").prepend(this);
					    	
					    	$("#panel IMG#" + img_id).css('opacity' , 0);
					    	
							//$("#site").css('opacity' , 0);
							// $("#site").css('display', 'block'); 
							
							// align site
							site_move_content();
							
							$("#panel IMG#" + img_id)
							.animate({
								
								opacity: 1
								
							}, 500);   	
					    	
					    });						
					
				//}
				
			
			} else {
				$("#site").css('display', 'block');	
			}
			
			
			// pause , show site
			$("#site").pause(500).css('display', 'block');	


			// hover on img
			$("DIV.mask_for_hover").css('opacity', '0');
			$("DIV.mask_for_hover").css('display', 'block');
			$("DIV#content_img_right UL LI")
			.bind('mouseenter', function(){
				$(this).find('DIV.mask_for_hover').animate({
					opacity: 1	
				}, 500);
			})			
			.bind('mouseleave', function(){
				$(this).find('DIV.mask_for_hover').animate({
					opacity: 0	
				}, 500);	
			});
			
			
			//scrl btn
			$(".back_to_top_btn").bind('click', function(){
				$('html, body').animate({scrollTop:0}, 'slow');
				return false;	
			});
			
			$("#shop_now").bind('click', function(){
				$('html, body').animate({scrollTop:1200}, 'slow');
				return false;	
			});
			
			$("#to_footer").bind('click', function(){
				$('html, body').animate({scrollTop:1460}, 'slow');
				return false;	
			});
			
			
			$("DIV#buy_layer DIV UL LI A IMG").css('opacity', 0);
			$("DIV#buy_layer DIV UL LI A")
			.bind('mouseenter', function(){
				$(this).find('IMG').animate({
					opacity: 1	
				}, 500);	
			}).bind('mouseleave', function(){
				$(this).find('IMG').animate({
					opacity: 0	
				}, 500);	
			});
			

			
			// attach window resize event
			$(window).resize(function() {
				  
				if (typeof img_id != 'undefined'){
					
					if( $(".no_bg_image").length == 0 ){
						
						// img resize - calc new dimensions
						user_new_window_width = $(window).width();
						new_img_width		  = user_new_window_width;
						new_img_height		  = parseInt(new_img_width * aspect_ratio);
						$("#" + img_id).attr({
							width: 	new_img_width,
							height: new_img_height
						});
						
						// move content , calc middle
						site_move_content();
									
					}
					
				}
				else {
						
						// move content , calc middle
						site_move_content();
					
				}
							
			  
			});
			


			//------------------- LIGHTBOX --------------------
			// $(".lightbox").lightbox();
			//------------------- /LIGHTBOX -------------------

			
		});
		
		
