		jQuery(document).ready(function() {
			//Activate FancyBox
			
			jQuery("div.screenshots a").fancybox({
				'hideOnContentClick': true
			});
			jQuery("div.column_screenshots a").fancybox({
				'hideOnContentClick': true
			});
			
			jQuery("div.screenshots_detail a").fancybox({
				'hideOnContentClick': true
			});
			
			jQuery('.user').hide(); //needed to hide star rater %
			
			//autocomplete
			jQuery("#search_main").autocomplete("/search/search_autocomplete",{minChars:1, matchSubset:1, matchContains:1, cacheLength:10, onItemSelect:selectItem, formatItem:formatItem, selectOnly:1, autoFill:false, maxItemsToShow:10});
			jQuery("#searchfield").autocomplete("/search/search_autocomplete",{minChars:1, matchSubset:1, matchContains:1, cacheLength:10, onItemSelect:selectItem, formatItem:formatItem, selectOnly:1, autoFill:false, maxItemsToShow:10});
			
			});
			
			//autocomplete search
			function selectItem(li) {

			}
			//autocomplete search
			function formatItem(row) {
				return row[0] ;
			}
			

			//add item to list begin
				function add_item(app_id, type, name)  {

											new jQuery.get('/lists/add_item/'+app_id+'/'+type+'/'+name,
											  {}, function(data){humanMsg.displayMsg(data);}

											);                            
										}
			//add item to list end
			
			//add item to list begin
				function delete_item(app_id, type, name)  {

											new jQuery.get('/lists/delete_item/'+app_id+'/'+type+'/'+name,
											  {}, function(data){humanMsg.displayMsg(data);
												jQuery('#result_'+app_id).slideUp();}

											);                            
										}
			//add item to list end
			
			//submit a comment	
				function submit_comment() {
					// target element(s) to be updated with server response 
					    var options = { target:        '.commentadd'}
					    // bind to the forms submit event 
					    jQuery('#frmaddcomment').submit(function() { 
					        // inside event callbacks 'this' is the DOM element so we first 
					        // wrap it in a jQuery object and then invoke ajaxSubmit 
					        jQuery(this).ajaxSubmit(options); 
					        // !!! Important !!! 
					        // always return false to prevent standard browser submit and page navigation 
					        return false; 
					    });

				}

				//submit a comment end	
								
				
				//add a comment	form
					function add_comment(app_id, comment_id, discussion_id, blog_id, comment_level)  {
					new jQuery('#addcomment'+comment_id).hide().load('/comments/add_comment/'+app_id+'/'+comment_id+'/'+discussion_id+'/'+blog_id+'/'+comment_level,
					 {}, 
					function() { jQuery(this).slideDown('fast'); });
					}
				//add a comment form end
				
				//add a comment	form
					function version_history(app_id)  {
					new jQuery('#version_history').hide().load('/page/version_history/'+app_id+'/',
					 {}, 
					function() { jQuery(this).slideDown('fast'); });
					}
				//add a comment form end

				//star rater script
				function rateitem(element, info) {
				  new Ajax.Request('/rate/', { parameters: info });
				}



			//rate a comment begin		
				function rate_comment(comment_id, comment_user_id, comment_rating, rating)  {

											new jQuery('#commentquality'+comment_id).hide().load('/comments/rate_comment/'+comment_id+'/'+comment_user_id+'/'+comment_rating+'/'+rating,
											  {},
											  function() { jQuery(this).fadeIn(); }
											);                            
										}
			//rate a comment end