

jQuery(document).ready(function(){
	//SLIDER
	jQuery("#slider").easySlider({
		auto: true,
		continuous: true,
		numeric: true,
		pause: 6000
	});
	
	
	//Add APp
	$('#addapplication').draggable();
	$('#addapplicationlink').click(function(){
		$('#addapplication').toggle();
	});
	$('.ui-dialog-titlebar-close').click(function(){
		$('#addapplication').fadeOut();
	});
	
	//add portlets
	$('#add-filerepository').click(function(){
		$('#portlet-filerepository').css('opacity','1');
		$('#portlet-filerepository').parent().css('display','block');
	});
	$('#add-myrecords').click(function(){
		$('#portlet-myrecords').css('opacity','1');
		$('#portlet-myrecords').parent().css('display','block');
	});
	$('#add-stylechanger').click(function(){
		$('#portlet-stylechanger').css('opacity','1');
		$('#portlet-stylechanger').parent().css('display','block');
	});
	$('#add-email').click(function(){
		$('#portlet-email').css('opacity','1');
		$('#portlet-email').parent().css('display','block');
	});
	$('#add-rssreader').click(function(){
		$('#portlet-rssreader').css('opacity','1');
		$('#portlet-rssreader').parent().css('display','block');
	});
	$('#add-announcements').click(function(){
		$('#portlet-announcements').css('opacity','1');
		$('#portlet-announcements').parent().css('display','block');
	});
	
	
	//STYLE CHANGER

			//Change color
			$('#style_changer_blue').click(function(){
				set_stylesheet('blue');
				return false;
			});
			$('#style_changer_black').click(function(){
				set_stylesheet('black');
				return false;
			});
			$('#style_changer_green').click(function(){
				set_stylesheet('green');
				return false;
			});
			$('#style_changer_gray').click(function(){
				set_stylesheet('gray');
				return false;
			});
			$('#style_changer_orange').click(function(){
				set_stylesheet('orange');
				return false;
			});
			$('#style_changer_purple').click(function(){
				set_stylesheet('purple');
				return false;
			});
			
			
			//Change Font
			$('#style_changer_small').click(function(){
				set_font('10px');
				return false;
			});
			$('#style_changer_medium').click(function(){
				set_font('12px');
				return false;
			});
			$('#style_changer_large').click(function(){
				set_font('15px');
				return false;
			});
			
			function set_stylesheet(stylesheet){
				$('#style_change').attr({href:'css/scheme/'+stylesheet+'.css'});
				$('#style_changer_color').val(stylesheet);
			}
			
			function set_font(fontsize){
				$('#content-wrapper').css('font-size' , fontsize);
				$('#style_changer_fontSize').val(fontsize);
			}
	
});
