$(function(){
				// Datepicker : assigns to a box with a class of "calendar"
				$('.calendar').datepicker({ 
					dateFormat: 'dd/mm/yy',
					duration: 'fast',
					inline: true,
					showOn: 'button',
					buttonImage: 'images/calendar.gif',
					buttonImageOnly: true
					});
				
				
				// Accordion
				$(".accordion").accordion({ 
					header: "h3",
					active: false,
					collapsible: true,
					autoHeight: true
					});
			
				

				
				
				
				
				// Dialog			
					$("div:[alt='dialogBox']").dialog({
					autoOpen: false,
					bgiframe: false,
					resizable: true,
					width: 600,
					modal: true,
					overlay: {
					backgroundColor: '#000000',
					opacity: 0.5
					},
					buttons: {
						'Close': function() {
							$(this).dialog('close');
						}
					}
				});
				
				// Dialog Link
				$("p[alt='dialog_link']").click(function(){
				var dialogueBoxToOpen = $(this).attr("nextBox");
				var dialogueBoxWidth = $(this).attr("widthToDisplay");
				$("#" + dialogueBoxToOpen).dialog('open');
				$("#" + dialogueBoxToOpen).dialog('option', 'width', dialogueBoxWidth);
				$("#" + dialogueBoxToOpen).dialog('option', 'minWidth', 600);
				$("#" + dialogueBoxToOpen).dialog('option', 'position', 'center');
				$("#" + dialogueBoxToOpen).dialog('option', 'zIndex', 500);
				return false;
				});
				
				
				// Tabs
				$('#tabs').tabs();
				
				
				
				
				
				
				// List Sorting
				
				$('#myList').sortable({
					opacity: '0.5',
					update: function(e, ui){
						serial = $(this).sortable("serialize");	
						var URLtoOpen = $('#myList').attr("urlTag");
						var divIDToUpdate = $('#myList').attr("divIDToUpdate");
						$.ajax({							
							url: URLtoOpen,
							type: "POST",
							data: serial,
							// complete: function(){},
							success: function(feedback){
										$("#" + divIDToUpdate).html(feedback);
											}
							// error: function(){}
						});
					}
				});
				
				
				
				
				
				
				
				
				$('#carousel').Carousel(
				{
					itemWidth: 140,
					itemHeight: 80,
					itemMinWidth: 140,
					items: 'a',
					reflections: 0,
					rotationSpeed: 2
				}
				);
				
				
				$.ImageBox.init(
					{
						loaderSRC: 'images/loading.gif',
						closeHTML: '<img src="images/close.jpg" class="closeBox" />'
					}
				);
				
				
				
				
				
				
				
				
				
				// Progressbar
				$("#progressbar").progressbar({
					value: 20
				});
				
				//hover states on the static widgets
				$('#dialog_link, ul#icons li').hover(
					function() { $(this).addClass('ui-state-hover'); }, 
					function() { $(this).removeClass('ui-state-hover'); }
				);
				
				
				
				
				
				
				
				$("#slider").slider({
					value:100,
					min: 0,
					max: 500,
					step: 50,
					slide: function(event, ui) {
						$("#amount").val('$' + ui.value);
					}
				});
				
			});
