$(function() {

	$("#left_menu").lavaLamp({
		fx: "easeOutBack",
		speed: 700,
		/*returnHome:true,
		homeLeft: -100,
		homeTop: -25,
		homeWidth:300,
		homeHeight:10,
		homeLeft: 400,
		homeTop: -15,
		homeWidth:100,
		homeHeight:10,*/
		click: function(event, menuItem) {
			//alert(menuItem.name);
			//return false;
			return menuItem;
		}
	});	
	
	//$('#flash_news').load('news/headings.html #flash_news', function(){ 
	
		//alert($('#flash_news').html());
		$('.news_roto').cycle({ 
		//$('.home_bottom_news').cycle({ 
			delay: 5000,
			speed : 3000,
			timeout: 6000,
			fit: 1,
			cleartype:  1 // enable cleartype corrections 
		});
	//});
		
		$('.home_bottom_news').cycle({ 
			delay: 5000,
			speed : 3000,
			timeout: 6000,
			fit: 1,
			cleartype:  1 // enable cleartype corrections 
		});
	
	$('.banner').load('frontend/default.html #home .banner', function(){ 
		$('.banner').cycle({ 
			delay: 5000,
			speed : 3000,
			timeout: 30000,
			fit: 1,
			random:  1,
			cleartype:  1 // enable cleartype corrections 
		});
	});
	
	var _animationType = 'fade';
	
	/*$('#flat').menu({
		content: $('#flat').html(),		
		maxHeight: 180,
		positionOpts: { offsetX: 10, offsetY: 20 },
		showSpeed: 300
	});*/
	
	$('.fg-button').hover(
    		function(){ $(this).removeClass('ui-state-default').addClass('ui-state-focus'); },
    		function(){ $(this).removeClass('ui-state-focus').addClass('ui-state-default'); }
    	);

	$('#flat1').menu({ 
			content: $('#flat1').next().html(), // grab content from this page
			showSpeed: 400,
			directionV: 'down',
			flyOut: true 
		});
	
	$('#flat2').menu({ 
			content: $('#flat2').next().html(), // grab content from this page
			showSpeed: 400,
			directionV: 'down',
			flyOut: true,
			linkToFront: true,
			directionH: 'left',
			width: 180,
			maxHeight: 50
		});
	
	// or from an external source
	/*	$.get('menuContent.html', function(data){ // grab content from another page
			$('#flat2').menu({ content: data, flyOut: true });
		});*/

	$('#flat3').menu({ 
			content: $('#flat3').next().html(), // grab content from this page
			showSpeed: 400,
			directionV: 'down',
			flyOut: true 
		});
	
	$('#flat4').menu({ 
			content: $('#flat4').next().html(), // grab content from this page
			showSpeed: 400,
			directionV: 'down',
			flyOut: true 
		});
	
	//alert($('#flat2').next().html());
	
	/*var _officeItemListCombobox = $('#select1').combobox(
	{
		comboboxContainerClass: "comboboxContainer",
		comboboxValueContentContainerClass: "comboboxValueContainer",
		comboboxValueContentClass: "comboboxValueContent",
		comboboxDropDownClass: "comboboxDropDownContainer",
		comboboxDropDownButtonClass: "comboboxDropDownButton",
		comboboxDropDownItemClass: "comboboxItem",
		comboboxDropDownItemHoverClass: "comboboxItemHover",
		comboboxDropDownGroupItemHeaderClass: "comboboxGroupItemHeader",
		comboboxDropDownGroupItemContainerClass: "comboboxGroupItemContainer"
	},
	{
		animationType: _animationType,
		width: 195
	});*/
	//$("#select1").val('nothing');
	
	/*_officeItemListCombobox.combobox.onChange = function() {
		//goToPage($("#select1").val());
		alert($("#select1").val());
	};*/
	
	 /*$("#select1").change(function() {
	 	alert($("#select1").val());
	 });*/
	 
	 
	 /*combobox.defaults = {
	showOnMouseOver:	false,
	hideOnMouseOut:		false,
	autoComplete:		true,
	maxVisibleOptions:	1000000,
	buttonText:		'&gt;',
	callbackShowOptions:	function(arr) {},
	callbackSelectOption:	function(val) {}
};*/

	/*$('#flash_news').cycle({ 
		fx:    'scrollDown', 
		delay: 5000,
		speed : 3000,
		timeout: 6000,
		fit: 1
	});*/
	
	
	/*$.ajax({
		type: "GET",
		url: "news/heading.xml",
		dataType: "xml",
		success: function(xml) {
			//alert(xml);
			$(xml).find('heading').each(function(){
				var id = $(this).attr('id');
				var title = $(this).find('title').text();
				//alert(title);
				var url = $(this).find('url').text();
				//var html = $(this).find('html');
				//alert(html);
				//$('<div class="items" id="link_'+id+'"></div>').html('<a href="'+url+'">'+title+'</a>').appendTo('#page-wrap');
				
				$(this).find('desc').each(function(){
					var brief = $(this).find('brief').text();
					var long = $(this).find('long').text();
					//$('<div class="brief"></div>').html(brief).appendTo('#link_'+id);
					//$('<div class="long"></div>').html(long).appendTo('#link_'+id);
					$('#flash'+id).html(long);
					//$('#'+id).html(long);
					document.getElementById('#'+id).innerHTML = long;     
				});
			});
		}
	});*/
	
});
	

