		
		/*img_original_width = 2000;
		img_orignal_height = 900;
		
		img_id			   = 'panel_image';
		img_path		   = '/include/images/homepage-1.jpg';*/
		
		$(document).ready(function(){
				
						
			// detect safari
			if( $.browser.safari ){ $("DIV#footer_nav").addClass('safari');	}
			
			// position site
			new_content_left = parseInt(($(window).width() - $("#site").width()) / 2);
			$("#site").css('left', new_content_left + 'px');
			
			// last class
			$("#topmenu UL LI:first").addClass('first');
			$("#topmenu UL LI A:last").addClass('last');
		
			// calc img size for user
			if (typeof img_id != 'undefined'){
				
				if( $(".no_bg_image").length == 0 ){
					
					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").css('opacity' , 0);
					    	
							//$("#site").css('opacity' , 0);
							$("#site").css('display', 'block');
							
							/*$("#site")
							.pause(100)
							.animate({
								
								opacity: 1
								
							}, 500);*/	
							
								// 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
								});	 
							
							$("#panel IMG")
							.animate({
								
								opacity: 1
								
							}, 500);   	
					    	
					    });						
					
				}
				
			
			} else {
				$("#site").css('display', 'block');	
			}
			
			
			$("#site").pause(600).css('display', 'block');	

			
			// 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();
						
						// calc bottom margin , update bottom margin
						site_content_topmargin(new_img_height);		
									
					}
					
				}
				else {
						
						// move content , calc middle
						site_move_content();
					
				}
							
			  
			});
			
			// content top margin
			if ( (typeof img_id != 'undefined') && (typeof user_img_height != 'undefined') ){ site_content_topmargin(user_img_height); }
			
			//------------------------- footer middle UL ----------------------
			$("#footer_nav UL LI").after('<li class="sep">|</li>');
			$("#footer_nav UL LI:last").remove();
			//------------------------- /footer middle UL ----------------------
			
			
			//------------------------- FAQ UL ----------------------
			$(".faq_list:odd").addClass('no_margin');
			$(".faq_list LI").each(function(index){
			
				li_height = $(this).height();
				
				if( li_height ){
					$(this).find('div').height(li_height + 12);	
				}

			});
			//------------------------- /FAQ UL ---------------------
			
			//------------------------- friends UL ----------------------
			$("DIV.friends_list UL LI:nth-child(3n)").addClass('no_margin');
			//------------------------- /friends UL ---------------------
			
			
			//---------------------- PURCHASE UL -------------------------
			$("UL.purchase_detail_list:nth-child(3n+1)").addClass('last');
			$("UL.purchase_detail_list.last").after('<div class="p_sep"><!----></div>');
			$("DIV.p_sep:last").remove();
			//---------------------- /PURCHASE UL ------------------------
			
			
			//------------------------- LOCATION SELECTMENU ----------------------
			/*$('select#dropmenu_regions')
				.change(function(){
					$(this).css('margin-top', '-200px');
					selected_value = $(this).val();
					selected_index = $(this).attr("selectedIndex");
					selected_text  = $(this).find(":selected").text();
					//ws_change_category(selected_value);
				})
				.selectmenu({
					style: 'dropdown',
					width: 250
				});*/
				
			$('select#dropmenu_regions')
			.attr("selectedIndex", $('select#dropmenu_regions OPTION').length - 1)
			.change(function(){
				selected_value = $(this).val();
				selected_index = $(this).attr("selectedIndex");
				selected_text  = $(this).find(":selected").text();
				location.href  = selected_value;
			})
			.selectmenu({width: 250 , style: 'popup'});


			//------------------------- /LOCATION SELECTMENU ---------------------

			// lightbox
			$(".lightbox").lightbox();
			
			// film page
			$("UL.video_list LI:nth-child(3n)").after('<li class="sep"><!----></li>');
			$("UL.video_list LI.sep:last").remove();
			$("UL.video_list LI:not(.sep)").each(function(index){
				if( !index ){ $(this).addClass('col1'); }
				if( (index % 3) == 0 ){ $(this).addClass('col1'); }
			});
			$("UL.video_list LI:not(.active) A IMG").css('opacity', '0.5');
			$("UL.video_list LI:not(.active)")
			.bind('mouseenter', function(){
				$(this).addClass('hovered');
				$("IMG", $(this) ).animate({
					opacity: 1
				});
			})
			.bind('mouseleave', function(){
				$(this).removeClass('hovered');
				$("IMG", $(this) ).animate({
					opacity: 0.5
				});
			});
			
			
			// footer
			f_width = $("#footer").width();
			f_ul_width = $("#footer ul").width();
			$("#footer ul").css('margin-left' , parseInt((f_width-f_ul_width) / 2) + "px" );


			
		});
		
		
